customer.vue 10.0 KB

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