From 4cc27f93a1901e12eb12a198029911c483dd991f Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 27 八月 2025 14:30:57 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_JLMY' into dev_JLMY

---
 src/views/production/components/ProductionDetailsTable.vue |   43 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/src/views/production/components/ProductionDetailsTable.vue b/src/views/production/components/ProductionDetailsTable.vue
index dd89b4b..044a3f1 100644
--- a/src/views/production/components/ProductionDetailsTable.vue
+++ b/src/views/production/components/ProductionDetailsTable.vue
@@ -1,5 +1,24 @@
 <template>
   <el-table :data="tableData" :border="border" style="width: 100%">
+    <el-table-column label="鐓ゆ枡绫诲瀷" min-width="120">
+      <template #default="{ row, $index }">
+        <el-select
+            clearable
+            v-model="row.type"
+            placeholder="璇烽�夋嫨鐓ゆ枡绫诲瀷"
+            filterable
+            :key="`coalId-select-${$index}-${typeList.length}`"
+            :disabled="isViewMode"
+        >
+          <el-option
+              v-for="(item, index) of typeList"
+              :key="`option-${index}-${item.value}`"
+              :label="item.label"
+              :value="item.value"
+          />
+        </el-select>
+      </template>
+    </el-table-column>
     <el-table-column label="鐓ょ" min-width="120">
       <template #default="{ row, $index }">
         <el-select
@@ -50,10 +69,13 @@
 
     <el-table-column label="鑳借�楁垚鏈�" min-width="120">
       <template #default="{ row, $index }">
+        <!-- 涓嶈兘涓鸿礋鏁� -->
         <el-input
             v-model="row.energyConsumptionCost"
             placeholder="璇疯緭鍏ヨ兘鑰楁垚鏈�"
             type="number"
+            min="0"
+            step="0.01"
             @input="handleInput('energyConsumptionCost', $index, $event)"
             :disabled="isViewMode"
         >
@@ -137,7 +159,7 @@
         label="鎿嶄綔"
         width="120"
         fixed="right"
-        v-if="dialogType !== 'viewRow'"
+        v-if="dialogType === 'add'"
     >
       <template #default="{ $index }">
         <el-button
@@ -156,10 +178,21 @@
 <script setup name="ProductionDetailsTable">
 import {ref, computed, watch, onMounted, nextTick} from "vue";
 import {Delete} from "@element-plus/icons-vue";
+import {ElMessage} from "element-plus";
 import {getCoalFieldList} from "@/api/basicInformation/coalQualityMaintenance";
 import {getCoalInfoList} from "@/api/production";
 import {userListAll} from "@/api/publicApi";
 
+const typeList = [
+  {
+    label: "鎴愬搧",
+    value: 1,
+  },
+  {
+    label: "鍘熸枡",
+    value: 2,
+  }
+  ]
 const props = defineProps({
   modelValue: {
     type: Array,
@@ -197,6 +230,11 @@
 
 // 澶勭悊杈撳叆鍙樺寲
 const handleInput = (field, index, value) => {
+  // 纭繚杈撳叆鍊兼槸鏁板瓧鎴栫┖瀛楃涓茶�屼笖闈炶礋鏁�
+  if (!/^\d*\.?\d*$/.test(value) && value !== "") {
+    ElMessage.error("璇疯緭鍏ユ湁鏁堢殑鏁板瓧");
+    return;
+  }
   const newData = [...tableData.value];
   newData[index][field] = value;
 
@@ -220,7 +258,7 @@
 // 璁$畻鎬绘垚鏈�
 const calculateTotalCost = (row) => {
   const laborCost = parseFloat(row.laborCost) || 0;
-  const energyCost = parseFloat(row.energyCost) || 0;
+  const energyCost = parseFloat(row.energyConsumptionCost) || 0;
   const equipmentDepreciation = parseFloat(row.equipmentDepreciation) || 0;
   const purchasePrice = parseFloat(row.purchasePrice) || 0;
 
@@ -378,6 +416,7 @@
       purchasePrice: "",
       totalCost: "",
       producerId: "",
+      type: 1,
       ...rowData,
     };
     tableData.value = [...tableData.value, defaultRow];

--
Gitblit v1.9.3