实现 M009 手工开票前端页面

This commit is contained in:
andy committed 2026-07-17 11:57:26 +07:00
1 parent 11478c6913
commit 72fee44a68
16 files changed
+2032 -3

No files matched your search

@@ -79,6 +79,18 @@ function createDebugMenu(): AuthMenuResult {
}
}
function createManualInvoiceMenu(): AuthMenuResult {
return {
menu_code: 'RESERVATION_MANUAL_INVOICE',
menu_name: '手工开票',
route_path: '/reservation/invoices/new',
component_key: 'ReservationManualInvoice',
icon_key: 'pi pi-file-pdf',
permission_code: 'RESERVATION_INVOICE_GENERATE',
sort_order: 25,
}
}
function createSystemMenu(): AuthMenuResult {
return {
menu_code: 'SYSTEM_SETTINGS',
@@ -120,6 +132,11 @@ async function mountShell(menus = [createReservationOrdersMenu(), createReservat
component: { template: '<div />' },
meta: { titleKey: 'debugEml.title' },
},
{
path: '/reservation/invoices/new',
component: { template: '<div />' },
meta: { titleKey: 'nav.manualInvoice' },
},
{
path: '/system',
component: { template: '<div />' },
@@ -175,6 +192,13 @@ describe('ReservationAppShell', () => {
expect(wrapper.text()).toContain('Debug EML')
})
it('shows Manual Invoice only when backend menus include it', async () => {
const wrapper = await mountShell([createReservationOrdersMenu(), createManualInvoiceMenu()])
expect(wrapper.find('a[href="/reservation/invoices/new"]').exists()).toBe(true)
expect(wrapper.text()).toContain('手工开票')
})
it('shows System Settings only when backend menus include it', async () => {
const wrapper = await mountShell([createReservationOrdersMenu(), createSystemMenu()])