@dongkboy 3 лет назад
Родитель
Сommit
9495b6185a
1 измененных файлов с 40 добавлено и 29 удалено
  1. 40 29
      src/views/Letter/Letter.vue

+ 40 - 29
src/views/Letter/Letter.vue

@@ -633,9 +633,9 @@
                     {{ reslistitem.result.endDateJq }}</span></span>
                 <span v-show="reslistitem.result.startDateSy">商业险: <span>{{ reslistitem.result.startDateSy }} -
                     {{ reslistitem.result.endDateSy }}</span></span>
-                    <span v-if="reslistitem.namesimple == '永诚财险'">光博分:<span>{{ reslistitem.result.ilogPreUdwMess ?
+                <span v-if="reslistitem.namesimple == '永诚财险'">光博分:<span>{{ reslistitem.result.ilogPreUdwMess ?
                   reslistitem.result.ilogPreUdwMess : '无' }}</span></span>
-                <span v-else >评分:<span>{{ reslistitem.result.ilogPreUdwMess ?
+                <span v-else>评分:<span>{{ reslistitem.result.ilogPreUdwMess ?
                   reslistitem.result.ilogPreUdwMess : '无' }}</span></span>
                 <span v-if="reslistitem.result.accidentInfoStr">出险信息:<span>{{
                   reslistitem.result.accidentInfoStr }}</span></span>
@@ -1011,7 +1011,7 @@
       </span>
     </el-dialog>
     <el-dialog title="车型选择" :visible.sync="chexingdialogVisible" width="1300px">
-      <el-form :inline="true"  class="demo-form-inline" size="small">
+      <el-form :inline="true" class="demo-form-inline" size="small">
         <el-form-item label="厂牌型号">
           <el-input v-model="carInfo.modelcname" placeholder="厂牌型号" style="width:500px;"></el-input>
         </el-form-item>
@@ -1172,7 +1172,7 @@
         <div style="padding:0 20px">
           <div class="ORcode">
             <div style="padding:5px;position: relative;">
-              <div v-show="['永安财险', '人保财险', '永诚财险', '中煤财险', '众安财险', '紫金财险','国任财险'].includes(inscompany)" id="qrcode"
+              <div v-show="['永安财险', '人保财险', '永诚财险', '中煤财险', '众安财险', '紫金财险', '国任财险'].includes(inscompany)" id="qrcode"
                 ref="qrcode">
               </div>
               <img v-show="['恒邦财险'].includes(inscompany)" :src="paycodeimg" alt style="width:100%" />
@@ -1639,7 +1639,7 @@
 import QRCode from "qrcodejs2";
 import Cookies from "js-cookie";
 import CommonUtil from "@/utils/comutil.js";
-import { getAgeByIdCard, searchkey,addressCode } from "@/utils/validate.js";
+import { getAgeByIdCard, searchkey, addressCode } from "@/utils/validate.js";
 import { regionData, codeToText } from "element-china-area-data";
 export default {
   inject: ["reload"],
@@ -1668,8 +1668,8 @@ export default {
       }
     };
     return {
-      formInline:{},
-      regular:/.+?(省|市|自治区|自治州|县|区|城|旗|域|岛|院|划|街道)/g,
+      formInline: {},
+      regular: /.+?(省|市|自治区|自治州|县|区|城|旗|域|岛|院|划|街道)/g,
       xlcell: 6,
       lgcell: 12,
       mdcell: 12,
@@ -2742,7 +2742,17 @@ export default {
       import("element-ui/packages/image/src/image-viewer")
   },
   created() {
-    console.log(addressCode('山西省静乐县王村镇三山村71号1户'))
+    // 输入的字符串
+    var text = "亲,您的爱车上一年交强险于2023年11月7日 00:00:00到期,为了避免重复投保,我们已经更新了您的交强险生效日期 !----.------.. ....-亲,您的爱车上一年商业险于2023年11月7日到期。根据您选择的保单起期,商业险于2023年9月28日起重怎投保,请确认是否以 平台返回的商业险到期日为准!";
+
+    // 正则表达式匹配日期模式,支持不同格式的日期
+    var datePattern = /(\d{4}年\d{1,2}月\d{1,2}日(?: \d{2}:\d{2}:\d{2})?)/g;
+
+    // 使用正则表达式匹配所有日期
+    var dates = text.match(datePattern);
+
+    console.log(dates); // 输出匹配到的所有日期
+    console.log(this.transformTime(dates[0]))
     this.getDicType("vehicleType");//车辆种类
     this.getDicType("trafficManagementVehicleType");//车辆类型
     this.getDicType("energyType");//能源种类
@@ -3412,11 +3422,7 @@ export default {
     },
     //订单生成前数据处理事件
     OrderStageProcessing() {
-      if (this.imageList1.length == 0 && this.imageList2.length == 0) {
-        this.$message({ message: "手动录单先上传影像", type: "error", });
-        return;
-      }
-      if (this.tbczcarShow) { //投保人同车主
+      if (this.tbczcarShow && this.imageList2.length > 0) { //投保人同车主
         this.imageList3 = JSON.parse(JSON.stringify(this.imageList2));
         if (this.imageList3.length == 1) {
           this.imageList3[0].imageType = "C03";
@@ -3425,7 +3431,7 @@ export default {
           this.imageList3[1].imageType = "D03";
         }
       }
-      if (this.bbczcarShow) { //被保人同车主
+      if (this.bbczcarShow && this.imageList2.length > 0) { //被保人同车主
         this.imageList4 = JSON.parse(JSON.stringify(this.imageList2));
         if (this.imageList4.length == 1) {
           this.imageList4[0].imageType = "C04";
@@ -3434,7 +3440,7 @@ export default {
           this.imageList4[1].imageType = "D04";
         }
       }
-      if (this.bbtbcarShow) { //被保人同投保人
+      if (this.bbtbcarShow && this.imageList3.length > 0) { //被保人同投保人
         this.imageList4 = JSON.parse(JSON.stringify(this.imageList3));
         if (this.imageList4.length == 1) {
           this.imageList4[0].imageType = "C04";
@@ -3445,14 +3451,15 @@ export default {
       }
       //上传图片
       const mergedArray = [...this.imageList1, ...this.imageList2, ...this.imageList3, ...this.imageList4];
-      let imageparam = {
-        imageList: mergedArray,
-        quoteNo: this.quoteno
+      if (mergedArray.length > 0) {
+        let imageparam = {
+          imageList: mergedArray,
+          quoteNo: this.quoteno
+        }
+        this.$api.letter.uploadImages(imageparam).then(responses => {
+          this.imageEcho(this.quoteno); // 获取图片
+        });
       }
-      this.$api.letter.uploadImages(imageparam).then(responses => {
-        this.imageEcho(this.quoteno); // 获取图片
-      });
-      // 上传图片
       //日期长度<10处理
       const formatDate = (date) => {
         if (date.length < 10) {
@@ -4261,6 +4268,10 @@ export default {
 
     },
     hbsubmitdialog(data) {
+      if (this.imageList1.length == 0 && this.imageList2.length == 0) {
+        this.$message({ message: "影像不全,先上传影像", type: "error", });
+        return;
+      }
       this.companyId = data.result.companyId;
       this.apiType = data.apiType;
       this.hbsubmitdialogVisible = true;
@@ -5142,10 +5153,10 @@ export default {
               this.ownerInfoform.identifyValidEndDate = '9999-12-31';
             }
           }
-         let values=addressCode(this.ownerInfoform.addr);
-          this.ownerInfoform.province=codeToText[values[0]]
-          this.ownerInfoform.city=codeToText[values[1]]
-          this.ownerInfoform.county=codeToText[values[2]]
+          let values = addressCode(this.ownerInfoform.addr);
+          this.ownerInfoform.province = codeToText[values[0]]
+          this.ownerInfoform.city = codeToText[values[1]]
+          this.ownerInfoform.county = codeToText[values[2]]
         }
       });
     },
@@ -5153,17 +5164,17 @@ export default {
       //传参
       switch (this.userIndex) {
         case 2:
-          this.selectedOptions1=addressCode(this.ownerInfoform.addr);
+          this.selectedOptions1 = addressCode(this.ownerInfoform.addr);
           this.ownerInfo = JSON.parse(JSON.stringify(this.ownerInfoform));
           break;
         case 3:
-        this.selectedOptions2=addressCode(this.ownerInfoform.addr);
+          this.selectedOptions2 = addressCode(this.ownerInfoform.addr);
           this.policyHolderInfo = JSON.parse(
             JSON.stringify(this.ownerInfoform)
           );
           break;
         case 4:
-        this.selectedOptions3=addressCode(this.ownerInfoform.addr);
+          this.selectedOptions3 = addressCode(this.ownerInfoform.addr);
           this.insuredPersonInfo = JSON.parse(
             JSON.stringify(this.ownerInfoform)
           );