From 8116e0429106e90d7984990e3cc02811e971190d Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Thu, 9 Jul 2026 16:44:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(F006-W17.6):=20PageHeader=20=E5=8A=A0=20SK?= =?UTF-8?q?U=20=E6=80=BB=E6=95=B0=E6=98=BE=E7=A4=BA=20(=E5=AE=9E=E7=89=A9?= =?UTF-8?q?=E5=95=86=E5=93=81=E9=A1=B5=20sub=20=E6=94=B9=E4=B8=BA=20?= =?UTF-8?q?=E5=85=B1=20N=20=E4=B8=AA=E5=95=86=E5=93=81,=20M=20=E4=B8=AASKU?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/supplier/good/GoodListView.vue | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/modules/supplier/good/GoodListView.vue b/src/modules/supplier/good/GoodListView.vue index ca6f769..ae1e206 100644 --- a/src/modules/supplier/good/GoodListView.vue +++ b/src/modules/supplier/good/GoodListView.vue @@ -112,6 +112,9 @@ const selection = ref([]) // 状态统计 (与 tab 解耦, 只跟搜索条件关联 - 跨 tab 一致) const checkStats = reactive({ pending: 0, approved: 0, rejected: 0 }) +// W17.6: 商品总数 + SKU 总数 (实物商品下, 全量, 不分 checkStatus) +const counts = reactive({ goodCount: 0, skuCount: 0 }) + const filters = reactive({ title: '', enterpriseName: '', @@ -169,6 +172,18 @@ async function loadStats() { } } +// W17.6: 全量商品数 + 全量 SKU 数 (实物, type=1, 不分 checkStatus / 搜索) +async function loadCounts() { + try { + const r: any = await httpGet('/supplier/good/sku-count', { type: 1 }) + counts.goodCount = Number(r?.goodCount ?? 0) + counts.skuCount = Number(r?.skuCount ?? 0) + } catch { + counts.goodCount = 0 + counts.skuCount = 0 + } +} + async function load() { loading.value = true error.value = null @@ -210,8 +225,8 @@ async function load() { } } -function onSearch() { page.value = 1; Promise.all([load(), loadStats()]) } -function onReset() { filters.title = ''; filters.enterpriseName = ''; filters.checkStatus = ''; page.value = 1; Promise.all([load(), loadStats()]) } +function onSearch() { page.value = 1; Promise.all([load(), loadStats(), loadCounts()]) } +function onReset() { filters.title = ''; filters.enterpriseName = ''; filters.checkStatus = ''; page.value = 1; Promise.all([load(), loadStats(), loadCounts()]) } function onPageChange(p: number) { page.value = p; load() } function onLimitChange(l: number) { limit.value = l; page.value = 1; load() } function onSelectionChange(rows: Good[]) { selection.value = rows } @@ -317,12 +332,12 @@ function onDeleteBatch() { function onExport() { ElMessage.success('导出商品 (mock)') } function onAdd() { ElMessage.info('新增商品 (mock)') } -onMounted(() => Promise.all([load(), loadStats()])) +onMounted(() => Promise.all([load(), loadStats(), loadCounts()]))