|
@@ -1,10 +1,10 @@
|
|
|
-import { reactive, shallowRef } from 'vue'
|
|
|
|
|
|
|
+import { reactive, shallowRef,computed } from 'vue'
|
|
|
import { useDataTable } from '@/hooks/datatable'
|
|
import { useDataTable } from '@/hooks/datatable'
|
|
|
import { useLoginStore, useUserStore } from '@/stores'
|
|
import { useLoginStore, useUserStore } from '@/stores'
|
|
|
import { queryHisAmountLog, t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryAccountInOutApply, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign } from '@/services/api/bank'
|
|
import { queryHisAmountLog, t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryAccountInOutApply, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign } from '@/services/api/bank'
|
|
|
-import { formatDate } from '@/filters'
|
|
|
|
|
-import { Model } from 'echarts'
|
|
|
|
|
import { decryptAES } from '@/utils/websocket/crypto'
|
|
import { decryptAES } from '@/utils/websocket/crypto'
|
|
|
|
|
+import moment from "moment";
|
|
|
|
|
+import { da } from 'element-plus/es/locale'
|
|
|
|
|
|
|
|
// 历史资金流水列表
|
|
// 历史资金流水列表
|
|
|
export function useBankStatementList() {
|
|
export function useBankStatementList() {
|
|
@@ -143,36 +143,48 @@ export function doWithdraw() {
|
|
|
/// 获取当前是否已签约
|
|
/// 获取当前是否已签约
|
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
|
|
|
|
|
|
|
+ const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
|
|
|
|
|
+ if (bankAccountSign.value.length) {
|
|
|
|
|
+ return bankAccountSign.value[0]
|
|
|
|
|
+ }
|
|
|
|
|
+ return {}
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
/// 查询签约信息
|
|
/// 查询签约信息
|
|
|
const request = queryBankAccountSign({
|
|
const request = queryBankAccountSign({
|
|
|
data: {
|
|
data: {
|
|
|
userid: getUserId()
|
|
userid: getUserId()
|
|
|
},
|
|
},
|
|
|
success:(res)=>{
|
|
success:(res)=>{
|
|
|
- bankAccountSign.value=res.data,
|
|
|
|
|
- ({
|
|
|
|
|
- bankaccountname2:formData.BankAccoutName,
|
|
|
|
|
- branchbankname: formData.BranchBankName,
|
|
|
|
|
- accountcode: formData.AccountCode,
|
|
|
|
|
- cusbankid: formData.CusBankID,
|
|
|
|
|
- bankid: formData.OpenCardBankId
|
|
|
|
|
- }=res.data[0])
|
|
|
|
|
|
|
+ if(res.data.length) {
|
|
|
|
|
+ bankAccountSign.value=res.data
|
|
|
|
|
+ const data=res.data[0]
|
|
|
|
|
+ formData.Currency=data.currency
|
|
|
|
|
+ formData.CusBankID=data.cusbankid
|
|
|
|
|
+ formData.BankAccoutName = data.bankaccountname
|
|
|
|
|
+ formData.OpenCardBankId=data.bankid
|
|
|
|
|
+ formData.AccountCode=data.accountcode
|
|
|
|
|
+ formData.BranchBankName=data.branchbankname
|
|
|
|
|
+ formData.BankAccoutName=data.bankaccountname2
|
|
|
|
|
+ formData.BankAccoutNum=data.bankaccountno2
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const formData = reactive<Partial<Proto.t2bBankWithdrawReq>>({
|
|
const formData = reactive<Partial<Proto.t2bBankWithdrawReq>>({
|
|
|
AccountType: 0,
|
|
AccountType: 0,
|
|
|
- ExtOperatorID: new Date().getTime(),
|
|
|
|
|
- AppDateTime: formatDate(Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
|
|
|
|
|
+ AppDateTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
extend_info: JSON.stringify({"sex": 1})
|
|
extend_info: JSON.stringify({"sex": 1})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const onSubmit = async () => {
|
|
const onSubmit = async () => {
|
|
|
await request
|
|
await request
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
|
|
+
|
|
|
return t2bBankWithdraw({
|
|
return t2bBankWithdraw({
|
|
|
data: {
|
|
data: {
|
|
|
...formData,
|
|
...formData,
|
|
|
|
|
+ ExtOperatorID: new Date().getTime()
|
|
|
},
|
|
},
|
|
|
complete: () => {
|
|
complete: () => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -184,37 +196,40 @@ export function doWithdraw() {
|
|
|
loading,
|
|
loading,
|
|
|
onSubmit,
|
|
onSubmit,
|
|
|
formData,
|
|
formData,
|
|
|
- bankAccountSign
|
|
|
|
|
|
|
+ sign
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 充值请求
|
|
// 充值请求
|
|
|
-export function doDeposit(url: string) {
|
|
|
|
|
|
|
+export function doDeposit() {
|
|
|
/// 获取UserId
|
|
/// 获取UserId
|
|
|
const {getUserId} = useLoginStore()
|
|
const {getUserId} = useLoginStore()
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
/// 获取当前是否已签约
|
|
/// 获取当前是否已签约
|
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
|
|
|
|
|
- const formData = reactive<Partial<Proto.t2bBankDepositReq>>({
|
|
|
|
|
- ExtOperatorID: new Date().getTime(),
|
|
|
|
|
- extend_info: JSON.stringify({'certificate_photo_url': url, "sex": 1})
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ const extendInfo={
|
|
|
|
|
+ certificate_photo_url: '',
|
|
|
|
|
+ sex: 1
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const formData = reactive<Partial<Proto.t2bBankDepositReq>>({})
|
|
|
|
|
|
|
|
const request = queryBankAccountSign({
|
|
const request = queryBankAccountSign({
|
|
|
data: {
|
|
data: {
|
|
|
userid: getUserId()
|
|
userid: getUserId()
|
|
|
},
|
|
},
|
|
|
success:(res)=>{
|
|
success:(res)=>{
|
|
|
- bankAccountSign.value=res.data,
|
|
|
|
|
- ({
|
|
|
|
|
- amount: formData.Amount,
|
|
|
|
|
- cusbankid: formData.CusBankID,
|
|
|
|
|
- currency: formData.Currency,
|
|
|
|
|
- bankaccountname2: formData.BankAccoutName,
|
|
|
|
|
- bankaccountno2: formData.BankAccoutNum,
|
|
|
|
|
- accountcode: formData.AccountCode
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if(res.data.length) {
|
|
|
|
|
+ bankAccountSign.value=res.data
|
|
|
|
|
+ const data=res.data[0]
|
|
|
|
|
+ formData.Currency=data.currency
|
|
|
|
|
+ formData.CusBankID=data.cusbankid
|
|
|
|
|
+ formData.BankAccoutName = data.bankaccountname2
|
|
|
|
|
+ formData.OpenCardBankId=data.bankid
|
|
|
|
|
+ formData.AccountCode=data.accountcode
|
|
|
|
|
+ formData.BankAccoutNum=data.bankaccountno2
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -223,7 +238,9 @@ export function doDeposit(url: string) {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
return t2bBankDeposit({
|
|
return t2bBankDeposit({
|
|
|
data: {
|
|
data: {
|
|
|
- ...formData
|
|
|
|
|
|
|
+ ...formData,
|
|
|
|
|
+ ExtOperatorID: new Date().getTime(),
|
|
|
|
|
+ extend_info:JSON.stringify(extendInfo)
|
|
|
},
|
|
},
|
|
|
complete: () => {
|
|
complete: () => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -234,6 +251,7 @@ export function doDeposit(url: string) {
|
|
|
return {
|
|
return {
|
|
|
loading,
|
|
loading,
|
|
|
onSubmit,
|
|
onSubmit,
|
|
|
|
|
+ extendInfo,
|
|
|
formData,
|
|
formData,
|
|
|
bankAccountSign
|
|
bankAccountSign
|
|
|
}
|
|
}
|
|
@@ -255,9 +273,8 @@ export function doBankSign() {
|
|
|
BankCardType: 0,
|
|
BankCardType: 0,
|
|
|
BankAccountType: 1,
|
|
BankAccountType: 1,
|
|
|
extend_info: JSON.stringify({"sex": 1}),
|
|
extend_info: JSON.stringify({"sex": 1}),
|
|
|
- ExtOperatorID: new Date().getTime(),
|
|
|
|
|
AccountCode: getFirstAccountId().toString(),
|
|
AccountCode: getFirstAccountId().toString(),
|
|
|
- CertID: getUserInfo()?.cardnum,
|
|
|
|
|
|
|
+ CertID: decryptAES(getUserInfo()?.cardnum ?? ''),
|
|
|
CertType: getUserInfo()?.cardtypeid.toString(),
|
|
CertType: getUserInfo()?.cardtypeid.toString(),
|
|
|
|
|
|
|
|
})
|
|
})
|
|
@@ -281,10 +298,11 @@ export function doBankSign() {
|
|
|
const onSubmit = async () => {
|
|
const onSubmit = async () => {
|
|
|
await request
|
|
await request
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
- console.log(cusSignBank)
|
|
|
|
|
|
|
+
|
|
|
return t2bBankSign({
|
|
return t2bBankSign({
|
|
|
data: {
|
|
data: {
|
|
|
...formData,
|
|
...formData,
|
|
|
|
|
+ ExtOperatorID: new Date().getTime(),
|
|
|
AccountName: formData.BankAccountName,
|
|
AccountName: formData.BankAccountName,
|
|
|
ExBankName: cusSignBank.value?.Banklst.find(obj=> obj.bankid===formData.OpenBankAccId )?.bankname
|
|
ExBankName: cusSignBank.value?.Banklst.find(obj=> obj.bankid===formData.OpenBankAccId )?.bankname
|
|
|
},
|
|
},
|
|
@@ -307,44 +325,50 @@ export function doCancelBankSign() {
|
|
|
/// 获取UserId
|
|
/// 获取UserId
|
|
|
const {getUserId} = useLoginStore()
|
|
const {getUserId} = useLoginStore()
|
|
|
const loading = shallowRef(false)
|
|
const loading = shallowRef(false)
|
|
|
|
|
+
|
|
|
|
|
+ /// 表单信息
|
|
|
|
|
+ const formData = reactive<Partial<Proto.t2bBankCancelSignReq>>({ })
|
|
|
/// 获取当前是否已签约
|
|
/// 获取当前是否已签约
|
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
const bankAccountSign = shallowRef<Model.BankAccountSignRsp[]>([])
|
|
|
- /// 表单信息
|
|
|
|
|
- const formData = reactive<Partial<Proto.t2bBankCancelSignReq>>({})
|
|
|
|
|
-
|
|
|
|
|
|
|
+ /// 当前已签约
|
|
|
|
|
+ const sign = computed<Partial<Model.BankAccountSignRsp>>(() => {
|
|
|
|
|
+ if (bankAccountSign.value.length) { return bankAccountSign.value[0] }
|
|
|
|
|
+ return {}
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
/// 请求签约信息
|
|
/// 请求签约信息
|
|
|
const request = queryBankAccountSign({
|
|
const request = queryBankAccountSign({
|
|
|
data: {
|
|
data: {
|
|
|
userid: getUserId()
|
|
userid: getUserId()
|
|
|
},
|
|
},
|
|
|
success:(res)=>{
|
|
success:(res)=>{
|
|
|
- bankAccountSign.value=res.data,
|
|
|
|
|
- ({
|
|
|
|
|
- cusbankid: formData.CusBankID,
|
|
|
|
|
- currency: formData.Currency,
|
|
|
|
|
- tradedate: formData.TradeDate,
|
|
|
|
|
- accountcode: formData.AccountCode,
|
|
|
|
|
- bankaccountno: formData.BankChildAcc,
|
|
|
|
|
- bankaccountname: formData.BankChildAccName
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ 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 formSubmit = async () => {
|
|
const formSubmit = async () => {
|
|
|
await request
|
|
await request
|
|
|
- const { cusbankid, currency, accountcode, bankaccountno, bankaccountname } = bankAccountSign.value[0]
|
|
|
|
|
|
|
+ const { cusbankid, currency, accountcode, bankaccountno2, bankaccountname2 } = bankAccountSign.value[0]
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
/// 发起请求
|
|
/// 发起请求
|
|
|
return t2bBankCancelSign({
|
|
return t2bBankCancelSign({
|
|
|
data: {
|
|
data: {
|
|
|
|
|
+ ...formData,
|
|
|
IsForce: 0,
|
|
IsForce: 0,
|
|
|
ExtOperatorID: new Date().getTime(),
|
|
ExtOperatorID: new Date().getTime(),
|
|
|
- ...formData,
|
|
|
|
|
CusBankID: cusbankid,
|
|
CusBankID: cusbankid,
|
|
|
Currency: currency,
|
|
Currency: currency,
|
|
|
AccountCode: accountcode,
|
|
AccountCode: accountcode,
|
|
|
- BankChildAcc: bankaccountno,
|
|
|
|
|
- BankChildAccName: bankaccountname
|
|
|
|
|
|
|
+ BankChildAcc: bankaccountno2,
|
|
|
|
|
+ BankChildAccName: bankaccountname2
|
|
|
},
|
|
},
|
|
|
complete: () => {
|
|
complete: () => {
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -356,6 +380,6 @@ export function doCancelBankSign() {
|
|
|
loading,
|
|
loading,
|
|
|
formSubmit,
|
|
formSubmit,
|
|
|
formData,
|
|
formData,
|
|
|
- bankAccountSign
|
|
|
|
|
|
|
+ sign
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|