policy.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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. <block v-for="(orderItem,orderIndex) in list " :key="orderIndex" >
  32. <view class="container-list-item p-3 pt-2 box-sizing">
  33. <view class="container-list-item-header d-flex">
  34. <view class="date">{{orderItem.createtime}}</view>
  35. </view>
  36. <view class="container-list-item-body d-flex">
  37. <view class="left flex-column d-flex a-center j-center" :data-orderno="orderItem.orderno" @tap="openQuoteDetail">
  38. <p class="plate-number">{{orderItem.carinfo.licenseNo}}</p>
  39. <p class="plate-number">{{orderItem.inscompany}}</p>
  40. <p class="car-owner">{{orderItem.ownerinfo.name}}</p>
  41. </view>
  42. <view class="right d-flex flex-1 flex-column">
  43. <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
  44. <template v-if="riskItem.riskCode == '0507'">
  45. <view class="ritem d-flex flex-column">
  46. <view class="top d-flex j-sb">
  47. <p class="insurance">交强险</p>
  48. <p class="amount">{{riskItem.premium}}元</p>
  49. </view>
  50. <view class="time">{{riskItem.startDate}} - {{riskItem.endDate}} </view>
  51. </view>
  52. </template>
  53. </block>
  54. <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
  55. <template v-if="riskItem.riskCode == '0510'">
  56. <view class="ritem d-flex flex-column">
  57. <view class="top d-flex j-sb">
  58. <p class="insurance">商业险</p>
  59. <p class="amount">{{riskItem.premium}}元</p>
  60. </view>
  61. <view class="time">{{riskItem.startDate}} - {{riskItem.endDate}} </view>
  62. </view>
  63. </template>
  64. </block>
  65. </view>
  66. </view>
  67. <view class="container-list-item-footer">
  68. <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
  69. <template v-if="riskItem.riskCode == '0507'">
  70. <view class="numStyle">交强险保单号:{{orderItem.jqpolicyno}}</view>
  71. </template>
  72. </block>
  73. <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
  74. <template v-if="riskItem.riskCode == '0510'">
  75. <view class="numStyle">商业险保单号:{{orderItem.sypolicyno}}</view>
  76. </template>
  77. </block>
  78. </view>
  79. </view>
  80. </block>
  81. </view>
  82. </z-paging>
  83. </view>
  84. </template>
  85. <script>
  86. import {mapState} from "vuex"
  87. import search from "@/components/modules/orders/search.vue";
  88. import ZPagingMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin';
  89. export default {
  90. components:{
  91. search,
  92. ZPagingMixin
  93. },
  94. computed: {
  95. ...mapState(['userInfo']),
  96. getHeight() {
  97. let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(184);
  98. let bgColor = '#FFFFFF';
  99. if(this.list.length>0){
  100. bgColor = '#F5F5F5';
  101. }
  102. return `height: ${height}px; background-color:${bgColor}`;
  103. }
  104. },
  105. data() {
  106. return {
  107. list:[],
  108. /* 查询区域Start */
  109. typeArray:['车险'], //订单的类型
  110. // typeArray:['车险','意外险','寿险'], //订单的类型
  111. stageArray:[
  112. {"label":'待继续',"value":'0'},
  113. {"label":'核保中',"value":'1'},
  114. {"label":'已核保',"value":'2'},
  115. {"label":'已核保待缴费',"value":'5'},
  116. {"label":'已缴费',"value":'6'},
  117. {"label":'已承保',"value":'7'},
  118. {"label":'待修改',"value":'3'},
  119. {"label":'核保不通过',"value":'4'},
  120. {"label":'已关闭',"value":'99'}
  121. ], //订单的阶段
  122. yearArray:[], //订单的查询年份
  123. monthArray:[], //订单的查询月份
  124. typeIndex:0, //订单的类型选择
  125. yearIndex:0, //订单的年份选择
  126. monthIndex:0, //订单的月份选择
  127. /* 查询区域End */
  128. }
  129. },
  130. onLoad() {
  131. // 搜索年选项Start
  132. this.yearArray=[(new Date().getFullYear()-2),(new Date().getFullYear()-1),new Date().getFullYear(),]
  133. this.yearIndex=this.yearArray.length-1;
  134. // 搜索年选项End
  135. // 搜索月选项Start
  136. var month = new Date().getMonth()+1;
  137. for(var i=1;i<=month;i++){
  138. if(i<10){
  139. this.monthArray.push('0'+i);
  140. }else{
  141. this.monthArray.push(i);
  142. }
  143. }
  144. this.monthIndex=this.monthArray.length-1;
  145. // 搜索月选项End
  146. },
  147. methods: {
  148. // 订单类型发生变化
  149. bindPickerTypeChange(e){
  150. this.typeIndex = e.target.value;
  151. },
  152. isCarBrand(str) {
  153. 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}临$/;
  154. return mPattern.test(str.trim())
  155. },
  156. search(a){
  157. if(this.isCarBrand(a.trim())){
  158. this.list=[]; //获取到的订单列表
  159. var infodata= {
  160. "columnFilters":{
  161. "orderstatus":{
  162. "name":"orderstatus",
  163. "value":"7"
  164. },
  165. "licenseNo":{
  166. "name":"licenseNo",
  167. "value":a.trim()
  168. },
  169. "userid":{
  170. "name":"userid",
  171. "value":this.userInfo.sysUser.id
  172. },
  173. "quotestatus":{
  174. "name":"quotestatus",
  175. "value":'1'
  176. }
  177. },
  178. "pageNum":1,
  179. "pageSize":10
  180. };
  181. this.getOrdersList(1,10,infodata);//重新查询订单
  182. }else{
  183. return uni.showToast({icon:"none",title:"请输入正确的车牌号或车架号",duration:1500})
  184. }
  185. },
  186. //搜索年发生变化
  187. bindPickerYearChange(e) {
  188. this.yearIndex = e.target.value;
  189. this.monthArray=[];
  190. if(this.yearIndex == (this.yearArray.length-1)){
  191. var month = new Date().getMonth()+1;
  192. for(var i=1;i<=month;i++){
  193. if(i<10){
  194. this.monthArray.push('0'+i);
  195. }else{
  196. this.monthArray.push(i);
  197. }
  198. }
  199. this.monthIndex=this.monthArray.length-1;
  200. }else{
  201. for(var i=1;i<=12;i++){
  202. if(i<10){
  203. this.monthArray.push('0'+i);
  204. }else{
  205. this.monthArray.push(i);
  206. }
  207. }
  208. this.monthIndex=0;
  209. }
  210. this.list=[]; //获取到的订单列表
  211. this.getOrdersList(1,10);//重新查询订单
  212. },
  213. //搜索月发生变化
  214. bindPickerMonthChange(e) {
  215. this.monthIndex = e.target.value
  216. this.list=[]; //获取到的订单列表
  217. this.getOrdersList(1,10);//重新查询订单
  218. },
  219. //获取订单数据Start
  220. async getOrdersList(pageNo, pageSize,info={}) {
  221. var queryStartDate = this.yearArray[this.yearIndex]+'-'+this.monthArray[this.monthIndex]+'-'+'01';
  222. var formatQueryDate = new Date(queryStartDate);
  223. formatQueryDate.setMonth(formatQueryDate.getMonth()+1)
  224. formatQueryDate.setTime(formatQueryDate.getTime()-24*60*60*1000);
  225. var queryEndDate = formatQueryDate.getFullYear()+'-'+(formatQueryDate.getMonth()+1)+'-'+formatQueryDate.getDate();
  226. var data = {};
  227. if(info=={}){
  228. data = info;
  229. }else{
  230. data = {
  231. "columnFilters": {
  232. "orderstatus":{
  233. "name":"orderstatus",
  234. "value":"7"
  235. },
  236. "startdate":{
  237. "name":"startdate",
  238. "value":queryStartDate
  239. },
  240. "licenseNo":{
  241. "name":"licenseNo",
  242. "value":this.queryLicenseNo
  243. },
  244. "enddate":{
  245. "name":"enddate",
  246. "value":queryEndDate
  247. },
  248. "userid":{
  249. "name":"userid",
  250. "value":this.userInfo.sysUser.id
  251. },
  252. "quotestatus":{
  253. "name":"quotestatus",
  254. "value":'1'
  255. }
  256. },
  257. "pageNum": pageNo,
  258. "pageSize": pageSize
  259. };
  260. }
  261. let res = await this.$http.post('/insOrder/findPage',data);
  262. let content = [];
  263. if(res.data.content.length>0){
  264. content = res.data.content;
  265. }
  266. this.$refs.paging.complete(content);
  267. },
  268. //获取订单数据End
  269. //跳转订单详情页面Start(公用)
  270. openQuoteDetail(e){
  271. this.navigate({
  272. url:"/pages/carInsure/quoteDetail?orderno="+e.currentTarget.dataset.orderno
  273. },'navigateTo',true)
  274. },
  275. //跳转订单详情页面End(公用)
  276. },
  277. }
  278. </script>
  279. <style lang="scss" scoped>
  280. @import '@/style/mixin.scss';
  281. .container-list-item{
  282. background: #fff;
  283. margin-bottom: 15upx;
  284. }
  285. .container-list-item-header .date{
  286. background:rgba($themeColor, 0.8) ;
  287. color: #FFFFFF;
  288. width: 290upx;
  289. border-radius: 4upx;
  290. font-size: 24upx;
  291. text-align: center;
  292. }
  293. .container-list-item-body .left{
  294. width: 230upx;
  295. flex-shrink: 0;
  296. color: rgba($themeColor, 0.8);
  297. font-size: 26upx;
  298. }
  299. .container-list-item-body .right .ritem{
  300. box-sizing: border-box;
  301. padding-top: 10upx;
  302. padding-bottom: 10upx;
  303. border-bottom: 1px solid rgba(0,0,0,.05);
  304. }
  305. .container-list-item-body .right .ritem .top{
  306. font-size: 28upx;
  307. color: #464646;
  308. margin-bottom: 10upx;
  309. }
  310. .container-list-item-body .right .ritem .time{
  311. font-size: 22upx;
  312. color: rgba(0,0,0,.5);
  313. }
  314. .container-list-item-footer .numStyle{
  315. line-height: 60upx;
  316. }
  317. /* 查询区域Start */
  318. .queryView {
  319. justify-content: space-around;
  320. height: 82upx;
  321. line-height: 80upx;
  322. }
  323. .queryView>view{
  324. border-top: 1px solid rgba($themeColor, 0.6);
  325. border-bottom: 1px solid rgba($themeColor, 0.6);
  326. border-left: 1px solid rgba($themeColor, 0.6);
  327. box-sizing: border-box;
  328. color: rgba($themeColor, 0.6);
  329. }
  330. .queryView>view:nth-child(1){
  331. flex: 3;
  332. }
  333. .queryView>view:nth-child(2){
  334. flex: 3;
  335. }
  336. .queryView>view:nth-child(3){
  337. border-right: 1px solid rgba($themeColor, 0.6);
  338. flex: 3;
  339. }
  340. /* 查询区域End */
  341. </style>