Handy_Cao 10 months ago
parent
commit
f697a25362

+ 27 - 3
src/business/bank/index.ts

@@ -13,7 +13,8 @@ import {
     YJF_GetWithholdSignInSMSVCode,
     YJF_WithholdInApply,
     YJF_WithholdSignInSMS,
-    YJF_WithholdSignOut
+    YJF_WithholdSignOut,
+    queryMemberCusBankInfo
 } from '@/services/api/bank'
 import { SignStatus } from '@/constants/bank'
 import { decryptAES } from '@/services/websocket/package/crypto'
@@ -173,8 +174,31 @@ export function useDoBankSign() {
         extend_info: JSON.stringify({ "sex": 1 })
     })
 
-    /// 查询签约银行信息
-    const request = queryCusBankSignBank().then((res) => {
+    /// 查询签约银行信息 任务 #6605
+    const request = system_1016.value === '1' ?  queryMemberCusBankInfo().then((res) => {
+        if (res.data.length) {
+            // 默认选择第一个
+            selectCusBank.value = res.data[0]
+            cusBanks.value = res.data ?? []
+            banklist.value = selectCusBank.value.Banklst.filter(e => e.status == 0)
+
+            swsFormData.CusBankID = selectCusBank.value.cusbankid
+            swsFormData.TradeDate = selectCusBank.value.tradedate
+
+            formData.Currency = selectCusBank.value.currency
+            formData.CusBankID = selectCusBank.value.cusbankid
+            formData.TradeDate = selectCusBank.value.tradedate
+
+            // 查找银行是否存在
+            const bankItem = banklist.value.find(obj => obj.bankid === formData.OpenBankAccId)
+            if (bankItem) {
+                formData.ExBankName = bankItem.bankname
+            } else {
+                formData.OpenBankAccId = ''
+                formData.ExBankName = ''
+            }
+        }
+    }) : queryCusBankSignBank().then((res) => {
         if (res.data.length) {
             // 默认选择第一个
             selectCusBank.value = res.data[0]

+ 1 - 15
src/packages/mobile/views/bank/sign/components/edit/Index.vue

@@ -101,7 +101,6 @@ import { validateRules } from '@/constants/regex'
 import { useCountDown } from '@vant/use'
 import { useUserStore, i18n } from '@/stores'
 import AppModal from '@/components/base/modal/index.vue'
-import { queryMemberCusBankInfo } from '@/services/api/bank'
 
 const props = defineProps({
     isedit: {
@@ -115,7 +114,7 @@ const SelectBank = defineAsyncComponent(() => import('./select-bank/index.vue'))
 // 搜索支行
 const SearchBank = defineAsyncComponent(() => import('./search-bank/index.vue'))
 
-const { formData, onSubmit, cusBanks, selectCusBank, swsFormData, bankInfo, extendInfo, system_1010, system_1016, system_1013, smsVerificationCode } = useDoBankSign()
+const { formData, onSubmit, cusBanks, selectCusBank, swsFormData, bankInfo, extendInfo, system_1010, system_1013, smsVerificationCode } = useDoBankSign()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
 const formRef = shallowRef<FormInstance>()
@@ -328,19 +327,6 @@ watch(configs, (data) => {
 
 onMounted(() => {
     // 任务 #6605
-    setTimeout(() => {
-        if (system_1016.value === '1') {
-            queryMemberCusBankInfo().then((res) => {
-                // 签约界面可用渠道列表逻辑变更: 若1016参数有且为1时,通过userid查询经纪会员配置(Qhj/QueryMemberCusBankInfo)的可用渠道列表;1016无或为其它值值,使用原逻辑取得的渠道列表
-                cusBanks.value = res.data ?? []
-                // 默认选中第一个
-                if (res.data.length != 0) {
-                    selectCusBank.value = res.data[0]
-                }
-            })
-        }
-    }, 300);
-
     if (formData.CusBankID) {
         cusBankName.value = bankInfo.value?.cusbankname ?? ''
         formData.CusBankID = bankInfo.value?.cusbankid