feat: standardize default page size to 20, add pagination to pick list, and fix table horizontal scrollbar visibility
This commit is contained in:
@ -106,7 +106,7 @@
|
||||
</div>
|
||||
<el-table
|
||||
ref="manualTableRef"
|
||||
:data="filteredStockData"
|
||||
:data="paginatedStockData"
|
||||
height="500"
|
||||
border
|
||||
row-key="uniqueKey"
|
||||
@ -141,6 +141,17 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
style="margin-top: 12px; justify-content: flex-end; display: flex;"
|
||||
v-model:current-page="stockPage"
|
||||
v-model:page-size="stockPageSize"
|
||||
:total="filteredStockData.length"
|
||||
:page-sizes="[20, 50, 100, 200]"
|
||||
layout="total, prev, pager, next"
|
||||
background
|
||||
@size-change="() => { stockPage = 1 }"
|
||||
@current-change="() => {}"
|
||||
/>
|
||||
<template #footer>
|
||||
<span style="float: left; line-height: 32px; color: #909399;">
|
||||
已勾选 {{ tempSelection.length }} 项
|
||||
@ -338,6 +349,8 @@ const allStockData = ref<any[]>([])
|
||||
const filteredStockData = ref<any[]>([])
|
||||
const searchKeyword = ref('')
|
||||
const tempSelection = ref<any[]>([])
|
||||
const stockPage = ref(1)
|
||||
const stockPageSize = ref(20)
|
||||
|
||||
// 表格引用
|
||||
const manualTableRef = ref<InstanceType<typeof ElTable>>()
|
||||
@ -414,6 +427,12 @@ const shortageList = computed(() => {
|
||||
|
||||
const hasShortage = computed(() => shortageList.value.length > 0 && bomSets.value > maxBuildableSets.value)
|
||||
|
||||
// ★ 出库选单分页数据(固定 height="500" 时仍需分页减轻渲染压力)
|
||||
const paginatedStockData = computed(() => {
|
||||
const start = (stockPage.value - 1) * stockPageSize.value
|
||||
return filteredStockData.value.slice(start, start + stockPageSize.value)
|
||||
})
|
||||
|
||||
// --- 辅助方法 ---
|
||||
const getTypeTag = (type: string) => {
|
||||
switch (type) {
|
||||
@ -428,6 +447,7 @@ const getTypeTag = (type: string) => {
|
||||
|
||||
const openManualSelect = async () => {
|
||||
manualDialogVisible.value = true
|
||||
stockPage.value = 1
|
||||
|
||||
if (allStockData.value.length === 0) {
|
||||
try {
|
||||
@ -461,6 +481,7 @@ const openManualSelect = async () => {
|
||||
}
|
||||
|
||||
const filterStock = () => {
|
||||
stockPage.value = 1
|
||||
const kw = searchKeyword.value.trim().toLowerCase()
|
||||
if (!kw) {
|
||||
filteredStockData.value = allStockData.value
|
||||
|
||||
Reference in New Issue
Block a user