fix: align appointment procurement and carpool workflows with agreed views

This commit is contained in:
2026-10-10 15:33:10 +08:00
parent 172cb05c78
commit 0cb8a5c2b2
18 changed files with 407 additions and 58 deletions
@@ -240,9 +240,26 @@ describe('procurement purchase node operations', () => {
const wrapper = render(fixture('CANCEL')); await open(wrapper); await explain(wrapper); await confirm(wrapper)
expect(sessionStorage.getItem(storageKey)).toBeNull(); expect(document.body.textContent).toContain('订单版本冲突'); expect(wrapper.emitted('changed')).toBeUndefined()
})
it('hides actions without permission and disables actions blocked by the server', async () => {
it('hides unauthorized actions and preserves blocked node reasons without a submit button', async () => {
let wrapper = render(fixture(), []); expect(wrapper.find('.purchase-actions button').exists()).toBe(false); wrapper.unmount()
wrapper = render(fixture('REVIEW', false)); expect(wrapper.find('.purchase-actions button').attributes('disabled')).toBeDefined()
wrapper = render(fixture('REVIEW', false))
expect(wrapper.find('.purchase-actions button').exists()).toBe(false)
expect(wrapper.find('details').text()).toContain('审核采购')
expect(wrapper.find('details').text()).toContain('业务条件不满足')
expect(submitProcurementCommand).not.toHaveBeenCalled()
})
it('keeps executable workflow actions in front and financial exceptions in a closed group', () => {
const detail = fixture('PURCHASE')
detail.actions.push(...fixture('FINANCE_ADJUST').actions, ...fixture('PACK', false).actions)
const wrapper = render(detail)
const primary = wrapper.get('[data-testid="current-procurement-actions"]')
expect(primary.text()).toContain('登记购买完成')
expect(primary.text()).not.toContain('费用更正与退款')
expect(primary.text()).not.toContain('保存装箱草稿')
const groups = wrapper.findAll('details')
expect(groups[0].text()).toContain('费用更正与退款')
expect(groups[0].attributes('open')).toBeUndefined()
expect(groups[1].text()).toContain('业务条件不满足')
})
it('prevents a second submit while the first command is pending', async () => {
let complete!: () => void; vi.mocked(submitProcurementCommand).mockImplementation(() => new Promise(resolve => { complete = resolve }))