feat(project): show business fields in statistics details
Reuse assignment business columns and keyword searches in the four statistics drill-down lists. Add a statistics-permission read endpoint sharing tenant-scoped detail queries without granting assignment access. Related to issue #13. Independent static review completed. User self-test arrangement: regression cases authored, no tests or builds executed.
This commit is contained in:
1 parent
f04e24186f
commit
fa5efa9629
7 files changed
+106
-8
No files matched your search
@@ -91,6 +91,11 @@ export const fetchAssignmentRecords = (params: Record<string, unknown>) =>
|
||||
url: `${base}/assignments/records`,
|
||||
params
|
||||
})
|
||||
export const fetchStatisticsRecords = (params: Record<string, unknown>) =>
|
||||
request.get<{ list: AssignmentRecord[]; total: number; statusCounts: Record<string, number> }>({
|
||||
url: `${base}/statistics/records`,
|
||||
params
|
||||
})
|
||||
export const previewAssignment = (data: ProjectRecord) =>
|
||||
request.post<{ records: ProjectRecord[] }>({ url: `${base}/assignments/preview`, data })
|
||||
export const saveAssignment = (data: ProjectRecord) =>
|
||||
|
||||
@@ -241,6 +241,7 @@
|
||||
bizLabels,
|
||||
fetchProjectRecords,
|
||||
fetchAssignmentRecords,
|
||||
fetchStatisticsRecords,
|
||||
previewAssignment,
|
||||
saveAssignment,
|
||||
fetchAssignmentHistory,
|
||||
@@ -274,12 +275,12 @@
|
||||
historyVisible = ref(false),
|
||||
historyRows = ref<ProjectRecord[]>([])
|
||||
const visibleColumns = computed(() =>
|
||||
props.assignment
|
||||
? assignmentColumns[query.bizType as AssignmentBizType]
|
||||
: [{ prop: 'bizNo', label: '单据编号', minWidth: 180 }]
|
||||
query.bizType === 'presign'
|
||||
? [{ prop: 'bizNo', label: '单据编号', minWidth: 180 }]
|
||||
: assignmentColumns[query.bizType]
|
||||
)
|
||||
const keywordHint = computed(() =>
|
||||
props.assignment ? assignmentKeywordHints[query.bizType as AssignmentBizType] : '请输入单据编号'
|
||||
query.bizType === 'presign' ? '请输入单据编号' : assignmentKeywordHints[query.bizType]
|
||||
)
|
||||
let loadVersion = 0
|
||||
function statusLabel(status: string) {
|
||||
@@ -306,7 +307,11 @@
|
||||
loadError.value = false
|
||||
rows.value = []
|
||||
try {
|
||||
const fetchRecords = props.assignment ? fetchAssignmentRecords : fetchProjectRecords
|
||||
const fetchRecords = props.assignment
|
||||
? fetchAssignmentRecords
|
||||
: query.bizType === 'presign'
|
||||
? fetchProjectRecords
|
||||
: fetchStatisticsRecords
|
||||
const result = await fetchRecords({
|
||||
...props.filters,
|
||||
...query,
|
||||
|
||||
Reference in new issue
Block a user