From 4b9403d9f405d11342290a02a0c5148d01a033b3 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 17 三月 2026 16:06:23 +0800
Subject: [PATCH] fix: 库存报表页面未做页码分页(仓储物流的入库管理也没有分页)

---
 src/views/consumablesLogistics/stockReport/index.vue |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/views/consumablesLogistics/stockReport/index.vue b/src/views/consumablesLogistics/stockReport/index.vue
index 0305289..3daddfc 100644
--- a/src/views/consumablesLogistics/stockReport/index.vue
+++ b/src/views/consumablesLogistics/stockReport/index.vue
@@ -235,6 +235,19 @@
              show-overflow-tooltip
            />
         </el-table>
+
+        <div style="margin-top: 12px; display: flex; justify-content: flex-end;">
+          <el-pagination
+            background
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="page.total"
+            v-model:page-size="page.size"
+            v-model:current-page="page.current"
+            :page-sizes="[10, 20, 50, 100]"
+            @size-change="handlePageChange"
+            @current-change="handlePageChange"
+          />
+        </div>
       </el-card>
     </div>
   </div>
@@ -272,6 +285,16 @@
   tableData: []
 })
 
+const page = reactive({
+  current: 1,
+  size: 10,
+  total: 0,
+})
+
+const handlePageChange = () => {
+  fetchList()
+}
+
 const stockRecordTypeOptions = ref([])
 
 const getRecordType = (recordType) => {
@@ -306,7 +329,7 @@
 }
 
 // 鏌ヨ鏁版嵁
-const handleQuery = async () => {
+const fetchList = async () => {
   if (!validateSearchForm()) {
     return
   }
@@ -323,6 +346,7 @@
     }
     if (response.code === 200) {
       reportData.value.tableData = response.data.records
+      page.total = Number(response.data.total ?? 0) || 0
       // reportData.value.summary = response.data.summary
       // reportData.value.chartData = response.data.chartData
       // nextTick(() => {
@@ -335,6 +359,12 @@
   } finally {
     tableLoading.value = false
   }
+}
+
+// 鏌ヨ鏁版嵁锛堟寜閽Е鍙戯細鍥炲埌绗竴椤碉級
+const handleQuery = () => {
+  page.current = 1
+  fetchList()
 }
 // // 鐢熸垚鍋囨暟鎹�
 // const generateMockData = () => {
@@ -396,7 +426,9 @@
     startMonth: "",
     endMonth: "",
     startDate: "",
-    endDate: ""
+    endDate: "",
+    current: page.current,
+    size: page.size,
   }
   
   if (searchForm.reportType === 'daily') {
@@ -418,6 +450,9 @@
   searchForm.singleDate = ''
   searchForm.dateRange = []
   searchForm.monthRange = []
+  page.current = 1
+  page.size = 10
+  page.total = 0
   reportData.value = {
     summary: null,
     chartData: null,

--
Gitblit v1.9.3