Browse Source

轮胎保注册提交错误报错问题优化

liyuan 16 hours ago
parent
commit
b5517ab14e
1 changed files with 8 additions and 2 deletions
  1. 8 2
      pages/home/insurance/details.vue

+ 8 - 2
pages/home/insurance/details.vue

@@ -784,6 +784,7 @@
 					return
 				}
         let tyreNoList = []
+        console.info(this.form.tireInsuranceFilesList)
 				for (let item of this.form.tireInsuranceFilesList) {
           if (!item.tyreNo) {
             return uni.showToast({
@@ -797,11 +798,17 @@
               icon: 'none'
             });
           }
-          if (tyreNoList.indexOf(item.tyreNo) !== -1) {
+          let existData = tyreNoList.find(i => i.tyreNo === item.tyreNo)
+          if (existData && Number(existData.index) !== Number(item.affiliatedWithGroup)) {
             return uni.showToast({
               title: `轮胎${item.affiliatedWithGroup }的胎号重复,请检查轮胎${item.affiliatedWithGroup }的胎号是否正确`,
               icon: 'none'
             });
+          } else {
+            tyreNoList.push({
+              tyreNo: item.tyreNo,
+              index: item.affiliatedWithGroup
+            });
           }
 					if (item.fileUrl == null) {
 						return uni.showToast({
@@ -810,7 +817,6 @@
 							icon: 'none'
 						});
 					}
-          tyreNoList.push(item.tyreNo);
 				}
 				let obj = {
 					...this.form,