调整订单列表待处理数量口径

This commit is contained in:
andy
2026-07-20 12:05:54 +07:00
parent d7b24cbef7
commit c5244bc652
12 changed files with 149 additions and 14 deletions

View File

@@ -295,7 +295,7 @@ export default {
columns: {
order: 'Order',
status: 'Status',
openTasks: 'Open tasks',
openTasks: 'Open work',
createdAt: 'Created at',
},
},

View File

@@ -295,7 +295,7 @@ export default {
columns: {
order: 'ออเดอร์',
status: 'สถานะ',
openTasks: 'งานที่ยังไม่ปิด',
openTasks: 'งานค้าง',
createdAt: 'เวลาสร้าง',
},
},

View File

@@ -295,7 +295,7 @@ export default {
columns: {
order: '订单',
status: '状态',
openTasks: '未关闭任务',
openTasks: '待处理',
createdAt: '创建时间',
},
},

View File

@@ -390,6 +390,7 @@ describe('reservationService real API mode', () => {
group_code: 'GRP-001',
display_name: 'GRP-001',
open_task_count: 2,
open_work_item_count: 1,
next_processable_task_id: '10002',
next_v4_order_task_id: '9001',
next_v4_action_card_id: '9101',
@@ -420,6 +421,7 @@ describe('reservationService real API mode', () => {
)
expect(result.items[0]?.display_order_key).toBe('GRP-001')
expect(result.items[0]?.next_processable_task_id).toBe('10002')
expect(result.items[0]?.open_work_item_count).toBe(1)
expect(result.items[0]?.next_v4_order_task_id).toBe('9001')
expect(result.items[0]?.next_v4_action_type).toBe('REVIEW')
expect(result.items[0]?.next_v4_action_status).toBe('REVIEW_REQUIRED')

View File

@@ -180,6 +180,7 @@ function createOrderCandidate(overrides: Partial<ReservationOrderListItem> = {})
group_code: 'GRP-001',
display_name: 'GRP-001',
open_task_count: 1,
open_work_item_count: 1,
next_processable_task_id: null,
created_at: '2026-07-08T03:00:00Z',
updated_at: '2026-07-08T03:10:00Z',

View File

@@ -53,6 +53,7 @@ function createOrderListResult(
group_code: displayOrderKey,
display_name: displayOrderKey,
open_task_count: 2,
open_work_item_count: 2,
next_processable_task_id: '10002',
created_at: '2026-07-08T03:00:00Z',
updated_at: '2026-07-08T03:10:00Z',
@@ -516,6 +517,29 @@ describe('reservation P0 views', () => {
expect(wrapper.text()).not.toContain('接口待接入')
})
it('shows the backend unified open work item count in the order list', async () => {
vi.mocked(service.fetchReservationOrders).mockResolvedValue(createOrderListResult('GRP-001', {
page_num: 1,
page_size: 20,
total: 1,
}, {
open_task_count: 99,
v4_open_order_task_count: 88,
open_work_item_count: 3,
}))
const wrapper = await mountWithPlugins(ReservationOrderListView)
await vi.dynamicImportSettled()
const headers = wrapper.findAll('thead th').map((header) => header.text())
const cells = wrapper.findAll('tbody td').map((cell) => cell.text())
expect(headers).toContain('待处理')
expect(cells[1]).toBe('3')
expect(cells[1]).not.toContain('99')
expect(cells[1]).not.toContain('88')
})
it('routes continue action to the V4 order task when the backend returns next_v4_order_task_id', async () => {
vi.mocked(service.fetchReservationOrders).mockResolvedValue(createOrderListResult('GRP-001', {
page_num: 1,
@@ -576,6 +600,7 @@ describe('reservation P0 views', () => {
total: 1,
}, {
open_task_count: 0,
open_work_item_count: 0,
next_processable_task_id: null,
next_v4_order_task_id: null,
next_v4_action_card_id: null,

View File

@@ -71,6 +71,7 @@ export interface ReservationOrderListItem {
group_code: string | null
display_name: string
open_task_count: number | null
open_work_item_count: number | null
next_processable_task_id: string | null
next_v4_order_task_id?: string | null
next_v4_action_card_id?: string | null

View File

@@ -108,6 +108,7 @@
<thead>
<tr>
<th>{{ t('orderList.columns.order') }}</th>
<th>{{ t('orderList.columns.openTasks') }}</th>
<th>{{ t('orderList.columns.createdAt') }}</th>
<th>{{ t('workbench.columns.updatedAt') }}</th>
<th>{{ t('workbench.columns.operation') }}</th>
@@ -121,6 +122,9 @@
<td>
<strong>{{ formatOrderKey(order) }}</strong>
</td>
<td class="open-count-cell">
{{ formatOpenWorkItemCount(order) }}
</td>
<td>{{ formatReservationDateTime(order.created_at) }}</td>
<td>{{ formatReservationDateTime(order.updated_at) }}</td>
<td>
@@ -309,6 +313,13 @@ function formatOrderKey(order: ReservationOrderListItem): string {
)
}
function formatOpenWorkItemCount(order: ReservationOrderListItem): string {
if (typeof order.open_work_item_count !== 'number') {
return '-'
}
return String(order.open_work_item_count)
}
function resolveContinueTarget(order: ReservationOrderListItem): string | null {
if (order.next_v4_order_task_id) {
return `/reservation/order-tasks/${order.next_v4_order_task_id}`
@@ -476,6 +487,12 @@ td small {
font-size: 12px;
}
.open-count-cell {
color: var(--th-color-slate-900);
font-size: 15px;
font-weight: 800;
}
.row-actions {
display: flex;
flex-wrap: wrap;