@@ -457,10 +456,9 @@
-
-
+
@@ -470,7 +468,7 @@
-
+
@@ -1118,11 +1116,11 @@ const submitEditForm = async () => {
url: '/cashCollection/complete',
data: {
orderCode: editFormData.value.orderCode,
- handlingCharge: editFormData.value.handlingCharge * 100, // 转为分单位
+ handlingCharge: editFormData.value.handlingCharge * 100 || null, // 转为分单位
paymentCurrency: CurrencyForId(editFormData.value.paymentCurrency),
paymentAmount: editFormData.value.paymentAmount * 100, // 转为分单位
receivedCurrency: CurrencyForId(editFormData.value.receivedCurrency),
- receivedAmount: editFormData.value.receivedAmount * 100, // 转为分单位
+ receivedAmount: editFormData.value.receivedAmount * 100 || null, // 转为分单位
receivedTime: editFormData.value.receivedTime,
receivedRemark: editFormData.value.receivedRemark || ''
}
diff --git a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
index 24906d4..0f87048 100644
--- a/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
+++ b/src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
@@ -82,25 +82,21 @@ export const addFormRule = {
{ required: true, message: '请选择付款时间', trigger: 'change' }
]
};
-
-//填手续费校验规则
export const editFormRule = {
- // 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数
- receivedAmount: [
- { required: true, message: '请输入到账金额', trigger: 'blur' },
- {
- pattern: /^\d{1,6}(\.\d{1,2})?$/,
- message: '请检查到账金额格式',
- trigger: 'blur'
- }
- ],
- // 手续费:同到账金额规则
- handlingCharge: [
- { required: true, message: '请输入手续费', trigger: 'blur' },
- {
- pattern: /^\d{1,6}(\.\d{1,2})?$/,
- message: '请检查手续费格式',
- trigger: 'blur'
- }
- ],
+ // 到账金额:正数,整数部分最多6位,小数部分最多2位(支持纯小数如 0.1、0.99)
+ receivedAmount: [
+ {
+ pattern: /^(0\.\d{1,2}|[1-9]\d{0,5}(\.\d{1,2})?)$/, // 修正:添加 / 包裹正则
+ message: '请检查到账金额格式',
+ trigger: 'blur'
+ }
+ ],
+ // 手续费:正数,整数部分最多6位,小数部分最多2位(不支持纯0开头的小数如 0.1,需从1开始)
+ handlingCharge: [
+ {
+ pattern: /^\d{1,6}(\.\d{1,2})?$/, // 注意:此正则允许 0 开头(如 0123 不符合整数规范)
+ message: '整数部分最多6位,小数部分最多2位',
+ trigger: 'blur'
+ }
+ ],
};
\ No newline at end of file