| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- import type { RouteRecordRaw } from 'vue-router';
- import AppLayout from '@/layout/AppLayout.vue';
- import type { UserRole } from '@/types/page';
- const allRoles: UserRole[] = ['admin', 'manager', 'operator', 'procurement', 'warehouse', 'customer_service'];
- export const routes: RouteRecordRaw[] = [
- {
- path: '/login',
- name: 'login',
- component: () => import('@/views/auth/LoginView.vue'),
- meta: { public: true, title: '登录' }
- },
- {
- path: '/',
- component: AppLayout,
- redirect: '/report/dashboard',
- meta: { requiresAuth: true },
- children: [
- {
- path: '/report/dashboard',
- name: 'report-dashboard',
- component: () => import('@/views/dashboard/ReportDashboardView.vue'),
- meta: { title: '运营看板', pageKey: 'report-dashboard', roles: ['admin', 'manager', 'operator', 'procurement'] }
- },
- {
- path: '/report/center',
- name: 'report-center',
- component: () => import('@/views/report/ReportCenterView.vue'),
- meta: { title: '报表中心', pageKey: 'report-center', roles: ['admin', 'manager', 'operator', 'procurement'] }
- },
- {
- path: '/product/list',
- name: 'product-list',
- component: () => import('@/views/product/ProductListView.vue'),
- meta: { title: '商品列表', pageKey: 'product-list', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/product/editor',
- name: 'product-editor',
- component: () => import('@/views/product/ProductEditorView.vue'),
- meta: { title: '商品新建/编辑', pageKey: 'product-editor', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/product/mapping',
- name: 'product-mapping',
- component: () => import('@/views/product/ProductMappingView.vue'),
- meta: { title: '渠道映射', pageKey: 'product-mapping', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/product/pricing',
- name: 'product-pricing',
- component: () => import('@/views/product/ProductPricingView.vue'),
- meta: { title: '定价与库存规则', pageKey: 'product-pricing', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/order/list',
- name: 'order-list',
- component: () => import('@/views/order/OrderListView.vue'),
- meta: { title: '订单列表', pageKey: 'order-list', roles: ['admin', 'manager', 'operator', 'customer_service', 'warehouse'] }
- },
- {
- path: '/order/detail',
- name: 'order-detail',
- component: () => import('@/views/order/OrderDetailView.vue'),
- meta: { title: '订单详情/处理', pageKey: 'order-detail', roles: ['admin', 'manager', 'operator', 'customer_service', 'warehouse'] }
- },
- {
- path: '/order/after-sale',
- name: 'order-after-sale',
- component: () => import('@/views/order/OrderAfterSaleView.vue'),
- meta: { title: '售后处理', pageKey: 'order-after-sale', roles: ['admin', 'manager', 'operator', 'customer_service'] }
- },
- {
- path: '/supplier/list',
- name: 'supplier-list',
- component: () => import('@/views/supplier/SupplierListView.vue'),
- meta: { title: '供应商管理', pageKey: 'supplier-list', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/supplier/purchase-orders',
- name: 'purchase-orders',
- component: () => import('@/views/supplier/PurchaseOrderView.vue'),
- meta: { title: '采购单管理', pageKey: 'purchase-orders', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/supplier/capability',
- name: 'supply-capability',
- component: () => import('@/views/supplier/SupplyCapabilityView.vue'),
- meta: { title: '供货能力配置', pageKey: 'supply-capability', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/channel/config',
- name: 'channel-config',
- component: () => import('@/views/channel/ChannelConfigView.vue'),
- meta: { title: '渠道接入配置', pageKey: 'channel-config', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/inventory/overview',
- name: 'inventory-overview',
- component: () => import('@/views/inventory/InventoryOverviewView.vue'),
- meta: { title: '库存总览', pageKey: 'inventory-overview', roles: ['admin', 'manager', 'operator', 'procurement', 'warehouse'] }
- },
- {
- path: '/inventory/shipping',
- name: 'shipping-work',
- component: () => import('@/views/inventory/ShippingWorkView.vue'),
- meta: { title: '发货作业', pageKey: 'shipping-work', roles: ['admin', 'manager', 'warehouse'] }
- },
- {
- path: '/inventory/logs',
- name: 'inventory-logs',
- component: () => import('@/views/warehouse/InventoryLogView.vue'),
- meta: { title: '库存变动记录', pageKey: 'inventory-logs', roles: ['admin', 'manager', 'operator', 'warehouse'] }
- },
- {
- path: '/warehouse/manage',
- name: 'warehouse-manage',
- component: () => import('@/views/warehouse/WarehouseView.vue'),
- meta: { title: '仓库管理', pageKey: 'warehouse-manage', roles: ['admin', 'manager'] }
- },
- {
- path: '/logistics/providers',
- name: 'logistics-providers',
- component: () => import('@/views/logistics/LogisticsProviderView.vue'),
- meta: { title: '物流商配置', pageKey: 'logistics-providers', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/logistics/templates',
- name: 'shipping-templates',
- component: () => import('@/views/logistics/ShippingTemplateView.vue'),
- meta: { title: '运费模板', pageKey: 'shipping-templates', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/finance/payments',
- name: 'finance-payments',
- component: () => import('@/views/finance/PaymentView.vue'),
- meta: { title: '收款管理', pageKey: 'finance-payments', roles: ['admin', 'manager', 'finance'] }
- },
- {
- path: '/procurement/replenishment',
- name: 'replenishment-plan',
- component: () => import('@/views/procurement/ReplenishmentPlanView.vue'),
- meta: { title: '备货计划', pageKey: 'replenishment-plan', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/crm/tickets',
- name: 'crm-tickets',
- component: () => import('@/views/crm/TicketView.vue'),
- meta: { title: '工单管理', pageKey: 'crm-tickets', roles: ['admin', 'manager', 'customer_service'] }
- },
- {
- path: '/system/roles',
- name: 'role-permission',
- component: () => import('@/views/system/RolePermissionView.vue'),
- meta: { title: '角色权限', pageKey: 'role-permission', roles: ['admin'] }
- },
- {
- path: '/system/logs',
- name: 'operation-log',
- component: () => import('@/views/system/OperationLogView.vue'),
- meta: { title: '操作日志', pageKey: 'operation-log', roles: ['admin', 'manager'] }
- },
- {
- path: '/system/api-keys',
- name: 'api-key',
- component: () => import('@/views/system/ApiKeyView.vue'),
- meta: { title: 'API Key 管理', pageKey: 'api-key', roles: ['admin'] }
- },
- {
- path: '/warehouse/return-package',
- name: 'return-package',
- component: () => import('@/views/warehouse/ReturnPackageView.vue'),
- meta: { title: '退件管理', pageKey: 'return-package', roles: ['admin', 'manager', 'warehouse'] }
- },
- {
- path: '/finance/refund',
- name: 'finance-refund',
- component: () => import('@/views/finance/RefundView.vue'),
- meta: { title: '退款管理', pageKey: 'finance-refund', roles: ['admin', 'manager', 'finance'] }
- },
- {
- path: '/finance/settlement',
- name: 'supplier-settlement',
- component: () => import('@/views/finance/SupplierSettlementView.vue'),
- meta: { title: '供应商结算', pageKey: 'supplier-settlement', roles: ['admin', 'manager', 'finance'] }
- },
- {
- path: '/marketing/promotion',
- name: 'marketing-promotion',
- component: () => import('@/views/marketing/PromotionView.vue'),
- meta: { title: '促销活动', pageKey: 'marketing-promotion', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/report/inventory-turnover',
- name: 'inventory-turnover',
- component: () => import('@/views/report/InventoryTurnoverView.vue'),
- meta: { title: '库存周转分析', pageKey: 'inventory-turnover', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/procurement/purchase-request',
- name: 'purchase-request',
- component: () => import('@/views/procurement/PurchaseRequestView.vue'),
- meta: { title: '采购需求申请', pageKey: 'purchase-request', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/procurement/iqc',
- name: 'procurement-iqc',
- component: () => import('@/views/procurement/IQCView.vue'),
- meta: { title: '来料质检', pageKey: 'procurement-iqc', roles: ['admin', 'manager', 'procurement', 'warehouse'] }
- },
- {
- path: '/system/notification',
- name: 'system-notification',
- component: () => import('@/views/system/NotificationView.vue'),
- meta: { title: '消息中心', pageKey: 'system-notification', roles: ['admin', 'manager'] }
- },
- {
- path: '/system/message-template',
- name: 'message-template',
- component: () => import('@/views/system/MessageTemplateView.vue'),
- meta: { title: '消息模板', pageKey: 'message-template', roles: ['admin', 'manager'] }
- },
- {
- path: '/system/approval-flow',
- name: 'approval-flow',
- component: () => import('@/views/system/ApprovalFlowView.vue'),
- meta: { title: '审批流程', pageKey: 'approval-flow', roles: ['admin'] }
- },
- {
- path: '/finance/invoice',
- name: 'finance-invoice',
- component: () => import('@/views/finance/InvoiceView.vue'),
- meta: { title: '发票管理', pageKey: 'finance-invoice', roles: ['admin', 'manager', 'finance'] }
- },
- {
- path: '/marketing/coupon',
- name: 'marketing-coupon',
- component: () => import('@/views/marketing/CouponView.vue'),
- meta: { title: '优惠券管理', pageKey: 'marketing-coupon', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/marketing/price-watch',
- name: 'marketing-price-watch',
- component: () => import('@/views/marketing/PriceWatchView.vue'),
- meta: { title: '价格预警', pageKey: 'marketing-price-watch', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/crm/satisfaction',
- name: 'crm-satisfaction',
- component: () => import('@/views/crm/SatisfactionView.vue'),
- meta: { title: '满意度评价', pageKey: 'crm-satisfaction', roles: ['admin', 'manager', 'customer_service'] }
- },
- {
- path: '/supplier/performance',
- name: 'supplier-performance',
- component: () => import('@/views/supplier/SupplierPerformanceView.vue'),
- meta: { title: '供应商绩效', pageKey: 'supplier-performance', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/system/employee',
- name: 'system-employee',
- component: () => import('@/views/system/EmployeeView.vue'),
- meta: { title: '员工管理', pageKey: 'system-employee', roles: ['admin'] }
- },
- {
- path: '/system/department',
- name: 'system-department',
- component: () => import('@/views/system/DepartmentView.vue'),
- meta: { title: '部门管理', pageKey: 'system-department', roles: ['admin'] }
- },
- {
- path: '/report/sales-analysis',
- name: 'sales-analysis',
- component: () => import('@/views/report/SalesAnalysisView.vue'),
- meta: { title: '销售分析', pageKey: 'sales-analysis', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/report/profit-analysis',
- name: 'profit-analysis',
- component: () => import('@/views/report/ProfitAnalysisView.vue'),
- meta: { title: '利润分析', pageKey: 'profit-analysis', roles: ['admin', 'manager', 'finance'] }
- },
- {
- path: '/report/inventory-age',
- name: 'inventory-age',
- component: () => import('@/views/report/InventoryAgeAnalysisView.vue'),
- meta: { title: '库存库龄分析', pageKey: 'inventory-age', roles: ['admin', 'manager', 'procurement', 'warehouse'] }
- },
- {
- path: '/report/customer-analysis',
- name: 'customer-analysis',
- component: () => import('@/views/report/CustomerAnalysisView.vue'),
- meta: { title: '客户分析', pageKey: 'customer-analysis', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/report/logistics-report',
- name: 'logistics-report',
- component: () => import('@/views/report/LogisticsReportView.vue'),
- meta: { title: '物流报表', pageKey: 'logistics-report', roles: ['admin', 'manager', 'warehouse'] }
- },
- {
- path: '/report/channel-performance',
- name: 'channel-performance',
- component: () => import('@/views/report/ChannelPerformanceView.vue'),
- meta: { title: '渠道绩效', pageKey: 'channel-performance', roles: ['admin', 'manager', 'operator'] }
- },
- {
- path: '/report/procurement-report',
- name: 'procurement-report',
- component: () => import('@/views/report/ProcurementReportView.vue'),
- meta: { title: '采购报表', pageKey: 'procurement-report', roles: ['admin', 'manager', 'procurement'] }
- },
- {
- path: '/report/marketing-report',
- name: 'marketing-report',
- component: () => import('@/views/report/MarketingReportView.vue'),
- meta: { title: '营销报表', pageKey: 'marketing-report', roles: ['admin', 'manager', 'operator'] }
- }
- ]
- },
- {
- path: '/403',
- name: '403',
- component: () => import('@/views/shared/ForbiddenView.vue'),
- meta: { public: true, title: '无权限访问', roles: allRoles }
- }
- ];
|