orders.vue 18 KB

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