From 8a7e367d00fd3c40c8abe0cb5454de21f396cccd Mon Sep 17 00:00:00 2001 From: dxc Date: Tue, 24 Feb 2026 16:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E5=8A=9F=E8=83=BD=E8=A1=A5=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-web/src/views/material/list.vue | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index ff5a1b0..cf9240c 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -216,6 +216,19 @@ +
+ +
+ { tableSize.value = command; }; +// 新增:分页大小改变处理 +const handlePageSizeChange = (val: number) => { + queryParams.pageSize = val; + queryParams.pageNum = 1; // 切换大小时重置到第一页 + getList(); +}; + +// 新增:当前页码改变处理 +const handlePageCurrentChange = (val: number) => { + queryParams.pageNum = val; + getList(); +}; + const handleAdd = () => { resetForm(); dialog.title = '新增基础信息'; @@ -715,12 +741,12 @@ const handleEdit = (row: MaterialBaseVO) => { const checkDuplicate = async (name: string, spec: string): Promise => { try { - const nameRes: any = await listMaterialBase({ pageNum: 1, pageSize: 100, keyword: name }); + const nameRes: any = await listMaterialBase({ pageNum: 1, pageSize: 100, keyword: name, category: '', type: '', company: '' }); if (nameRes.data?.items?.some((item: MaterialBaseVO) => item.name === name && item.id !== form.value.id)) { ElMessage.error(`已存在名称为 "${name}" 的基础信息!`); return true; } - const specRes: any = await listMaterialBase({ pageNum: 1, pageSize: 100, keyword: spec }); + const specRes: any = await listMaterialBase({ pageNum: 1, pageSize: 100, keyword: spec, category: '', type: '', company: '' }); if (specRes.data?.items?.some((item: MaterialBaseVO) => item.spec === spec && item.id !== form.value.id)) { ElMessage.error(`已存在规格/编号为 "${spec}" 的基础信息!`); return true; @@ -956,6 +982,13 @@ onMounted(() => { flex-direction: column; } +/* 新增:分页样式 */ +.pagination-container { + margin-top: 15px; + display: flex; + justify-content: flex-start; +} + /* 上传相关样式 */ .upload-container { display: flex; flex-wrap: wrap; gap: 8px; } :deep(.el-upload--picture-card) { width: 100px; height: 100px; line-height: 100px; }