|
|
@ -646,7 +646,12 @@ const handlePayTypeChange = (val) => { |
|
|
const handleMarketChange = (val) => { |
|
|
const handleMarketChange = (val) => { |
|
|
showWallet(val); |
|
|
showWallet(val); |
|
|
if (addFormRef.value) { |
|
|
if (addFormRef.value) { |
|
|
addFormRef.value.validateField('receivedMarket'); |
|
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
addFormRef.value.validateField('receivedMarket', () => { }); |
|
|
|
|
|
} else { |
|
|
|
|
|
addFormRef.value.clearValidate('receivedMarket'); |
|
|
|
|
|
} |
|
|
|
|
|
addFormRef.value.clearValidate('receivedWallet'); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -725,7 +730,7 @@ const ifGroup = () => { |
|
|
isGroup.value = true |
|
|
isGroup.value = true |
|
|
addFormData.value.receivedMarket = t('cash.markets.Malaysia') |
|
|
addFormData.value.receivedMarket = t('cash.markets.Malaysia') |
|
|
addFormData.value.receivedWallet = t('cash.wallet.MalaysiaWallet') |
|
|
addFormData.value.receivedWallet = t('cash.wallet.MalaysiaWallet') |
|
|
} else if (addFormData.value.payType === t('cash.payMethods.transfer')) { |
|
|
|
|
|
|
|
|
} else if (addFormData.value.payType === t('cash.payMethods.transfer') || addFormData.value.payType === t('cash.payMethods.iotPay') || addFormData.value.payType === t('cash.payMethods.stripe3')) { |
|
|
isGroup.value = true |
|
|
isGroup.value = true |
|
|
addFormData.value.receivedMarket = t('cash.markets.Canada') |
|
|
addFormData.value.receivedMarket = t('cash.markets.Canada') |
|
|
addFormData.value.receivedWallet = t('cash.wallet.CanadaWallet') |
|
|
addFormData.value.receivedWallet = t('cash.wallet.CanadaWallet') |
|
|
@ -746,8 +751,7 @@ const ifGroup = () => { |
|
|
selectWallet.value = true |
|
|
selectWallet.value = true |
|
|
} |
|
|
} |
|
|
if (addFormRef.value) { |
|
|
if (addFormRef.value) { |
|
|
addFormRef.value.validateField('receivedMarket'); |
|
|
|
|
|
addFormRef.value.validateField('receivedWallet'); |
|
|
|
|
|
|
|
|
addFormRef.value.clearValidate(['receivedMarket', 'receivedWallet']); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//选择地区之后 钱包下拉框显示对应地区的钱包 |
|
|
//选择地区之后 钱包下拉框显示对应地区的钱包 |
|
|
@ -780,9 +784,6 @@ const showWallet = (receivedMarket) => { |
|
|
selectWallet.value = false |
|
|
selectWallet.value = false |
|
|
addFormData.value.receivedWallet = t('cash.wallet.BeijingWallet') |
|
|
addFormData.value.receivedWallet = t('cash.wallet.BeijingWallet') |
|
|
} |
|
|
} |
|
|
if (addFormRef.value) { |
|
|
|
|
|
addFormRef.value.validateField('receivedWallet'); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//失焦和回车查询仅选一个 |
|
|
//失焦和回车查询仅选一个 |
|
|
@ -801,8 +802,14 @@ const handleJwcodeBlur = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 精网号失焦:查询客户姓名和地区 |
|
|
// 精网号失焦:查询客户姓名和地区 |
|
|
|
|
|
const jwcodeQuerying = ref(false) |
|
|
|
|
|
let jwcodeQueryPromise = null |
|
|
const jwcodeSeachMarket = async () => { |
|
|
const jwcodeSeachMarket = async () => { |
|
|
try { |
|
|
try { |
|
|
|
|
|
if (jwcodeQuerying.value && jwcodeQueryPromise) { |
|
|
|
|
|
await jwcodeQueryPromise |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
const jwcode = String(addFormData.value.jwcode ?? '').replace(/\s/g, '') |
|
|
const jwcode = String(addFormData.value.jwcode ?? '').replace(/\s/g, '') |
|
|
addFormData.value.jwcode = jwcode |
|
|
addFormData.value.jwcode = jwcode |
|
|
if (!jwcode) { |
|
|
if (!jwcode) { |
|
|
@ -817,10 +824,12 @@ const jwcodeSeachMarket = async () => { |
|
|
ElMessage.error(t('elmessage.limitJwcodeLength')) |
|
|
ElMessage.error(t('elmessage.limitJwcodeLength')) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
const result = await request({ |
|
|
|
|
|
|
|
|
jwcodeQuerying.value = true |
|
|
|
|
|
jwcodeQueryPromise = request({ |
|
|
url: '/cashCollection/getNameAndMarket', |
|
|
url: '/cashCollection/getNameAndMarket', |
|
|
data: jwcode |
|
|
data: jwcode |
|
|
}) |
|
|
}) |
|
|
|
|
|
const result = await jwcodeQueryPromise |
|
|
if (result.code == 200 && result.data && Object.keys(result.data).length > 0) { |
|
|
if (result.code == 200 && result.data && Object.keys(result.data).length > 0) { |
|
|
ElMessage.success(t('elmessage.customerSuccess')) |
|
|
ElMessage.success(t('elmessage.customerSuccess')) |
|
|
addFormData.value.market = result.data.market |
|
|
addFormData.value.market = result.data.market |
|
|
@ -845,6 +854,15 @@ const jwcodeSeachMarket = async () => { |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log(error); |
|
|
console.log(error); |
|
|
|
|
|
} finally { |
|
|
|
|
|
jwcodeQuerying.value = false |
|
|
|
|
|
jwcodeQueryPromise = null |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const waitJwcodeQuery = async () => { |
|
|
|
|
|
if (jwcodeQuerying.value && jwcodeQueryPromise) { |
|
|
|
|
|
await jwcodeQueryPromise |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -864,14 +882,19 @@ const openAddForm = (row) => { |
|
|
} |
|
|
} |
|
|
console.log('这是编辑数据:', addFormData.value); |
|
|
console.log('这是编辑数据:', addFormData.value); |
|
|
showWallet(addFormData.value.receivedMarket) |
|
|
showWallet(addFormData.value.receivedMarket) |
|
|
jwcodeSeachMarket() |
|
|
|
|
|
|
|
|
ifGroup() |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// 新增模式 |
|
|
// 新增模式 |
|
|
addOrEdit.value = 1 |
|
|
addOrEdit.value = 1 |
|
|
addFormData.value = { goodsName: '' } |
|
|
addFormData.value = { goodsName: '' } |
|
|
|
|
|
isGroup.value = false |
|
|
|
|
|
selectWallet.value = false |
|
|
} |
|
|
} |
|
|
addFormisible.value = true |
|
|
addFormisible.value = true |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
addFormRef.value?.clearValidate?.(['receivedMarket', 'receivedWallet']) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 关闭新增/编辑弹窗 |
|
|
// 关闭新增/编辑弹窗 |
|
|
@ -880,6 +903,8 @@ const closeAddForm = () => { |
|
|
addFormData.value = {} |
|
|
addFormData.value = {} |
|
|
addOrEdit.value = 0 |
|
|
addOrEdit.value = 0 |
|
|
isGold.value = false |
|
|
isGold.value = false |
|
|
|
|
|
isGroup.value = false |
|
|
|
|
|
selectWallet.value = false |
|
|
addFormRef.value?.resetFields(); |
|
|
addFormRef.value?.resetFields(); |
|
|
} |
|
|
} |
|
|
const testGold = () => { |
|
|
const testGold = () => { |
|
|
@ -910,6 +935,7 @@ const testGold = () => { |
|
|
// 客服新增收款 |
|
|
// 客服新增收款 |
|
|
const handleAddForm = async () => { |
|
|
const handleAddForm = async () => { |
|
|
try { |
|
|
try { |
|
|
|
|
|
await waitJwcodeQuery() |
|
|
await addFormRef.value.validate(); |
|
|
await addFormRef.value.validate(); |
|
|
if (!testGold().valid) { |
|
|
if (!testGold().valid) { |
|
|
ElMessage.error(testGold().message); |
|
|
ElMessage.error(testGold().message); |
|
|
@ -931,6 +957,8 @@ const handleAddForm = async () => { |
|
|
if (!isGold.value && addFormData.value.numUnit == '') { |
|
|
if (!isGold.value && addFormData.value.numUnit == '') { |
|
|
ElMessage.error(t('elmessage.checkNumUnit')); |
|
|
ElMessage.error(t('elmessage.checkNumUnit')); |
|
|
return; |
|
|
return; |
|
|
|
|
|
}else{ |
|
|
|
|
|
addFormData.value.numUnit = t('cash.unit') |
|
|
} |
|
|
} |
|
|
if (addFormData.value.goodsName == t('cash.coinRecharge')) { |
|
|
if (addFormData.value.goodsName == t('cash.coinRecharge')) { |
|
|
if (addFormData.value.permanentGold == null || addFormData.value.permanentGold == 0) { |
|
|
if (addFormData.value.permanentGold == null || addFormData.value.permanentGold == 0) { |
|
|
@ -980,12 +1008,15 @@ const handleAddForm = async () => { |
|
|
console.log('新增报错:', error); |
|
|
console.log('新增报错:', error); |
|
|
ElMessage.error(t('elmessage.checkFormInfoSubmit')); |
|
|
ElMessage.error(t('elmessage.checkFormInfoSubmit')); |
|
|
ifAddDone.value = false |
|
|
ifAddDone.value = false |
|
|
|
|
|
}finally{ |
|
|
|
|
|
ifAddDone.value = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 客服编辑收款(撤回后重新提交) |
|
|
// 客服编辑收款(撤回后重新提交) |
|
|
const handleEditForm = async () => { |
|
|
const handleEditForm = async () => { |
|
|
try { |
|
|
try { |
|
|
|
|
|
await waitJwcodeQuery() |
|
|
await addFormRef.value.validate(); |
|
|
await addFormRef.value.validate(); |
|
|
if (!testGold().valid) { |
|
|
if (!testGold().valid) { |
|
|
ElMessage.error(testGold().message); |
|
|
ElMessage.error(testGold().message); |
|
|
@ -1007,11 +1038,15 @@ const handleEditForm = async () => { |
|
|
ElMessage.error(t('elmessage.productNumError')); |
|
|
ElMessage.error(t('elmessage.productNumError')); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
addFormData.value.goodNum = addFormData.value.permanentGold || 0 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!isGold.value && addFormData.value.numUnit == '') { |
|
|
if (!isGold.value && addFormData.value.numUnit == '') { |
|
|
ElMessage.error(t('elmessage.checkNumUnit')); |
|
|
ElMessage.error(t('elmessage.checkNumUnit')); |
|
|
return; |
|
|
return; |
|
|
|
|
|
}else{ |
|
|
|
|
|
addFormData.value.numUnit = t('cash.unit') |
|
|
} |
|
|
} |
|
|
// 时间格式 |
|
|
// 时间格式 |
|
|
if (addFormData.value.payTime) { |
|
|
if (addFormData.value.payTime) { |
|
|
@ -1048,6 +1083,8 @@ const handleEditForm = async () => { |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log(error); |
|
|
console.log(error); |
|
|
ifReAddDone.value = false |
|
|
ifReAddDone.value = false |
|
|
|
|
|
}finally{ |
|
|
|
|
|
ifReAddDone.value = false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1073,6 +1110,8 @@ const paytypeOptions = ref([ |
|
|
t('cash.payMethods.grabpay'), // Grabpay |
|
|
t('cash.payMethods.grabpay'), // Grabpay |
|
|
t('cash.payMethods.nets'), // Nets |
|
|
t('cash.payMethods.nets'), // Nets |
|
|
t('cash.payMethods.transfer'), // E-Transfer |
|
|
t('cash.payMethods.transfer'), // E-Transfer |
|
|
|
|
|
t('cash.payMethods.iotPay'), // IOT Pay |
|
|
|
|
|
t('cash.payMethods.stripe3'), // Stripe3 |
|
|
t('cash.payMethods.paypal'), // PayPal |
|
|
t('cash.payMethods.paypal'), // PayPal |
|
|
t('cash.payMethods.paysolution'), // Paysolution |
|
|
t('cash.payMethods.paysolution'), // Paysolution |
|
|
t('cash.payMethods.bankTransfer'),// 银行转账 |
|
|
t('cash.payMethods.bankTransfer'),// 银行转账 |
|
|
@ -1108,6 +1147,7 @@ const productRestrictType = computed(() => { |
|
|
const handleProductChange = (productName) => { |
|
|
const handleProductChange = (productName) => { |
|
|
console.log('LastGoodsName:', LastGoodsName.value); |
|
|
console.log('LastGoodsName:', LastGoodsName.value); |
|
|
LastGoodsName.value = productName |
|
|
LastGoodsName.value = productName |
|
|
|
|
|
addFormData.value.numUnit = '' |
|
|
console.log('选中的产品名称:', productName); |
|
|
console.log('选中的产品名称:', productName); |
|
|
if (productName && productName == t('cash.coinRecharge')) { |
|
|
if (productName && productName == t('cash.coinRecharge')) { |
|
|
showWallet(addFormData.value.receivedMarket) |
|
|
showWallet(addFormData.value.receivedMarket) |
|
|
@ -1400,6 +1440,8 @@ const paytypeList = ref([ |
|
|
t('cash.payMethods.grabpay'), // Grabpay |
|
|
t('cash.payMethods.grabpay'), // Grabpay |
|
|
t('cash.payMethods.nets'), // Nets |
|
|
t('cash.payMethods.nets'), // Nets |
|
|
t('cash.payMethods.transfer'), // E-Transfer |
|
|
t('cash.payMethods.transfer'), // E-Transfer |
|
|
|
|
|
t('cash.payMethods.iotPay'), // IOT Pay |
|
|
|
|
|
t('cash.payMethods.stripe3'), // Stripe3 |
|
|
t('cash.payMethods.paypal'), // PayPal |
|
|
t('cash.payMethods.paypal'), // PayPal |
|
|
t('cash.payMethods.paysolution'), // Paysolution |
|
|
t('cash.payMethods.paysolution'), // Paysolution |
|
|
t('cash.payMethods.bankTransfer'),// 银行转账 |
|
|
t('cash.payMethods.bankTransfer'),// 银行转账 |
|
|
|