From 351e2c4fd56d116061beff3cc335101b9a512f50 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 27 八月 2025 13:18:56 +0800
Subject: [PATCH] yys  完善生产管控

---
 src/views/production/components/ProductionDetailsTable.vue                     |    2 
 src/views/production/operationScheduling/index.vue                             |   19 ++++++---
 src/views/production/index.vue                                                 |   16 ++++----
 src/views/production/operationScheduling/components/ProductionDetailsTable.vue |    2 
 src/views/production/productionReporting/index.vue                             |   32 ++++++++--------
 src/views/production/operationScheduling/components/ProductionDialog.vue       |   14 ++++---
 6 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/src/views/production/components/ProductionDetailsTable.vue b/src/views/production/components/ProductionDetailsTable.vue
index 43be265..044a3f1 100644
--- a/src/views/production/components/ProductionDetailsTable.vue
+++ b/src/views/production/components/ProductionDetailsTable.vue
@@ -159,7 +159,7 @@
         label="鎿嶄綔"
         width="120"
         fixed="right"
-        v-if="dialogType !== 'viewRow'"
+        v-if="dialogType === 'add'"
     >
       <template #default="{ $index }">
         <el-button
diff --git a/src/views/production/index.vue b/src/views/production/index.vue
index fa77e22..70385a4 100644
--- a/src/views/production/index.vue
+++ b/src/views/production/index.vue
@@ -22,14 +22,14 @@
         <el-button type="success" :icon="Plus" @click="openDialog('add')">
           鏂板鍔犲伐
         </el-button>
-        <el-button
-          type="danger"
-          :icon="Delete"
-          :disabled="!selectedRows.length"
-          @click="() => deleteSelected(delPM)"
-        >
-          鍒犻櫎
-        </el-button>
+<!--        <el-button-->
+<!--          type="danger"-->
+<!--          :icon="Delete"-->
+<!--          :disabled="!selectedRows.length"-->
+<!--          @click="() => deleteSelected(delPM)"-->
+<!--        >-->
+<!--          鍒犻櫎-->
+<!--        </el-button>-->
       </div>
       <!-- 鏁版嵁琛ㄦ牸 -->
       <ETable
