style(admin): unify dialog layouts and dense readonly presentation

This commit is contained in:
2026-10-20 10:11:31 +08:00
parent 7ff7c9914f
commit 3267679758
214 changed files with 10931 additions and 2654 deletions
@@ -56,18 +56,18 @@ describe('DeliveryOrdersView permissions and commands', () => {
await wrapper.findAll('button').find(button => button.text().includes('编辑状态'))!.trigger('click')
await flushPromises()
await wrapper.find('[data-dialog="编辑派送状态"] select').setValue('DELIVERING')
await wrapper.find('[data-dialog="编辑派送状态"] .dialog-confirm').trigger('click')
await wrapper.find('[data-dialog^="编辑派送状态"] select').setValue('DELIVERING')
await wrapper.find('[data-dialog^="编辑派送状态"] .dialog-confirm').trigger('click')
await flushPromises()
expect(updateDeliveryOrderStatus).toHaveBeenCalledWith('DEL/1', '100', { status: 'DELIVERING', expectedVersion: 7, remark: undefined })
await wrapper.findAll('button').find(button => button.text().includes('标记退货'))!.trigger('click')
await flushPromises()
expect(listDeliveryReturnInboundOptions).toHaveBeenCalledWith('DEL/1', '100')
await wrapper.find('[data-dialog="标记退货"] textarea').setValue(' 客户拒收 ')
await wrapper.find('[data-dialog="标记退货"] input[type="checkbox"]').setValue(true)
await wrapper.find('[data-dialog="标记退货"] input[type="number"]').setValue(2)
await wrapper.find('[data-dialog="标记退货"] .dialog-confirm').trigger('click')
await wrapper.find('[data-dialog^="标记退货"] textarea').setValue(' 客户拒收 ')
await wrapper.find('[data-dialog^="标记退货"] input[type="checkbox"]').setValue(true)
await wrapper.find('[data-dialog^="标记退货"] input[type="number"]').setValue(2)
await wrapper.find('[data-dialog^="标记退货"] .dialog-confirm').trigger('click')
await flushPromises()
expect(markDeliveryReturn).toHaveBeenCalledWith('DEL/1', '100', {
lastMileOrderId: '109', reason: '客户拒收', returnDirection: 'OVERSEAS_WAREHOUSE',
@@ -83,7 +83,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
await flushPromises()
await wrapper.findAll('button').find(button => button.text().includes('标记退货'))!.trigger('click')
await flushPromises()
await wrapper.find('[data-dialog="标记退货"] .dialog-confirm').trigger('click')
await wrapper.find('[data-dialog^="标记退货"] .dialog-confirm').trigger('click')
expect(markDeliveryReturn).not.toHaveBeenCalled()
wrapper.unmount()
})
@@ -94,16 +94,16 @@ describe('DeliveryOrdersView permissions and commands', () => {
await flushPromises()
await wrapper.findAll('button').find(button => button.text().includes('编辑状态'))!.trigger('click')
await flushPromises()
const select = wrapper.find('[data-dialog="编辑派送状态"] select')
const select = wrapper.find('[data-dialog^="编辑派送状态"] select')
expect(select.find('option[value="DELIVERING"]').text()).toBe('派送中')
expect(select.find('option[value="DELIVERED"]').exists()).toBe(false)
expect(select.find('option[value="WAIT_DELIVERY"]').exists()).toBe(false)
expect(select.find('option[value="CANCELLED"]').exists()).toBe(false)
await select.setValue('DELIVERING')
await wrapper.find('[data-dialog="编辑派送状态"] textarea').setValue('123')
await wrapper.find('[data-dialog^="编辑派送状态"] textarea').setValue('123')
let reject!: (error: unknown) => void
vi.mocked(updateDeliveryOrderStatus).mockReturnValueOnce(new Promise((_resolve, rejectRequest) => { reject = rejectRequest }))
const button = wrapper.find('[data-dialog="编辑派送状态"] .dialog-confirm')
const button = wrapper.find('[data-dialog^="编辑派送状态"] .dialog-confirm')
await button.trigger('click'); await button.trigger('click')
expect(updateDeliveryOrderStatus).toHaveBeenCalledTimes(1)
expect(updateDeliveryOrderStatus).toHaveBeenCalledWith('DEL/1', '100', { status: 'DELIVERING', expectedVersion: 7, remark: '123' })
@@ -155,7 +155,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
vi.mocked(listDeliveryReturnInboundOptions).mockResolvedValue([{ lastMileOrderId: '9007199254741299', lastMileOrderNo: 'LM-RETURN-1', inboundOrderId: null, inboundCode: null, customerId: '100', returnSources: [{ outboundPalletItemId: '9007199254740995', inventoryPositionId: null, returnCartonId: '9007199254740997', cartonMark: 'RETURN-CARTON-1', maxReturnPackages: 1 }] }])
const wrapper = mountView(); await flushPromises()
await wrapper.findAll('button').find(button => button.text() === '标记退货')!.trigger('click'); await flushPromises()
const dialog = wrapper.get('[data-dialog="标记退货"]')
const dialog = wrapper.get('[data-dialog^="标记退货"]')
expect(dialog.text()).toContain('原退货箱 RETURN-CARTON-1(整箱退回)')
expect(dialog.text()).toContain('LM-RETURN-1 · 无普通入仓关联')
expect(dialog.text()).not.toContain('9007199254741299')
@@ -175,7 +175,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
const wrapper = mountView(); await flushPromises()
try {
await wrapper.findAll('button').find(button => button.text() === '标记退货')!.trigger('click'); await flushPromises()
const dialog = wrapper.get('[data-dialog="标记退货"]')
const dialog = wrapper.get('[data-dialog^="标记退货"]')
expect(dialog.text()).toContain('LM-RELABEL-1 · 无普通入仓关联')
expect(dialog.text()).not.toContain('9007199254741300')
await dialog.get('textarea').setValue('换标主单拒收')
@@ -198,7 +198,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
const wrapper = mountView(); await flushPromises()
try {
await wrapper.findAll('button').find(button => button.text() === '标记退货')!.trigger('click'); await flushPromises()
const dialog = wrapper.get('[data-dialog="标记退货"]')
const dialog = wrapper.get('[data-dialog^="标记退货"]')
const masterSelect = dialog.get('select')
expect(masterSelect.findAll('option').map(option => option.attributes('value'))).toEqual(['109', '110'])
await masterSelect.setValue('109')
@@ -224,7 +224,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
const wrapper = mountView(); await flushPromises()
try {
await wrapper.findAll('button').find(button => button.text() === '标记退货')!.trigger('click'); await flushPromises()
const dialog = wrapper.get('[data-dialog="标记退货"]')
const dialog = wrapper.get('[data-dialog^="标记退货"]')
await dialog.get('textarea').setValue('拒收')
const state = wrapper.vm as unknown as { returnItems: Array<typeof ownCarton & { selected: boolean; packageCount: number }> }
state.returnItems = [{ ...ownCarton, returnCartonId: '22', cartonMark: 'FOREIGN-CARTON', selected: true, packageCount: 1 }]
@@ -239,7 +239,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
const wrapper = mountView(); await flushPromises()
try {
await wrapper.findAll('button').find(button => button.text().includes('标记退货'))!.trigger('click'); await flushPromises()
const dialog = wrapper.find('[data-dialog="标记退货"]')
const dialog = wrapper.find('[data-dialog^="标记退货"]')
expect(dialog.text()).toContain('PL-1 · SKU-1(最多 3 箱)')
expect(dialog.text()).not.toContain('9007199254740995')
expect(dialog.text()).not.toContain('可自由填写')
@@ -278,7 +278,7 @@ describe('DeliveryOrdersView permissions and commands', () => {
const wrapper = mountView(); await flushPromises()
try {
await wrapper.findAll('button').find(button => button.text().includes('标记退货'))!.trigger('click'); await flushPromises()
const dialog = wrapper.find('[data-dialog="标记退货"]')
const dialog = wrapper.find('[data-dialog^="标记退货"]')
await dialog.find('select').setValue('109')
await dialog.find('input[type="checkbox"]').setValue(true)
await dialog.find('input[type="number"]').setValue(2)