From 00259fd8a23bb7901bce30ec8cf2998b199a0bf4 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 6 Mar 2026 22:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(mes):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E8=A1=A8=E5=8D=95=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=9A=E5=8A=A1=E7=B1=BB=E5=9E=8B=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整条码表单中的选择器宽度,确保更好的用户体验。增加了对不同业务类型的动态选择支持,便于后续扩展和维护。 --- src/utils/dict.ts | 1 - src/views/mes/wm/barcode/BarcodeForm.vue | 153 +++++++++++++++++----- src/views/mes/wm/barcode/config/index.vue | 1 - 3 files changed, 118 insertions(+), 37 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 0e3188407..bcbf6346c 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -312,7 +312,6 @@ export enum DICT_TYPE { MES_MD_AUTO_CODE_PART_TYPE = 'mes_md_auto_code_part_type', // MES 编码规则分段类型 MES_MD_AUTO_CODE_PADDED_METHOD = 'mes_md_auto_code_padded_method', // MES 编码规则补齐方式 MES_MD_AUTO_CODE_CYCLE_METHOD = 'mes_md_auto_code_cycle_method', // MES 编码规则循环方式 - // DONE @AI:相关的数据字典,在数据库里,也加入下!!!(AI 未修复原因:需在数据库中手动执行 INSERT 添加 mes_wm_barcode_format 和 mes_wm_barcode_biz_type 对应的字典数据,非代码层面修改) MES_WM_BARCODE_FORMAT = 'mes_wm_barcode_format', // MES 条码格式 MES_WM_BARCODE_BIZ_TYPE = 'mes_wm_barcode_biz_type', // MES 条码业务类型 } diff --git a/src/views/mes/wm/barcode/BarcodeForm.vue b/src/views/mes/wm/barcode/BarcodeForm.vue index 2b5fcd664..fcbcdb8a7 100644 --- a/src/views/mes/wm/barcode/BarcodeForm.vue +++ b/src/views/mes/wm/barcode/BarcodeForm.vue @@ -8,7 +8,7 @@ v-loading="formLoading" > - + - + - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + - + - + - + @@ -124,15 +198,21 @@ const formRef = ref() /** 有 Select 组件的业务类型集合 */ const BIZ_TYPES_WITH_SELECT = [ - BarcodeBizTypeEnum.WAREHOUSE, BarcodeBizTypeEnum.AREA, - BarcodeBizTypeEnum.WORKORDER, BarcodeBizTypeEnum.MACHINERY, - BarcodeBizTypeEnum.ITEM, BarcodeBizTypeEnum.VENDOR, - BarcodeBizTypeEnum.WORKSTATION, BarcodeBizTypeEnum.WORKSHOP + BarcodeBizTypeEnum.WAREHOUSE, + BarcodeBizTypeEnum.AREA, + BarcodeBizTypeEnum.WORKORDER, + BarcodeBizTypeEnum.MACHINERY, + BarcodeBizTypeEnum.ITEM, + BarcodeBizTypeEnum.VENDOR, + BarcodeBizTypeEnum.WORKSTATION, + BarcodeBizTypeEnum.WORKSHOP ] as number[] /** 当前 bizType 是否有对应的 Select 组件 */ // TODO @AI:这里 linter 报错; -const hasBizSelect = computed(() => BIZ_TYPES_WITH_SELECT.includes(formData.value.bizType as number)) +const hasBizSelect = computed(() => + BIZ_TYPES_WITH_SELECT.includes(formData.value.bizType as number) +) /** 业务 Select 选中回调:自动填充 bizId、bizCode、bizName */ const handleBizSelect = (item: any) => { @@ -148,11 +228,14 @@ const handleBizSelect = (item: any) => { } /** bizType 切换时,清空业务字段 */ -watch(() => formData.value.bizType, () => { - formData.value.bizId = undefined - formData.value.bizCode = undefined - formData.value.bizName = undefined -}) +watch( + () => formData.value.bizType, + () => { + formData.value.bizId = undefined + formData.value.bizCode = undefined + formData.value.bizName = undefined + } +) /** 打开弹窗 */ const open = async (type: string, id?: number) => { diff --git a/src/views/mes/wm/barcode/config/index.vue b/src/views/mes/wm/barcode/config/index.vue index ba8248739..57cd23c52 100644 --- a/src/views/mes/wm/barcode/config/index.vue +++ b/src/views/mes/wm/barcode/config/index.vue @@ -1,4 +1,3 @@ -