From 3b55fed0ba65d887969acbe118c1a868bc3b3ad0 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期三, 07 一月 2026 17:13:46 +0800
Subject: [PATCH] 生产报工加删除按钮

---
 src/views/productionManagement/productionReporting/index.vue |   26 ++++++++++++++++++++++++++
 src/views/productionManagement/workOrder/index.vue           |   10 ++++++++--
 src/api/productionManagement/productionReporting.js          |   10 +++++++++-
 3 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/src/api/productionManagement/productionReporting.js b/src/api/productionManagement/productionReporting.js
index fdec712..3e29943 100644
--- a/src/api/productionManagement/productionReporting.js
+++ b/src/api/productionManagement/productionReporting.js
@@ -32,4 +32,12 @@
     method: "post",
     data: query,
   });
-}
\ No newline at end of file
+}
+// 鐢熶骇鎶ュ伐-鍒犻櫎
+export function productionReportDelete(query) {
+  return request({
+    url: "/productionProductMain/delete",
+    method: "delete",
+    data: query,
+  });
+}
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index 97a3656..a08326a 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -152,6 +152,7 @@
   import {
     productionReportUpdate,
     workListPageById,
+    productionReportDelete,
   } from "@/api/productionManagement/productionReporting.js";
   import { productionProductMainListPage } from "@/api/productionManagement/productionProductMain.js";
   import { userListNoPageByTenantId } from "@/api/system/user.js";
@@ -262,6 +263,13 @@
             showOutput(row);
           },
         },
+        {
+          name: "鍒犻櫎",
+          type: "danger",
+          clickFun: row => {
+            deleteReport(row);
+          },
+        },
       ],
     },
   ]);
@@ -293,6 +301,24 @@
     }
     handleQuery();
   };
+  const deleteReport = row => {
+    ElMessageBox.confirm("纭畾鍒犻櫎璇ユ姤宸ュ悧锛�", "鎻愮ず", {
+      confirmButtonText: "纭畾",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    }).then(() => {
+      productionReportDelete({ id: row.id }).then(res => {
+        if (res.code === 200) {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        } else {
+          ElMessageBox.alert(res.msg || "鍒犻櫎澶辫触", "鎻愮ず", {
+            confirmButtonText: "纭畾",
+          });
+        }
+      });
+    });
+  };
   const pagination = obj => {
     page.current = obj.page;
     page.size = obj.limit;
diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index b34e76a..255e317 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -249,6 +249,7 @@
       width: "200",
       align: "center",
       dataType: "action",
+      fixed: "right",
       operation: [
         {
           name: "缂栬緫",
@@ -289,6 +290,7 @@
     reportWork: "",
     productProcessRouteItemId: "",
     userId: "",
+    productMainId: null,
   });
   const currentReportRowData = ref(null);
   const page = reactive({
@@ -332,7 +334,10 @@
 
   const showTransferCard = async row => {
     transferCardRowData.value = row;
-    const qrContent = proxy.javaApi + "/work-order?orderId=" + row.id;
+    const qrContent =
+      proxy.javaApi + "/work-order?orderRow=" + JSON.stringify(row);
+    console.log(qrContent, "qrContent");
+
     transferCardQrUrl.value = await QRCode.toDataURL(qrContent);
     transferCardVisible.value = true;
   };
@@ -363,10 +368,11 @@
   const showReportDialog = row => {
     currentReportRowData.value = row;
     reportForm.remainingQuantity = 1;
-    reportForm.quantity = 0;
+    reportForm.quantity = row.quantity;
     reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
     reportForm.workOrderId = row.id;
     reportForm.reportWork = row.reportWork;
+    reportForm.productMainId = row.productMainId;
     // 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛淇℃伅
 
     reportDialogVisible.value = true;

--
Gitblit v1.9.3