orders.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <view class="parent">
  3. <!-- 查询区域Start -->
  4. <view class="white flexd "
  5. style="box-shadow:rgb(255, 204, 149) 0px 0px 6px 1px;z-index: 99; background: linear-gradient(to left, #f2994a, #f2c94c);padding-top: 50px;">
  6. <view class="search">
  7. <u-search v-model="pageRequest.licenseNo" @custom="custom" @search="search" :shape="shape"
  8. :clearabled="clearabled" :show-action="showAction" :input-align="inputAlign" @clear="clear"
  9. placeholder="车牌号搜索"></u-search>
  10. </view>
  11. <u-dropdown active-color="#fff" inactive-color="#fff" ref="uDropdown">
  12. <u-dropdown-item title="筛选条件">
  13. <view class="slot-content1">
  14. <view class="dis f-c">
  15. <text class="title" style="margin:0 10px;">订单状态</text>
  16. <view class="dis a-c f-wrap" style="margin: 10px;">
  17. <view class="status-data" :class="item.value==pageRequest.orderStatus? 'active':''"
  18. v-for="(item,index) in statusList" @tap="statusclick(index)" :key="index">
  19. {{item.label}}
  20. </view>
  21. </view>
  22. </view>
  23. <view class="dis f-c">
  24. <text class="title" style="margin:0 10px;">订单日期</text>
  25. <view class="dis a-c f-wrap" style="margin: 10px;">
  26. <view class="status-data" :class="item.value==timespecifications? 'active':''"
  27. v-for="(item,index) in dateList" @tap="dateclick(index)" :key="index">
  28. {{item.label}}
  29. </view>
  30. <view class="dis a-c ">
  31. <view class="status-data" :class="startShow? 'active' :''" @tap="startShowmethod()">
  32. <text v-if="pageRequest.startDate!=''">{{pageRequest.startDate}}</text>
  33. <text v-else>{{transformTime()}}</text>
  34. </view>
  35. <view class="status-data" :class="endShow? 'active' :''" @tap="endShowmethod()">
  36. <text v-if="pageRequest.endDate!=''">{{pageRequest.endDate}}</text>
  37. <text v-else>{{transformTime()}}</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="dis j-s a-c" style="margin:10px;">
  43. <u-button type="success" size="medium" :hair-line="false" style="width: 45%;"
  44. @click="closeDropdown">取消</u-button>
  45. <u-button type="warning" size="medium" style="width: 45%;"
  46. @click="querysearch">确定</u-button>
  47. </view>
  48. </view>
  49. </u-dropdown-item>
  50. </u-dropdown>
  51. </view>
  52. <view class="search" style="padding-top: 150px;">
  53. <view class=" orderItemPane" v-for="(item,index) in pageResult" :key="index" @click="querydetail(item)">
  54. <view class="orderItemPane-upper dis j-s a-c search">
  55. <view class="dis j-s">
  56. <view class="icon iconfont icon-tree-round-car"
  57. style="color: rgba(255, 154, 23, 0.57);margin-right: 5px;">
  58. </view>
  59. <text class="title">{{item.licenseno}}</text>
  60. </view>
  61. <text class="upper-time moosize">{{item.createtime}}</text>
  62. </view>
  63. <view class="orderItemPane-centre " style="padding: 0 10px;">
  64. <view class="status dis j-end">
  65. <view v-for="(statusitem,statusindex) in statusList" :key="statusindex">
  66. <text v-if="item.orderstatus==statusitem.value"
  67. :style="{color:statusitem.color}">{{statusitem.label}}
  68. <u-icon name="arrow-right" size="14px"
  69. style="margin-left: 5px;color: #999;"></u-icon></text>
  70. </view>
  71. </view>
  72. <view class="dis f-wrap item ">
  73. <text>投保人:{{item.insuredname}}</text>
  74. <text>投保险种:{{item.product}}</text>
  75. <text v-if="item.orderstatus=='3'">承保公司:{{item.insCompany}}</text>
  76. <text>订单号:{{item.orderno}}</text>
  77. </view>
  78. </view>
  79. <view class="orderItemPane-below dis a-c j-end search">
  80. <u-button type="primary" size="mini" :hair-line="false" :plain="true"
  81. @click="quotehistory(item)">报价历史</u-button>
  82. <u-button v-if="item.orderstatus!='3'" type="success" size="mini" :hair-line="false" :plain="true"
  83. @click="CloseEdit(item)">编辑</u-button>
  84. </view>
  85. </view>
  86. </view>
  87. <o-empty v-if="pageResult.length==0" />
  88. <!-- 回到顶部 -->
  89. <u-picker v-model="startShow" mode="time" :params="params" @confirm="startconfirm"></u-picker>
  90. <u-picker v-model="endShow" mode="time" :params="params" @confirm="endconfirm"></u-picker>
  91. </view>
  92. </template>
  93. <script>
  94. import {
  95. mapState,
  96. mapMutations
  97. } from "vuex"
  98. import carOrders from "@/components/modules/orders/carOrders.vue";
  99. import nothingOrder from "@/components/modules/orders/nothingOrder.vue";
  100. import {
  101. watch
  102. } from "vue";
  103. export default {
  104. components: {
  105. carOrders,
  106. nothingOrder,
  107. },
  108. watch: {
  109. stageIndex(newVal, oldVal) {
  110. if (newVal !== oldVal) {
  111. this.pageRequest.orderStatus = newVal;
  112. }
  113. }
  114. },
  115. data() {
  116. return {
  117. dwdw: this.$u.color['success'],
  118. /* 时间筛选相关 */
  119. startShow: false,
  120. endShow: false,
  121. params: {
  122. year: true, //年
  123. month: true, //月
  124. day: true, //日
  125. },
  126. /* 时间筛选相关 */
  127. pageRequest: { //查询的默认条件
  128. orderNo: "",
  129. frameNo: "",
  130. insuredName: "",
  131. licenseNo: "",
  132. orderStatus: "",
  133. userId: "",
  134. deptId: "",
  135. endDate: "",
  136. startDate: "",
  137. pageNum: 1,
  138. pageSize: 20,
  139. },
  140. timespecifications: null,
  141. pageResult: [], //列表数据
  142. /* 搜索框配置 */
  143. shape: 'round',
  144. clearabled: true,
  145. showAction: true,
  146. inputAlign: 'left',
  147. /* 搜索框配置 */
  148. //状态筛选list
  149. statusList: [{
  150. label: '报价中',
  151. value: 0,
  152. color: "#1E9600"
  153. },
  154. {
  155. label: '待核保',
  156. value: 1,
  157. color: "#f5af19"
  158. },
  159. {
  160. label: '已核保待缴费',
  161. value: 2,
  162. color: "#f12711"
  163. },
  164. {
  165. label: '已承保',
  166. value: 3,
  167. color: "#86A8E7"
  168. },
  169. {
  170. label: '核保退回',
  171. value: 4,
  172. color: "#bdc3c7"
  173. }
  174. ],
  175. //日期筛选list
  176. dateList: [{
  177. label: '全部',
  178. value: 0,
  179. },
  180. {
  181. label: '一周内',
  182. value: 1,
  183. },
  184. {
  185. label: '一个月内',
  186. value: 2,
  187. },
  188. {
  189. label: '三个月内',
  190. value: 3,
  191. },
  192. {
  193. label: '六个月内',
  194. value: 4,
  195. },
  196. ],
  197. typeArray: [{
  198. label: '车险',
  199. value: 0,
  200. },
  201. {
  202. label: '意外险',
  203. value: 1,
  204. },
  205. {
  206. label: '寿险',
  207. value: 2,
  208. }
  209. ], //订单的类型
  210. toTopFlag: false, //显示回到顶部按钮
  211. queryLicenseNo: "",
  212. queryFrameNo: "",
  213. insureMore: false,
  214. insureMoreIndex: null,
  215. }
  216. },
  217. computed: {
  218. ...mapState(['userInfo', 'typeIndex', 'stageIndex'])
  219. },
  220. // 页面触底加载
  221. onReachBottom() {
  222. this.currentPage = this.currentPage + 1;
  223. if (this.totalPages >= this.currentPage) {} else {
  224. return false;
  225. }
  226. },
  227. // 页面滚动触发
  228. onPageScroll(e) { //根据距离顶部距离是否显示回到顶部按钮
  229. if (e.scrollTop > 600) { //当距离大于600时显示回到顶部按钮
  230. this.toTopFlag = true
  231. } else { //当距离小于600时显示回到顶部按钮
  232. this.toTopFlag = false
  233. }
  234. },
  235. onShow() {
  236. const arr = uni.getStorageSync('historyInfo');
  237. if (arr) {
  238. uni.removeStorageSync('historyInfo');
  239. }
  240. this.getOrdersList()
  241. },
  242. onLoad(e) {
  243. console.log(e)
  244. this.pageRequest.userId = this.userInfo.sysUser.id;
  245. this.pageRequest.deptId = this.userInfo.sysUser.deptId;
  246. this.getOrdersList()
  247. },
  248. methods: {
  249. ...mapMutations(['setOrderType', 'setOrderStage']),
  250. async getOrdersList() {
  251. let res = await this.$http.post('/insurance/order/queryPageOrder', this.pageRequest);
  252. if (res.code == '200') {
  253. this.pageResult = res.data.content;
  254. }
  255. },
  256. //展开
  257. selectMore(val) {
  258. this.insureMore = true;
  259. this.insureMoreIndex = val;
  260. },
  261. packup(val) {
  262. this.insureMore = false;
  263. this.insureMoreIndex = val;
  264. },
  265. //取消事件
  266. closeDropdown() {
  267. this.$refs.uDropdown.close();
  268. },
  269. //查询事件
  270. querysearch() {
  271. this.getOrdersList();
  272. this.$refs.uDropdown.close();
  273. },
  274. //状态筛选
  275. statusclick(e) {
  276. this.pageRequest.orderStatus = e;
  277. },
  278. startShowmethod() {
  279. this.startShow = true;
  280. this.timespecifications = null;
  281. },
  282. endShowmethod() {
  283. this.endShow = true;
  284. this.timespecifications = null;
  285. },
  286. //日期筛选
  287. dateclick(e) {
  288. /* 0:全部 1:一周内 2:一个月内 3:三个月内 4:六个月内*/
  289. switch (e) {
  290. case 0:
  291. this.pageRequest.startDate = "";
  292. this.pageRequest.endDate = "";
  293. break;
  294. case 1:
  295. this.pageRequest.startDate = this.transformTime(7);
  296. this.pageRequest.endDate = this.transformTime();
  297. break;
  298. case 2:
  299. this.pageRequest.startDate = this.transformTime1(1);
  300. this.pageRequest.endDate = this.transformTime();
  301. break;
  302. case 3:
  303. this.pageRequest.startDate = this.transformTime1(3);
  304. this.pageRequest.endDate = this.transformTime();
  305. break;
  306. case 4:
  307. this.pageRequest.startDate = this.transformTime1(6);
  308. this.pageRequest.endDate = this.transformTime();
  309. break;
  310. default:
  311. }
  312. this.timespecifications = e;
  313. },
  314. startconfirm(e) {
  315. this.pageRequest.startDate = e.year + '-' + e.month + '-' + e.day;
  316. },
  317. endconfirm(e) {
  318. this.pageRequest.endDate = e.year + '-' + e.month + '-' + e.day;
  319. },
  320. //验证车架号
  321. isFrameno(str) {
  322. let mPattern = /^([0-9A-Z]){17}$/;
  323. return mPattern.test(str);
  324. },
  325. isCarBrand(str) {
  326. let mPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}([A-Z0-9挂学警港澳使领]{1}|应急)$/ ||
  327. /^沪[0-9A-Z]{5}$/ || /^陆丰[0-9A-Z]{4}临$/;
  328. return mPattern.test(str.trim())
  329. // return /^陆丰[0-9A-Z]{4}临$/.test(str.trim())
  330. },
  331. //查看子订单
  332. async querydetail(val) {
  333. let params = {
  334. orderno: val.orderno,
  335. insuredname: val.insuredname,
  336. licenseno: val.licenseno,
  337. modelcname: val.carinfo.modelcname,
  338. }
  339. uni.navigateTo({
  340. url: `/pages/orders/subOrders?orderno=${JSON.stringify(params)}`
  341. })
  342. },
  343. //报价历史
  344. quotehistory(val) {
  345. let params = {
  346. orderno: val.orderno,
  347. insuredname: val.insuredname,
  348. licenseno: val.licenseno,
  349. modelcname: val.carinfo.modelcname,
  350. }
  351. uni.navigateTo({
  352. url: `/pages/orders/quoteHistory?orderno=${JSON.stringify(params)}`
  353. })
  354. },
  355. //编辑
  356. CloseEdit(val) {
  357. this.navigate({
  358. url: '/pages/carInsure1/quote1',
  359. success: (res) => {
  360. res.eventChannel.emit("acceptData", {
  361. carInfo: val.carinfo, //车辆信息
  362. ownerInfo: val.ownerinfo, //车主信息
  363. policyHolderInfo: val.applyinfo, //
  364. insuredPersonInfo: val.insureinfo,
  365. riskList: val.risk,
  366. kindList: val.king,
  367. orderno: val.orderno, //车辆
  368. quoteno: val.quoteno, //车主
  369. vehicleAndVesselTaxForm: val.vehicleAndVesselTax, //车船税
  370. })
  371. }
  372. }, "navigateTo", true);
  373. },
  374. //回车搜索事件
  375. search(val) {
  376. this.getOrdersList();
  377. },
  378. //搜索按钮事件
  379. custom(val) {
  380. this.getOrdersList();
  381. },
  382. //搜索框清除事件
  383. clear(val) {
  384. },
  385. //关闭订单后查询
  386. closeOrders() {
  387. this.totalSize = 0;
  388. this.ordersList = []; //获取到的订单列表
  389. this.currentPage = 1; //当前的页数
  390. this.totalPages = 1; //总共的页数
  391. },
  392. //当前时间
  393. transformTime(day) {
  394. var date = new Date();
  395. date.setFullYear(date.getFullYear());
  396. date.setTime(date.getTime());
  397. var strYear = date.getFullYear();
  398. var strDay = day ? date.getDate() - day : date.getDate();
  399. var strMonth = date.getMonth() + 1;
  400. if (strMonth < 10) {
  401. strMonth = "0" + strMonth;
  402. }
  403. if (strDay < 10) {
  404. strDay = "0" + strDay;
  405. }
  406. var datastr = strYear + "-" + strMonth + "-" + strDay;
  407. return datastr;
  408. },
  409. transformTime1(month) {
  410. var date = new Date();
  411. date.setFullYear(date.getFullYear());
  412. date.setTime(date.getTime());
  413. var strYear = date.getFullYear();
  414. var strDay = date.getDate();
  415. var strMonth = month ? (date.getMonth() + 1) - month : date.getMonth() + 1;
  416. if (strMonth < 10) {
  417. strMonth = "0" + strMonth;
  418. }
  419. if (strDay < 10) {
  420. strDay = "0" + strDay;
  421. }
  422. var datastr = strYear + "-" + strMonth + "-" + strDay;
  423. return datastr;
  424. },
  425. }
  426. }
  427. </script>
  428. <style>
  429. page {
  430. background-color: #f2f2f2;
  431. }
  432. </style>
  433. <style lang="scss" scoped>
  434. @import '@/style/mixin.scss';
  435. /deep/ uni-tabbar .uni-tabbar-bottom {
  436. position: fixed;
  437. left: 0;
  438. right: 0;
  439. bottom: 0;
  440. }
  441. /deep/ .u-action[data-v-1a326067] {
  442. color: #FFFFFF;
  443. }
  444. /deep/ .u-dropdown__menu__item__arrow[data-v-01c0c507] uni-text {
  445. color: #FFFFFF !important;
  446. }
  447. .parent {}
  448. .search {
  449. padding: 10px;
  450. }
  451. .slot-content1 {
  452. background-color: #FFFFFF;
  453. padding: 24rpx;
  454. }
  455. .title {
  456. font-weight: bold;
  457. color: #333;
  458. }
  459. .status-data {
  460. padding: 4px 10px;
  461. box-sizing: border-box;
  462. margin: 0 10px 10px 0;
  463. font-size: 15px;
  464. border: 1px solid #eee;
  465. border-radius: 5px;
  466. cursor: pointer;
  467. }
  468. .active {
  469. background: rgba(234, 142, 45, 0.08);
  470. color: #ff9556;
  471. border: 1px solid rgba(234, 85, 45, 0.01);
  472. font-weight: 700;
  473. }
  474. .white {
  475. background-color: white;
  476. }
  477. .orderItemPane {
  478. background-color: white;
  479. width: 100%;
  480. height: auto;
  481. margin: 10px 0;
  482. border-radius: 10px;
  483. box-shadow: 0 0 6px 1px #e3e3e3;
  484. // padding: 10px 10px 0 10px;
  485. cursor: pointer;
  486. }
  487. .orderItemPane .orderItemPane-centre,
  488. .orderItemPane .orderItemPane-upper .upper-time,
  489. .inscommny-sum>text {
  490. color: #999;
  491. }
  492. .orderItemPane-centre .status,
  493. .inscommny-sum>text text {
  494. color: #ff9000;
  495. font-weight: bold;
  496. }
  497. .orderItemPane-centre .item {
  498. border-bottom: 1px solid #f2f2f2;
  499. }
  500. .orderItemPane-centre .item>text,
  501. .inscommny-sum>text {
  502. margin: 0 10px 4px 10px;
  503. font-size: 14px;
  504. }
  505. .orderItemPane-below {
  506. height: auto;
  507. border-bottom: 1px solid #f2f2f2;
  508. &>button {
  509. margin-left: 10px;
  510. }
  511. }
  512. .orderItemPane-extend .extend-button>text {
  513. color: #ff9000;
  514. font-size: 12px;
  515. }
  516. .orderItemPane-extend {
  517. border-bottom-right-radius: 10px;
  518. border-bottom-left-radius: 10px;
  519. }
  520. .classes::before {
  521. content: "·";
  522. color: #ff9000;
  523. margin-right: 10px;
  524. }
  525. .flexd {
  526. position: fixed;
  527. left: 0;
  528. right: 0;
  529. }
  530. .moosize {
  531. font-size: 12px;
  532. }
  533. .color {
  534. color: #ff9000;
  535. }
  536. /* 查询区域End */
  537. </style>