Browse Source

YT-536新增、修改,物料代码选择一个时,应不能保存成功,应多个物料时能组合

intex_online20241111
zhaoyiran 1 month ago
parent
commit
4d1d6de110
  1. 15
      src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts

15
src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts

@ -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: '组合号',

Loading…
Cancel
Save