فهرست منبع

平安保险对接、平安签单

lihongxiao 2 سال پیش
والد
کامیت
85a28d4c4a

+ 1 - 1
config/dev.env.js

@@ -8,7 +8,7 @@ module.exports = merge(prodEnv, {
 
   ENV_CONFIG:'"dev"',
   // BASE_URL: '"https://test.baoxianzhanggui.com/web-api"',//测试服务器
-  BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"'//正式服务器
+  // BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"'//正式服务器
   // BASE_URL:'"https://sxzgkj.baoxianzhanggui.com/web-api"'//正式服务器
   // BASE_URL: '"http://192.168.0.115:8080/"' //凯森
   // BASE_URL: '"http://192.168.0.106:8080/"',//屈晨

+ 1 - 0
config/pre.env.js

@@ -6,4 +6,5 @@ module.exports = merge(prodEnv, {
   NODE_ENV: '"testing"',
   ENV_CONFIG:'"test"',
   BASE_URL: '"https://pre.baoxianzhanggui.com/web-api"',//测试服务器
+  // BASE_URL: '"http:///192.168.0.103:8080/web-api"',//测试服务器
 })

+ 24 - 0
src/http/moudules/letter.js

@@ -1177,4 +1177,28 @@ export const getDocumentStatusList = (data) => {
     method: 'post',
     data
   })
+}
+// 平安签章
+export const pingAnsignEleApply = (params) => {
+  return axios({
+    url: '/order/pingAnApi/signEleApply',
+    method: 'get',
+    params
+  })
+}
+//发送验证码
+export const getApplyVerifyCodeAndRecoverApplyVerifyCode = (params) => {
+  return axios({
+    url: '/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode',
+    method: 'get',
+    params
+  })
+}
+//签章 下一步
+export const recoverApplyVerifyCode = (data) => {
+  return axios({
+    url: '/order/pingAnApi/recoverApplyVerifyCode',
+    method: 'post',
+    data
+  })
 }

+ 31 - 16
src/router/index.js

@@ -3,6 +3,7 @@ import Router from 'vue-router'
 import Cookies from "js-cookie"
 import Login from '@/views/Login'
 import NotFound from '@/views/Error/404'
+import Signature from '@/views/Letter/Signature'
 import Home from '@/views/Home'
 import Intro from '@/views/Intro/Intro'
 import Calculate from '@/views/Task/Calculate'
