Kaynağa Gözat

报价订单编辑后报价参数优化
核保后状态更新

@dongkboy 4 ay önce
ebeveyn
işleme
53e3f39976
1 değiştirilmiş dosya ile 60 ekleme ve 40 silme
  1. 60 40
      src/views/insurancePolicy/index.vue

+ 60 - 40
src/views/insurancePolicy/index.vue

@@ -1038,7 +1038,7 @@
                           <el-table-column label="产品名称" prop="productName" align="center">
                             <template #default="props">
                               <el-button link type="primary" @click="getJYXDetail(props.row)">{{ props.row.productName
-                                }}</el-button>
+                              }}</el-button>
                             </template>
                           </el-table-column>
                           <el-table-column label="数量" align="center">
@@ -1236,12 +1236,12 @@
                     @click="handleSubmit(InsurancePolicyRefs, scope.row)">计算保费</el-button>
                   <el-button v-if="scope.row.quoteCode == 200" link type="primary"
                     @click="handleShare(scope.row.quoteResult.ordersNo)">分享</el-button>
-                  <el-button v-if="scope.row.quoteResult?.quoteStatus == 4" link type="primary"
-                    @click="handlePayment(scope.row.quoteResult.ordersNo)">支付码</el-button>
-                  <el-button v-if="scope.row.quoteResult?.quoteStatus == 4" link type="primary"
-                    @click="handleCancelPayment(scope.row.quoteResult.ordersNo)">撤销支付码</el-button>
                   <el-button v-if="scope.row.quoteCode == 200" link type="primary" :loading="scope.row.loading"
                     @click="handleUnderwriting(scope)">核保</el-button>
+                  <el-button v-if="scope.row.quoteResult?.quoteStatus == 4 || scope.row.quoteResult?.order?.orderStatus == 4" link type="primary"
+                    @click="handlePayment(scope.row.quoteResult.ordersNo)">支付码</el-button>
+                  <el-button v-if="scope.row.quoteResult?.quoteStatus == 4 || scope.row.quoteResult?.order?.orderStatus == 4" link type="primary"
+                    @click="handleCancelPayment(scope.row.quoteResult.ordersNo)">撤销支付码</el-button>
                 </div>
               </template>
             </el-table-column>
@@ -1691,7 +1691,6 @@ const initDetail = () => {
       })
       // 根据选择的保险类型过滤公司
       let newObj = optionObj.value.insuranceType.find(a => a.checked)
-      console.log(newObj)
       if (newObj) {
         ruleFilterCompany(newObj, obj)
 
@@ -1738,7 +1737,7 @@ const handleSalesmanSelect = (data: any) => {
       quoteData.value = []
       ruleFilterCompany({
         value: insurancePolicyForm.value.productId
-      },null)
+      }, null)
     }
     // 更新业务员信息
     insurancePolicyForm.value.salesman = data.name
