From 01b5728bb6842fbed09426cbf5e70e0e17def518 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 02 四月 2026 11:33:53 +0800
Subject: [PATCH] Merge branch 'dev_银川_中盛建材' of http://114.132.189.42:9002/r/product-inventory-management into dev_银川_中盛建材

---
 src/views/index.vue  |  109 +++++++++++++++++++++++++++++++++++++++++++++---------
 src/api/viewIndex.js |    7 +++
 2 files changed, 98 insertions(+), 18 deletions(-)

diff --git a/src/api/viewIndex.js b/src/api/viewIndex.js
index 8b5d144..96bdc25 100644
--- a/src/api/viewIndex.js
+++ b/src/api/viewIndex.js
@@ -326,3 +326,10 @@
     method: "get",
   });
 };
+// 绠$悊缁熻
+export const getManageStatistics = () => {
+  return request({
+    url: "/home/manage",
+    method: "get",
+  });
+};
diff --git a/src/views/index.vue b/src/views/index.vue
index 2e8ed36..cf17886 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -75,7 +75,7 @@
                    :xAxis="salesAmountXAxis"
                    :yAxis="salesAmountYAxis"
                    :series="salesAmountSeries"
-                   style="height: 300px" />
+                   style="height: 90%" />
         </section>
       </div>
       <div class="right-col">
@@ -169,27 +169,51 @@
         <section class="section-card mini-table-wrap"
                  v-if="isSectionVisible('planTable')">
           <div class="section-title">鏈�杩戞姤宸�</div>
-          <el-table :data="planTable"
+          <el-table :data="reportingTable"
                     size="small"
-                    stripe>
-            <el-table-column prop="planNo"
-                             label="鐝"
+                    stripe
+                    :loading="reportingTableLoading">
+            <el-table-column prop="productNo"
+                             label="鎶ュ伐缂栧彿"
                              min-width="150" />
-            <el-table-column prop="product"
+            <el-table-column prop="schedule"
+                             label="鐝粍"
+                             min-width="80">
+              <template #default="{ row }">
+                <el-tag :type="row.schedule === '鐧界彮' ? 'primary' : 'warning'">{{ row.schedule || '-' }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column prop="postName"
                              label="鍒涘缓浜�"
-                             min-width="120" />
-            <el-table-column prop="product"
+                             min-width="100" />
+            <el-table-column prop="createTime"
                              label="鎶ュ伐鏃堕棿"
-                             min-width="120" />
-            <el-table-column prop="qty"
+                             min-width="150">
+              <template #default="{ row }">
+                {{ row.createTime ? dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') : '' }}
+              </template>
+            </el-table-column>
+            <el-table-column prop="productName"
                              label="浜у搧"
-                             min-width="90" />
-            <el-table-column prop="issued"
+                             min-width="120">
+              <template #default="{ row }">
+                <el-tag :type="row.productName === '鐮屽潡' ? 'primary' : 'warning'">{{ row.productName || '-' }}</el-tag>
+              </template>
+            </el-table-column>
+            <el-table-column prop="totalQuantity"
                              label="鐢熶骇鏁伴噺"
-                             min-width="90" />
-            <el-table-column prop="issued"
+                             min-width="100">
+              <template #default="{ row }">
+                <span style="color:rgba(18, 148, 212, 0.8);">{{ row.totalQuantity || '-' }}</span> 鏂�
+              </template>
+            </el-table-column>
+            <el-table-column prop="quantity"
                              label="鍚堟牸鏁伴噺"
-                             min-width="90" />
+                             min-width="100">
+              <template #default="{ row }">
+                <span style="color:rgba(0, 228, 99, 0.8);">{{ row.quantity || '-' }}</span> 鏂�
+              </template>
+            </el-table-column>
           </el-table>
         </section>
       </div>
@@ -269,9 +293,12 @@
     processDataProductionStatistics,
     qualityInspectionStatistics,
     nonComplianceWarning,
+    getManageStatistics,
   } from "@/api/viewIndex.js";
   import { energyConsumptionDetailStatistics } from "@/api/energyManagement/energyType";
   import { getSalesAmountAnalysis } from "@/api/reportAnalysis/salesStatistics";
+  import { productionReportListPage } from "@/api/productionManagement/productionReporting.js";
+  import dayjs from "dayjs";
 
   const router = useRouter();
   const userStore = useUserStore();
@@ -454,8 +481,8 @@
     { name: "宸插畬鎴愯鍗曟暟", value: "-" },
     { name: "鏈畬鎴愯鍗曟暟", value: "-" },
     { name: "閮ㄥ垎瀹屾垚璁㈠崟鏁�", value: "-" },
-    { name: "璐ㄦ鎬绘暟", value: "-" },
-    { name: "杩囩▼妫�鎬绘暟", value: "-" },
+    { name: "鏉ユ枡妫�鎬绘暟", value: "-" },
+    // { name: "杩囩▼妫�鎬绘暟", value: "-" },
   ]);
 
   const pendingTasks = reactive([]);
@@ -773,7 +800,33 @@
       });
   };
 
-  const planTable = reactive([]);
+  // 鎶ュ伐琛ㄦ牸鏁版嵁
+  const reportingTable = ref([]);
+  const reportingTableLoading = ref(false);
+
+  // 鑾峰彇鏈�杩戞姤宸ユ暟鎹�
+  const fetchReportingData = () => {
+    reportingTableLoading.value = true;
+    productionReportListPage({
+      current: 1,
+      size: 5, // 鍙樉绀烘渶杩�5鏉�
+    })
+      .then(res => {
+        if (res.code === 200) {
+          console.log(res.data.records || []);
+          reportingTable.value = res.data.records || [];
+        } else {
+          reportingTable.value = [];
+        }
+      })
+      .catch(error => {
+        console.error("鑾峰彇鎶ュ伐鏁版嵁澶辫触:", error);
+        reportingTable.value = [];
+      })
+      .finally(() => {
+        reportingTableLoading.value = false;
+      });
+  };
   const recentTrendCards = reactive([
     {
       key: "planIssued",
@@ -1204,6 +1257,24 @@
     //   console.error("expenseCompositionAnalysis鎺ュ彛鑾峰彇澶辫触:", error);
     // }
   };
+  const loadManageStatistics = async () => {
+    try {
+      const res = await getManageStatistics();
+      const data = res?.data || {};
+      businessFocus[0].value = `${pickFirstNumber(data, ["total"])} 鏉;
+      businessFocus[1].value = `${pickFirstNumber(data, ["completed"])} 鏉;
+      businessFocus[2].value = `${pickFirstNumber(data, ["uncompleted"])} 鏉;
+      businessFocus[3].value = `${pickFirstNumber(data, [
+        "partialCompleted",
+      ])} 鏉;
+      businessFocus[4].value = `${pickFirstNumber(data, [
+        "materialInspection",
+      ])} 鏉;
+      // businessFocus[5].value = `${pickFirstNumber(data, [""])} 鏉;
+    } catch (error) {
+      console.error("manageStatistics鎺ュ彛鑾峰彇澶辫触:", error);
+    }
+  };
 
   const refreshDashboardData = () => {
     // loadHomeTodos();
@@ -1212,8 +1283,10 @@
     // loadQualityData();
     // loadCostComposition();
     // loadWarningCenter();
+    loadManageStatistics();
     updateEnergyTypeChart();
     fetchSalesAmountChartData();
+    fetchReportingData();
     lastUpdatedAt.value = new Date().toLocaleString();
   };
 

--
Gitblit v1.9.3