@@ -667,6 +667,18 @@ const handleAddForm = async () => {
ElMessage.error(testGold().message);
return;
}
+ //单独校验产品数量
+ if (!isGold.value) {
+ if (!addFormData.value.goodNum) {
+ ElMessage.error('请输入产品数量');
+ return;
+ }
+ const positiveIntReg = /^[1-9]\d*$/;
+ if (!positiveIntReg.test(addFormData.value.goodNum)) {
+ ElMessage.error('产品数量必须为正整数');
+ return;
+ }
+ }
// 处理时间格式
if (addFormData.value.payTime) {
addFormData.value.payTime = moment(addFormData.value.payTime).format('YYYY-MM-DD HH:mm:ss')
@@ -704,6 +716,18 @@ const handleEditForm = async () => {
ElMessage.error(testGold().message);
return;
}
+ //单独校验产品数量
+ if (!isGold.value) {
+ if (!addFormData.value.goodNum) {
+ ElMessage.error('请输入产品数量');
+ return;
+ }
+ const positiveIntReg = /^[1-9]\d*$/;
+ if (!positiveIntReg.test(addFormData.value.goodNum)) {
+ ElMessage.error('产品数量必须为正整数');
+ 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 9e8f4b1..23ca657 100644
--- a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
+++ b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
@@ -23,11 +23,6 @@ export const addFormRule = {
// 产品数量:0-100纯数字
goodNum: [
{ required: true, message: '请输入产品数量', trigger: 'blur' },
- {
- pattern: /^[1-9]\d*$/,
- message: '请输入正整数',
- trigger: 'blur'
- }
],
// 付款币种:必填
paymentCurrency: [