From 8ef5afed625531bab0e544b853b9568509533c0e Mon Sep 17 00:00:00 2001
From: buhuazhen <hua100783@gmail.com>
Date: 星期六, 09 五月 2026 15:23:15 +0800
Subject: [PATCH] feat(生产管理): 在多个页面表格和筛选器中添加车间字段

---
 src/views/productionManagement/productionReporting/index.vue    |    6 ++
 src/views/productionManagement/productionCosting/index.vue      |    5 ++
 src/views/productionManagement/productionOrder/index.vue        |   49 +++++++++++++++++++++++-
 src/views/productionManagement/productionTraceability/index.vue |    2 +
 src/views/productionManagement/workOrderEdit/index.vue          |    5 ++
 src/views/productionManagement/workOrderManagement/index.vue    |    5 ++
 6 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/src/views/productionManagement/productionCosting/index.vue b/src/views/productionManagement/productionCosting/index.vue
index f438518..2dc63bd 100644
--- a/src/views/productionManagement/productionCosting/index.vue
+++ b/src/views/productionManagement/productionCosting/index.vue
@@ -94,6 +94,11 @@
       prop: "schedulingUserName",
       minWidth: 100,
     },
+    {
+      label: "杞﹂棿",
+      prop: "workshopName",
+      minWidth: 100,
+    },
     // {
     //   label: "鍚堝悓鍙�",
     //   prop: "salesContractNo",
diff --git a/src/views/productionManagement/productionOrder/index.vue b/src/views/productionManagement/productionOrder/index.vue
index 4dfe92b..e761523 100644
--- a/src/views/productionManagement/productionOrder/index.vue
+++ b/src/views/productionManagement/productionOrder/index.vue
@@ -30,7 +30,7 @@
         <el-form-item label="鐘舵��:">
           <el-select v-model="searchForm.status"
                      placeholder="璇烽�夋嫨"
-                     style="width: 160px;"
+                     style="width: 100px;"
                      @change="handleQuery">
             <el-option label="寰呭紑濮�"
                        value="1" />
@@ -42,6 +42,19 @@
                        value="4" />
             <el-option label="宸茬粨鏉�"
                        value="5" />
+          </el-select>
+        </el-form-item>
+                <el-form-item label="杞﹂棿:">
+          <el-select v-model="searchForm.workshopId"
+                     placeholder="璇烽�夋嫨杞﹂棿"
+                     clearable
+                     filterable
+                     @change="handleQuery"
+                     style="width: 160px">
+            <el-option v-for="item in workshopOptions"
+                       :key="item.id"
+                       :label="item.name"
+                       :value="item.id" />
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -226,6 +239,7 @@
   import { ElMessageBox } from "element-plus";
   import dayjs from "dayjs";
   import { useRouter } from "vue-router";
+  import { workshopPage } from "@/api/basicData/workshop.js";
   import {
     productOrderListPage,
     listProcessRoute,
@@ -261,6 +275,7 @@
   const sourcePage = reactive({
     total: 0,
   });
+  const workshopOptions = ref([]);
 
   const processColumnWidth = computed(() => {
     if (!tableData.value || tableData.value.length === 0) return "200px";
@@ -361,7 +376,7 @@
       width: 120,
     },
     {
-      label: "杞﹂棿鍚嶇О",
+      label: "杞﹂棿",
       prop: "workshopName",
     },
     {
@@ -482,6 +497,7 @@
       productName: "",
       model: "",
       status: "",
+      workshopName: ""
     },
   });
   const { searchForm } = toRefs(data);
@@ -519,6 +535,33 @@
       return "red";
     }
   };
+  function parseWorkshopPagePayload(res) {
+    const payload = res?.data;
+    if (!payload) {
+      return { records: [], total: 0 };
+    }
+    if (Array.isArray(payload)) {
+      return { records: payload, total: payload.length };
+    }
+    const records = payload.records ?? payload.list ?? payload.rows ?? [];
+    const total = Number(payload.total ?? payload.totalCount ?? 0);
+    return { records: Array.isArray(records) ? records : [], total };
+  }
+  const fetchWorkshopOptions = () => {
+    workshopPage({
+      name: "",
+      principal: "",
+      contactPhone: "",
+      current: 1,
+      size: 999,
+    }).then(res => {
+      if (res.code === 200) {
+        const { records } = parseWorkshopPagePayload(res);
+        workshopOptions.value = records;
+      }
+    });
+  };
+
 
   // 缁戝畾宸ヨ壓璺嚎寮规
   const bindRouteDialogVisible = ref(false);
@@ -641,6 +684,7 @@
       productName: "",
       model: "",
       status: "",
+      workshopName: "",
     };
     handleQuery();
   };
@@ -848,6 +892,7 @@
 
   onMounted(() => {
     getList();
+    fetchWorkshopOptions();
   });
 </script>
 
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index aff050f..cf42a0a 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -226,13 +226,17 @@
       prop: "unit",
       width: 120,
     },
-
     {
       label: "鍒涘缓鏃堕棿",
       prop: "createTime",
       width: 120,
     },
     {
+      label: "杞﹂棿",
+      prop: "workshopName",
+      width: 120,
+    },
+    {
       dataType: "action",
       label: "鎿嶄綔",
       align: "center",
diff --git a/src/views/productionManagement/productionTraceability/index.vue b/src/views/productionManagement/productionTraceability/index.vue
index a850788..a494cf5 100644
--- a/src/views/productionManagement/productionTraceability/index.vue
+++ b/src/views/productionManagement/productionTraceability/index.vue
@@ -49,6 +49,8 @@
                          :status="rowData.productionOrderDto?.completionStatus >= 100 ? 'success' : ''"
                          style="width: 80%;" />
           </el-descriptions-item>
+          <el-descriptions-item label="杞﹂棿">{{rowData.productionOrderDto?.workshopName}}</el-descriptions-item>
+
         </el-descriptions>
       </div>
       <el-empty v-else
diff --git a/src/views/productionManagement/workOrderEdit/index.vue b/src/views/productionManagement/workOrderEdit/index.vue
index 1cde5ea..d0b77bd 100644
--- a/src/views/productionManagement/workOrderEdit/index.vue
+++ b/src/views/productionManagement/workOrderEdit/index.vue
@@ -209,6 +209,11 @@
       width: "180",
     },
     {
+      label: "杞﹂棿",
+      prop: "workshopName",
+      width: "180",
+    },
+    {
       label: "鎿嶄綔",
       width: "200",
       align: "center",
diff --git a/src/views/productionManagement/workOrderManagement/index.vue b/src/views/productionManagement/workOrderManagement/index.vue
index 600b274..6a1b24f 100644
--- a/src/views/productionManagement/workOrderManagement/index.vue
+++ b/src/views/productionManagement/workOrderManagement/index.vue
@@ -345,6 +345,11 @@
       width: "140",
     },
     {
+      label: "杞﹂棿",
+      prop: "workshopName",
+      width: "140",
+    },
+    {
       label: "鎿嶄綔",
       width: "260",
       align: "center",

--
Gitblit v1.9.3