Browse Source

到账金额校验

lihuilin/feature-20251104102812-现金二期
ZhangYong 2 weeks ago
parent
commit
9d55df49bf
  1. 12
      src/views/moneyManage/receiveDetail/receiveFinance.vue
  2. 14
      src/views/moneyManage/receiveDetail/utils/recriveFormRules.js

12
src/views/moneyManage/receiveDetail/receiveFinance.vue

@ -267,7 +267,6 @@
</template>
</el-dialog>
<!-- 仅保留地区财务相关弹窗审核弹窗编辑手续费弹窗 -->
<!-- 审核弹窗 -->
<el-dialog class="adddialog" v-model="auditFormisible" width="20vw" :before-close="closeAuditForm">
<el-form class="addForm" label-width="4vw" label-position="left">
@ -370,7 +369,7 @@
</template>
</el-dialog>
<!-- 编辑填手续费弹窗地区财务核心编辑功能 -->
<!-- 编辑填手续费弹窗 -->
<el-dialog class="editdialog" v-model="editFormisible" width="20vw" :before-close="closeEditForm">
<div class="content">
<div class="left">
@ -457,10 +456,9 @@
</el-form>
</div>
<div class="right">
<!-- 地区财务可编辑项仅到账相关信息 -->
<el-form ref="editFormRef" :rules="editFormRule" :model="editFormData" class="editFormRighrt"
label-width="4.5vw" label-position="left">
<el-form-item label="到账货币" required>
<el-form-item label="到账货币" >
<CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions"
placeholder="请选择到账货币" />
</el-form-item>
@ -470,7 +468,7 @@
<el-form-item label="手续费" prop="handlingCharge">
<el-input v-model="editFormData.handlingCharge" placeholder="请输入手续费" type="number" />
</el-form-item>
<el-form-item label="到账时间" required>
<el-form-item label="到账时间" >
<el-date-picker type="datetime" v-model="editFormData.receivedTime" placeholder="请选择到账时间" />
</el-form-item>
</el-form>
@ -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 || ''
}

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

@ -82,24 +82,20 @@ export const addFormRule = {
{ required: true, message: '请选择付款时间', trigger: 'change' }
]
};
//填手续费校验规则
export const editFormRule = {
// 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数
// 到账金额:正数,整数部分最多6位,小数部分最多2位(支持纯小数如 0.1、0.99)
receivedAmount: [
{ required: true, message: '请输入到账金额', trigger: 'blur' },
{
pattern: /^\d{1,6}(\.\d{1,2})?$/,
pattern: /^(0\.\d{1,2}|[1-9]\d{0,5}(\.\d{1,2})?)$/, // 修正:添加 / 包裹正则
message: '请检查到账金额格式',
trigger: 'blur'
}
],
// 手续费:同到账金额规则
// 手续费:正数,整数部分最多6位,小数部分最多2位(不支持纯0开头的小数如 0.1,需从1开始)
handlingCharge: [
{ required: true, message: '请输入手续费', trigger: 'blur' },
{
pattern: /^\d{1,6}(\.\d{1,2})?$/,
message: '请检查手续费格式',
pattern: /^\d{1,6}(\.\d{1,2})?$/, // 注意:此正则允许 0 开头(如 0123 不符合整数规范)
message: '整数部分最多6位,小数部分最多2位',
trigger: 'blur'
}
],
Loading…
Cancel
Save