orders.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  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. <text>业务员:{{item.username}}({{item.userid}})</text>
  88. </view>
  89. </view>
  90. <view class="orderItemPane-below dis a-c j-end search">
  91. <u-button type="primary" size="mini" :hair-line="false" :plain="true"
  92. @click="quotehistory(item)">报价历史</u-button>
  93. <u-button v-if="item.orderstatus!='3'" type="success" size="mini" :hair-line="false" :plain="true"
  94. @click="CloseEdit(item.orderno)">编辑</u-button>
  95. </view>
  96. </view>
  97. </view>
  98. <o-empty v-if="pageResult.length==0" />
  99. <!-- 回到顶部 -->
  100. <u-picker v-model="startShow" mode="time" :params="params" @confirm="startconfirm"></u-picker>
  101. <u-picker v-model="endShow" mode="time" :params="params" @confirm="endconfirm"></u-picker>
  102. </view>
  103. </template>
  104. <script>
  105. import {
  106. mapState,
  107. mapMutations
  108. } from "vuex"
  109. // import carOrders from "@/components/modules/orders/carOrders.vue";
  110. import {
  111. watch
  112. } from "vue";
  113. export default {
  114. components: {},
  115. watch: {
  116. stageIndex(newVal, oldVal) {
  117. if (newVal !== oldVal) {
  118. this.pageRequest.orderStatus = newVal;
  119. }
  120. }
  121. },
  122. data() {
  123. return {
  124. dwdw: this.$u.color['success'],
  125. /* 时间筛选相关 */
  126. startShow: false,
  127. endShow: false,
  128. params: {
  129. year: true, //年
  130. month: true, //月
  131. day: true, //日
  132. },
  133. /* 时间筛选相关 */
  134. pageRequest: { //查询的默认条件
  135. companyId: "",
  136. orderNo: "",
  137. frameNo: "",
  138. insuredName: "",
  139. licenseNo: "",
  140. orderStatus: "",
  141. userId: "",
  142. deptId: "",
  143. endDate: "",
  144. startDate: "",
  145. pageNum: 1,
  146. pageSize: 20,
  147. },
  148. timespecifications: null,
  149. pageResult: [], //列表数据
  150. /* 搜索框配置 */
  151. shape: 'round',
  152. clearabled: true,
  153. showAction: true,
  154. inputAlign: 'left',
  155. /* 搜索框配置 */
  156. //状态筛选list
  157. statusList: [{
  158. label: '报价中',
  159. value: 0,
  160. color: "#1E9600"
  161. },
  162. {
  163. label: '待核保',
  164. value: 1,
  165. color: "#f5af19"
  166. },
  167. {
  168. label: '已核保待缴费',
  169. value: 2,
  170. color: "#f12711"
  171. },
  172. {
  173. label: '已承保',
  174. value: 3,
  175. color: "#86A8E7"
  176. },
  177. {
  178. label: '核保退回',
  179. value: 4,
  180. color: "#bdc3c7"
  181. }
  182. ],
  183. //日期筛选list
  184. dateList: [{
  185. label: '全部',
  186. value: 0,
  187. },
  188. {
  189. label: '一周内',
  190. value: 1,
  191. },
  192. {
  193. label: '一个月内',
  194. value: 2,
  195. },
  196. {
  197. label: '三个月内',
  198. value: 3,
  199. },
  200. {
  201. label: '六个月内',
  202. value: 4,
  203. },
  204. ],
  205. typeArray: [{
  206. label: '车险',
  207. value: 0,
  208. },
  209. {
  210. label: '意外险',
  211. value: 1,
  212. },
  213. {
  214. label: '寿险',
  215. value: 2,
  216. }
  217. ], //订单的类型
  218. toTopFlag: false, //显示回到顶部按钮
  219. queryLicenseNo: "",
  220. queryFrameNo: "",
  221. insureMore: false,
  222. insureMoreIndex: null,
  223. esmInsCompanyList: [],
  224. }
  225. },
  226. computed: {
  227. ...mapState(['userInfo', 'typeIndex', 'stageIndex'])
  228. },
  229. // 页面触底加载
  230. onReachBottom() {
  231. this.currentPage = this.currentPage + 1;
  232. if (this.totalPages >= this.currentPage) {} else {
  233. return false;
  234. }
  235. },
  236. // 页面滚动触发
  237. onPageScroll(e) { //根据距离顶部距离是否显示回到顶部按钮
  238. if (e.scrollTop > 600) { //当距离大于600时显示回到顶部按钮
  239. this.toTopFlag = true
  240. } else { //当距离小于600时显示回到顶部按钮
  241. this.toTopFlag = false
  242. }
  243. },
  244. onShow() {
  245. const arr = uni.getStorageSync('historyInfo');
  246. if (arr) {
  247. uni.removeStorageSync('historyInfo');
  248. }
  249. this.getOrdersList()
  250. this.esmInsCompany()
  251. },
  252. async onLoad(e) {
  253. this.pageRequest.userId = this.userInfo.sysUser.id;
  254. this.pageRequest.deptId = this.userInfo.sysUser.deptId;
  255. this.getOrdersList()
  256. },
  257. methods: {
  258. ...mapMutations(['setOrderType', 'setOrderStage']),
  259. async getOrdersList() {
  260. let res = await this.$http.post('/insurance/order/queryPageOrder', this.pageRequest);
  261. if (res.code == '200') {
  262. this.pageResult = res.data.content;
  263. }
  264. },
  265. async esmInsCompany() {
  266. let commpanykad = await this.$http.get('/insurance/order/getAgreementInsCompany');
  267. if (commpanykad.code == '200') {
  268. this.esmInsCompanyList = commpanykad.data;
  269. }
  270. },
  271. //展开
  272. selectMore(val) {
  273. this.insureMore = true;
  274. this.insureMoreIndex = val;
  275. },
  276. packup(val) {
  277. this.insureMore = false;
  278. this.insureMoreIndex = val;
  279. },
  280. //取消事件
  281. closeDropdown() {
  282. this.$refs.uDropdown.close();
  283. },
  284. //查询事件
  285. querysearch() {
  286. this.getOrdersList();
  287. this.$refs.uDropdown.close();
  288. },
  289. //状态筛选
  290. statusclick(e) {
  291. this.pageRequest.orderStatus = e;
  292. },
  293. //保险公司筛选
  294. companystatusclick(e) {
  295. this.pageRequest.companyId = e;
  296. },
  297. startShowmethod() {
  298. this.startShow = true;
  299. this.timespecifications = null;
  300. },
  301. endShowmethod() {
  302. this.endShow = true;
  303. this.timespecifications = null;
  304. },
  305. //日期筛选
  306. dateclick(e) {
  307. /* 0:全部 1:一周内 2:一个月内 3:三个月内 4:六个月内*/
  308. switch (e) {
  309. case 0:
  310. this.pageRequest.startDate = "";
  311. this.pageRequest.endDate = "";
  312. break;
  313. case 1:
  314. this.pageRequest.startDate = this.transformTime(7);
  315. this.pageRequest.endDate = this.transformTime();
  316. break;
  317. case 2:
  318. this.pageRequest.startDate = this.transformTime1(1);
  319. this.pageRequest.endDate = this.transformTime();
  320. break;
  321. case 3:
  322. this.pageRequest.startDate = this.transformTime1(3);
  323. this.pageRequest.endDate = this.transformTime();
  324. break;
  325. case 4:
  326. this.pageRequest.startDate = this.transformTime1(6);
  327. this.pageRequest.endDate = this.transformTime();
  328. break;
  329. default:
  330. }
  331. this.timespecifications = e;
  332. },
  333. startconfirm(e) {
  334. this.pageRequest.startDate = e.year + '-' + e.month + '-' + e.day;
  335. },
  336. endconfirm(e) {
  337. this.pageRequest.endDate = e.year + '-' + e.month + '-' + e.day;
  338. },
  339. //验证车架号
  340. isFrameno(str) {
  341. let mPattern = /^([0-9A-Z]){17}$/;
  342. return mPattern.test(str);
  343. },
  344. isCarBrand(str) {
  345. let mPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}([A-Z0-9挂学警港澳使领]{1}|应急)$/ ||
  346. /^沪[0-9A-Z]{5}$/ || /^陆丰[0-9A-Z]{4}临$/;
  347. return mPattern.test(str.trim())
  348. // return /^陆丰[0-9A-Z]{4}临$/.test(str.trim())
  349. },
  350. //查看子订单
  351. async querydetail(val) {
  352. let params = {
  353. orderno: val.orderno,
  354. insuredname: val.insuredname,
  355. licenseno: val.licenseno,
  356. modelcname: val.carinfo.modelcname,
  357. }
  358. uni.navigateTo({
  359. url: `/pages/orders/subOrders?orderno=${JSON.stringify(params)}`
  360. })
  361. },
  362. //报价历史
  363. quotehistory(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/orders/quoteHistory?orderno=${JSON.stringify(params)}`
  372. })
  373. },
  374. //编辑
  375. CloseEdit(val) {
  376. uni.navigateTo({
  377. url: "/pages/carInsure1/quote1?orderno=" + val
  378. })
  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>