祁鹏飞 hace 1 mes
padre
commit
1231984ec8
Se han modificado 1 ficheros con 10 adiciones y 1 borrados
  1. 10 1
      src/views/insurancePolicy/index.vue

+ 10 - 1
src/views/insurancePolicy/index.vue

@@ -2394,7 +2394,7 @@ let btns = ref({
     checked: false
   }],
 })
-const handleChange = (item: any, type: any) => {
+const handleChange = async (item: any, type: any) => {
 
   switch (type) {
     case 'owner1':
@@ -2473,6 +2473,11 @@ const handleChange = (item: any, type: any) => {
       }
       break;
     case 'insurance':
+      const valid = await validateForm(InsurancePolicyRefs.value)
+      if (!valid) {
+        ElMessage.warning('请完整填写相关信息')
+        return
+      }
       ruleFilterCompany(item, null)
       let list4 = optionObj.value.insuranceType.filter(a => a.label != item.label)
       list4.forEach(a => a.checked = false)
@@ -3425,6 +3430,10 @@ const validate = async (quoteList) => {
   for (let i = 0; i < quoteList.length; i++) {
     const element = quoteList[i];
     const product = element.projectList?.find((v, index) => element.productIndex === index)
+    if (!product) {
+      ElMessage.warning('请选择方案')
+      return
+    }
     const noMatchObj = product.drivings.find(v => v.minQuantity && Number(v.quantity ?? 0) < Number(v.minQuantity))
     if (noMatchObj) {
       ElMessage({