瀏覽代碼

优化报价历史支付码

@dongkboy 3 月之前
父節點
當前提交
5b785b4aab
共有 1 個文件被更改,包括 22 次插入20 次删除
  1. 22 20
      src/views/insurancePolicy/index.vue

+ 22 - 20
src/views/insurancePolicy/index.vue

@@ -1176,8 +1176,8 @@
                 </div>
               </template>
               <template #default="scope">
-                <div class="result" v-if="scope.row.checked  && !scope.row.loading || isViewSuccess">
-                  <div class="resultItem" v-if="scope.row.quoteCode==200">
+                <div class="result" v-if="scope.row.checked && !scope.row.loading || isViewSuccess">
+                  <div class="resultItem" v-if="scope.row.quoteCode == 200">
                     <span v-if="scope.row.quoteResult?.costs?.sumPremium">总保费:{{
                       scope.row.quoteResult?.costs?.sumPremium }}</span>
 
@@ -1189,14 +1189,14 @@
                     </div>
                   </div>
                   <div class="resultItem">
-                    <span v-if="scope.row.quoteResult?.costs?.ciPremium && scope.row.quoteCode==200"
+                    <span v-if="scope.row.quoteResult?.costs?.ciPremium && scope.row.quoteCode == 200"
                       style="text-align: left; margin-right: 10px">交强:{{ `¥${scope.row.quoteResult?.costs?.ciPremium}`
                       }}</span>
                     <span v-if="scope.row.quoteResult?.costs?.vvTax" style="text-align: left; margin-right: 10px">车船税:{{
                       `¥${scope.row.quoteResult?.costs?.vvTax}` }}</span>
                   </div>
                   <div class="resultItem">
-                    <span v-if="scope.row.quoteResult?.costs?.biPremium && scope.row.quoteCode==200"
+                    <span v-if="scope.row.quoteResult?.costs?.biPremium && scope.row.quoteCode == 200"
                       style="text-align: left; margin-right: 10px">商业险:{{ `¥${scope.row.quoteResult.costs?.biPremium}`
                       }}</span>
                     <span v-if="scope.row.quoteResult?.costs?.niPremium"
@@ -1204,17 +1204,17 @@
                       }}</span>
                   </div>
                   <span class="resultItem"
-                    v-if="scope.row.quoteResult?.ciRiskInfoVo?.startDate || scope.row.quoteResult?.ciRiskInfoVo?.endDate && scope.row.quoteCode==200">
+                    v-if="scope.row.quoteResult?.ciRiskInfoVo?.startDate || scope.row.quoteResult?.ciRiskInfoVo?.endDate && scope.row.quoteCode == 200">
                     <span>交强险保险期:{{ `${scope.row.quoteResult?.ciRiskInfoVo?.startDate} 至
                       ${scope.row.quoteResult?.ciRiskInfoVo?.endDate}` }}</span>
                   </span>
                   <span class="resultItem"
-                    v-if="scope.row.quoteResult?.biRiskInfoVo?.startDate || scope.row.quoteResult?.biRiskInfoVo?.endDate && scope.row.quoteCode==200">
+                    v-if="scope.row.quoteResult?.biRiskInfoVo?.startDate || scope.row.quoteResult?.biRiskInfoVo?.endDate && scope.row.quoteCode == 200">
                     <span>商业险保险期:{{ `${scope.row.quoteResult?.biRiskInfoVo?.startDate} 至
                       ${scope.row.quoteResult?.biRiskInfoVo?.endDate}` }}</span>
                   </span>
                   <div>
-                    <div class="quoteFail" v-if="scope.row?.failMsg && scope.row.quoteCode==500">
+                    <div class="quoteFail" v-if="scope.row?.failMsg && scope.row.quoteCode == 500">
                       <el-icon style="color: #FF4545; font-size: 14px">
                         <Warning />
                       </el-icon>&nbsp;&nbsp;{{ scope.row?.failMsg }}
@@ -1228,19 +1228,19 @@
             <el-table-column label="操作" align="center" width="360">
               <template #default="scope">
                 <div v-if="scope.row.checked || isViewSuccess">
