From 10ffa7b2fa6a6c2ba5d8d031d51ffc8dc91119f2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 06 五月 2026 09:15:47 +0800
Subject: [PATCH] 升级pro 1.财务页面删除掉一些功能

---
 src/views/productionManagement/productionOrder/index.vue |  121 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 116 insertions(+), 5 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 5f4fa61..93fc177 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -40,6 +40,8 @@
                        value="3" />
             <el-option label="宸插彇娑�"
                        value="4" />
+            <el-option label="宸茬粨鏉�"
+                       value="5" />
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -65,6 +67,7 @@
                 :tableLoading="tableLoading"
                 :row-class-name="tableRowClassName"
                 :isSelection="true"
+                :selectable="row => !row.endOrder"
                 @selection-change="handleSelectionChange"
                 @pagination="pagination">
         <template #completionStatus="{ row }">
@@ -181,6 +184,12 @@
     <new-product-order v-if="isShowNewModal"
                        v-model:visible="isShowNewModal"
                        @completed="handleQuery" />
+    <!-- 鎵撳嵃棰嗘枡鍗曠粍浠� -->
+    <div class="print-requisition-wrapper">
+      <PrintMaterialRequisition ref="printRef"
+                                :order-row="printOrderRow"
+                                :material-list="printMaterialList" />
+    </div>
   </div>
 </template>
 
@@ -204,13 +213,19 @@
     listProcessBom,
     delProductOrder,
     getProductOrderSource,
+    updateProductOrder,
   } from "@/api/productionManagement/productionOrder.js";
   import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js";
   import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue";
   import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue";
   import MaterialSupplementDialog from "@/views/productionManagement/productionOrder/components/MaterialSupplementDialog.vue";
+  import PrintMaterialRequisition from "@/views/productionManagement/productionOrder/components/PrintMaterialRequisition.vue";
   import PIMTable from "@/components/PIMTable/PIMTable.vue";
   import { listPage } from "@/api/productionManagement/processRoute.js";
+  import {
+    listMaterialPickingDetail,
+    listMaterialPickingBom,
+  } from "@/api/productionManagement/productionOrder.js";
   const NewProductOrder = defineAsyncComponent(() =>
     import("@/views/productionManagement/productionOrder/New.vue")
   );
@@ -232,7 +247,7 @@
       prop: "npsNo",
       width: "150px",
     },
