diff --git a/src/views/moneyManage/receiveDetail/receiveFinance.vue b/src/views/moneyManage/receiveDetail/receiveFinance.vue index 1a87d09..28361f7 100644 --- a/src/views/moneyManage/receiveDetail/receiveFinance.vue +++ b/src/views/moneyManage/receiveDetail/receiveFinance.vue @@ -1244,16 +1244,15 @@ onMounted(async () => { // 初始化加载地区财务订单数据 await getlist(); - // 菜单权限校验(确保地区财务权限) - if (!hasMenuPermission(menuTree.value, 67)) { - ElMessageBox.alert( - '您暂无该页面操作权限,请联系管理员', - '权限提示', - { type: 'error' } - ).then(() => { - window.history.back(); - }); - } + // if (!hasMenuPermission(menuTree.value, 67)) { + // ElMessageBox.alert( + // '您暂无该页面操作权限,请联系管理员', + // '权限提示', + // { type: 'error' } + // ).then(() => { + // window.history.back(); + // }); + // } //背景预加载 const bgImg = new Image(); bgImg.src = '/src/assets/receive-recall.png'; diff --git a/src/views/moneyManage/receiveDetail/receiveManage.vue b/src/views/moneyManage/receiveDetail/receiveManage.vue index 1a87d09..28361f7 100644 --- a/src/views/moneyManage/receiveDetail/receiveManage.vue +++ b/src/views/moneyManage/receiveDetail/receiveManage.vue @@ -1244,16 +1244,15 @@ onMounted(async () => { // 初始化加载地区财务订单数据 await getlist(); - // 菜单权限校验(确保地区财务权限) - if (!hasMenuPermission(menuTree.value, 67)) { - ElMessageBox.alert( - '您暂无该页面操作权限,请联系管理员', - '权限提示', - { type: 'error' } - ).then(() => { - window.history.back(); - }); - } + // if (!hasMenuPermission(menuTree.value, 67)) { + // ElMessageBox.alert( + // '您暂无该页面操作权限,请联系管理员', + // '权限提示', + // { type: 'error' } + // ).then(() => { + // window.history.back(); + // }); + // } //背景预加载 const bgImg = new Image(); bgImg.src = '/src/assets/receive-recall.png'; diff --git a/src/views/moneyManage/receiveDetail/receiveService.vue b/src/views/moneyManage/receiveDetail/receiveService.vue index e315d31..ce0585c 100644 --- a/src/views/moneyManage/receiveDetail/receiveService.vue +++ b/src/views/moneyManage/receiveDetail/receiveService.vue @@ -212,13 +212,13 @@
永久金币: -
免费金币: -
@@ -589,9 +589,10 @@ const openAddForm = (row) => { if (row?.jwcode) { // 编辑模式 addOrEdit.value = 2 - addFormData.value = { ...row, + addFormData.value = { + ...row, activity: row.activityId - } + } jwcodeSeachMarket() ifGold() } else { @@ -610,11 +611,38 @@ const closeAddForm = () => { isGold.value = false addFormRef.value?.resetFields(); } - +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' }; + } + return { valid: true }; +} // 客服新增收款 const handleAddForm = async () => { try { await addFormRef.value.validate(); + if (!testGold().valid) { + ElMessage.error(testGold().message); + return; + } // 处理时间格式 if (addFormData.value.payTime) { addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') @@ -647,7 +675,11 @@ const handleAddForm = async () => { // 客服编辑收款(撤回后重新提交) const handleEditForm = async () => { try { - await addFormRef.value.validate(); + await addFormRef.value.validate(); + if (!testGold().valid) { + ElMessage.error(testGold().message); + return; + } // 处理时间格式 if (addFormData.value.payTime) { addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss') diff --git a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js index 0f87048..23ca657 100644 --- a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js +++ b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js @@ -24,30 +24,6 @@ export const addFormRule = { goodNum: [ { required: true, message: '请输入产品数量', trigger: 'blur' }, ], - // 永久金币:纯数字(非必填,可按需调整) - permanentGold: [ - { - validator: (rule, value, callback) => { - if (value && !/^\d+$/.test(value)) { - callback(new Error('请输入纯数字')); - } else { - callback(); - } - }, trigger: 'blur' - } - ], - // 免费金币:纯数字(非必填,可按需调整) - freeGold: [ - { - validator: (rule, value, callback) => { - if (value && !/^\d+$/.test(value)) { - callback(new Error('请输入纯数字')); - } else { - callback(); - } - }, trigger: 'blur' - } - ], // 付款币种:必填 paymentCurrency: [ { required: true, message: '请选择付款币种', trigger: 'change' }