@@ -73,7 +74,12 @@ const router = new Router({
       name: 'notFound',
       component: NotFound
     },
-    
+    {
+      path: '/Signature',
+      name: '签单',
+      component: Signature,
+      meta: { requiresAuth: true }
+    },
   ]
 })
 router.beforeEach((to, from, next) => {
@@ -82,23 +88,32 @@ router.beforeEach((to, from, next) => {
   let token =getToken()
   //let userName = sessionStorage.getItem('user')
   let userName = Cookies.get('user')
-  if (to.path === '/login') {
-    // 如果是访问登录界面,如果用户会话信息存在,代表已登录过,跳转到主页
-    if (token) {
-      next({ path: '/' })
-    } else {
-      next()
-    }
-  } else {
-    if (!token) {
-      // 如果访问非登录界面,且户会话信息不存在,代表未登录,则跳转到登录界面
-      next({ path: '/login' })
+  
+  if (to.matched.some(record => record.meta.requiresAuth)) {
+    next()
+     return
+    // next({ path: '/Signature' })
+  }
+    if (to.path === '/login') {
+      // 如果是访问登录界面,如果用户会话信息存在,代表已登录过,跳转到主页
+      if (token) {
+        next({ path: '/' })
+  
+      } else {
+        next()
+      }
     } else {
-      // 加载动态菜单和路由
-      addDynamicMenuAndRoutes(userName, to, from)
-      next()
+      if (!token) {
+        // 如果访问非登录界面,且户会话信息不存在,代表未登录,则跳转到登录界面
+          next({ path: '/login' })
+      } else {
+        // 加载动态菜单和路由
+        addDynamicMenuAndRoutes(userName, to, from)
+        next()
+      }
     }
-  }
+ 
+ 
 })
 
 /**

+ 99 - 0
src/views/Letter/Signature.vue

@@ -0,0 +1,99 @@
+<template>
+    <div >
+        <div class="box">
+            <span>手机验证码:</span>
+            <el-input size="small" style="width: 220px;" v-model="input" placeholder="请输入验证码"></el-input>
+            <el-button size="small" type="primary"  @click.prevent="onClick" :disabled="countdown > 0">
+                {{ countdown > 0 ? `${countdown}秒后重新获取` : '获取验证码' }}
+            </el-button>
+        </div>
+        <div  class="box"  style="margin-top:20px">
+            <el-button style="width: 65%;" plain  type="primary"  @click.prevent="next">下一步</el-button>
+        </div>
+    </div>
+</template>
+<script>
+import axios from 'axios';
+export default {
+    data() {
+        return {
+            input: '',
+            countdown: 0, // 倒计时秒数
+            intervalId: null, // 存储interval的id
+        }
+    },
+    methods: {
+        startCountdown(seconds) {
+        this.countdown = seconds;
+        this.intervalId = setInterval(() => {
+            if (this.countdown > 0) {
+            this.countdown -= 1;
+            } else {
+            clearInterval(this.intervalId);
+            }
+        }, 1000);
+        },
+        onClick(){
+            this.startCountdown(60); // 假设倒计时60秒
+            axios.get(process.env.BASE_URL+'/order/pingAnApi/getApplyVerifyCodeAndRecoverApplyVerifyCode',{
+                params:{
+                    companyId:this.$route.query.companyId
+                }
+            })
+            .then(response => {
+            })
+            // this.$api.letter.getApplyVerifyCodeAndRecoverApplyVerifyCode({companyId:this.$route.query.companyId}).then(res=>{
+            //     //if(res.code==200 && res.data.resultCode==='0'){
+            //         // this.$message({
+            //         //     showClose: true,
+            //         //     message: '发送成功',
+            //         //     type: 'success'
+            //         // });
+            //     //}
+            //     // else{
+            //     //     this.$message({
+            //     //         message: res.data.resultMessage,
+            //     //         type: 'error'
+            //     //     });
+            //     // }
+            // })
+        },
+        next() {
+            if (this.input) {
+                axios.post (process.env.BASE_URL+'/order/pingAnApi/recoverApplyVerifyCode', {
+                    companyId:this.$route.query.companyId,
+                    msgCode:this.input
+                    }) .then (res=> {
+                    if(res.code==200){
+                         window.location.href=res.msg
+                    }
+                    else{
+                        this.$message({
+                        message: res.msg,
+                        type: 'error'
+                    });
+                    }
+                })
+                // this.$api.letter.recoverApplyVerifyCode({companyId:this.$route.query.companyId,msgCode:this.input}).then(res=>{
+                //     if(res.code==200){
+                //             window.location.href=res.msg
+                //     }
+                // })
+            }
+            else {
+                this.$message({
+                    message: '请输入验证码!!!',
+                    type: 'warning'
+                });
+            }
+        }
+    }
+}
+</script>
+<style scoped>
+.box{
+    display: flex;
+    justify-content: center;
+    margin-top:50px
+}
+</style>

+ 1 - 1
src/views/Login.vue

@@ -143,7 +143,7 @@ import { md5 } from "@/utils/md5";
 import ThemePicker from "@/components/ThemePicker";
 import LangSelector from "@/components/LangSelector";
 import { login } from "@/api/user";
-import CryptoJS from "crypto-js";
+// import CryptoJS from "crypto-js";
 export default {
   name: "Login",
   inject: ["reload"],

+ 30 - 13
src/views/Task/daikeComponents/KtLetter.vue

@@ -1391,11 +1391,11 @@
                     <el-select clearable v-model="pingantemplateSelection" placeholder="未选择" @clear="clearAccidentFormPA"
                       @change="pinganInsuranceChange">
                       <el-option v-for="(item, index) in pinganInsuranceData" :key="index" :label="item.projectName"
-                        :value="item.projectCode"></el-option>
+                        :value="item.projectName"></el-option>
                     </el-select>
                   </el-form-item>
                   <el-form-item label="选择份数" style="margin-right: 50px">
-                    <el-input-number v-model="accidentFormPA.quantity" @change="numberCopieschangePA" :min="1"
+                    <el-input-number v-model="accidentFormPA.quantity" @change="numberCopieschangePA" :min="1" :max="accidentFormPA.sellListSize"
                       controls-position="right"></el-input-number>
                   </el-form-item>
                   <el-form-item label="保费:">
@@ -1410,7 +1410,7 @@
                   }">
                   <el-table-column align="center" width="55" label="选择">
                     <template slot-scope="scope">
-                      <el-radio class="radio" v-model="pinganInsurancetype" :label="scope.row.projectCode"
+                      <el-radio class="radio" v-model="pinganInsurancetype" :label="scope.row.code"
                         @click.native.stop.prevent="PADrivingRadio(scope.row)">&nbsp;</el-radio>
                     </template>
                   </el-table-column>
@@ -4821,7 +4821,7 @@ export default {
       if (!index) {
         return;
       }
-      this.taikangtemplateSelection = index;
+      this.pingantemplateSelection = index;
       // this.accidentFormPA = Object.assign(
       //   this.accidentFormPA,
       //   this.pinganInsuranceData.find((val) => val.projectCode == index)
@@ -4832,9 +4832,14 @@ export default {
       //     item.sumAmount =
       //       Number(item.amount) * Number(this.accidentFormPA.seatNum);
       //   });
-      this.taikangInsuranceDataTable = this.pinganInsuranceData.find(
-        (val) => val.projectCode == index
+      this.accidentFormPA.projectName=index
+      this.accidentFormPA.projectCode=this.pinganInsuranceData.find(
+        (val) => val.projectName == index
+      ).projectCode
+      this.pinganInsuranceDataTable = this.pinganInsuranceData.find(
+        (val) => val.projectName == index
       ).son;
+      console.log( this.accidentFormPA,2222222222);
     },
     taikangInsuranceChange(index) {
       if (index) {
@@ -5130,6 +5135,7 @@ export default {
     },
     numberCopieschangePA(index) {
       this.accidentFormPA.premium = Number(this.accidentPremiumPA) * index;
+
     },
     numberCopieschangeZM(index) {
       this.accidentFormZM.sumPremium = Number(this.accidentPremiumZM) * index;
@@ -5410,19 +5416,19 @@ export default {
             risk: this.riskList,
             kind: this.kindList,
             ruleThirdPartyInsurance: this.insureList[1].amount,
-            cimodelclass: ins == "平安财险" 
+            cimodelclass: item.namesimple  == "平安财险" 
                   ? this.carInfo.cimodelclass
                   : "",
-              isUseCombine:ins == "平安财险" 
+              isUseCombine:item.namesimple  == "平安财险" 
               ? 'Y'
               : "",
-              tonNumber:ins == "平安财险" 
+              tonNumber:item.namesimple  == "平安财险" 
               ? this.carInfo.limitLoad
               : "",
-              ownAttribute:ins == "平安财险" 
+              ownAttribute:item.namesimple  == "平安财险" 
               ? '03'
               : "",
-              useAttribute: ins == "平安财险" 
+              useAttribute: item.namesimple  == "平安财险" 
                   ? this.carInfo.carnature
                   : "",
           })
@@ -5645,10 +5651,14 @@ export default {
     //平安驾意险选择
     PADrivingRadio(row) {
       this.accidentPremiumPA = row.premium;
+      this.accidentFormPA.quantity = '1';
+      this.accidentFormPA.sellListSize =Number(row.sellListSize) ;
+      this.accidentFormPA.premium = row.premium
       this.pinganInsurancetype = row.code;
       this.pinganaccidentalDrivingVo = Object.assign({
         ...this.pinganaccidentalDrivingVo,
-        ...row,
+       ...row,
+       ...this.accidentFormPA,
       });
     },
     ZADrivingRadio(row) {
@@ -7034,8 +7044,15 @@ export default {
     // 平安报价
     pingan(num, id) {
       let isTaxSource = this.totalCompanyList[num].isTaxSource;
+      let accidentalDrivingVo={}
+      if(this.pinganaccidentalDrivingVo &&this.pinganaccidentalDrivingVo.projectCode){
+        accidentalDrivingVo = Object.assign({
+            ...this.pinganaccidentalDrivingVo,
+            ...this.accidentFormPA,
+        });
+      }
       let params = {
-        accidentalDrivingVo: this.pinganaccidentalDrivingVo,
+        accidentalDrivingVo,
         orderNo: this.orderno,
         companyId: id,
         agreementId: this.totalCompanyList[num].agreementId,

+ 38 - 1
src/views/Task/daikeComponents/KtOrder.vue

@@ -181,6 +181,10 @@
                     <i class="el-icon-arrow-down el-icon--right"></i>
                   </span>
                   <el-dropdown-menu slot="dropdown">
+                    <el-dropdown-item>
+                      <el-button v-if="item.inscompany == '平安财险'" size="mini" type="text" style="color: #2d4d89"
+                        @click="signature(item)">生成签章</el-button>
+                    </el-dropdown-item>
                     <el-dropdown-item>
                       <el-button size="mini" type="text" style="color: #2d4d89"
                         @click="orderTrajectory(scope.row, item)">订单轨迹</el-button>
@@ -474,6 +478,11 @@
         </el-table>
       </div>
     </el-dialog>
+    <el-dialog :visible.sync="signaturedialogVisible" title="生成签章" width="14%">
+      <div style="padding:0 20px">
+        <div  id="signaturecode" ref="signaturecode"></div>
+      </div>
+    </el-dialog>
     <!-- 报价单 -->
     <quotationDialog ref="quotationDialog" :queryOrders="queryOrders"></quotationDialog>
     <quotationDialogPro ref="quotationDialogPro" :queryOrders="queryOrders"></quotationDialogPro>
@@ -496,6 +505,8 @@ export default {
       qrcodeHeight: "180",
       qrCodeId: Cookies.get("user"),
       ddgjdialogVisible: false,
+      signaturedialogVisible:false,
+      signaturecode:null,
       trajectoryTable: [],
       queryOrders: {
         carinfo: {},
@@ -1229,7 +1240,33 @@ export default {
       //   }
       // })
     },
-
+   
+    signature(row){
+      this.$api.letter.pingAnsignEleApply({companyId:row.id}).then((res) => {
+        if (res.code == 200 && res.data) {
+          this.signaturedialogVisible = true;
+              // 查找并删除旧的二维码DOM元素
+          let element = document.getElementById("signaturecode");
+          while (element.firstChild) {
+            element.removeChild(element.firstChild);
+          }
+          this.signaturecode = new QRCode("signaturecode", {
+            text:  res.data.resultMessage, 
+            width: 180,
+            height: 180,
+            colorDark: "#000000",
+            colorLight: "#ffffff",
+            correctLevel: QRCode.CorrectLevel.H,
+          });
+         
+        } else { 
+          this.$message({ 
+            message: res.msg || "暂无数据!",
+            type: "warning",
+          });
+        }
+      });
+    },
     orderTrajectory(row, item) {
       this.$api.letter.queryBySuborder(item.id).then((res) => {
         if (res.code == 200 && res.data.length > 0) {