|
|
@ -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' } |
|
|
|
], |
|
|
|