From ecb800b7af57ecf5d14c41a6cf54a16c3be61094 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 19 六月 2025 17:30:59 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 src/views/production/components/ProductionDetailsTable.vue |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/views/production/components/ProductionDetailsTable.vue b/src/views/production/components/ProductionDetailsTable.vue
index eb4091b..7a87b17 100644
--- a/src/views/production/components/ProductionDetailsTable.vue
+++ b/src/views/production/components/ProductionDetailsTable.vue
@@ -4,11 +4,11 @@
       <template #default="{ row, $index }">
         <el-select 
           clearable 
-          :model-value="getCoalNameById(row.coal) || row.coal"
+          :model-value="getCoalNameById(row.coalId) || row.coalId"
           placeholder="璇烽�夋嫨鐓ょ"
           @change="(value) => handleCoalSelectChange(row, value)"
           filterable
-          :key="`coal-select-${$index}-${weekList.length}`"
+          :key="`coalId-select-${$index}-${weekList.length}`"
         >
           <el-option
             v-for="(item, index) of weekList"
@@ -149,6 +149,7 @@
 import { ref, computed, watch, onMounted, nextTick } from "vue";
 import { Delete } from "@element-plus/icons-vue";
 import { getCoalFieldList } from "@/api/basicInformation/coalQualityMaintenance";
+import { getCoalInfoList } from "@/api/production";
 import { userListAll } from "@/api/publicApi";
 const props = defineProps({
   modelValue: {
@@ -233,16 +234,16 @@
   // 鏍规嵁閫夋嫨鐨勫悕绉版壘鍒板搴旂殑ID
   const coalItem = weekList.value.find(item => item.value === selectedName);
   if (coalItem) {
-    row.coal = coalItem.key; // 璁剧疆涓篒D
+    row.coalId = coalItem.key; // 璁剧疆涓篒D
   } else {
-    row.coal = ''; // 濡傛灉娌℃壘鍒帮紝娓呯┖
+    row.coalId = ''; // 濡傛灉娌℃壘鍒帮紝娓呯┖
   }
 };
 
 // 鏍规嵁ID鑾峰彇鐓ょ鍚嶇О锛堢敤浜庢樉绀猴級
 const getCoalNameById = (id) => {
-  const coal = weekList.value.find(item => item.key == id);
-  return coal ? coal.value : id;
+  const coalId = weekList.value.find(item => item.key == id);
+  return coalId ? coalId.value : id;
 };
 
 const weekList = ref([]);
@@ -268,10 +269,11 @@
 }, { deep: true });
 
 onMounted(async()=>{
-  let res = await getCoalFieldList()
+  let res = await getCoalInfoList()
+  console.log(res);
   res.data.forEach(item => {
     let obj = {};
-    obj.value = item.fieldName;
+    obj.value = item.coal;
     obj.key = item.id;
     weekList.value.push(obj); 
   });
@@ -292,7 +294,7 @@
   let res = await getCoalFieldList();
   if (res.code === 200) {
     dropdownList.value = res.data.map((item) => ({
-      value: item.fieldName,
+      value: item.coal,
       key: item.id,
     }));
   } else {
@@ -348,11 +350,12 @@
 defineExpose({
   calculateTotalCost,
   getDropdownData,
+  getUserList,
   getCoalNameById, // 鏆撮湶鑾峰彇鐓ょ鍚嶇О鐨勬柟娉�
   weekList, // 鏆撮湶weekList璁╃埗缁勪欢鍙互璁块棶
   addRow: (rowData = {}) => {
     const defaultRow = {
-      coal: "",
+      coalId: "",
       calorificValue: "",
       productionQuantity: "",
       laborCost: "",

--
Gitblit v1.9.3