3 changed files with 161 additions and 20 deletions
-
4.env.development
-
64src/views/moneyManage/receiveDetail/receiveDetail.vue
-
113src/views/moneyManage/receiveDetail/utils/recriveFormRules.js
@ -0,0 +1,113 @@ |
|||||
|
export const addFormRule = { |
||||
|
// 精网号:6-10位纯数字
|
||||
|
jwcode: [ |
||||
|
{ required: true, message: '请输入精网号', trigger: 'blur' }, |
||||
|
{ pattern: /^\d{6,10}$/, message: '请检查精网号格式', trigger: 'blur' } |
||||
|
], |
||||
|
// 客户姓名:必填
|
||||
|
name: [ |
||||
|
{ required: true, message: '请输入客户姓名', trigger: 'blur' } |
||||
|
], |
||||
|
// 所属地区:必填
|
||||
|
marketName: [ |
||||
|
{ required: true, message: '请选择所属地区', trigger: 'blur' } |
||||
|
], |
||||
|
// 活动名称:必填 + 长度小于30
|
||||
|
activity: [ |
||||
|
{ required: true, message: '请输入活动名称', trigger: 'blur' }, |
||||
|
{ max: 30, message: '活动名称长度不能超过30个字符', trigger: 'blur' } |
||||
|
], |
||||
|
// 产品名称:必填
|
||||
|
goodsName: [ |
||||
|
{ required: true, message: '请选择产品名称', trigger: 'change' } |
||||
|
], |
||||
|
// 产品数量:0-100纯数字
|
||||
|
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' } |
||||
|
], |
||||
|
// 付款金额:小于8位纯数字 + 不为0
|
||||
|
paymentAmount: [ |
||||
|
{ 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')); |
||||
|
} else { |
||||
|
callback(); |
||||
|
} |
||||
|
}, trigger: 'blur' |
||||
|
} |
||||
|
], |
||||
|
// 支付方式:必填
|
||||
|
payType: [ |
||||
|
{ required: true, message: '请选择支付方式', trigger: 'change' } |
||||
|
], |
||||
|
// 到账地区:必填
|
||||
|
receivedMarket: [ |
||||
|
{ required: true, message: '请选择到账地区', trigger: 'change' } |
||||
|
], |
||||
|
// 付款时间:必填
|
||||
|
payTime: [ |
||||
|
{ required: true, message: '请选择付款时间', trigger: 'change' } |
||||
|
], |
||||
|
// 转账凭证:必填
|
||||
|
voucher: [ |
||||
|
{ required: true, message: '请上传转账凭证', trigger: 'change' } |
||||
|
], |
||||
|
// 备注:必填
|
||||
|
remark: [ |
||||
|
{ required: true, message: '请输入备注', trigger: 'blur' } |
||||
|
] |
||||
|
}; |
||||
|
|
||||
|
//填手续费校验规则
|
||||
|
export const editFormRule = { |
||||
|
// 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数
|
||||
|
receivedAmount: [ |
||||
|
{ |
||||
|
pattern: /^\d{1,6}(\.\d{1,2})?$/, |
||||
|
message: '请检查到账金额格式', |
||||
|
trigger: 'blur' |
||||
|
} |
||||
|
], |
||||
|
// 手续费:同到账金额规则
|
||||
|
handlingCharge: [ |
||||
|
{ |
||||
|
pattern: /^\d{1,6}(\.\d{1,2})?$/, |
||||
|
message: '请检查手续费格式', |
||||
|
trigger: 'blur' |
||||
|
} |
||||
|
], |
||||
|
}; |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue