|
@ -5,10 +5,23 @@ import * as ItembasicApi from "@/api/wms/itembasic"; |
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const ItemSyntheticRelationRules = reactive({ |
|
|
export const ItemSyntheticRelationRules = reactive({ |
|
|
name: [required], |
|
|
name: [required], |
|
|
itemCode: [required], |
|
|
itemCode: [required, { validator: validateItemCodes, message: '应选择多个物料', trigger: 'blur' }], |
|
|
available: [required], |
|
|
available: [required], |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
export function validateItemCodes(rule, value, callback) { |
|
|
|
|
|
if (value) { |
|
|
|
|
|
const Reg = /,/ |
|
|
|
|
|
if (Reg.test(value)) { |
|
|
|
|
|
callback() |
|
|
|
|
|
} else { |
|
|
|
|
|
callback(new Error('应选择多个物料')) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
callback() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
export const ItemSyntheticRelation = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
export const ItemSyntheticRelation = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
{ |
|
|
{ |
|
|
label: '组合号', |
|
|
label: '组合号', |
|
|