From e0cb2008ffb01348b54a7370180a100f3c975877 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 06 二月 2026 10:49:24 +0800
Subject: [PATCH] Merge branch 'dev_New' into dev_天津军泰伟业
---
src/views/inventoryManagement/stockReport/index.vue | 70 +++++++++++++++++++++++++++-------
1 files changed, 55 insertions(+), 15 deletions(-)
diff --git a/src/views/inventoryManagement/stockReport/index.vue b/src/views/inventoryManagement/stockReport/index.vue
index 0bbfac6..89773cf 100644
--- a/src/views/inventoryManagement/stockReport/index.vue
+++ b/src/views/inventoryManagement/stockReport/index.vue
@@ -48,12 +48,12 @@
style="width: 240px;"
/>
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px">
+ <el-button type="primary" @click="onSearch" style="margin-left: 10px">
鏌ヨ
</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,6 +207,7 @@
prop="totalStockOut"
width="100"
align="center"
+ v-if="searchForm.reportType === 'inout'"
/>
<el-table-column
label="鐜板湪搴撳瓨"
@@ -215,7 +216,7 @@
/>
<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 +226,34 @@
label="鍏ュ簱浜�"
prop="createBy"
width="80"
- v-if="!searchForm.reportType === 'inout'"
+ v-if="searchForm.reportType !== 'inout'"
show-overflow-tooltip
/>
</el-table>
+ <pagination
+ :total="total"
+ layout="total, sizes, prev, pager, next, jumper"
+ :page="page.current"
+ :limit="page.size"
+ @pagination="paginationChange"
+ />
</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 pagination from '@/components/PIMTable/Pagination.vue'
import {
getStockInventoryInAndOutReportList,
getStockInventoryReportList
} from "@/api/inventoryManagement/stockInventory.js";
-import {findAllQualifiedStockRecordTypeOptions} from "@/api/basicData/enum.js";
+import {
+ findAllQualifiedStockInRecordTypeOptions,findAllUnQualifiedStockInRecordTypeOptions,
+} from "@/api/basicData/enum.js";
const { proxy } = getCurrentInstance()
@@ -268,6 +275,13 @@
tableData: []
})
+const page = reactive({
+ current: 1,
+ size: 10,
+})
+
+const total = ref(0)
+
const stockRecordTypeOptions = ref([])
const getRecordType = (recordType) => {
@@ -276,9 +290,13 @@
// 鑾峰彇鏉ユ簮绫诲瀷閫夐」
const fetchStockRecordTypeOptions = () => {
- findAllQualifiedStockRecordTypeOptions()
+ findAllQualifiedStockInRecordTypeOptions()
.then(res => {
stockRecordTypeOptions.value = res.data;
+ findAllUnQualifiedStockInRecordTypeOptions()
+ .then(res => {
+ stockRecordTypeOptions.value = [...stockRecordTypeOptions.value,...res.data];
+ })
})
}
@@ -294,6 +312,7 @@
// 鎶ヨ〃绫诲瀷鏀瑰彉
const handleReportTypeChange = () => {
+ page.current = 1
reportData.value = {
summary: null,
chartData: null,
@@ -309,7 +328,12 @@
tableLoading.value = true
try {
- const params = getQueryParams()
+ const baseParams = getQueryParams()
+ const params = {
+ ...baseParams,
+ current: page.current,
+ size: page.size,
+ }
let response
if (searchForm.reportType === 'inout') {
@@ -318,7 +342,8 @@
response = await getStockInventoryReportList(params)
}
if (response.code === 200) {
- reportData.value.tableData = response.data.records
+ reportData.value.tableData = response.data.records || []
+ total.value = response.data.total || 0
// reportData.value.summary = response.data.summary
// reportData.value.chartData = response.data.chartData
// nextTick(() => {
@@ -331,6 +356,19 @@
} finally {
tableLoading.value = false
}
+}
+
+// 鏌ヨ鎸夐挳锛氶噸缃埌绗竴椤靛苟鏌ヨ
+const onSearch = () => {
+ page.current = 1
+ handleQuery()
+}
+
+// 鍒嗛〉鍙樺寲
+const paginationChange = (obj) => {
+ page.current = obj.page
+ page.size = obj.limit
+ handleQuery()
}
// // 鐢熸垚鍋囨暟鎹�
// const generateMockData = () => {
@@ -551,6 +589,8 @@
]
fetchStockRecordTypeOptions()
+ // 鍒濆鍖栧姞杞戒竴娆℃暟鎹�
+ handleQuery()
})
</script>
--
Gitblit v1.9.3