|
|
@ -5,10 +5,23 @@ import * as ItembasicApi from "@/api/wms/itembasic"; |
|
|
|
// 表单校验
|
|
|
|
export const ItemSyntheticRelationRules = reactive({ |
|
|
|
name: [required], |
|
|
|
itemCode: [required], |
|
|
|
itemCode: [required, { validator: validateItemCodes, message: '应选择多个物料', trigger: 'blur' }], |
|
|
|
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[]>([ |
|
|
|
{ |
|
|
|
label: '组合号', |
|
|
|