From 8931cf0404272c33af7178b786eb00bd920b47db Mon Sep 17 00:00:00 2001 From: shaoleiliu-netizen123 <480188199@qq.com> Date: Wed, 3 Jun 2026 08:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/biz/orderProject/index.vue | 38 +++++++++++--- src/views/biz/qualityTesting/index.vue | 58 +++++++++++++-------- src/views/biz/submitLog/index.vue | 30 ++++++----- src/views/production/dispatchwork/index.vue | 12 ++--- 4 files changed, 90 insertions(+), 48 deletions(-) diff --git a/src/views/biz/orderProject/index.vue b/src/views/biz/orderProject/index.vue index c0075fa..f331eb5 100644 --- a/src/views/biz/orderProject/index.vue +++ b/src/views/biz/orderProject/index.vue @@ -400,6 +400,8 @@ const formData = reactive({ ...defaultFormData }) // 字典选项(下拉框/单选框/复选框关联字典时使用) const sourceOptions = ref<{ label: string; value: any }[]>([]) const statusOptions = ref<{ label: string; value: any }[]>([]) +const prodTypeOptions = ref<{label: string; value:any} []>([]) + // 表单校验规则 const formRules = { @@ -419,11 +421,23 @@ const columns: DataTableColumns = [ { title: '项目来源', key: 'source', width: 110,align: 'center', render(row) { const val = row.source + console.log(sourceOptions.value); + const opt = sourceOptions.value.find(o => o.value === val || String(o.value) === String(val)) - return opt ? opt.label : (val ?? '-') + if (!opt) return val ?? '-' + + return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label }) + } + }, + { title: '生产类型', key: 'prodType', width: 100 ,align: 'center', + render(row) { + const val = row.prodType + const opt = prodTypeOptions.value.find(o => o.value === val || String(o.value) === String(val)) + if (!opt) return val ?? '-' + + return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label }) } }, - { title: '生产类型', key: 'prodType', width: 100 ,align: 'center'}, { title: 'BOM版本', key: 'bomVersion', width: 100 ,align: 'center'}, { title: '规格型号', key: 'specModel', width: 140, ellipsis: { tooltip: true } }, { title: '单位', key: 'unit', width: 70 ,align: 'center'}, @@ -434,7 +448,9 @@ const columns: DataTableColumns = [ render(row) { const val = row.status const opt = statusOptions.value.find(o => o.value === val || String(o.value) === String(val)) - return opt ? opt.label : (val ?? '-') + if (!opt) return val ?? '-' + + return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label }) } }, { title: '计划完成日期', key: 'planFinishTime', width: 170 ,align: 'center'}, @@ -470,8 +486,9 @@ const columns: DataTableColumns = [ ] const pickMtrlStatusMap: Record = { - '0': '未领料', - '1': '已领料', + '1': '未领料', + '2': '待定', + '3': '已领料', } const kingdeeMoColumns: DataTableColumns = [ @@ -516,6 +533,8 @@ const kingdeeMoColumns: DataTableColumns = [ title: '领料状态', key: 'pickMtrlStatus', width: 90, align: 'center', render(row) { const val = row.pickMtrlStatus + console.log(val); + return val != null ? (pickMtrlStatusMap[String(val)] ?? val) : '-' } }, @@ -864,11 +883,16 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) { async function loadDictOptions() { try { const data = await dictDataApi.listByType('pro_source') - sourceOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) })) + sourceOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass })) } catch {} try { const data = await dictDataApi.listByType('pro_status') - statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) })) + statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass })) + } catch {} + + try { + const data = await dictDataApi.listByType("prod_type") + prodTypeOptions.value = data.map(d=>({label: d.dictLabel,value:(Number(d.dictValue) || d.dictValue),class:d.listClass})) } catch {} } diff --git a/src/views/biz/qualityTesting/index.vue b/src/views/biz/qualityTesting/index.vue index 766079a..6d86550 100644 --- a/src/views/biz/qualityTesting/index.vue +++ b/src/views/biz/qualityTesting/index.vue @@ -317,7 +317,7 @@