From c64a847ab50557de079699087cd1794792eebdc8 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 30 Dec 2025 14:25:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E7=8A=B6=E6=80=81=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E7=9A=84=E5=80=BC=E7=B1=BB=E5=9E=8B=E5=92=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=20-=20=E5=B0=86=E7=89=A9=E6=96=99=E5=92=8C=E7=89=A9?= =?UTF-8?q?=E6=96=99=E5=88=86=E7=B1=BB=E7=9A=84=E7=8A=B6=E6=80=81=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=80=BC=E7=B1=BB=E5=9E=8B=E7=BB=9F=E4=B8=80=E4=B8=BA?= =?UTF-8?q?=E6=95=B0=E5=AD=97=20-=20=E4=BF=AE=E6=AD=A3=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=8A=B6=E6=80=81=E9=80=89=E9=A1=B9=E7=9A=84?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E5=80=BC=20-=20=E8=B0=83=E6=95=B4=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=8A=B6=E6=80=81=E5=80=BC=E4=B8=BA=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictTag/index.vue | 4 ++-- .../productionMaterial/MmMaterial.vue | 13 +++++++------ .../productionMaterial/MmMaterialCategory.vue | 10 +++++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue index fbed747..b910bfb 100644 --- a/src/components/DictTag/index.vue +++ b/src/components/DictTag/index.vue @@ -46,7 +46,7 @@ const props = defineProps({ } }) const dataList = computed(() => { - if (props.config) { + if (props.config && typeof props.config === 'object' && props.config.label && props.config.value && props.options) { let config = props.config var newList = [] @@ -58,7 +58,7 @@ const dataList = computed(() => { } return newList } - return props.options + return props.options || [] }) const values = computed(() => { if (props.value !== null && typeof props.value !== 'undefined') { diff --git a/src/views/materialManagement/productionMaterial/MmMaterial.vue b/src/views/materialManagement/productionMaterial/MmMaterial.vue index 0c5671f..ab8d400 100644 --- a/src/views/materialManagement/productionMaterial/MmMaterial.vue +++ b/src/views/materialManagement/productionMaterial/MmMaterial.vue @@ -164,8 +164,9 @@ - 停用 - 启用 + + {{ item.dictLabel }} + @@ -294,7 +295,7 @@ const state = reactive({ single: true, multiple: true, form: { - status: 2 + status: '1' }, rules: { materialCode: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], @@ -326,11 +327,11 @@ const state = reactive({ ], statusOptions: [ { - dictValue: '0', + dictValue: '停用', dictLabel: '停用' }, { - dictValue: '1', + dictValue: '启用', dictLabel: '启用' } ] @@ -359,7 +360,7 @@ function reset() { supplierCode: null, supplierName: null, safetyStock: null, - status: null, + status: '1', createdTime: null, updatedTime: null, description: null diff --git a/src/views/materialManagement/productionMaterial/MmMaterialCategory.vue b/src/views/materialManagement/productionMaterial/MmMaterialCategory.vue index d164fd8..1abb6fa 100644 --- a/src/views/materialManagement/productionMaterial/MmMaterialCategory.vue +++ b/src/views/materialManagement/productionMaterial/MmMaterialCategory.vue @@ -110,7 +110,7 @@ - + {{ item.dictLabel }} @@ -232,7 +232,7 @@ const state = reactive({ single: true, multiple: true, form: { - status: '1' + status: 1 }, rules: { categoryCode: [{ required: true, message: '分类编码不能为空', trigger: 'blur' }], @@ -242,11 +242,11 @@ const state = reactive({ // 状态(0/1) 选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'} statusOptions: [ { - dictValue: '0', + dictValue: 0, dictLabel: '停用' }, { - dictValue: '1', + dictValue: 1, dictLabel: '启用' } ] @@ -270,7 +270,7 @@ function reset() { parentCode: null, levelNo: null, description: null, - status: '1', // 设置默认值为'1'(启用) + status: 1, // 设置默认值为'1'(启用) createdTime: null, updatedTime: null }