-    // 1.寰呭紑濮嬨��2.杩涜涓��3.宸插畬鎴愩��4.宸插彇娑�
+    // 1.寰呭紑濮嬨��2.杩涜涓��3.宸插畬鎴愩��4.宸插彇娑堛��5.宸茬粨鏉�
     {
       label: "鐘舵��",
       prop: "status",
@@ -245,6 +260,8 @@
           ? "杩涜涓�"
           : val === 3
           ? "宸插畬鎴�"
+          : val === 5
+          ? "宸茬粨鏉�"
           : "宸插彇娑�",
       formatType: val =>
         val === 1
@@ -253,7 +270,9 @@
           ? "warning"
           : val === 3
           ? "success"
-          : "danger",
+          : val === 5
+          ? "danger"
+          : "info",
     },
     {
       label: "浜у搧鍚嶇О",
@@ -308,7 +327,7 @@
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 260,
+      width: 280,
       operation: [
         {
           name: "宸ヨ壓璺嚎",
@@ -321,7 +340,7 @@
         {
           name: "缁戝畾宸ヨ壓璺嚎",
           type: "text",
-          showHide: row => !row.processRouteCode,
+          showHide: row => !row.processRouteCode && !row.endOrder,
           clickFun: row => {
             openBindRouteDialog(row, "add");
           },
@@ -329,7 +348,7 @@
         {
           name: "鏇存崲宸ヨ壓璺嚎",
           type: "text",
-          showHide: row => row.processRouteCode,
+          showHide: row => row.processRouteCode && !row.endOrder,
           clickFun: row => {
             openBindRouteDialog(row, "change");
           },
@@ -345,6 +364,7 @@
           name: "棰嗘枡",
           type: "text",
           color: "#5EC7AB",
+          showHide: row => !row.endOrder,
           clickFun: row => {
             openMaterialDialog(row);
           },
@@ -353,6 +373,7 @@
           name: "琛ユ枡",
           type: "text",
           color: "#5EC7AB",
+          showHide: row => !row.endOrder,
           clickFun: row => {
             openMaterialSupplementDialog(row);
           },
@@ -363,6 +384,39 @@
           color: "#5EC7AB",
           clickFun: row => {
             openMaterialDetailDialog(row);
+          },
+        },
+        {
+          name: "鎵撳嵃棰嗘枡鍗�",
+          type: "text",
+          color: "#5EC7AB",
+          showHide: row => !row.endOrder,
+          clickFun: row => {
+            handlePrint(row);
+          },
+        },
+        {
+          name: "鐢熶骇杩芥函",
+          type: "text",
+          color: "#409eff",
+          clickFun: row => {
+            router.push({
+              path: "/productionManagement/productionTraceability",
+              query: {
+                npsNo: row.npsNo,
+                productName: row.productName,
+                model: row.model,
+              },
+            });
+          },
+        },
+        {
+          name: "缁撴潫璁㈠崟",
+          type: "text",
+          color: "red",
+          showHide: row => !row.endOrder,
+          clickFun: row => {
+            handleEndOrder(row);
           },
         },
       ],
@@ -439,6 +493,42 @@
   const currentMaterialDetailOrder = ref(null);
   const materialSupplementDialogVisible = ref(false);
   const currentMaterialSupplementOrder = ref(null);
+
+  // 鎵撳嵃鐩稿叧
+  const printOrderRow = ref(null);
+  const printMaterialList = ref([]);
+  const handlePrint = async row => {
+    printOrderRow.value = row;
+    proxy.$modal.loading("姝e湪鑾峰彇棰嗘枡鏁版嵁...");
+    try {
+      printMaterialList.value = [];
+      const detailRes = await listMaterialPickingDetail(row.id);
+      const detailList = Array.isArray(detailRes?.data)
+        ? detailRes.data
+        : detailRes?.data?.records || [];
+
+      if (detailList.length > 0) {
+        printMaterialList.value = detailList;
+      }
+
+      if (printMaterialList.value.length === 0) {
+        proxy.$modal.msgWarning("鏆傛棤棰嗘枡鏁版嵁");
+        return;
+      }
+
+      // 绛夊緟 DOM 鏇存柊鍚庢墽琛屾墦鍗�
+      proxy.$nextTick(() => {
+        setTimeout(() => {
+          window.print();
+        }, 800);
+      });
+    } catch (e) {
+      console.error("鑾峰彇棰嗘枡鏁版嵁澶辫触锛�", e);
+      proxy.$modal.msgError("鑾峰彇棰嗘枡鏁版嵁澶辫触");
+    } finally {
+      proxy.$modal.closeLoading();
+    }
+  };
 
   const openBindRouteDialog = async (row, type) => {
     bindForm.orderId = row.id;
@@ -572,6 +662,7 @@
           quantity: row.quantity || 0,
           orderId,
           type: "order",
+          editable: !row.endOrder,
         },
       });
     } catch (e) {
@@ -666,6 +757,26 @@
       });
   };
 
+  // 缁撴潫璁㈠崟
+  const handleEndOrder = row => {
+    ElMessageBox.confirm(`鏄惁纭缁撴潫璁㈠崟锛�${row.npsNo}锛焋, "鎻愮ず", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        const params = {
+          id: row.id,
+          endOrder: true,
+        };
+        updateProductOrder(params).then(() => {
+          proxy.$modal.msgSuccess("缁撴潫璁㈠崟鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {});
+  };
+
   const handleConfirmRoute = () => {};
 
   onMounted(() => {

--
Gitblit v1.9.3