|
|
@@ -209,13 +209,10 @@ export function useDoDeposit() {
|
|
|
const { getUserId } = useLoginStore()
|
|
|
const loading = shallowRef(false)
|
|
|
/// 获取当前是否已签约
|
|
|
- const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
-
|
|
|
- const extendInfo = {
|
|
|
- certificate_photo_url: '',
|
|
|
- sex: 1
|
|
|
- }
|
|
|
-
|
|
|
+ const sign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
+ /// 常量信息
|
|
|
+ const extendInfo = { certificate_photo_url: '', sex: 1 }
|
|
|
+ /// formData
|
|
|
const formData = reactive<Partial<Proto.t2bBankDepositReq>>({})
|
|
|
|
|
|
const request = queryBankAccountSign({
|
|
|
@@ -224,7 +221,7 @@ export function useDoDeposit() {
|
|
|
},
|
|
|
success: (res) => {
|
|
|
if (res.data.length) {
|
|
|
- bankAccountSign.value = res.data
|
|
|
+ sign.value = res.data
|
|
|
const data = res.data[0]
|
|
|
formData.Currency = data.currency
|
|
|
formData.CusBankID = data.cusbankid
|
|
|
@@ -256,7 +253,7 @@ export function useDoDeposit() {
|
|
|
onSubmit,
|
|
|
extendInfo,
|
|
|
formData,
|
|
|
- bankAccountSign
|
|
|
+ sign
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -267,22 +264,6 @@ export function useDoBankSign() {
|
|
|
const { getUserInfo } = useUserStore()
|
|
|
const { getFirstAccountId } = useLoginStore()
|
|
|
|
|
|
- /// 数据
|
|
|
- const formData = reactive<Partial<Proto.t2bBankSignReq>>({
|
|
|
- AccountType: 1,
|
|
|
- IsForce: 0,
|
|
|
- AgentCertType: 0,
|
|
|
- OperateType: 1,
|
|
|
- BankCardType: 0,
|
|
|
- BankAccountType: 1,
|
|
|
- extend_info: JSON.stringify({ "sex": 1 }),
|
|
|
- AccountCode: getFirstAccountId().toString(),
|
|
|
- CertID: decryptAES(getUserInfo()?.cardnum ?? ''),
|
|
|
- CertType: getUserInfo()?.cardtypeid.toString(),
|
|
|
- BankAccountName: getUserInfo()?.customername
|
|
|
-
|
|
|
- })
|
|
|
-
|
|
|
/// 托管银行信息
|
|
|
const cusSignBank = shallowRef<Model.CusBankSignBankRsp>()
|
|
|
|
|
|
@@ -304,6 +285,35 @@ export function useDoBankSign() {
|
|
|
return (cusSignBank.value?.Banklst ?? []).filter(e => e.status == 0)
|
|
|
})
|
|
|
|
|
|
+ const { getBankAccountList, bankInfo } = useBankAccountSign()
|
|
|
+ /// 判断是否有签约信息 有就做修改
|
|
|
+ getBankAccountList().then(()=>{
|
|
|
+ ({
|
|
|
+ currency:formData.Currency,
|
|
|
+ cusbankid:formData.CusBankID,
|
|
|
+ accountcode:formData.AccountCode,
|
|
|
+ accountname:formData.BankAccountName,
|
|
|
+ branchbankname: formData.OpenBankName,
|
|
|
+ bankaccountno: formData.BankAccountNo,
|
|
|
+ bankid:formData.OpenBankAccId,
|
|
|
+ }=bankInfo.value)
|
|
|
+ })
|
|
|
+
|
|
|
+ /// 数据
|
|
|
+ const formData = reactive<Partial<Proto.t2bBankSignReq>>({
|
|
|
+ AccountType: 1,
|
|
|
+ IsForce: 0,
|
|
|
+ AgentCertType: 0,
|
|
|
+ OperateType: bankInfo.value ? 1 : 2,
|
|
|
+ BankCardType: 0,
|
|
|
+ BankAccountType: 1,
|
|
|
+ extend_info: JSON.stringify({ "sex": 1 }),
|
|
|
+ AccountCode: getFirstAccountId().toString(),
|
|
|
+ CertID: decryptAES(getUserInfo()?.cardnum ?? ''),
|
|
|
+ CertType: getUserInfo()?.cardtypeid.toString(),
|
|
|
+ BankAccountName: getUserInfo()?.customername,
|
|
|
+ })
|
|
|
+
|
|
|
const onSubmit = async () => {
|
|
|
await request
|
|
|
loading.value = true
|
|
|
@@ -325,59 +335,58 @@ export function useDoBankSign() {
|
|
|
loading,
|
|
|
formData,
|
|
|
banklist,
|
|
|
- onSubmit
|
|
|
+ onSubmit,
|
|
|
+ bankInfo
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// 银行解约请求
|
|
|
export function useDoCancelBankSign() {
|
|
|
+ const { getBankAccountList, bankInfo } = useBankAccountSign()
|
|
|
+
|
|
|
/// 获取UserId
|
|
|
- const { getUserId } = useLoginStore()
|
|
|
const loading = shallowRef(false)
|
|
|
|
|
|
/// 表单信息
|
|
|
- const formData = reactive<Partial<Proto.t2bBankCancelSignReq>>({})
|
|
|
+ const formData = reactive<Partial<Proto.t2bBankCancelSignReq>>({
|
|
|
+ IsForce: 0,
|
|
|
+ })
|
|
|
/// 获取当前是否已签约
|
|
|
- const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
- /// 当前已签约
|
|
|
- const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
|
|
|
- if (bankAccountSign.value.length) { return bankAccountSign.value[0] }
|
|
|
- return {}
|
|
|
+ const sign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
+
|
|
|
+ getBankAccountList().then(()=>{
|
|
|
+ ({
|
|
|
+ currency:formData.Currency,
|
|
|
+ cusbankid:formData.CusBankID,
|
|
|
+ accountcode:formData.AccountCode,
|
|
|
+ }=bankInfo.value)
|
|
|
+
|
|
|
})
|
|
|
|
|
|
- /// 请求签约信息
|
|
|
- const request = queryBankAccountSign({
|
|
|
- data: {
|
|
|
- userid: getUserId()
|
|
|
- },
|
|
|
- success: (res) => {
|
|
|
- if (res.data.length) {
|
|
|
- bankAccountSign.value = res.data
|
|
|
- const data = res.data[0]
|
|
|
- formData.CusBankID = data.cusbankid
|
|
|
- formData.Currency = data.currency
|
|
|
- formData.AccountCode = data.accountcode
|
|
|
- formData.BankChildAccName = data.accountname2
|
|
|
- formData.BankChildAcc = data.bankaccountno2
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ // /// 请求签约信息
|
|
|
+ // const request = queryBankAccountSign({
|
|
|
+ // data: {
|
|
|
+ // userid: getUserId()
|
|
|
+ // },
|
|
|
+ // success: (res) => {
|
|
|
+ // if (res.data.length) {
|
|
|
+ // sign.value = res.data
|
|
|
+ // const data = res.data[0]
|
|
|
+ // formData.Currency = data.currency,
|
|
|
+ // formData.CusBankID = data. cusbankid,
|
|
|
+ // formData.AccountCode = data. accountcode
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
const cancelSubmit = async () => {
|
|
|
- await request
|
|
|
- const { cusbankid, currency, accountcode, bankaccountno2, bankaccountname2 } = bankAccountSign.value[0]
|
|
|
+ // await request
|
|
|
loading.value = true
|
|
|
/// 发起请求
|
|
|
return t2bBankCancelSign({
|
|
|
data: {
|
|
|
...formData,
|
|
|
- IsForce: 0,
|
|
|
ExtOperatorID: new Date().getTime(),
|
|
|
- CusBankID: cusbankid,
|
|
|
- Currency: currency,
|
|
|
- AccountCode: accountcode,
|
|
|
- BankChildAcc: bankaccountno2,
|
|
|
- BankChildAccName: bankaccountname2
|
|
|
},
|
|
|
complete: () => {
|
|
|
loading.value = false
|
|
|
@@ -389,7 +398,8 @@ export function useDoCancelBankSign() {
|
|
|
loading,
|
|
|
cancelSubmit,
|
|
|
formData,
|
|
|
- sign
|
|
|
+ sign,
|
|
|
+ bankInfo
|
|
|
}
|
|
|
}
|
|
|
|