orders.vue 17 KB

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