Procházet zdrojové kódy

模拟承保布局+接口对接

祁鹏飞 před 3 měsíci
rodič
revize
2aaeb4bc0d

+ 1 - 0
src/api/modules/insurancePolicy.ts

@@ -17,6 +17,7 @@ const insurancePolicyApi = (axiosInstance: ApiInstance) => ({
   queryList: (data: any) => axiosInstance.post('supplementOrder/queryList', data), // 订单
   deleteOrder: (data: any) => axiosInstance.get(`supplementOrder/deleteById?id=${data.id}`), // 删除订单
   getOrderStatus: (data: any) => axiosInstance.post('/unify/order/getOrderStatus', data), // 状态更新
+  mockUnderwited: (data: any) => axiosInstance.post('/unify/order/mockUnderwited', data), // 模拟付款
   getQrCode: (data: string) => axiosInstance.get(`/order/qrCode/getQrCode?orderNo=${data}`), // 支付二维码
   getOrderDetail: (data: any) => axiosInstance.get(`/supplementOrder/getOrderDetail?ordersNo=${data}`), // 详情
   orderTrack: (data: any) => axiosInstance.post('/orderTrack/list', data), // 订单轨迹

+ 21 - 0
src/views/insurancePolicy/order.vue

@@ -134,6 +134,10 @@
           <el-button link type="primary"
             v-if="scope.row.orderStatus === '7' || scope.row.orderStatus === '1' || scope.row.orderStatus === '4'"
             @click="updateOrderStatus(scope.row.orderNo)">更新订单</el-button>
+          <!-- 模拟接口,正式上线后,删除 -->
+          <el-button link type="primary"
+            v-if="scope.row.orderStatus === '7' || scope.row.orderStatus === '1' || scope.row.orderStatus === '4'"
+            @click="mockUnderwited(scope.row.orderNo)">模拟承保</el-button>
           <el-button link type="primary" v-if="scope.row.orderStatus === '3'"
             @click="updateOrderStatus(scope.row.orderNo)">同步订单</el-button>
           <el-button link type="primary" v-if="scope.row.orderStatus === '6'"
@@ -553,6 +557,23 @@ const updateOrderStatus = (orderNo) => {
   })
 }
 
+const mockUnderwited = (orderNo) => {
+  api.insurancePolicyApi.mockUnderwited({ order: { ordersNo: orderNo } }).then((res: any) => {
+    if (res.code == 200) {
+      ElMessage({
+        message: res.msg,
+        type: 'success'
+      })
+      initData()
+    } else {
+      ElMessage({
+        message: res.msg,
+        type: 'warning'
+      })
+    }
+  })
+}
+
 /**
  * 删除保险订单
  * @param {string} id - 订单ID

+ 11 - 5
src/views/quoteConfig/insuranceCompanyAccount/modules/insuranceAccountAdd.vue

@@ -363,7 +363,7 @@ const initEditData = () => {
     })
   }
 }
-
+/** 检测保险公司账号登录是否有效,校验必填字段后调用登录检测接口,根据结果提示用户或触发验证码登录流程 */
 const loginDetection = () => {
   if (!insuranceAccountForm.value.insCompanyId) {
     ElMessage.warning('请选择保险公司')
@@ -384,7 +384,7 @@ const loginDetection = () => {
   api.insuranceApi.detectLogin(params).then(res => {
     if (res.code === 200) {
       if (res.data) {
-        ElMessage.success('登录信息有效')
+        ElMessage.success(res.msg || '登录信息有效')
       } else {
         ElMessage.warning('登录信息无效,请重新登录')
         setTimeout(() => {
@@ -395,16 +395,22 @@ const loginDetection = () => {
   })
 }
 
+/** 重新登录按钮加载状态 */
 const againLoginLoading = ref(false)
+/** 重新登录对话框的显示状态 */
 const againLoginDialog = ref(false)
+/** 验证码输入值 */
 const captcha = ref('')
-const agreementId = ref('')
+/** 验证码标识,用于关联验证码图片与用户输入的验证码值 */
 const captchaId = ref('')
 
+
+/** 重新登录保险公司账号,通过验证码进行二次验证登录 */
 const againLogin = async () => {
   const params = {
     captcha: captcha.value,
-    agreementId: agreementId.value,
+    username: insuranceAccountForm.value.username,
+    password: insuranceAccountForm.value.password,
   }
   againLoginLoading.value = true
   api.insurancePolicyApi.againLogin({
@@ -414,12 +420,12 @@ const againLogin = async () => {
     if (res.code == 200) {
       againLoginDialog.value = false
       captcha.value = ''
-      agreementId.value = ''
       ElMessage.success('登录成功')
     }
   }).finally(() => againLoginLoading.value = false)
 }
 
+/** 获取保验证码,打开重新登录对话框 */
 const getGuoRenCaptcha = () => {
   const params = {
     username: insuranceAccountForm.value.username,