From 6da8d7c3e2fb6aa02b14b0af63a8b5fadc0716bc Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 29 四月 2026 17:24:13 +0800
Subject: [PATCH] 合格率加百分号

---
 src/views/productionManagement/productionOrder/index.vue |  130 ++++++++++++++++++++++++++++++------------
 1 files changed, 92 insertions(+), 38 deletions(-)

diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index d876f3d..28356dd 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -11,22 +11,6 @@
                     style="width: 160px;"
                     @change="handleQuery" />
         </el-form-item>
-        <el-form-item label="瀹㈡埛鍚嶇О:">
-          <el-input v-model="searchForm.customerName"
-                    placeholder="璇疯緭鍏�"
-                    clearable
-                    prefix-icon="Search"
-                    style="width: 160px;"
-                    @change="handleQuery" />
-        </el-form-item>
-        <el-form-item label="鍚堝悓鍙�:">
-          <el-input v-model="searchForm.salesContractNo"
-                    placeholder="璇疯緭鍏�"
-                    clearable
-                    prefix-icon="Search"
-                    style="width: 160px;"
-                    @change="handleQuery" />
-        </el-form-item>
         <el-form-item label="浜у搧鍚嶇О:">
           <el-input v-model="searchForm.productName"
                     placeholder="璇疯緭鍏�"
@@ -191,9 +175,18 @@
     <MaterialDetailDialog v-model="materialDetailDialogVisible"
                           :order-row="currentMaterialDetailOrder"
                           @confirmed="getList" />
+    <MaterialSupplementDialog v-model="materialSupplementDialogVisible"
+                              :order-row="currentMaterialSupplementOrder"
+                              @saved="getList" />
     <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>
 
@@ -221,8 +214,14 @@
   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")
   );
@@ -320,7 +319,7 @@
       label: "鎿嶄綔",
       align: "center",
       fixed: "right",
-      width: 340,
+      width: 260,
       operation: [
         {
           name: "宸ヨ壓璺嚎",
@@ -353,27 +352,38 @@
             showSourceData(row);
           },
         },
-        // {
-        //   name: "浜у搧缁撴瀯",
-        //   type: "text",
-        //   clickFun: row => {
-        //     showProductStructure(row);
-        //   },
-        // },
-        // {
-        //   name: "棰嗘枡",
-        //   type: "text",
-        //   clickFun: row => {
-        //     openMaterialDialog(row);
-        //   },
-        // },
-        // {
-        //   name: "棰嗘枡璇︽儏",
-        //   type: "text",
-        //   clickFun: row => {
-        //     openMaterialDetailDialog(row);
-        //   },
-        // },
+        {
+          name: "棰嗘枡",
+          type: "text",
+          color: "#5EC7AB",
+          clickFun: row => {
+            openMaterialDialog(row);
+          },
+        },
+        {
+          name: "琛ユ枡",
+          type: "text",
+          color: "#5EC7AB",
+          clickFun: row => {
+            openMaterialSupplementDialog(row);
+          },
+        },
+        {
+          name: "棰嗘枡璇︽儏",
+          type: "text",
+          color: "#5EC7AB",
+          clickFun: row => {
+            openMaterialDetailDialog(row);
+          },
+        },
+        {
+          name: "鎵撳嵃棰嗘枡鍗�",
+          type: "text",
+          color: "#409eff",
+          clickFun: row => {
+            handlePrint(row);
+          },
+        },
       ],
     },
   ]);
@@ -446,6 +456,44 @@
   const currentMaterialOrder = ref(null);
   const materialDetailDialogVisible = ref(false);
   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;
@@ -499,6 +547,11 @@
   const openMaterialDetailDialog = async row => {
     currentMaterialDetailOrder.value = row;
     materialDetailDialogVisible.value = true;
+  };
+
+  const openMaterialSupplementDialog = row => {
+    currentMaterialSupplementOrder.value = row;
+    materialSupplementDialogVisible.value = true;
   };
 
   const handleReset = () => {
@@ -571,6 +624,7 @@
           model: row.model || "",
           bomNo: row.bomNo || "",
           description: data.description || "",
+          quantity: row.quantity || 0,
           orderId,
           type: "order",
         },

--
Gitblit v1.9.3