fix(web-admin): 隐藏生产/质检中试服务 Tab 并从「所有」排除 (#160)
客户已下线中试业务:侧栏不再展示中试 Tab,前端在「所有」列表过滤出库中试数据(含 bizType 缺省)。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
85fe63fa9f
commit
8349b0ce73
8 files changed
+115
-18
No files matched your search
+11
-2
@@ -22,6 +22,7 @@ import {
|
||||
isAllProductionWorkOrderTab,
|
||||
tabSupportsInactiveProtocolFilter,
|
||||
resolveTabKeyFromWorkOrder,
|
||||
workOrderMatchesTab,
|
||||
type ProductionWorkOrderTabKey
|
||||
} from '@/utils/production-work-order-tabs'
|
||||
import { toAllTabListQuery } from '@/utils/production-work-order-category'
|
||||
@@ -164,8 +165,16 @@ export function useProductionWorkOrderTabPage(
|
||||
...listQuery,
|
||||
...buildPlannedStartTimeParams()
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
const rawList = res.list || []
|
||||
const list = isAllProductionWorkOrderTab(tabKey.value)
|
||||
? rawList.filter((row) => workOrderMatchesTab(row, 'all'))
|
||||
: rawList
|
||||
tableData.value = list
|
||||
// 「所有」前端排除中试时,按本页剔除量修正 total(后端未改)
|
||||
pagination.total = Math.max(
|
||||
0,
|
||||
(res.total ?? 0) - (rawList.length - list.length)
|
||||
)
|
||||
selectedRows.value = selectedRows.value.filter((row) =>
|
||||
tableData.value.some((item) => item.id === row.id)
|
||||
)
|
||||
|
||||
+7
-2
@@ -20,6 +20,7 @@ import {
|
||||
isAllQcWorkOrderTab,
|
||||
isInboundSampleQcTab,
|
||||
resolveTabKeyFromWorkOrder,
|
||||
workOrderMatchesTab,
|
||||
type QcWorkOrderTabKey
|
||||
} from '@/utils/qc-work-order-tabs'
|
||||
import { toAllTabListQuery } from '@/utils/qc-work-order-category'
|
||||
@@ -210,7 +211,10 @@ export function useQcWorkOrderTabPage(
|
||||
...listQuery,
|
||||
...timeParams
|
||||
})
|
||||
const list = res.list || []
|
||||
const rawList = res.list || []
|
||||
const list = isAllQcWorkOrderTab(tabKey.value)
|
||||
? rawList.filter((row) => workOrderMatchesTab(row, 'all'))
|
||||
: rawList
|
||||
const ids = list.map((row) => row.id).filter(Boolean)
|
||||
const batchMap = ids.length
|
||||
? (await fetchQcInspectionBatchesBatch(ids).catch(() => ({}))) || {}
|
||||
@@ -218,7 +222,8 @@ export function useQcWorkOrderTabPage(
|
||||
// 先写入批次摘要,再渲染卡片,避免子组件在 preset 未就绪时逐条请求 inspection-batches
|
||||
presetBatchesByWorkOrderId.value = batchMap
|
||||
tableData.value = list
|
||||
pagination.total = res.total ?? 0
|
||||
// 「所有」前端排除中试时,按本页剔除量修正 total(后端未改)
|
||||
pagination.total = Math.max(0, (res.total ?? 0) - (rawList.length - list.length))
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user