From 3a63dff0d98c148c6b915cd762a50ed87aa6c3a5 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 26 三月 2026 11:20:55 +0800
Subject: [PATCH] feat:1.生产订单增加清场记录弹框

---
 src/views/productionManagement/productionOrder/index.vue |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 829f7ab..8c254da 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -95,6 +95,13 @@
     <new-product-order v-if="isShowNewModal"
                        v-model:visible="isShowNewModal"
                        @completed="handleQuery"/>
+
+    <!-- 娓呭満璁板綍寮规 -->
+    <clearance-record-dialog
+      v-model="clearanceDialogVisible"
+      :order-data="currentOrderData"
+      @save="handleSaveClearanceRecord"
+    />
   </div>
 </template>
 
@@ -108,12 +115,14 @@
   listProcessRoute,
   bindingRoute,
   delProductOrder, finishOrder,
+  saveCleanRecord,
 } from "@/api/productionManagement/productionOrder.js";
 import {listMain as getOrderProcessRouteMain} from "@/api/productionManagement/productProcessRoute.js";
 import {fileDel} from "@/api/financialManagement/revenueManagement.js";
 import PIMTable from "@/components/PIMTable/PIMTable.vue";
 
 const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue"));
+const ClearanceRecordDialog = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/ClearanceRecordDialog.vue"));
 
 const {proxy} = getCurrentInstance();
 
@@ -227,6 +236,14 @@
           handleFinishOrder(row);
         },
       },
+      {
+        name: "娓呭満璁板綍",
+        type: "text",
+        showHide: row => !row.isEnd,
+        clickFun: row => {
+          handleClearanceRecord(row);
+        },
+      },
     ],
   },
 ]);
@@ -289,6 +306,10 @@
 const bindRouteLoading = ref(false);
 const bindRouteSaving = ref(false);
 const routeOptions = ref([]);
+
+// 娓呭満璁板綍寮规
+const clearanceDialogVisible = ref(false);
+const currentOrderData = ref({});
 const bindForm = reactive({
   orderId: null,
   routeId: null,
@@ -478,6 +499,32 @@
         proxy.$modal.msg("宸插彇娑�");
       });
 };
+
+// 鎵撳紑娓呭満璁板綍寮规
+const handleClearanceRecord = (row) => {
+  currentOrderData.value = row;
+  clearanceDialogVisible.value = true;
+};
+
+// 淇濆瓨娓呭満璁板綍
+const handleSaveClearanceRecord = async (saveData, callback) => {
+  const orderId = currentOrderData.value?.id;
+  if (!orderId) {
+    proxy.$modal.msgError("璁㈠崟ID涓嶅瓨鍦�");
+    return;
+  }
+
+  try {
+    await saveCleanRecord(orderId, saveData);
+    proxy.$modal.msgSuccess("娓呭満璁板綍淇濆瓨鎴愬姛");
+    currentOrderData.value.cleanRecord = saveData;
+    if (callback) callback();
+    getList();
+  } catch (error) {
+    console.error('淇濆瓨娓呭満璁板綍澶辫触:', error);
+    proxy.$modal.msgError("娓呭満璁板綍淇濆瓨澶辫触");
+  }
+};
 onMounted(() => {
   getList();
 });

--
Gitblit v1.9.3