From 5de52d2ccac5f925039a5ea6c95ee11e4ab78b7f Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Wed, 2 Dec 2026 18:42:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(web-admin):=20=E5=B7=A5=E5=8D=95=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=BC=B9=E7=AA=97=E6=8C=89=20pageSize=3D100=20?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=8B=89=E4=BB=BB=E5=8A=A1=20(#184)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 避免 /qc-tasks pageSize=200 触发 le=100 校验 422。 Co-authored-by: Cursor --- .../QcWorkOrderAttachmentDialog.vue | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/web-admin/src/views/quality-inspection/qc-work-order/QcWorkOrderAttachmentDialog.vue b/web-admin/src/views/quality-inspection/qc-work-order/QcWorkOrderAttachmentDialog.vue index aab3f7a6..cccb0f70 100644 --- a/web-admin/src/views/quality-inspection/qc-work-order/QcWorkOrderAttachmentDialog.vue +++ b/web-admin/src/views/quality-inspection/qc-work-order/QcWorkOrderAttachmentDialog.vue @@ -154,14 +154,25 @@ const seq = ++loadSeq taskLoading.value = true try { - const res = await fetchQcTaskList({ - workOrderId, - page: 1, - pageSize: 200 - }) - if (seq !== loadSeq) return + // /qc-tasks 的 pageSize 上限为 100;按页拉取避免 422 + const pageSize = 100 + let page = 1 + let totalPages = 1 + const tasks: QcTask[] = [] + while (page <= totalPages) { + const res = await fetchQcTaskList({ + workOrderId, + page, + pageSize + }) + if (seq !== loadSeq) return + tasks.push(...(res.list || [])) + totalPages = Math.max(1, Number(res.totalPages || 1)) + page += 1 + if (page > 20) break + } const groups: TaskAttachmentGroup[] = [] - for (const task of res.list || []) { + for (const task of tasks) { const files = taskFiles(task) if (!files.length) continue const type = String(task.taskType || '')