调整预订事项字段展示与基础信息编辑

This commit is contained in:
andy
2026-07-22 10:34:26 +07:00
parent 08c8b0165b
commit 891a4aa6cf
10 changed files with 212 additions and 65 deletions

View File

@@ -115,8 +115,21 @@ describe('reservation V4 pages', () => {
await wrapper.find('select').setValue('ACC-LIVE')
await flushPromises()
expect(wrapper.text()).toContain('LEISURE')
expect(wrapper.text()).toContain('TRAVEL_AGENT')
const basicCard = wrapper.findAll('.task-card-section')[0]!
expect(basicCard.find('.v4-field__label em').exists()).toBe(false)
expect(basicCard.text()).not.toContain('Market 由 Account Code 派生')
expect(basicCard.text()).not.toContain('Source 由 Account Code 派生')
expect(basicCard.text()).not.toContain('选择后会带出市场')
const marketField = findFieldByLabel(basicCard, '市场代码')
const sourceField = findFieldByLabel(basicCard, '来源代码')
expect(marketField?.find('input[name="/basic_information/market_code"]').exists()).toBe(true)
expect(sourceField?.find('input[name="/basic_information/source_code"]').exists()).toBe(true)
expect((marketField?.find('input[name="/basic_information/market_code"]').element as HTMLInputElement).value)
.toBe('LEISURE')
expect((sourceField?.find('input[name="/basic_information/source_code"]').element as HTMLInputElement).value)
.toBe('TRAVEL_AGENT')
await marketField?.find('input[name="/basic_information/market_code"]').setValue('MICE')
await sourceField?.find('input[name="/basic_information/source_code"]').setValue('DIRECT')
await wrapper.findAll('button').find((button) => button.text().includes('确认卡片'))?.trigger('click')
await flushPromises()
@@ -125,6 +138,8 @@ describe('reservation V4 pages', () => {
confirmed_payload: {
basic_information: {
account_code: 'ACC-LIVE',
market_code: 'MICE',
source_code: 'DIRECT',
},
},
})
@@ -830,6 +845,9 @@ describe('reservation V4 pages', () => {
expect(roomCard.text()).not.toContain('target_order')
expect(roomCard.text()).not.toContain('Adult')
expect(roomCard.text()).not.toContain('Legacy Room Type')
expect(roomCard.text()).not.toContain('Group Block Name')
expect(roomCard.text()).not.toContain('Rate Code')
expect(roomCard.text()).not.toContain('Group Booking Status')
expect(roomCard.find('input[name="/room_information/final_values/adult"]').exists()).toBe(false)
expect(roomCard.find('input[name="/room_information/final_values/nights"]').exists()).toBe(false)
expect(roomCard.find('input[name="/room_information/final_values/target_order/locator_value"]').exists()).toBe(false)
@@ -1194,7 +1212,7 @@ describe('reservation V4 pages', () => {
)
await flushPromises()
expect(wrapper.text()).toContain(zhCN.taskV4.lookup.empty)
expect(wrapper.text()).not.toContain(zhCN.taskV4.lookup.empty)
expect(wrapper.text()).not.toContain(zhCN.taskV4.lookup.stale)
expect(wrapper.text()).not.toContain('PMS sync is stale')
expect(wrapper.text()).not.toContain('PMS_SYNC')
@@ -1307,9 +1325,6 @@ describe('reservation V4 pages', () => {
page_num: 1,
page_size: 20,
})
expect(wrapper.text()).toContain('MICE')
expect(wrapper.text()).toContain('DIRECT')
await wrapper.findAll('button').find((button) => button.text().includes('确认卡片'))?.trigger('click')
await flushPromises()
@@ -1318,6 +1333,8 @@ describe('reservation V4 pages', () => {
confirmed_payload: {
basic_information: {
account_code: 'ACC-101',
market_code: 'LEISURE',
source_code: 'TRAVEL_AGENT',
},
},
})
@@ -1347,7 +1364,7 @@ describe('reservation V4 pages', () => {
)
await flushPromises()
expect(wrapper.text()).toContain(zhCN.taskV4.lookup.empty)
expect(wrapper.text()).not.toContain(zhCN.taskV4.lookup.empty)
expect(wrapper.text()).not.toContain('固定种子初始化')
expect(wrapper.text()).not.toContain('真实 PMS')
expect(wrapper.text()).not.toContain('PMS_SYNC')
@@ -1582,6 +1599,8 @@ function createOrderTaskDetail(options: {
businessFields?: ReservationV4TaskCardResult['fields']
sourceDisplayPayload?: ReservationV4TaskCardResult['display_payload']
basicAccountValue?: string
basicMarketCodeValue?: string
basicSourceCodeValue?: string
basicAccountRequired?: boolean
} = {}): ReservationV4OrderTaskDetailResult {
const sourceCard = createCard('card-source', 'SOURCE_MESSAGE_DISPLAY', 'READONLY', {
@@ -1609,6 +1628,26 @@ function createOrderTaskDetail(options: {
options_source: 'RESERVATION_V4_ACCOUNT_CATALOG',
control_type: 'SELECT',
}),
createField('/basic_information/market_code', {
display_name: 'Market Code',
value: options.basicMarketCodeValue ?? 'LEISURE',
editable: false,
raw_readonly: true,
control_type: 'READONLY',
edit_scope: 'NEVER',
write_target: 'NONE',
control_hint: 'Market 由 Account Code 派生,前端只读展示。',
}),
createField('/basic_information/source_code', {
display_name: 'Source Code',
value: options.basicSourceCodeValue ?? 'TRAVEL_AGENT',
editable: false,
raw_readonly: true,
control_type: 'READONLY',
edit_scope: 'NEVER',
write_target: 'NONE',
control_hint: 'Source 由 Account Code 派生,前端只读展示。',
}),
createField('/basic_information/read_only_marker', {
display_name: 'Read only marker',
value: 'VISIBLE',