Browse Source

活动撤回提交问题,金币校验问题

lihuilin/feature-20251104102812-现金二期
ZhangYong 2 weeks ago
parent
commit
9fdbc6ce5e
  1. 45
      src/views/moneyManage/receiveDetail/receiveService.vue
  2. 5
      src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
  3. 4
      src/views/moneyManage/receiveDetail/utils/staticData.js

45
src/views/moneyManage/receiveDetail/receiveService.vue

@ -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-9999990
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-9999990
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
} }

5
src/views/moneyManage/receiveDetail/utils/recriveFormRules.js

@ -23,6 +23,11 @@ export const addFormRule = {
// 产品数量:0-100纯数字 // 产品数量:0-100纯数字
goodNum: [ goodNum: [
{ required: true, message: '请输入产品数量', trigger: 'blur' }, { required: true, message: '请输入产品数量', trigger: 'blur' },
{
pattern: /^[1-9]\d*$/,
message: '请输入正整数',
trigger: 'blur'
}
], ],
// 付款币种:必填 // 付款币种:必填
paymentCurrency: [ paymentCurrency: [

4
src/views/moneyManage/receiveDetail/utils/staticData.js

@ -187,8 +187,8 @@ export const productList = [
"label": "博股会员" "label": "博股会员"
}, },
{ {
"value": "Hc信息费",
"label": "Hc信息费"
"value": "HC信息费",
"label": "HC信息费"
} }
] ]
} }

Loading…
Cancel
Save