From e5c3a10ffc181fadd32c19ed0dc566d8a0cb93d7 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 17 三月 2026 16:10:59 +0800
Subject: [PATCH] fix: 库存报表页面未做页码分页(仓储物流的入库管理也没有分页)
---
src/views/inventoryManagement/stockReport/index.vue | 68 ++++++++++++++++++++++++++-------
1 files changed, 53 insertions(+), 15 deletions(-)
diff --git a/src/views/inventoryManagement/stockReport/index.vue b/src/views/inventoryManagement/stockReport/index.vue
index 0bbfac6..61196e4 100644
--- a/src/views/inventoryManagement/stockReport/index.vue
+++ b/src/views/inventoryManagement/stockReport/index.vue
@@ -53,7 +53,7 @@
</el-button>
<el-button @click="handleReset">閲嶇疆</el-button>
</div>
-
+
<div class="search_right">
<!-- <el-button type="success" @click="handleExport" icon="Download">-->
<!-- 瀵煎嚭鎶ヨ〃-->
@@ -166,14 +166,14 @@
prop="createTime"
width="200"
show-overflow-tooltip
- v-if="!searchForm.reportType === 'inout'"
+ v-if="searchForm.reportType !== 'inout'"
/>
<el-table-column
label="鍏ュ簱鎵规"
prop="inboundBatches"
width="240"
show-overflow-tooltip
- v-if="!searchForm.reportType === 'inout'"
+ v-if="searchForm.reportType !== 'inout'"
/>
<el-table-column
label="浜у搧澶х被"
@@ -207,15 +207,21 @@
prop="totalStockOut"
width="100"
align="center"
+ v-if="searchForm.reportType === 'inout'"
/>
<el-table-column
label="鐜板湪搴撳瓨"
prop="currentStock"
align="center"
/>
+ <el-table-column
+ label="鐜板噣閲�(鍚�)"
+ prop="currentWeight"
+ align="center"
+ />
<el-table-column label="鏉ユ簮"
prop="recordType"
- v-if="!searchForm.reportType === 'inout'"
+ v-if="searchForm.reportType !== 'inout'"
show-overflow-tooltip>
<template #default="scope">
{{ getRecordType(scope.row.recordType) }}
@@ -225,28 +231,39 @@
label="鍏ュ簱浜�"
prop="createBy"
width="80"
- v-if="!searchForm.reportType === 'inout'"
+ v-if="searchForm.reportType !== 'inout'"
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>
</template>
<script setup>
-import { ref, reactive, onMounted, nextTick } from 'vue'
+import { ref, reactive, onMounted, nextTick, getCurrentInstance } from 'vue'
import { ElMessage } from 'element-plus'
import * as echarts from 'echarts'
-import {
- getStockMonthlyReport,
- getStockInOutReport,
-} from '@/api/inventoryManagement/stockReport'
import {
getStockInventoryInAndOutReportList,
getStockInventoryReportList
} from "@/api/inventoryManagement/stockInventory.js";
-import {findAllQualifiedStockRecordTypeOptions} from "@/api/basicData/enum.js";
+import {
+ findAllQualifiedStockInRecordTypeOptions,
+} from "@/api/basicData/enum.js";
const { proxy } = getCurrentInstance()
@@ -268,6 +285,16 @@
tableData: []
})
+const page = reactive({
+ current: 1,
+ size: 10,
+ total: 0,
+})
+
+const handlePageChange = () => {
+ fetchList()
+}
+
const stockRecordTypeOptions = ref([])
const getRecordType = (recordType) => {
@@ -276,7 +303,7 @@
// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
const fetchStockRecordTypeOptions = () => {
- findAllQualifiedStockRecordTypeOptions()
+ findAllQualifiedStockInRecordTypeOptions()
.then(res => {
stockRecordTypeOptions.value = res.data;
})
@@ -301,8 +328,7 @@
}
}
-// 鏌ヨ鏁版嵁
-const handleQuery = async () => {
+const fetchList = async () => {
if (!validateSearchForm()) {
return
}
@@ -319,6 +345,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(() => {
@@ -331,6 +358,12 @@
} finally {
tableLoading.value = false
}
+}
+
+// 鏌ヨ鏁版嵁锛堟寜閽Е鍙戯細鍥炲埌绗竴椤碉級
+const handleQuery = () => {
+ page.current = 1
+ fetchList()
}
// // 鐢熸垚鍋囨暟鎹�
// const generateMockData = () => {
@@ -392,7 +425,9 @@
startMonth: "",
endMonth: "",
startDate: "",
- endDate: ""
+ endDate: "",
+ current: page.current,
+ size: page.size,
}
if (searchForm.reportType === 'daily') {
@@ -414,6 +449,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