|
|
@@ -33,15 +33,6 @@ export function useDoWithdraw() {
|
|
|
const loading = shallowRef(false)
|
|
|
/// 获取当前是否已签约
|
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
-
|
|
|
- const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
|
|
|
- const method_types = shallowRef<string[]>([])
|
|
|
- const channel_banks = shallowRef<Model.HybridBank[]>([])
|
|
|
-
|
|
|
- const channel_code = shallowRef('')
|
|
|
- const method_type = shallowRef('')
|
|
|
- const bank_code = shallowRef('')
|
|
|
-
|
|
|
const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
|
|
|
if (bankAccountSign.value.length) {
|
|
|
return bankAccountSign.value[0]
|
|
|
@@ -70,27 +61,6 @@ export function useDoWithdraw() {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- // 获取支付中心混合支付渠道配置信息列表 泰商所采用
|
|
|
- getHybridConfigs().then((res) => {
|
|
|
- if (res.data.length) {
|
|
|
- hybrids.value = res.data.filter(e => e.can_amt_out === 1)
|
|
|
- if (hybrids.value.length) {
|
|
|
- // 默认选中第一个银行的 code
|
|
|
- channel_code.value = hybrids.value[0].channel_code ?? ''
|
|
|
- // 默认选中第一个下面的银行类型
|
|
|
- method_types.value = getMethodTypeKeys(hybrids.value[0].out_bank_infos)
|
|
|
- if (method_types.value.length != 0) {
|
|
|
- method_type.value = method_types.value[0]
|
|
|
-
|
|
|
- channel_banks.value = hybrids.value[0].out_bank_infos[method_type.value]
|
|
|
- if (channel_banks.value.length != 0) {
|
|
|
- bank_code.value = channel_banks.value[0].bank_code
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
const onSubmit = async () => {
|
|
|
await request,
|
|
|
loading.value = true
|
|
|
@@ -109,13 +79,7 @@ export function useDoWithdraw() {
|
|
|
loading,
|
|
|
onSubmit,
|
|
|
formData,
|
|
|
- sign,
|
|
|
- hybrids,
|
|
|
- bank_code,
|
|
|
- method_types,
|
|
|
- method_type,
|
|
|
- channel_banks,
|
|
|
- channel_code
|
|
|
+ sign
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -125,14 +89,6 @@ export function useDoDeposit(userid?: number) {
|
|
|
/// 获取当前是否已签约
|
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
|
|
|
- const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
|
|
|
- const method_types = shallowRef<string[]>([])
|
|
|
- const channel_banks = shallowRef<Model.HybridBank[]>([])
|
|
|
-
|
|
|
- const channel_code = shallowRef('')
|
|
|
- const method_type = shallowRef('')
|
|
|
- const bank_code = shallowRef('')
|
|
|
-
|
|
|
const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
|
|
|
if (bankAccountSign.value.length) {
|
|
|
return bankAccountSign.value[0]
|
|
|
@@ -157,47 +113,61 @@ export function useDoDeposit(userid?: number) {
|
|
|
formData.AccountCode = data.accountcode
|
|
|
formData.BankAccoutNum = data.bankaccountno2
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
+
|
|
|
+ const onSubmit = async () => {
|
|
|
+ await request
|
|
|
+ loading.value = true
|
|
|
+ return t2bBankDeposit({
|
|
|
+ data: {
|
|
|
+ ...formData,
|
|
|
+ ExtOperatorID: new Date().getTime(),
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ loading,
|
|
|
+ onSubmit,
|
|
|
+ formData,
|
|
|
+ sign
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 获取对应的混合支付渠道信息
|
|
|
+export function useHybridConfigs(in_out_type: number) {
|
|
|
+ const hybrids = shallowRef<Model.PaymentCenterHybridConfigs[]>([])
|
|
|
+ const method_types = shallowRef<string[]>([])
|
|
|
+ const channel_banks = shallowRef<Model.HybridBank[]>([])
|
|
|
+
|
|
|
+ const channel_code = shallowRef('')
|
|
|
+ const method_type = shallowRef('')
|
|
|
+ const bank_code = shallowRef('')
|
|
|
|
|
|
// 获取支付中心混合支付渠道配置信息列表 泰商所采用
|
|
|
getHybridConfigs().then((res) => {
|
|
|
if (res.data.length) {
|
|
|
- hybrids.value = res.data.filter(e => e.can_amt_in === 1)
|
|
|
+ hybrids.value = res.data.filter(e => in_out_type === 0 ? e.can_amt_in === 1 : e.can_amt_out === 1)
|
|
|
if (hybrids.value.length) {
|
|
|
// 默认选中第一个银行的 code
|
|
|
channel_code.value = hybrids.value[0].channel_code ?? ''
|
|
|
// 默认选中第一个下面的银行类型
|
|
|
- method_types.value = getMethodTypeKeys(hybrids.value[0].in_bank_infos)
|
|
|
+ method_types.value = getMethodTypeKeys( in_out_type === 0 ? hybrids.value[0].in_bank_infos : hybrids.value[0].out_bank_infos)
|
|
|
if (method_types.value.length != 0) {
|
|
|
method_type.value = method_types.value[0]
|
|
|
|
|
|
- channel_banks.value = hybrids.value[0].in_bank_infos[method_type.value]
|
|
|
+ channel_banks.value = in_out_type === 0 ? hybrids.value[0].in_bank_infos[method_type.value] : hybrids.value[0].out_bank_infos[method_type.value]
|
|
|
if (channel_banks.value.length != 0) {
|
|
|
bank_code.value = channel_banks.value[0].bank_code
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- const onSubmit = async () => {
|
|
|
- await request
|
|
|
- loading.value = true
|
|
|
- return t2bBankDeposit({
|
|
|
- data: {
|
|
|
- ...formData,
|
|
|
- ExtOperatorID: new Date().getTime(),
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- loading.value = false
|
|
|
- })
|
|
|
- }
|
|
|
+ })
|
|
|
|
|
|
return {
|
|
|
- loading,
|
|
|
- onSubmit,
|
|
|
- formData,
|
|
|
- sign,
|
|
|
hybrids,
|
|
|
bank_code,
|
|
|
method_types,
|
|
|
@@ -258,52 +228,39 @@ export function useDoBankSign() {
|
|
|
/// 查询签约银行信息 任务 #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 = ''
|
|
|
- }
|
|
|
+ // 设置信息
|
|
|
+ setCusBankInfo(res.data ?? [])
|
|
|
}
|
|
|
}) : queryCusBankSignBank().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 = ''
|
|
|
- }
|
|
|
+ // 设置信息
|
|
|
+ setCusBankInfo(res.data ?? [])
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ const setCusBankInfo = (infos: Model.CusBankSignBankRsp[]) => {
|
|
|
+ // 默认选择第一个
|
|
|
+ selectCusBank.value = infos[0]
|
|
|
+ cusBanks.value = infos
|
|
|
+ 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 = ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/// 判断是否有签约信息 有就做修改
|
|
|
queryBankAccountSign().then((res) => {
|
|
|
bankInfo.value = res.data.filter(obj => {
|
|
|
@@ -685,4 +642,4 @@ export function useDoYJFGetWithholdSignInSMSVCode() {
|
|
|
formData,
|
|
|
bankaccountno
|
|
|
}
|
|
|
-}
|
|
|
+}
|