|
|
@ -615,7 +615,6 @@ const openAddForm = (row) => { |
|
|
addOrEdit.value = 2 |
|
|
addOrEdit.value = 2 |
|
|
addFormData.value = { |
|
|
addFormData.value = { |
|
|
...row, |
|
|
...row, |
|
|
activity: row.activityId |
|
|
|
|
|
} |
|
|
} |
|
|
jwcodeSeachMarket() |
|
|
jwcodeSeachMarket() |
|
|
ifGold() |
|
|
ifGold() |
|
|
@ -637,25 +636,26 @@ const closeAddForm = () => { |
|
|
} |
|
|
} |
|
|
const testGold = () => { |
|
|
const testGold = () => { |
|
|
// 转换为数字(处理字符串类型的数字) |
|
|
// 转换为数字(处理字符串类型的数字) |
|
|
|
|
|
|
|
|
if (addFormData.value.permanentGold == null) { |
|
|
|
|
|
addFormData.value.permanentGold = 0 |
|
|
|
|
|
} |
|
|
|
|
|
if (addFormData.value.freeGold == null) { |
|
|
|
|
|
addFormData.value.freeGold = 0 |
|
|
|
|
|
} |
|
|
|
|
|
const permanentGold = Number(addFormData.value.permanentGold); |
|
|
|
|
|
const freeNum = Number(addFormData.value.freeGold); |
|
|
|
|
|
// 正则:仅允许0-999999的正整数(包括0) |
|
|
|
|
|
const reg = /^[0-9]{1,6}$/; |
|
|
|
|
|
if (!reg.test(permanentGold) || permanentGold < 0) { |
|
|
|
|
|
return { valid: false, message: '请检查永久金币格式' }; |
|
|
|
|
|
} |
|
|
|
|
|
if (!reg.test(freeNum) || freeNum < 0) { |
|
|
|
|
|
return { valid: false, message: '请检查免费金币格式' }; |
|
|
|
|
|
} |
|
|
|
|
|
if (permanentGold == 0 && freeNum == 0) { |
|
|
|
|
|
return { valid: false, message: '永久金币或免费金币不能同为0' }; |
|
|
|
|
|
|
|
|
if (addFormData.value.goodsName == '金币充值') { |
|
|
|
|
|
if (addFormData.value.permanentGold == null) { |
|
|
|
|
|
addFormData.value.permanentGold = 0 |
|
|
|
|
|
} |
|
|
|
|
|
if (addFormData.value.freeGold == null) { |
|
|
|
|
|
addFormData.value.freeGold = 0 |
|
|
|
|
|
} |
|
|
|
|
|
const permanentGold = Number(addFormData.value.permanentGold); |
|
|
|
|
|
const freeNum = Number(addFormData.value.freeGold); |
|
|
|
|
|
// 正则:仅允许0-999999的正整数(包括0) |
|
|
|
|
|
const reg = /^[0-9]{1,6}$/; |
|
|
|
|
|
if (!reg.test(permanentGold) || permanentGold < 0) { |
|
|
|
|
|
return { valid: false, message: '请检查永久金币格式' }; |
|
|
|
|
|
} |
|
|
|
|
|
if (!reg.test(freeNum) || freeNum < 0) { |
|
|
|
|
|
return { valid: false, message: '请检查免费金币格式' }; |
|
|
|
|
|
} |
|
|
|
|
|
if (permanentGold == 0 && freeNum == 0) { |
|
|
|
|
|
return { valid: false, message: '永久金币或免费金币不能同为0' }; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return { valid: true }; |
|
|
return { valid: true }; |
|
|
} |
|
|
} |
|
|
@ -718,7 +718,8 @@ const handleEditForm = async () => { |
|
|
goodNum: addFormData.value.goodNum || 0, |
|
|
goodNum: addFormData.value.goodNum || 0, |
|
|
paymentCurrency: CurrencyForId(addFormData.value.paymentCurrency) || '', |
|
|
paymentCurrency: CurrencyForId(addFormData.value.paymentCurrency) || '', |
|
|
receivedMarket: MarketNameForId(addFormData.value.receivedMarket) || '', |
|
|
receivedMarket: MarketNameForId(addFormData.value.receivedMarket) || '', |
|
|
paymentAmount: (addFormData.value.paymentAmount) * 100 |
|
|
|
|
|
|
|
|
paymentAmount: (addFormData.value.paymentAmount) * 100, |
|
|
|
|
|
activity: addFormData.value.activityId, |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (result.code == 200) { |
|
|
if (result.code == 200) { |
|
|
@ -898,7 +899,7 @@ const submitRefund = async () => { |
|
|
refundFormData.value.partRefundGold = refundFormData.value.permanentGold, |
|
|
refundFormData.value.partRefundGold = refundFormData.value.permanentGold, |
|
|
refundFormData.value.partRefundFree = refundFormData.value.freeGold |
|
|
refundFormData.value.partRefundFree = refundFormData.value.freeGold |
|
|
} else if (refundFormData.value.refundModel == 1) { |
|
|
} else if (refundFormData.value.refundModel == 1) { |
|
|
if(refundFormData.value.partRefundGold > refundFormData.value.permanentGold || refundFormData.value.partRefundFree > refundFormData.value.freeGold){ |
|
|
|
|
|
|
|
|
if (refundFormData.value.partRefundGold > refundFormData.value.permanentGold || refundFormData.value.partRefundFree > refundFormData.value.freeGold) { |
|
|
ElMessage.error('退款金额不能大于订单金额') |
|
|
ElMessage.error('退款金额不能大于订单金额') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|