Handy_Cao преди 9 месеца
родител
ревизия
06087ede7f
променени са 1 файла, в които са добавени 33 реда и са изтрити 19 реда
  1. 33 19
      src/business/bank/index.ts

+ 33 - 19
src/business/bank/index.ts

@@ -463,25 +463,39 @@ export function useDoCusBankExtendConfigs(extendbiztype: number) {
     const startTime = shallowRef(getSystemParamValue('012') ?? '')
     const startTime = shallowRef(getSystemParamValue('012') ?? '')
     const endTime = shallowRef(getSystemParamValue('013') ?? '')
     const endTime = shallowRef(getSystemParamValue('013') ?? '')
 
 
-    /// 查询签约银行信息
-    queryCusBankSignBank().then((res) => {
-        const firstData = res.data[0]
-        if (firstData) {
-            cusBank.value = firstData
-            /// 不为空 入金取 318 出金取 319
-            const time = getSystemParamValue(extendbiztype === 2 ? '318' : '319') ?? ''
-            endTime.value = time != '' ? time : endTime.value
-            /// 查询配置信息
-            queryBankCusBankExtendConfigs({
-                data: {
-                    cusbankid: firstData.cusbankid,
-                    extendbiztype: extendbiztype
-                },
-            }).then((res) => {
-                configs.value = res.data.map(obj => ({
-                    ...obj,
-                    value: obj.fieldcode === 'legal_name' ? (useStore.userInfo?.legalpersonname ?? '') : ''
-                }))
+    const banAccountSign = shallowRef<Model.BankAccountSignRsp>()
+    
+    /// 判断是否有签约信息 有就做修改
+    queryBankAccountSign().then((res) => {
+        if (res.data.length != 0) {
+            banAccountSign.value = res.data.filter(obj => {
+                return ![SignStatus.Rescinded].includes(obj.signstatus)
+            })[0]
+            // 查询托管银行信息
+            queryCusBankSignBank().then((res) => {
+                if (banAccountSign.value) {
+                    cusBank.value = res.data.filter(e => e.cusbankid === banAccountSign.value?.cusbankid)[0] ?? {}
+                } else {
+                    cusBank.value = res.data[0]
+                }
+                console.log(res)
+                if (cusBank.value) {
+                    /// 不为空 入金取 318 出金取 319
+                    const time = getSystemParamValue(extendbiztype === 2 ? '318' : '319') ?? ''
+                    endTime.value = time != '' ? time : endTime.value
+                    /// 查询配置信息
+                    queryBankCusBankExtendConfigs({
+                        data: {
+                            cusbankid: cusBank.value.cusbankid,
+                            extendbiztype: extendbiztype
+                        },
+                    }).then((res) => {
+                        configs.value = res.data.map(obj => ({
+                            ...obj,
+                            value: obj.fieldcode === 'legal_name' ? (useStore.userInfo?.legalpersonname ?? '') : ''
+                        }))
+                    })
+                }
             })
             })
         }
         }
     })
     })