diff --git a/src/views/production/operationScheduling/components/ProductionDetailsTable.vue b/src/views/production/operationScheduling/components/ProductionDetailsTable.vue
index 72b4064..2df336b 100644
--- a/src/views/production/operationScheduling/components/ProductionDetailsTable.vue
+++ b/src/views/production/operationScheduling/components/ProductionDetailsTable.vue
@@ -317,7 +317,7 @@
     const defaultRow = {
       process: "宸ュ簭1",
       unit: "椤�",
-      schedulingNum: "",
+      schedulingNum: 0,
       workHours: "",
       schedulingDate: "",
       schedulingUserId: "",
diff --git a/src/views/production/operationScheduling/components/ProductionDialog.vue b/src/views/production/operationScheduling/components/ProductionDialog.vue
index 4e26ec9..8bfaf55 100644
--- a/src/views/production/operationScheduling/components/ProductionDialog.vue
+++ b/src/views/production/operationScheduling/components/ProductionDialog.vue
@@ -17,7 +17,7 @@
           </el-button>
         </el-col>
         <el-col :span="4">
-          <div style="font-size: 16px;">寰呮帓浜ф暟閲忥細{{productionQuantity}}</div>
+          <div style="font-size: 16px;">寰呮帓浜ф暟閲忥細{{pendingQuantity}}</div>
         </el-col>
         <!-- <el-col :span="2">
           <el-button type="danger" @click="clearAllRows">
@@ -152,7 +152,7 @@
 const copyForm = ref(null);
 const coalList = ref([])
 const supplierList = ref([]);
-const productionQuantity = ref(0);
+const pendingQuantity = ref(0);
 
 // 宸ュ叿鍑芥暟
 const debugIdMatching = () => {
@@ -199,7 +199,7 @@
 };
 
 const editInitialization = async (type, data) => {
-  productionQuantity.value = data.productionQuantity;
+  pendingQuantity.value = data.productionQuantity - data.pendingQuantity;
   copyForm.value = deepClone(data);
   tableData.value = data.productionInventoryList || [];
   detailsTableData.value = data.productionList || [];
@@ -290,10 +290,12 @@
   }
   let num = 0;
   detailsTableData.value.forEach((row) => {
-    num += row.schedulingNum
+    num += Number(row.schedulingNum)
   })
-  if(productionQuantity.value <  num){
+  console.log(num)
+  if(pendingQuantity.value <  num){
     ElMessage.warning("寰呮帓浜ф暟閲忎笉鑳藉皬浜庣敓浜ф槑缁嗘暟閲�")
+    return;
   }
   console.log(copyForm.value)
   detailsTableData.value.forEach((row) => {
@@ -301,7 +303,7 @@
     row.productionId = copyForm.value.id
     row.coalId = copyForm.value.coalId
   })
-  detailsTableData.value[0].productionQuantity = copyForm.value.productionQuantity
+  detailsTableData.value[0].productionQuantity = pendingQuantity.value
   try{
     const res = await addProductionScheduling(detailsTableData.value)
     if (res.code === 200) {
diff --git a/src/views/production/operationScheduling/index.vue b/src/views/production/operationScheduling/index.vue
index ff8b2a6..f44b496 100644
--- a/src/views/production/operationScheduling/index.vue
+++ b/src/views/production/operationScheduling/index.vue
@@ -2,12 +2,12 @@
   <div class="app-container">
     <!-- 鎼滅储琛ㄥ崟 -->
     <el-form :inline="true" :model="queryParams" class="search-form">
-      <el-form-item label="鎼滅储">
-        <el-input
-            v-model="queryParams.searchAll"
-            placeholder="璇疯緭鍏ュ叧閿瘝"
-            clearable
-        />
+      <el-form-item label="鐘舵��">
+        <el-select style="width: 200px;" clearable v-model="queryParams.searchAll" placeholder="璇烽�夋嫨鐘舵��">
+          <el-option label="寰呮帓浜�" value="1"></el-option>
+          <el-option label="鎺掍骇涓�" value="2"></el-option>
+          <el-option label="宸叉帓浜�" value="3"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="handleSearch">鏌ヨ</el-button>
@@ -107,7 +107,12 @@
     }
   },
   { prop: "producer", label: "鐢熶骇浜�", minWidth: 150 },
-  { prop: "productionQuantity", label: "鐢熶骇鏁伴噺", minWidth: 120 },
+  { prop: "productionQuantity", label: "鎺掍骇鏁伴噺", minWidth: 120 },
+  { prop: "pendingQuantity", label: "宸叉帓浜ф暟閲�", minWidth: 120,
+    formatter: (row) => {
+      return row.pendingQuantity || '0';
+    }
+  },
   { prop: "laborCost", label: "浜哄伐鎴愭湰", minWidth: 150 },
   { prop: "energyConsumptionCost", label: "鑳借�楁垚鏈�", minWidth: 120 },
   { prop: "equipmentDepreciation", label: "璁惧鎶樻棫", minWidth: 143 },
diff --git a/src/views/production/productionReporting/index.vue b/src/views/production/productionReporting/index.vue
index 7a1d60e..4022023 100644
--- a/src/views/production/productionReporting/index.vue
+++ b/src/views/production/productionReporting/index.vue
@@ -2,12 +2,12 @@
   <div class="app-container">
     <!-- 鎼滅储琛ㄥ崟 -->
     <el-form :inline="true" :model="queryParams" class="search-form">
-      <el-form-item label="鎼滅储">
-        <el-input
-            v-model="queryParams.searchAll"
-            placeholder="璇疯緭鍏ュ叧閿瘝"
-            clearable
-        />
+      <el-form-item label="鐘舵��">
+        <el-select style="width: 200px;" clearable v-model="queryParams.searchAll" placeholder="璇烽�夋嫨鐘舵��">
+          <el-option label="寰呯敓浜�" value="1"></el-option>
+          <el-option label="鐢熶骇涓�" value="2"></el-option>
+          <el-option label="宸插叆搴�" value="3"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="handleSearch">鏌ヨ</el-button>
@@ -18,16 +18,16 @@
     <!-- 涓昏鍐呭鍖哄煙 -->
     <el-card>
       <!-- 鎿嶄綔鎸夐挳 -->
-      <div class="toolbar">
-        <el-button
-            type="danger"
-            :icon="Delete"
-            :disabled="!selectedRows.length"
-            @click="() => deleteSelected(delProductionScheduling)"
-        >
-          鍒犻櫎
-        </el-button>
-      </div>
+<!--      <div class="toolbar">-->
+<!--        <el-button-->
+<!--            type="danger"-->
+<!--            :icon="Delete"-->
+<!--            :disabled="!selectedRows.length"-->
+<!--            @click="() => deleteSelected(delProductionScheduling)"-->
+<!--        >-->
+<!--          鍒犻櫎-->
+<!--        </el-button>-->
+<!--      </div>-->
       <!-- 鏁版嵁琛ㄦ牸 -->
       <ETable
           :showOverflowTooltip="false"

--
Gitblit v1.9.3