customer.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <view>
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <!-- 顶部搜索框区域Start -->
  6. <view class="search">
  7. <search @search="search"></search>
  8. </view>
  9. <!-- 顶部搜索框区域End -->
  10. <!-- 查询区域Start -->
  11. <view class="queryView d-flex">
  12. <view class="d-flex a-center j-center">
  13. <picker @change="bindPickerTypeChange" :value="typeIndex" :range="typeArray">
  14. <view class="d-flex a-center">{{typeArray[typeIndex]}}
  15. <view class="icon iconfont icon-xiala"></view>
  16. </view>
  17. </picker>
  18. </view>
  19. <view class="d-flex a-center j-center">
  20. <picker @change="bindPickerYearChange" :value="yearIndex" :range="yearArray">
  21. <view class="d-flex a-center">{{yearArray[yearIndex]}}年 <view class="icon iconfont icon-xiala">
  22. </view>
  23. </view>
  24. </picker>
  25. </view>
  26. <view class="d-flex a-center j-center">
  27. <picker @change="bindPickerMonthChange" :value="monthIndex" :range="monthArray">
  28. <view class="d-flex a-center">{{monthArray[monthIndex]}}月 <view class="icon iconfont icon-xiala">
  29. </view>
  30. </view>
  31. </picker>
  32. </view>
  33. </view>
  34. <!-- 查询区域End -->
  35. <view class="container-list">
  36. <view class="container-list-item" v-for="(orderItem,orderIndex) in list " :key="orderIndex"
  37. @tap="openDetail(orderIndex)">
  38. <view class="container-list-item-body d-flex">
  39. <view class="left d-flex flex-1 flex-column">
  40. <view class="name">{{orderItem.inscompany}}</view>
  41. <!-- <view class="date">保险公司:</view>
  42. <view class="date">投保险种:交三</view> -->
  43. <block v-for="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex">
  44. <template v-if="riskItem.riskCode == '0507'">
  45. <view class="date">交强险到期时间:{{riskItem.endDate}}</view>
  46. </template>
  47. </block>
  48. <block v-for="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex">
  49. <template v-if="riskItem.riskCode == '0510'">
  50. <view class="date">商业险到期时间:{{riskItem.endDate}}</view>
  51. </template>
  52. </block>
  53. <view class="btn d-flex">
  54. <span class="d-flex a-center j-center" size="mini"
  55. style="background: #48A0D3;">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</span>
  56. <span class="d-flex a-center j-center" size="mini" style="background: #48A0D3;">到期提醒</span>
  57. </view>
  58. </view>
  59. <view class="right">
  60. <view style="font-size:24upx;" class="name d-flex a-center j-center">
  61. 晋AWEKOI3
  62. </view>
  63. <view class="name d-flex a-center j-center" style="font-size:24upx;">
  64. {{orderItem.inscompany}}
  65. </view>
  66. <view class="name d-flex a-center j-center" style="font-size:24upx;">交三
  67. </view>
  68. <span class="btn">生效中</span>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {
  77. mapState
  78. } from "vuex"
  79. import search from "@/components/modules/orders/search.vue";
  80. import ZPagingMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin';
  81. export default {
  82. components: {
  83. search,
  84. ZPagingMixin
  85. },
  86. computed: {
  87. ...mapState(['userInfo']),
  88. getHeight() {
  89. let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(184);
  90. let bgColor = '#FFFFFF';
  91. if (this.list.length > 0) {
  92. bgColor = '#F5F5F5';
  93. }
  94. return `height: ${height}px; background-color:${bgColor}`;
  95. }
  96. },
  97. data() {
  98. return {
  99. list: [],
  100. /* 查询区域Start */
  101. typeArray: ['车险'], //订单的类型
  102. // typeArray:['车险','意外险','寿险'], //订单的类型
  103. stageArray: [{
  104. "label": '待继续',
  105. "value": '0'
  106. },
  107. {
  108. "label": '核保中',
  109. "value": '1'
  110. },
  111. {
  112. "label": '已核保',
  113. "value": '2'
  114. },
  115. {
  116. "label": '已核保待缴费',
  117. "value": '5'
  118. },
  119. {
  120. "label": '已缴费',
  121. "value": '6'
  122. },
  123. {
  124. "label": '已承保',
  125. "value": '7'
  126. },
  127. {
  128. "label": '待修改',
  129. "value": '3'
  130. },
  131. {
  132. "label": '核保不通过',
  133. "value": '4'
  134. },
  135. {
  136. "label": '已关闭',
  137. "value": '99'
  138. }
  139. ], //订单的阶段
  140. yearArray: [], //订单的查询年份
  141. monthArray: [], //订单的查询月份
  142. typeIndex: 0, //订单的类型选择
  143. yearIndex: 0, //订单的年份选择
  144. monthIndex: 0, //订单的月份选择
  145. /* 查询区域End */
  146. queryLicenseNo: ''
  147. }
  148. },
  149. onLoad() {
  150. // 搜索年选项Start
  151. this.yearArray = [(new Date().getFullYear() - 1), new Date().getFullYear(), (new Date().getFullYear() + 1)]
  152. this.yearIndex = this.yearArray.length - 1;
  153. // 搜索年选项End
  154. // 搜索月选项Start
  155. var month = new Date().getMonth() + 1;
  156. for (var i = 1; i <= 12; i++) {
  157. if (i < 10) {
  158. this.monthArray.push('0' + i);
  159. } else {
  160. this.monthArray.push(i);
  161. }
  162. }
  163. this.monthIndex = new Date().getMonth();
  164. this.getOrdersList();
  165. // 搜索月选项End
  166. },
  167. methods: {
  168. // 订单类型发生变化
  169. bindPickerTypeChange(e) {
  170. this.typeIndex = e.target.value;
  171. },
  172. isCarBrand(str) {
  173. let mPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}([A-Z0-9挂学警港澳使领]{1}|应急)$/ ||
  174. /^沪[0-9A-Z]{5}$/ || /^陆丰[0-9A-Z]{4}临$/;
  175. return mPattern.test(str.trim())
  176. // return /^陆丰[0-9A-Z]{4}临$/.test(str.trim())
  177. },
  178. search(a) {
  179. if (this.isCarBrand(a.trim())) {
  180. this.queryLicenseNo = "";
  181. this.queryLicenseNo = a.trim();
  182. this.list = []; //获取到的订单列表
  183. var infodata = {
  184. "columnFilters": {
  185. "orderstatus": {
  186. "name": "orderstatus",
  187. "value": "7"
  188. },
  189. "licenseNo": {
  190. "name": "licenseNo",
  191. "value": this.queryLicenseNo
  192. },
  193. "userid": {
  194. "name": "userid",
  195. "value": this.userInfo.sysUser.id
  196. },
  197. "quotestatus": {
  198. "name": "quotestatus",
  199. "value": '1'
  200. }
  201. },
  202. "pageNum": 1,
  203. "pageSize": 10
  204. };
  205. this.getOrdersList(1, 10, infodata); //重新查询订单
  206. } else {
  207. return uni.showToast({
  208. icon: "none",
  209. title: "请输入正确的车牌号或车架号",
  210. duration: 1500
  211. })
  212. }
  213. },
  214. //搜索年发生变化
  215. bindPickerYearChange(e) {
  216. this.yearIndex = e.target.value;
  217. this.monthArray = [];
  218. for (var i = 1; i <= 12; i++) {
  219. if (i < 10) {
  220. this.monthArray.push('0' + i);
  221. } else {
  222. this.monthArray.push(i);
  223. }
  224. }
  225. this.list = []; //获取到的订单列表
  226. this.getOrdersList(1, 10); //重新查询订单
  227. },
  228. //搜索月发生变化
  229. bindPickerMonthChange(e) {
  230. this.monthIndex = e.target.value
  231. this.list = []; //获取到的订单列表
  232. this.getOrdersList(1, 10); //重新查询订单
  233. },
  234. //获取订单数据Start
  235. async getOrdersList() {
  236. let params = {
  237. "orderNo": "1731850885233725440"
  238. };
  239. let res = await this.$http.post('/insurance/order/querySuborder', params);
  240. if (res.code == 200) {
  241. this.list = res.data;
  242. }
  243. },
  244. //获取订单数据End
  245. //跳转订单详情页面Start(公用)
  246. openDetail(index) {
  247. this.navigate({
  248. url: "/pages/tools/customer/custormerDetail?",
  249. success: (res) => {
  250. res.eventChannel.emit("acceptData", {
  251. item: this.list[index].id
  252. })
  253. }
  254. }, 'navigateTo', true)
  255. },
  256. //跳转订单详情页面End(公用)
  257. }
  258. }
  259. </script>
  260. <style lang="scss" scoped>
  261. @import '@/style/mixin.scss';
  262. .container-list-item {
  263. background: #fff;
  264. margin-bottom: 20rpx;
  265. }
  266. .container-list-item-header .date {
  267. background: rgba($themeColor, 0.8);
  268. color: #FFFFFF;
  269. width: 290upx;
  270. border-radius: 4upx;
  271. font-size: 24upx;
  272. text-align: center;
  273. }
  274. .container-list-item-body {
  275. padding: 20upx 30upx;
  276. }
  277. .container-list-item-body .left .name {
  278. font-size: 28upx;
  279. font-weight: bold;
  280. }
  281. .container-list-item-body .left .date {
  282. font-size: 24upx;
  283. color: #A3A5A4;
  284. }
  285. .container-list-item-body .left .btn>span {
  286. padding: 0 20upx;
  287. width: 120upx;
  288. /* border: 1px solid #587D93; */
  289. color: #587D93;
  290. margin: 10upx 20upx;
  291. font-size: 24upx;
  292. border-radius: 10upx;
  293. color: #FFFFFF;
  294. font-weight: bold;
  295. }
  296. .container-list-item-body .right {
  297. width: 180upx;
  298. flex-shrink: 0;
  299. color: #B2B3B2;
  300. font-size: 26upx;
  301. }
  302. .container-list-item-body .right>span {
  303. line-height: 70upx;
  304. }
  305. .container-list-item-body .right .btn {
  306. padding: 7upx 30upx;
  307. background: #DD525E;
  308. color: #FFFFFF;
  309. border-radius: 10upx;
  310. margin: 20upx 0 0 20upx;
  311. }
  312. /* 查询区域Start */
  313. .queryView {
  314. justify-content: space-around;
  315. height: 82upx;
  316. line-height: 80upx;
  317. }
  318. .queryView>view {
  319. border-top: 1px solid rgba($themeColor, 0.6);
  320. border-bottom: 1px solid rgba($themeColor, 0.6);
  321. border-left: 1px solid rgba($themeColor, 0.6);
  322. box-sizing: border-box;
  323. color: rgba($themeColor, 0.6);
  324. }
  325. .queryView>view:nth-child(1) {
  326. flex: 3;
  327. }
  328. .queryView>view:nth-child(2) {
  329. flex: 3;
  330. }
  331. .queryView>view:nth-child(3) {
  332. border-right: 1px solid rgba($themeColor, 0.6);
  333. flex: 3;
  334. }
  335. /* 查询区域End */
  336. </style>