diff --git a/src/views/moneyManage/receiveDetail/receiveService.vue b/src/views/moneyManage/receiveDetail/receiveService.vue
index 256cc30..7ecd4f5 100644
--- a/src/views/moneyManage/receiveDetail/receiveService.vue
+++ b/src/views/moneyManage/receiveDetail/receiveService.vue
@@ -382,7 +382,7 @@
ps:请在退款理由表明用户的退款需求。
- 重置
+ 取消
提交
diff --git a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
index 23ca657..27152fa 100644
--- a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
+++ b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
@@ -33,16 +33,22 @@ export const addFormRule = {
{ required: true, message: '请输入付款金额', trigger: 'blur' },
{
validator: (rule, value, callback) => {
- if (!/^\d+$/.test(value)) {
- callback(new Error('请输入纯数字'));
- } else if (value.length >= 8) {
- callback(new Error('付款金额不能超过7位数字'));
- } else if (Number(value) === 0) {
- callback(new Error('付款金额不能为0'));
+ // 匹配非负数字(支持整数或最多2位小数)
+ const reg = /^\d+(\.\d{1,2})?$/;
+ if (!reg.test(value)) {
+ callback(new Error('请输入有效的金额(最多2位小数)'));
} else {
- callback();
+ const num = Number(value);
+ if (num === 0) {
+ callback(new Error('付款金额不能为0'));
+ } else if (num > 9999999) { // 限制最大值为9999999(7位整数)
+ callback(new Error('付款金额不能超过9999999'));
+ } else {
+ callback();
+ }
}
- }, trigger: 'blur'
+ },
+ trigger: 'blur'
}
],
// 支付方式:必填