From c9120650b03c477c27ce5c9c492a416be21df1b0 Mon Sep 17 00:00:00 2001
From: chengxiangling <291105840@qq.com>
Date: 星期五, 16 五月 2025 13:44:01 +0800
Subject: [PATCH] 提交负载统计更正

---
 src/views/mainPlan/pipeProduceStatics/index.vue |   60 ++++++++++++++++++++++++++----------------------------------
 1 files changed, 26 insertions(+), 34 deletions(-)

diff --git a/src/views/mainPlan/pipeProduceStatics/index.vue b/src/views/mainPlan/pipeProduceStatics/index.vue
index d99e07c..1e9835d 100644
--- a/src/views/mainPlan/pipeProduceStatics/index.vue
+++ b/src/views/mainPlan/pipeProduceStatics/index.vue
@@ -101,7 +101,7 @@
 import { useI18n } from "vue-i18n"; //瑕佸湪js涓娇鐢ㄥ浗闄呭寲
 const { t, locale } = useI18n();
 const { proxy } = getCurrentInstance();
-
+const { aps_factory } = proxy.useDict("aps_factory");
 const loading = ref(false);
 const gridRef = ref();
 const height = ref(document.documentElement.clientHeight - 180 + "px;");
@@ -200,6 +200,19 @@
     eYearMonth: `${eYear}-${eMonth.toString().padStart(2, "0")}`,
   };
 }
+const formatTypeLabelPlant = (list) => {
+  if (list) {
+    return list
+      .map((type) => {
+        const item = aps_factory.value.find(
+          (item) => item.value === type
+        );
+        return item ? item.label : type;
+      })
+      .join("");
+  }
+  return "";
+};
 /** 鏌ヨ闆朵欢缁熻琛ㄥ垪琛� */
 function getPipeList() {
   let rowKey = 0;
@@ -220,15 +233,15 @@
     major: "piping",
   }).then((response) => {
     const colList = [];
-    let headersOne = [];
-    let headersTwo = [];
+    // let headersOne = [];
+    // let headersTwo = [];
     if (response.code == "200") {
       if (!response.data.planTitle) {
         loading.value = false;
         return;
       }
-      headersOne.push(t("plan.table.dateYearMonth"));
-      headersTwo.push(t("plan.table.processName"));
+      // headersOne.push(t("plan.table.dateYearMonth"));
+      // headersTwo.push(t("plan.table.processName"));
       colList.push({
         field: "dateCol",
         title: t("plan.table.dateYearMonth"),
@@ -240,16 +253,16 @@
             width: 250,
             type: "html",
           },
+          {
+            field: `resourceGroupName`,
+            title: t("plan.table.applicableFactories"),
+            width: 250,
+            type: "html",
+          },
         ],
         width: 160,
       });
       response.data.planTitle.forEach((item) => {
-        headersOne.push(item);
-        headersOne.push("");
-        headersOne.push("");
-        headersTwo.push(t("plan.table.designWorkingHours"));
-        headersTwo.push(t("plan.table.requiredWorkingHours"));
-        headersTwo.push(t("plan.table.capacityLoad"));
         colKey++;
         colList.push({
           field: `dateColTime${colKey}`,
@@ -275,27 +288,16 @@
           width: 160,
         });
       });
-
-      headers.value.push(headersOne);
-      headers.value.push(headersTwo);
-
       const columnList = [...tableColumn, ...colList];
       const dataList = [];
-      let startCol = 1;
 
       //鑾峰彇map
       response.data.planTable.map((mapItem) => {
         rowKey++;
-        let lastCol = startCol + 2;
-        merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c: lastCol } });
-        startCol = lastCol + 1;
-        let data = [];
         const item = {
           id: `${rowKey}`,
         };
         for (const [key, listValue] of Object.entries(mapItem)) {
-          data.push(key);
-
           let tableKey = 0;
           let flag = false;
           listValue.forEach((listItem) => {
@@ -307,24 +309,14 @@
               listItem.requireTimes,
               listItem.capacityLoad
             );
-            // 0-100 缁胯壊锛�101-120榛勮壊锛屽ぇ浜�120绾㈣壊
-            // listItem.capacityLoad <= 100
-            //   ? `<font color="red">${listItem.capacityLoad}%</font>`
-            //   : listItem.capacityLoad + "%";
-            data.push(listItem.designTimes);
-            data.push(listItem.requireTimes);
-            data.push(listItem.capacityLoad + "%");
-            // if (listItem.capacityLoad > 100) {
-            //   flag = true;
-            // }
           });
 
           // item[`resourceName`] = flag
           //   ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>`
           //   : key;
-          item[`resourceName`] = key;
+          item[`resourceName`] = key.split("_")[0];
+          item[`resourceGroupName`] = formatTypeLabelPlant([key.split("_")[1]]);
         }
-        exportData.value.push(data);
         dataList.push(item);
       });
 

--
Gitblit v1.9.3