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

订单详情显示报价时方案 驾意险信息

祁鹏飞 1 месяц назад
Родитель
Сommit
1fff294901
1 измененных файлов с 28 добавлено и 14 удалено
  1. 28 14
      src/views/insurancePolicy/index.vue

+ 28 - 14
src/views/insurancePolicy/index.vue

@@ -1441,8 +1441,8 @@
     </el-dialog>
     <el-dialog :close-on-click-modal="false" title="提交核保" width="1100" v-model="underwritingShow">
       <underwriting v-if="underwritingShow" ref="UnderwritingRefs" :insOrderRightsInfoDto="insOrderRightsInfoDto"
-         :recipientInfo="[owerFormInfo, policyHolderInfo, insuredPersonInfo]"
-        @close="handleUnderwritingClose" @initDetail="initDetail"></underwriting>
+        :recipientInfo="[owerFormInfo, policyHolderInfo, insuredPersonInfo]" @close="handleUnderwritingClose"
+        @initDetail="initDetail"></underwriting>
     </el-dialog>
     <el-dialog :close-on-click-modal="false" title="证件识别" width="800" v-model="imageShow">
       <recognition ref="RecognitionRefs" :option="optionObj.car_type_code" @close="handleImageClose"></recognition>
@@ -1509,9 +1509,8 @@
         <el-button size="small" type="primary" @click="handlePayCodeClose">关闭</el-button>
       </template>
     </el-dialog>
-    <Equities v-model:show="equitiesShow"
-      :recipientInfo="[owerFormInfo, policyHolderInfo, insuredPersonInfo]" :EquitiesInfo="EquitiesInfo"
-      @save="handleEquitiesSave"></Equities>
+    <Equities v-model:show="equitiesShow" :recipientInfo="[owerFormInfo, policyHolderInfo, insuredPersonInfo]"
+      :EquitiesInfo="EquitiesInfo" @save="handleEquitiesSave"></Equities>
   </div>
   <quotation ref="quotationRef" :quotationObj="quotationObj" :insurancePolicyForm="insurancePolicyForm" />
 </template>
@@ -1626,6 +1625,7 @@ const initDetail = () => {
       // 设置业务员信息
       insurancePolicyForm.value.salesman = obj?.salesmanInfo?.name
       insurancePolicyForm.value.mobile = obj?.salesmanInfo?.mobile
+      insurancePolicyForm.value.schemeId = obj?.schemeId
       insurancePolicyForm.value.deptId = obj?.salesmanInfo?.deptId
       // 设置车辆信息
       insurancePolicyForm.value.isRegistered = obj?.carInfoVo?.isRegistered || '1'
@@ -2765,8 +2765,8 @@ const getSchemeResult = () => {
     // 方案信息
     quoteData.value.forEach((item: any) => {
       if (item.id === insurancePolicyForm.value.order.insuranceCompanyCode) {
-        item.productIndex = 0;
         if (myRoute.query.orderNo) {
+          item.productIndex = list.findIndex(v => v.id === insurancePolicyForm.value.schemeId)
           list.forEach((item2: any) => {
             if (item2.schemeType === "1") {
               item2.kinds = item2.kinds.map((v: any) => {
@@ -2780,15 +2780,25 @@ const getSchemeResult = () => {
                   premium: obj?.premium
                 }
               })
+            } else {
+              item2.kinds = item2.kinds.map((v: any) => {
+                let obj = item.insurancePlanInfo?.kinds?.find((kind: any) => kind.kindCode === v.kindCode && kind.amount === v.amount)
+                return {
+                  ...v,
+                  premium: obj?.premium
+                }
+              })
             }
           })
-        }
-        item.insurancePlanInfo = {
-          ...list[0],
-          rescue: [],
-          detection: [],
-          driver: [],
-          inspect: []
+        } else {
+          item.productIndex = 0;
+          item.insurancePlanInfo = {
+            ...list[0],
+            rescue: [],
+            detection: [],
+            driver: [],
+            inspect: []
+          }
         }
         item.projectList = list.map((item1: any) => {
           return {
@@ -3594,6 +3604,7 @@ const quoteInsurance = async (companyId: any, companyIndex: any, val: any) => {
   // 构建提交数据
   let data = {
     systemType: '2',
+    schemeId: product.id,
     order: {
       realQuoteUserId: insurancePolicyForm.value.mobile,
       insuranceCompanyCode: companyId,  // 保险公司代码
@@ -3950,11 +3961,14 @@ const ruleFilterCompany = (item: any, obj: any) => {
                 item.quoteCode = 500
                 item.failMsg = obj.errorMessage
               }
+              insurancePolicyForm.value.order.insuranceCompanyCode = a.id
+              getSchemeResult()
             }
             return a
           })
           return item
         })
+
       }
     } else {
       quoteData.value = []
@@ -3989,7 +4003,7 @@ const quotationRef = ref(null)
 const quotationObj = ref({})
 const handleQuotationView = (obj) => {
   quotationObj.value = obj
-  insurancePolicyForm.value.vehicleUseName=optionObj.value.vehicle_use_code.find(a=>a.value===insurancePolicyForm.value.vehicleUseCode)?.label
+  insurancePolicyForm.value.vehicleUseName = optionObj.value.vehicle_use_code.find(a => a.value === insurancePolicyForm.value.vehicleUseCode)?.label
   quotationRef.value.show(obj)
 }