123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359 |
- <template>
- <view>
- <!-- 公共组件-每个页面必须引入 -->
- <public-module></public-module>
- <!-- 顶部搜索框区域Start -->
- <view class="search">
- <search @search="search"></search>
- </view>
- <!-- 顶部搜索框区域End -->
-
- <!-- 查询区域Start -->
- <view class="queryView d-flex">
- <view class="d-flex a-center j-center">
- <picker @change="bindPickerTypeChange" :value="typeIndex" :range="typeArray">
- <view class="d-flex a-center">{{typeArray[typeIndex]}} <view class="icon iconfont icon-xiala"></view></view>
- </picker>
- </view>
- <view class="d-flex a-center j-center">
- <picker @change="bindPickerYearChange" :value="yearIndex" :range="yearArray">
- <view class="d-flex a-center">{{yearArray[yearIndex]}}年 <view class="icon iconfont icon-xiala"></view></view>
- </picker>
- </view>
- <view class="d-flex a-center j-center">
- <picker @change="bindPickerMonthChange" :value="monthIndex" :range="monthArray">
- <view class="d-flex a-center">{{monthArray[monthIndex]}}月 <view class="icon iconfont icon-xiala"></view></view>
- </picker>
- </view>
- </view>
- <!-- 查询区域End -->
-
- <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">
- <view class="container-list">
- <block v-for="(orderItem,orderIndex) in list " :key="orderIndex" >
- <view class="container-list-item p-3 pt-2 box-sizing">
- <view class="container-list-item-header d-flex">
- <view class="date">{{orderItem.createtime}}</view>
- </view>
- <view class="container-list-item-body d-flex">
- <view class="left flex-column d-flex a-center j-center" :data-orderno="orderItem.orderno" @tap="openQuoteDetail">
- <p class="plate-number">{{orderItem.carinfo.licenseNo}}</p>
- <p class="plate-number">{{orderItem.inscompany}}</p>
- <p class="car-owner">{{orderItem.ownerinfo.name}}</p>
- </view>
- <view class="right d-flex flex-1 flex-column">
- <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
- <template v-if="riskItem.riskCode == '0507'">
- <view class="ritem d-flex flex-column">
- <view class="top d-flex j-sb">
- <p class="insurance">交强险</p>
- <p class="amount">{{riskItem.premium}}元</p>
- </view>
- <view class="time">{{riskItem.startDate}} - {{riskItem.endDate}} </view>
- </view>
- </template>
-
-
- </block>
- <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
- <template v-if="riskItem.riskCode == '0510'">
- <view class="ritem d-flex flex-column">
- <view class="top d-flex j-sb">
- <p class="insurance">商业险</p>
- <p class="amount">{{riskItem.premium}}元</p>
- </view>
- <view class="time">{{riskItem.startDate}} - {{riskItem.endDate}} </view>
- </view>
- </template>
- </block>
- </view>
- </view>
- <view class="container-list-item-footer">
- <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
- <template v-if="riskItem.riskCode == '0507'">
- <view class="numStyle">交强险保单号:{{orderItem.jqpolicyno}}</view>
- </template>
- </block>
- <block v-for ="(riskItem,riskIndex) in orderItem.riskinfo" :key="riskIndex" >
- <template v-if="riskItem.riskCode == '0510'">
- <view class="numStyle">商业险保单号:{{orderItem.sypolicyno}}</view>
- </template>
- </block>
- </view>
- </view>
- </block>
- </view>
- </z-paging>
- </view>
- </template>
- <script>
- import {mapState} from "vuex"
- import search from "@/components/modules/orders/search.vue";
- import ZPagingMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin';
- export default {
- components:{
- search,
- ZPagingMixin
- },
- computed: {
- ...mapState(['userInfo']),
- getHeight() {
- let height = uni.getSystemInfoSync().windowHeight - uni.upx2px(184);
- let bgColor = '#FFFFFF';
- if(this.list.length>0){
- bgColor = '#F5F5F5';
- }
- return `height: ${height}px; background-color:${bgColor}`;
- }
- },
- data() {
- return {
- list:[],
-
- /* 查询区域Start */
- typeArray:['车险'], //订单的类型
- // typeArray:['车险','意外险','寿险'], //订单的类型
- stageArray:[
- {"label":'待继续',"value":'0'},
- {"label":'核保中',"value":'1'},
- {"label":'已核保',"value":'2'},
- {"label":'已核保待缴费',"value":'5'},
- {"label":'已缴费',"value":'6'},
- {"label":'已承保',"value":'7'},
- {"label":'待修改',"value":'3'},
- {"label":'核保不通过',"value":'4'},
- {"label":'已关闭',"value":'99'}
- ], //订单的阶段
- yearArray:[], //订单的查询年份
- monthArray:[], //订单的查询月份
- typeIndex:0, //订单的类型选择
- yearIndex:0, //订单的年份选择
- monthIndex:0, //订单的月份选择
- /* 查询区域End */
- }
- },
- onLoad() {
- // 搜索年选项Start
- this.yearArray=[(new Date().getFullYear()-2),(new Date().getFullYear()-1),new Date().getFullYear(),]
- this.yearIndex=this.yearArray.length-1;
- // 搜索年选项End
-
- // 搜索月选项Start
- var month = new Date().getMonth()+1;
- for(var i=1;i<=month;i++){
- if(i<10){
- this.monthArray.push('0'+i);
- }else{
- this.monthArray.push(i);
- }
- }
- this.monthIndex=this.monthArray.length-1;
- // 搜索月选项End
- },
- methods: {
- // 订单类型发生变化
- bindPickerTypeChange(e){
- this.typeIndex = e.target.value;
- },
-
- isCarBrand(str) {
- 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}临$/;
- return mPattern.test(str.trim())
- },
-
- search(a){
- if(this.isCarBrand(a.trim())){
- this.list=[]; //获取到的订单列表
- var infodata= {
- "columnFilters":{
- "orderstatus":{
- "name":"orderstatus",
- "value":"7"
- },
- "licenseNo":{
- "name":"licenseNo",
- "value":a.trim()
- },
- "userid":{
- "name":"userid",
- "value":this.userInfo.sysUser.id
- },
- "quotestatus":{
- "name":"quotestatus",
- "value":'1'
- }
- },
- "pageNum":1,
- "pageSize":10
- };
- this.getOrdersList(1,10,infodata);//重新查询订单
- }else{
- return uni.showToast({icon:"none",title:"请输入正确的车牌号或车架号",duration:1500})
- }
- },
-
- //搜索年发生变化
- bindPickerYearChange(e) {
- this.yearIndex = e.target.value;
- this.monthArray=[];
- if(this.yearIndex == (this.yearArray.length-1)){
- var month = new Date().getMonth()+1;
- for(var i=1;i<=month;i++){
- if(i<10){
- this.monthArray.push('0'+i);
- }else{
- this.monthArray.push(i);
- }
- }
- this.monthIndex=this.monthArray.length-1;
- }else{
- for(var i=1;i<=12;i++){
- if(i<10){
- this.monthArray.push('0'+i);
- }else{
- this.monthArray.push(i);
- }
- }
- this.monthIndex=0;
- }
- this.list=[]; //获取到的订单列表
- this.getOrdersList(1,10);//重新查询订单
- },
- //搜索月发生变化
- bindPickerMonthChange(e) {
- this.monthIndex = e.target.value
- this.list=[]; //获取到的订单列表
- this.getOrdersList(1,10);//重新查询订单
- },
- //获取订单数据Start
- async getOrdersList(pageNo, pageSize,info={}) {
-
- var queryStartDate = this.yearArray[this.yearIndex]+'-'+this.monthArray[this.monthIndex]+'-'+'01';
- var formatQueryDate = new Date(queryStartDate);
- formatQueryDate.setMonth(formatQueryDate.getMonth()+1)
- formatQueryDate.setTime(formatQueryDate.getTime()-24*60*60*1000);
- var queryEndDate = formatQueryDate.getFullYear()+'-'+(formatQueryDate.getMonth()+1)+'-'+formatQueryDate.getDate();
-
- var data = {};
- if(info=={}){
- data = info;
- }else{
- data = {
- "columnFilters": {
- "orderstatus":{
- "name":"orderstatus",
- "value":"7"
- },
- "startdate":{
- "name":"startdate",
- "value":queryStartDate
- },
- "licenseNo":{
- "name":"licenseNo",
- "value":this.queryLicenseNo
- },
- "enddate":{
- "name":"enddate",
- "value":queryEndDate
- },
- "userid":{
- "name":"userid",
- "value":this.userInfo.sysUser.id
- },
- "quotestatus":{
- "name":"quotestatus",
- "value":'1'
- }
- },
- "pageNum": pageNo,
- "pageSize": pageSize
- };
- }
- let res = await this.$http.post('/insOrder/findPage',data);
- let content = [];
- if(res.data.content.length>0){
- content = res.data.content;
- }
- this.$refs.paging.complete(content);
-
- },
- //获取订单数据End
-
- //跳转订单详情页面Start(公用)
- openQuoteDetail(e){
- this.navigate({
- url:"/pages/carInsure/quoteDetail?orderno="+e.currentTarget.dataset.orderno
- },'navigateTo',true)
- },
- //跳转订单详情页面End(公用)
- },
- }
- </script>
- <style lang="scss" scoped>
- @import '@/style/mixin.scss';
- .container-list-item{
- background: #fff;
- margin-bottom: 15upx;
- }
- .container-list-item-header .date{
- background:rgba($themeColor, 0.8) ;
- color: #FFFFFF;
- width: 290upx;
- border-radius: 4upx;
- font-size: 24upx;
- text-align: center;
- }
- .container-list-item-body .left{
- width: 230upx;
- flex-shrink: 0;
- color: rgba($themeColor, 0.8);
- font-size: 26upx;
- }
- .container-list-item-body .right .ritem{
- box-sizing: border-box;
- padding-top: 10upx;
- padding-bottom: 10upx;
- border-bottom: 1px solid rgba(0,0,0,.05);
- }
- .container-list-item-body .right .ritem .top{
- font-size: 28upx;
- color: #464646;
- margin-bottom: 10upx;
- }
- .container-list-item-body .right .ritem .time{
- font-size: 22upx;
- color: rgba(0,0,0,.5);
- }
- .container-list-item-footer .numStyle{
- line-height: 60upx;
- }
-
- /* 查询区域Start */
- .queryView {
- justify-content: space-around;
- height: 82upx;
- line-height: 80upx;
- }
- .queryView>view{
- border-top: 1px solid rgba($themeColor, 0.6);
- border-bottom: 1px solid rgba($themeColor, 0.6);
- border-left: 1px solid rgba($themeColor, 0.6);
- box-sizing: border-box;
- color: rgba($themeColor, 0.6);
- }
- .queryView>view:nth-child(1){
- flex: 3;
- }
- .queryView>view:nth-child(2){
- flex: 3;
- }
- .queryView>view:nth-child(3){
- border-right: 1px solid rgba($themeColor, 0.6);
- flex: 3;
- }
- /* 查询区域End */
- </style>
|