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; }