orders.vue 14 KB

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