From 4d1d6de11033f9762a77119f97b3f04ba27fb334 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Mon, 28 Oct 2024 15:23:51 +0800 Subject: [PATCH] =?UTF-8?q?YT-536=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E7=89=A9=E6=96=99=E4=BB=A3=E7=A0=81=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E4=B8=80=E4=B8=AA=E6=97=B6=EF=BC=8C=E5=BA=94=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E4=BF=9D=E5=AD=98=E6=88=90=E5=8A=9F=EF=BC=8C=E5=BA=94?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E7=89=A9=E6=96=99=E6=97=B6=E8=83=BD=E7=BB=84?= =?UTF-8?q?=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../itemSyntheticRelation.data.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts b/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts index ddf6f67d8..2251ea264 100644 --- a/src/views/wms/basicDataManage/itemManage/itemSyntheticRelation/itemSyntheticRelation.data.ts +++ b/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([ { label: '组合号',