Procházet zdrojové kódy

fix: 修改报价自选方案数据结构

wuguojie před 9 měsíci
rodič
revize
386adad7c0
1 změnil soubory, kde provedl 16 přidání a 6 odebrání
  1. 16 6
      src/views/insurancePolicy/index.vue

+ 16 - 6
src/views/insurancePolicy/index.vue

@@ -2360,14 +2360,19 @@ const handelSelectRow = (a, b) => {
         companyId: b.id,
         companyId: b.id,
         productId: insurancePolicyForm.value.productId
         productId: insurancePolicyForm.value.productId
       }).then((res: any) => {
       }).then((res: any) => {
-        if(res.data?.schemes) {
-          res.data?.schemes.forEach(item => {
+        let list = res.data?.schemes || [];
+        if(res.data?.optionalScheme) {
+            list.push(res.data.optionalScheme)
+            console.log(123123123, list)
+        }
+        if(list.length > 0) {
+            list.forEach(item => {
             item.checked = false
             item.checked = false
           })
           })
         }
         }
         quoteData.value.forEach(item => {
         quoteData.value.forEach(item => {
           if(item.id === b.id) {
           if(item.id === b.id) {
-            item.projectList = res.data.schemes.map(item => {
+            item.projectList = list.map(item => {
                 return {
                 return {
                     ...item,
                     ...item,
                     rescue: [],
                     rescue: [],
@@ -2391,14 +2396,19 @@ const handelExpend = (e) => {
             companyId: e.id,
             companyId: e.id,
             productId: insurancePolicyForm.value.productId
             productId: insurancePolicyForm.value.productId
         }).then((res: any) => {
         }).then((res: any) => {
-            if(res.data?.schemes) {
-                res.data?.schemes.forEach(item => {
+            let list = res.data?.schemes || [];
+            if(res.data?.optionalScheme) {
+                list.push(res.data.optionalScheme)
+                console.log(123123123, list)
+            }
+            if(list.length > 0) {
+                list.forEach(item => {
                     item.checked = false
                     item.checked = false
                 })
                 })
             }
             }
             quoteData.value.forEach(item => {
             quoteData.value.forEach(item => {
                 if(item.id === e .id) {
                 if(item.id === e .id) {
-                    item.projectList = res.data.schemes.map(item => {
+                    item.projectList = list.map(item => {
                         return {
                         return {
                             ...item,
                             ...item,
                             rescue: [],
                             rescue: [],