|
|
@ -596,13 +596,11 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
}, |
|
|
|
tableForm: { |
|
|
|
type: 'InputNumber', |
|
|
|
min: 1, |
|
|
|
precision: 6 |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'InputNumber', |
|
|
|
componentProps: { |
|
|
|
min: 1, |
|
|
|
precision: 6 |
|
|
|
} |
|
|
|
} |
|
|
@ -716,7 +714,15 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
isTableForm: false, |
|
|
|
} |
|
|
|
])) |
|
|
|
|
|
|
|
const validatePlanQty = (rule, value, callback) => { |
|
|
|
console.log('validatePlanQty',value) |
|
|
|
const numReg = /^[\d]+$/ |
|
|
|
if (numReg.test(value)&&value>0) { |
|
|
|
callback() |
|
|
|
} else { |
|
|
|
callback(new Error('计划数量不能为0')) |
|
|
|
} |
|
|
|
} |
|
|
|
//表单校验
|
|
|
|
export const PurchasePlanDetailRules = reactive({ |
|
|
|
// available: [
|
|
|
@ -729,7 +735,8 @@ export const PurchasePlanDetailRules = reactive({ |
|
|
|
{ required: true, message: '请选择计量单位', trigger: 'change' } |
|
|
|
], |
|
|
|
planQty: [ |
|
|
|
{ required: true, message: '请输入计划数量', trigger: 'blur' } |
|
|
|
{ required: true, message: '请输入计划数量', trigger: 'blur' }, |
|
|
|
{ validator:validatePlanQty, message: '计划数量不能为0', trigger: 'blur'} |
|
|
|
], |
|
|
|
remark: [ |
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|
|
|