Просмотр исходного кода

Merge branch 'dev' of http://39.101.143.165:8090/dong_k/tenant-Platform into dev

@dongkboy 2 недель назад
Родитель
Сommit
8c3668f517
2 измененных файлов с 60 добавлено и 28 удалено
  1. 33 2
      src/views/insurancePolicy/index.vue
  2. 27 26
      src/views/insurancePolicy/modules/recognition.vue

+ 33 - 2
src/views/insurancePolicy/index.vue

@@ -3493,7 +3493,7 @@ const handleImageClose = (data: any) => {
       }
     }
     if (imageVoList && imageVoList.length > 0) {
-      insurancePolicyForm.value.imageVoList = imageVoList.filter((a: any) => a.imageBase64List[0].imageId)
+      insurancePolicyForm.value.imageVoList = imageVoList.filter((a: any) => a.imageBase64List[0])
     }
     if (list && list.length > 0) {
       images.value = list
@@ -3675,8 +3675,17 @@ const paramValidate = () => {
     insurancePolicyForm.value.address2 = insurancePolicyForm.value.address1
     insurancePolicyForm.value.registeredCapital2 = insurancePolicyForm.value.registeredCapital1
     insurancePolicyForm.value.email2 = insurancePolicyForm.value.email1
-  }
 
+    insurancePolicyForm.value.imageVoList = insurancePolicyForm.value.imageVoList.map((v, i, arr) => {
+      ['C', 'D', 'Y'].forEach(item => {
+        if (v.imageCode === `${item}03` && !v.imageBase64List[0].imageId) {
+          const obj = arr.find(k => k.imageCode === `${item}02`) ?? {}
+          v.imageBase64List[0].imageId = obj.imageBase64List[0].imageId
+        }
+      })
+      return v
+    })
+  }
   // 处理投保人与被保人关系
   let obj2 = btns.value.owner2.find((a: any) => a.checked)
   btns.value.owner2Text = obj2.text
@@ -3695,6 +3704,17 @@ const paramValidate = () => {
     insurancePolicyForm.value.address3 = insurancePolicyForm.value.address1
     insurancePolicyForm.value.registeredCapital3 = insurancePolicyForm.value.registeredCapital1
     insurancePolicyForm.value.email3 = insurancePolicyForm.value.email1
+
+    insurancePolicyForm.value.imageVoList = insurancePolicyForm.value.imageVoList.map((v, i, arr) => {
+      ['C', 'D', 'Y'].forEach(item => {
+        if (v.imageCode === `${item}04` && !v.imageBase64List[0].imageId) {
+          const obj = arr.find(k => k.imageCode === `${item}02`)
+          v.imageBase64List[0].imageId = obj.imageBase64List[0].imageId
+
+        }
+      })
+      return v
+    })
   }
   if (obj2.text === '同投保人') {
     // 如果被保人选择"同投保人",则将被保人信息设为投保人信息
@@ -3711,6 +3731,17 @@ const paramValidate = () => {
     insurancePolicyForm.value.address3 = insurancePolicyForm.value.address2
     insurancePolicyForm.value.registeredCapital3 = insurancePolicyForm.value.registeredCapital2
     insurancePolicyForm.value.email3 = insurancePolicyForm.value.email2
+
+    insurancePolicyForm.value.imageVoList = insurancePolicyForm.value.imageVoList.map((v, i, arr) => {
+      ['C', 'D', 'Y'].forEach(item => {
+        if (v.imageCode === `${item}04` && !v.imageBase64List[0].imageId) {
+          const obj = arr.find(k => k.imageCode === `${item}03`)
+          v.imageBase64List[0].imageId = obj.imageBase64List[0].imageId
+
+        }
+      })
+      return v
+    })
   }
 
 }

+ 27 - 26
src/views/insurancePolicy/modules/recognition.vue

@@ -779,21 +779,21 @@ const uploadImage = async (file, type) => {
             carForm.value.carTypeCode = data.category // 车辆类型
             carForm.value.energyTypeCode = data.energyTypeCode // 能源种类
             carForm.value.plateType = data.plateType;
-            if(data.registerDate){
-            carForm.value.registerDate = // 注册日期
-               data.registerDate.substring(0, 4) +
-              "-" +
-              data.registerDate.substring(4, 6) +
-              "-" +
-              data.registerDate.substring(6, 8);
+            if (data.registerDate) {
+              carForm.value.registerDate = // 注册日期
+                data.registerDate.substring(0, 4) +
+                "-" +
+                data.registerDate.substring(4, 6) +
+                "-" +
+                data.registerDate.substring(6, 8);
             }
-            if(data.issueDate){
+            if (data.issueDate) {
               carForm.value.issueDate = // 发证日期
-              data.issueDate.substring(0, 4) +
-              "-" +
-              data.issueDate.substring(4, 6) +
-              "-" +
-              data.issueDate.substring(6, 8);
+                data.issueDate.substring(0, 4) +
+                "-" +
+                data.issueDate.substring(4, 6) +
+                "-" +
+                data.issueDate.substring(6, 8);
             }
           } else {
             ElMessage({
@@ -831,13 +831,13 @@ const uploadImage = async (file, type) => {
                 "-" +
                 data.identifyValidDate.substring(6, 8);
             }
-            if(data.identifyValidEndDate){
-                owerForm.value.identifyValidEndDate = data.identifyValidEndDate ? data.identifyValidEndDate === '长期' ? '9999-12-31' :
-              data.identifyValidEndDate.substring(0, 4) +
-              "-" +
-              data.identifyValidEndDate.substring(4, 6) +
-              "-" +
-              data.identifyValidEndDate.substring(6, 8) : ''
+            if (data.identifyValidEndDate) {
+              owerForm.value.identifyValidEndDate = data.identifyValidEndDate ? data.identifyValidEndDate === '长期' ? '9999-12-31' :
+                data.identifyValidEndDate.substring(0, 4) +
+                "-" +
+                data.identifyValidEndDate.substring(4, 6) +
+                "-" +
+                data.identifyValidEndDate.substring(6, 8) : ''
             }
 
             owerForm.value.age = getAgeByIdCard(data.identifyNumber)
@@ -873,13 +873,13 @@ const uploadImage = async (file, type) => {
             owerForm.value.addr = data.addr
             owerForm.value.nation = data.nation
             owerForm.value.identifyNumber = data.identifyNumber
-            if(data.identifyValidDate){
+            if (data.identifyValidDate) {
               owerForm.value.identifyValidDate =
-              data.identifyValidDate.substring(0, 4) +
-              "-" +
-              data.identifyValidDate.substring(4, 6) +
-              "-" +
-              data.identifyValidDate.substring(6, 8);
+                data.identifyValidDate.substring(0, 4) +
+                "-" +
+                data.identifyValidDate.substring(4, 6) +
+                "-" +
+                data.identifyValidDate.substring(6, 8);
             }
 
             owerForm.value.identifyValidEndDate = data.identifyValidEndDate ? data.identifyValidEndDate === '长期' ? '9999-12-31' :
@@ -1031,6 +1031,7 @@ const uploadImage = async (file, type) => {
             }
           })
         }
+        break;
       case 'bbrf':
         bbrFrontResult.value = result
         bbrFront.value = result.downloadUrl