-                  <el-button v-if="scope.row.quoteCode==200" link type="primary"
+                  <el-button v-if="scope.row.quoteCode == 200" link type="primary"
                     @click="handleCount(scope)">优惠测算</el-button>
-                  <el-button v-if="scope.row.quoteCode==200" link type="primary"
+                  <el-button v-if="scope.row.quoteCode == 200" link type="primary"
                     @click="toDetail(scope.row.quoteResult.ordersNo)">详情</el-button>
                   <el-button link type="primary" :loading="scope.row.loading"
                     @click="handleSubmit(InsurancePolicyRefs, scope.row)">计算保费</el-button>
-                  <el-button v-if="scope.row.quoteCode==200" link type="primary"
+                  <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"
+                  <el-button v-if="scope.row.quoteCode == 200" link type="primary" :loading="scope.row.loading"
                     @click="handleUnderwriting(scope)">核保</el-button>
                 </div>
               </template>
@@ -1318,7 +1318,7 @@
                 <el-button link type="primary" v-if="scope.row.orderStatus === '1'" :loading="scope.row.loading"
                   @click="historyhandleUnderwriting(scope.row.orderNo, scope)">核保</el-button>
                 <el-button link type="primary" v-if="scope.row.orderStatus === '4'"
-                  @click="getPayCode(scope.row.orderNo)">支付码</el-button>
+                  @click="handlePayment(scope.row.orderNo)">支付码</el-button>
                 <!--                <el-button link type="primary" v-if="scope.row.orderStatus === '1'" @click="handleImageSave(scope)">上传影像</el-button>-->
                 <el-button link type="primary" v-if="scope.row.orderStatus === '7'" :loading="scope.row.loading"
                   @click="historyhandleUnderwriting(scope.row.orderNo, scope)">重新核保</el-button>
@@ -2891,7 +2891,7 @@ const handleCopyLink = async () => {
 const handleCopyPaymentLink = async () => {
   paymentShow.value = false
   try {
-    await navigator.clipboard.writeText(`https://tennat.baoxianzhanggui.com/h5/#/pages/quote/paymentCode?ordersNo=${ordersNo.value}`);
+    await navigator.clipboard.writeText(paymentCodeUrl.value);
 
     ElMessage({
       message: '复制成功!',
@@ -2906,18 +2906,20 @@ 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) {
-
-    } else {
-      payCodeUrl.value = await QRCode.toDataURL(`https://tennat.baoxianzhanggui.com/h5/#/pages/quote/paymentCode?ordersNo=${ordersNo.value}`, {
+      payCodeUrl.value = await QRCode.toDataURL(res.data?.qrcode, {
         width: 150,
         margin: 2
       });
+      paymentCodeUrl.value = res.data?.qrcode
       paymentShow.value = true
+    } else {
+
     }
   })
 }
@@ -3587,8 +3589,8 @@ const quoteInsurance = async (companyId: any, companyIndex: any) => {
   await api.insurancePolicyApi.quote(data, { skipGlobalError: true }).then((res: any) => {
     if (res.code == 200 && res.data) {
       // 计算总保费
-        // 替换保险公司返回的正确日期
-        if (res.data.ciStartDate && res.data.ciRiskInfoVo) {
+      // 替换保险公司返回的正确日期
+      if (res.data.ciStartDate && res.data.ciRiskInfoVo) {
         res.data.ciRiskInfoVo.startDate = res.data.ciStartDate
         res.data.ciRiskInfoVo.endDate = res.data.ciEndDate
         insurancePolicyForm.value.JQStartDate = res.data.ciStartDate
@@ -3777,9 +3779,9 @@ const ruleFilterCompany = (item: any, obj: any) => {
             item.quoteCode = 200
             item.checked = true
             // 如果有错误信息,设置状态为失败 并记录错误信息
-            if(obj.errorMessage){
+            if (obj.errorMessage) {
               item.quoteCode = 500
-              item.failMsg =  obj.errorMessage
+              item.failMsg = obj.errorMessage
             }
           }
           return a