@@ -2148,7 +2147,6 @@ const licenseNoDataCancel = () => {
   licenseNoShow.value = false
 }
 const licenseNoDataSubmit = () => {
-  console.log(selectRowData.value)
   if (selectRowData.value && 'ratedPassengerCapacity' in selectRowData.value) {
     const carData = selectRowData.value as CarInfo;
     insurancePolicyForm.value.seatCount = carData.ratedPassengerCapacity
@@ -2351,7 +2349,7 @@ const handleChange = (item: any, type: any) => {
       }
       break;
     case 'insurance':
-      ruleFilterCompany(item,null)
+      ruleFilterCompany(item, null)
       let list4 = optionObj.value.insuranceType.filter(a => a.label != item.label)
       list4.forEach(a => a.checked = false)
       item.checked = true
@@ -2601,7 +2599,7 @@ const handleOpenEquities = (row: string) => {
 // 保存权益
 const handleEquitiesSave = (data: any) => {
   insOrderRightsInfoDto.value = data
-  console.log(insOrderRightsInfoDto.value)
+
   equitiesShow.value = false
 }
 
@@ -2615,7 +2613,6 @@ const handleSelect = (row: any) => {
       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: any) => {
@@ -2624,8 +2621,15 @@ const handleSelect = (row: any) => {
       }
       // 方案信息
       quoteData.value.forEach((item: any) => {
-        item.productIndex = 0
         if (item.id === row.id) {
+          item.productIndex = 0;
+          item.insurancePlanInfo = {
+            ...list[0],
+            rescue: [],
+            detection: [],
+            driver: [],
+            inspect: []
+          }
           item.projectList = list.map((item: any) => {
             return {
               ...item,
@@ -2651,7 +2655,6 @@ const handelExpend = (e: any) => {
       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: any) => {
@@ -2659,8 +2662,15 @@ const handelExpend = (e: any) => {
         })
       }
       quoteData.value.forEach((item: any) => {
-        item.productIndex = 0
         if (item.id === e.id) {
+          item.productIndex = 0;
+          item.insurancePlanInfo = {
+            ...list[0],
+            rescue: [],
+            detection: [],
+            driver: [],
+            inspect: []
+          }
           item.projectList = list.map((item: any) => {
             return {
               ...item,
@@ -2815,6 +2825,13 @@ const handleSpecialTableDataSubmit = () => {
 let discounts = ref([])
 let productIndex = ref(0)
 const handleProduct = (scope: any, e: any, index: any) => {
+  scope.row.insurancePlanInfo = {
+    ...e,
+    rescue: [],
+    detection: [],
+    driver: [],
+    inspect: []
+  }
   scope.row.productIndex = index
 }
 
@@ -2908,7 +2925,6 @@ const handleCopyPaymentLink = async () => {
 let paymentShow = ref(false)
 let paymentCodeUrl = ref('')
 const handlePayment = (scope: any) => {
-  console.log(scope)
   ordersNo.value = scope;
   api.insurancePolicyApi.getQrCode(scope).then(async (res: any) => {
     if (res.code == 200) {
@@ -2931,7 +2947,6 @@ const handleCount = (scope: any) => {
 
 // 详情
 const toDetail = (scope: any) => {
-  console.log(scope)
   router.push({
     path: '/insurancePolicy/order/insurancePolicyOrderDetail',
     query: {
@@ -3098,7 +3113,7 @@ const historyhandleUnderwriting = (ordersNo: String, scope: any) => {
 let underwritingMsgShow = ref(false)
 
 const handleUnderwritingClose = (bool: any, dataObj: any) => {
-
+  console.log(bool, dataObj)
   if (dataObj) {
     insOrderRightsInfoDto.value.length = dataObj.equitiesData;
     insOrderRightsInfoDto.value.totalPriceCount = dataObj.totalPriceCount;
@@ -3109,7 +3124,15 @@ const handleUnderwritingClose = (bool: any, dataObj: any) => {
       message: bool.msg,
       type: 'success'
     })
-    if (underwritingIndex.value >= 0) quoteData.value[underwritingIndex.value].underwritingMsg = "";
+    api.insurancePolicyApi.getOrderDetail(myRoute.query.orderNo).then((res: any) => {
+      if (res.code == 200) {
+        quoteData.value[underwritingIndex.value].underwritingMsg = "";
+        const quoteResult = quoteData.value[underwritingIndex.value].quoteResult;
+        if (quoteResult) {
+          quoteResult.quoteStatus = res.data?.order?.orderStatus;
+        }
+      }
+    })
     underwritingMsgShow.value = true
   } else {
     ElMessage({
@@ -3285,7 +3308,6 @@ let loading = ref(false)  // 提交加载状态
  * @param scope 当前行作用域
  */
 const handleSubmit = async (InsurancePolicyRefs: FormInstance | undefined, scope: any) => {
-  console.log(scope)
   const valid = await validateForm(InsurancePolicyRefs)
   if (!valid) {
     ElMessage({
@@ -3464,7 +3486,6 @@ const paramValidate = () => {
 const quoteInsurance = async (companyId: any, companyIndex: any) => {
   quoteData.value[companyIndex].loading = true
   let company = quoteData.value[companyIndex]
-  console.log(company)
   // 构建提交数据
   let data = {
     systemType: '2',
@@ -3579,8 +3600,8 @@ const quoteInsurance = async (companyId: any, companyIndex: any) => {
       taxpayerIdentifier: insurancePolicyForm.value.taxpayerIdentifier,
       identifyNumber: insurancePolicyForm.value.identifyNumber,
     },
-    kindInfoVo: company?.projectList?.[company.productIndex]?.kinds || [],
-    accidentalDrivings: company?.projectList?.[company.productIndex]?.drivings || [],
+    kindInfoVo: company?.insurancePlanInfo?.kinds || [],
+    accidentalDrivings: company?.insurancePlanInfo?.drivings || [],
     specialInfoVo: company?.specialSelectedList || []
   }
   owerFormInfo.value = { ...data.ownersInfo, title: '车主', policyPersonType: '1' };
@@ -3642,7 +3663,6 @@ const quoteInsurance = async (companyId: any, companyIndex: any) => {
       quoteData.value[companyIndex].failMsg = res.msg
       loading.value = false
       quoteData.value[companyIndex].loading = false
-      console.log(quoteData.value[companyIndex])
 
     }
     // InsurancePolicyRefs.resetFields()
@@ -3683,7 +3703,6 @@ const handleOpen = (scope: any) => {
  * @param item 选中的产品信息
  */
 const ruleFilterCompany = (item: any, obj: any) => {
-  console.log(item, obj)
   let data = {
     productId: item.value,  // 产品ID
     carInfo: {  // 车辆信息
@@ -3774,25 +3793,26 @@ const ruleFilterCompany = (item: any, obj: any) => {
       })
       if (obj) {
         quoteData.value?.map((item: any) => {
-        obj.insCompanyVo?.map((a: any) => {
-          if (item.id == a.id) {
-            item.quoteResult = a;
-            item.quoteResult.ordersNo = obj.ordersNo
-            item.quoteCode = 200
-            item.checked = true
-            handleSelect({id: item.id})
-            // 如果有错误信息,设置状态为失败 并记录错误信息
-            if (obj.errorMessage) {
-              item.quoteCode = 500
-              item.failMsg = obj.errorMessage
+          obj.insCompanyVo?.map((a: any) => {
+            if (item.id == a.id) {
+              item.quoteResult = { ...a, ...obj };
+              item.insurancePlanInfo = {}
+              item.insurancePlanInfo.drivings = obj.accidentalDrivings;
+              item.insurancePlanInfo.kinds = obj.kindInfoVo;
+              item.quoteCode = 200
+              item.checked = true
+              // 如果有错误信息,设置状态为失败 并记录错误信息
+              if (obj.errorMessage) {
+                item.quoteCode = 500
+                item.failMsg = obj.errorMessage
+              }
             }
-          }
-          return a
+            return a
+          })
+          return item
         })
-        return item
-      })
+        console.log(quoteData.value)
       }
-
     } else {
       quoteData.value = []
     }