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