From 908555743c2c36d7e13a129f4ad78f3f69602489 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 16 十月 2025 09:14:17 +0800
Subject: [PATCH] 生产管控-生产订单添加随机排产功能

---
 src/views/production/index.vue |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/views/production/index.vue b/src/views/production/index.vue
index fa77e22..e9198ea 100644
--- a/src/views/production/index.vue
+++ b/src/views/production/index.vue
@@ -30,6 +30,9 @@
         >
           鍒犻櫎
         </el-button>
+        <el-button type="primary" @click="handleRandomScheduling">
+          闅忔満鎺掍骇
+        </el-button>
       </div>
       <!-- 鏁版嵁琛ㄦ牸 -->
       <ETable
@@ -95,7 +98,7 @@
 import ProductionDialog from "./components/ProductionDialog.vue";
 import ETable from "@/components/Table/ETable.vue";
 import Pagination from "@/components/Pagination/index.vue";
-import { getProductionMasterList, delPM } from "@/api/production";
+import { getProductionMasterList, delPM, randomScheduling } from "@/api/production";
 import { parseCoalArray } from "@/utils/production";
 import { useTableData } from "./components/useTableData.js";
 import { useDialog } from "./components/useDialog.js";
@@ -173,6 +176,23 @@
   });
 };
 
+// 闅忔満鎺掍骇澶勭悊鍑芥暟
+const handleRandomScheduling = async () => {
+  try {
+    const { ElMessage } = await import('element-plus');
+    const res = await randomScheduling();
+    if (res.code === 200) {
+      ElMessage.success('闅忔満鎺掍骇鎴愬姛');
+      getList(); // 鍒锋柊鍒楄〃
+    } else {
+      ElMessage.error(res.msg || '闅忔満鎺掍骇澶辫触');
+    }
+  } catch (error) {
+    const { ElMessage } = await import('element-plus');
+    ElMessage.error('璇锋眰澶辫触锛岃绋嶅悗閲嶈瘯');
+  }
+};
+
 // 缁勪欢鎸傝浇鏃跺姞杞芥暟鎹�
 onMounted(async () => {
   try {

--
Gitblit v1.9.3