From df1406d0f571972d033dffd6a93fb4b94febeb56 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 24 六月 2025 16:46:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/production/components/ProductionDialog.vue | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/views/production/components/ProductionDialog.vue b/src/views/production/components/ProductionDialog.vue index 124e32f..3b96834 100644 --- a/src/views/production/components/ProductionDialog.vue +++ b/src/views/production/components/ProductionDialog.vue @@ -157,6 +157,7 @@ import { getOfficialAll, addOrEditPM, + getCoalInfoList, deleteProductionInventory, } from "@/api/production/index.js"; import {validateFormData, validateNumber, deepClone, createDefaultProductionRow} from "@/utils/production"; @@ -192,9 +193,15 @@ const selectedIds = ref([]); const currentRow = ref(null); const copyForm = ref(null); +const coalList = ref([]) +const supplierList = ref({}); // 琛ㄦ牸鍒楅厤缃� const columns = [ - {label: "鐓ょ", prop: "coal", minwidth: 120}, + {prop: "coalId", label: "鐓ょ", minwidth: 60,slot:false, + formatter: (row) => { + return coalList.value.find(coal => coal.id === row.coalId)?.coal || "--"; + } + }, {label: "搴撳瓨鏁伴噺", prop: "inventoryQuantity", minwidth: 100}, { label: "浣跨敤鏁伴噺", @@ -206,8 +213,18 @@ ]; const formalDatabaseColumns = ref([ - {prop: "supplierName", label: "渚涘簲鍟嗗悕绉�", minwidth: 150}, - {prop: "coal", label: "鐓ょ绫诲瀷", minwidth: 60}, + {prop: "supplierName", label: "渚涘簲鍟嗗悕绉�", minwidth: 150 + // ,formatter: (row) => { + // console.log(row); + // return supplierList.value[row.supplierId] || "--"; + // } + }, + {prop: "coalId", label: "鐓ょ", minwidth: 60, + formatter: (row) => { + // return coalList.value[row.coalId].coal || "--"; + return coalList.value.find(coal => coal.id === row.coalId)?.coal || "--"; + } + }, {prop: "inventoryQuantity", label: "搴撳瓨鏁伴噺", minwidth: 80}, {prop: "unit", label: "鍗曚綅", minwidth: 20}, {prop: "priceExcludingTax", label: "鍗曚环锛堜笉鍚◣锛�", minwidth: 80}, @@ -229,9 +246,12 @@ // 鑾峰彇閰嶇疆鏁版嵁 const handlData = async () => { innerVisible.value = true; - let res = await getOfficialAll(); - if (res.code === 200) { - formalDatabaseData.value = res.data; + let getSupplier = await getOfficialAll(); + let getCoalName = await getCoalInfoList(); + coalList.value = getCoalName.data || []; + supplierList.value = getSupplier.data || []; + if (getSupplier.code === 200) { + formalDatabaseData.value = getSupplier.data; const existingOfficialIds = tableData.value .map((item) => item.officialId) .filter((id) => id); -- Gitblit v1.9.3