Browse Source

HL-5407@王宇飞 加一下订单号为数字的校验

hella_online_20240821
wangyufei 3 months ago
parent
commit
0be9e74624
  1. 16
      src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts

16
src/views/wms/inventoryjobManage/scrap/scrapRequestMain/scrapRequestMain.data.ts

@ -794,11 +794,27 @@ export const ScrapRequestMain = useCrudSchemas(
])
)
const validateOrderNumber = (rule: any, value: any, callback: any) => {
if (!value) {
callback();
} else {
const codeReg = /^[0-9]+$/
if (codeReg.test(value)) {
callback()
} else {
callback(new Error('订单号只能是数字'))
}
}
}
//表单校验
export const ScrapRequestMainRules = reactive({
departmentCode: [
{ required: true, message: '请输入部门', trigger: 'blur' }
],
orderNumber: [
{ validator: validateOrderNumber, trigger: 'change' }
],
autoCommit: [
{ required: true, message: '请选择是否自动提交', trigger: 'change' }
],

Loading…
Cancel
Save