orders.vue 15 KB

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