Frontend Route Map

1. Router Definition (frontend/src/router/index.js)

Routes

PathNameComponentMeta
/loginLoginpages/LoginPage.vue{ guest: true }
/ (layout parent)views/Layout.vue{ auth: true }
/ (child)Dashboardpages/DashboardPage.vue
/uploadUploadpages/UploadPage.vue{ roles: ['employee', 'admin'] }
/ordersOrderListpages/OrderListPage.vue
/orders/:idOrderDetailpages/OrderDetailPage.vue
/adminAdminPanelpages/AdminPanelPage.vue{ roles: ['admin'] }
/benchmarkBenchmarkpages/BenchmarkPage.vue (NOT YET CREATED)

router.beforeEach Guard (lines 57-78)

1. if (to.meta.auth && !authStore.user) → redirect to /login
2. if (to.meta.guest && authStore.user) → redirect to / (Dashboard)
3. if (to.meta.roles && authStore.user && !to.meta.roles.includes(authStore.user.role)) → redirect to / (Dashboard)
4. else → next()

2. Page-by-Page API Endpoint Calls

LoginPage.vue

TriggerEndpointMethodBody
handleLogin()/api/auth/loginPOST{ name, password }

— No status checks, no mode checks, no task_type checks.


DashboardPage.vue

TriggerEndpointMethod
onMounted/api/stats?GET
Tab switchFilters displayOrders client-side by order.status

Status values used: uploading, processing, draft, pending_employee_review, employee_reviewed, pending_operator_review, operator_reviewed, imported, rejected, pending_retake

Pipeline keys: processing, pending_employee_review, pending_operator_review, operator_reviewed, imported

Mode checks: None. Task type checks: None.


UploadPage.vue

TriggerEndpointMethodBody
handleUpload()/api/ocr/uploadPOSTFormData: files[], remark, employee_id, busno, store_name

— On success → redirect to /orders after 1.2s. — No status/mode/task_type checks.


OrderListPage.vue

TriggerEndpointMethodParams
fetchOrders()/api/ordersGET?page=, ?per_page=20, ?status=, ?q=

Status tabs: all, pending_employee_review, pending_operator_review, operator_reviewed, imported

Role-aware default tab: employee→pending_employee_review, operator→pending_operator_review, others→all

canAct() check:

  • employee: o.status === 'pending_employee_review'
  • operator: o.status === 'pending_operator_review'
  • admin: all

OrderDetailPage.vue

Data Loading

fetchOrder()GET /api/orders/:id

Mode Computation

  • status in ['processing', 'uploading']readonly
  • status 'pending_employee_review' or 'draft' + role employee/admincorrect
  • status 'pending_operator_review' + role operator/adminreview
  • all others → readonly

Employee Correction (mode === ‘correct’)

APIMethodWhen
/api/items/:idPUTsubmitReview() — per-item save
/api/orders/:id/submit-employeePOSTsubmitReview() — final submit
localStorage ocr-draft-{id}saveDraft() — auto-save

Operator Review (mode === ‘review’)

APIMethodWhen
/api/orders/:id/supplier-recommendGETloadSupplierRecommend()
/api/orders/:idPUTonSupplierChange() — update supplier
/api/orders/:id/approvePOSTapproveOrder()
/api/orders/:id/rejectPOSTrejectOrder()
/api/items/batch-matchPUTopenBatchMatch()
/api/orders/:id/splitPOSTdoSplit()

Admin Operations

APIMethodWhen
/api/orders/:idPUTresetOrder() → status 'pending_employee_review'
/api/orders/:idDELETEconfirmDelete()
/api/ocr/retake/:idPOSTdoRetake()

Sub-components API

ComponentAPIMethod
ItemReviewCard.vue/api/products/search?q=GET
MatchDialog.vue/api/products/search?q=GET
CorrectionCard.vue/api/products/search?q=GET

AdminPanelPage.vue

APIMethod
/api/stats/adminGET
/api/ordersGET
/api/orders/:idDELETE

Layout.vue

APIMethod
/api/statsGET

LogFloatingPanel.vue

APIMethodParams
/api/system/logsGET?name=app|ocr|match&lines=200

3. Mode Checks

PageModeCondition
OrderDetailPage.vuecorrectstatus ∈ {pending_employee_review, draft} + role employee/admin
OrderDetailPage.vuereviewstatus === pending_operator_review + role operator/admin
OrderDetailPage.vuereadonlyAll other statuses
ItemTable.vuevia propPassed from parent

4. Task Type Checks

None found. No task_type variable or checks exist anywhere in the frontend.

5. Complete API Endpoint Catalog

EndpointMethodsUsed By
/api/auth/loginPOSTLoginPage.vue
/api/statsGETLayout.vue, DashboardPage.vue
/api/stats/adminGETAdminPanelPage.vue
/api/ordersGETOrderListPage.vue, AdminPanelPage.vue
/api/orders/:idGET, PUT, DELETEOrderDetailPage.vue, AdminPanelPage.vue
/api/orders/:id/approvePOSTOrderDetailPage.vue
/api/orders/:id/rejectPOSTOrderDetailPage.vue
/api/orders/:id/submit-employeePOSTOrderDetailPage.vue
/api/orders/:id/splitPOSTOrderDetailPage.vue
/api/orders/:id/supplier-recommendGETOrderDetailPage.vue
/api/items/:idPUTOrderDetailPage.vue
/api/items/batch-matchPUTOrderDetailPage.vue
/api/products/search?q=GETCorrectionCard, MatchDialog, ItemReviewCard
/api/ocr/uploadPOSTUploadPage.vue
/api/ocr/retake/:idPOSTOrderDetailPage.vue
/api/system/logsGETLogFloatingPanel.vue, LogViewer.vue