orders.vue 14 KB

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