一、MES — 叫料单扩展(schema + 逻辑) material_request 新增字段:packageNo(叫料包号,一次提交=一包)、callDate(叫料日,默认当天)、planBreakdown(jsonb,工单×排产日明细 []CallPlanBreakdown);targetDock 语义降级为"期望接驳台(可空,配送时 WMS 确定实际台)"。 新增 internal/logic/call_plan.go:实时计算「叫料需求明细(工单×排产日×物料)」,派生两类提示(当日剩余未叫 / 跨日量明细),不落库、不拦提交;接驳台空台校验 EnsureStationDocksEmpty、托盘回库 DispatchPalletReturnManual、人工清台 ClearDockLedger、配送单派车 DispatchDeliveryAgv、工位物料明细 StationMaterialDetail。 新增 internal/handler/production/call_pkg.go:8 个 MES 内部端点(X-API-TOKEN 网关),供 WMS 调用——叫料需求明细、按包查单、接驳台状态、托盘回库、人工清台、配送单派车、叫料池原始行、工位物料明细、WMS 代叫料。 internal/handler/production/call.go、internal/logic/call.go、agv.go、qty_report.go、routes_production.go、wmsclient/client.go、db.go 同步接入上述逻辑。 二、WMS — 配送单(新功能,叫料与送料彻底拆开) 新增 schema/delivery_order.go + delivery_order_item.go 及 ent 生成代码:delivery_order(PENDING→DISPATCHED→DONE / CANCELLED,一单=一次托盘配送)、delivery_order_item(配送物料明细快照:工单/工艺/排产日)。 新增 internal/handler/delivery.go + 路由 + DeliveryOrders.vue 页面(仓储作业 → 配送单)。 mesclient/client.go 扩展:MES 叫料单结构补 packageNo/callDate/workOrderNo/planBreakdown,新增 PoolRow/DockPalletState/DeliveryAgvItem/getJSON 等。 CallQueue.vue:按叫料包展示,新增「代叫料」「建配送单」按钮与对话框;出库单回写所属配送单号(outbound_order 加字段);AGV 派送改由配送单驱动。 三、工位终端 — 叫料体验升级 MaterialPanel.vue:新增「本工位物料明细」卡(工艺物料全集×工位账四数,量为 0 也显示);叫料改为「叫料包」模式(默认当天、可勾选分批、可选其他排产日、期望接驳台可空),新增叫料日选择器、两条提示横幅(当日剩余未叫 / 跨日量明细)、托盘回库按钮。 InspectPanel.vue/Main.vue/OnlinePanel.vue/OfflinePanel.vue/WorkPanel.vue/SyncQueueDialog.vue/api/index.js/internal/handler/line.go/routes.go 同步接入接驳台状态、托盘回库、下班双台空台校验等。 web/static/index.html 构建刷新。 四、文档 案例.md:重写第 5/6/8/9 节与新「配送单」流程,补「模拟模式跳过接驳台校验」说明,库管员菜单加「配送单」;并修正"本单箱体"等措辞歧义。 客户问题.md:同步本轮拍板口径。 五、构建产物 / 同步 多个 MES 前端页面(.vue)随本次改动统一重新构建刷新;ent 生成代码(MES material_request、WMS delivery_order/outbound_order 相关)随 schema 更新重新生成。
64 lines
6.2 KiB
JavaScript
64 lines
6.2 KiB
JavaScript
import { createRouter, createWebHistory } from 'vue-router'
|
||
import MainLayout from '../layouts/MainLayout.vue'
|
||
|
||
const routes = [
|
||
{ path: '/login', name: 'Login', component: () => import('../pages/Login.vue'), meta: { title: '登录' } },
|
||
// 免登录大屏:全屏无侧栏
|
||
{ path: '/display', name: 'Display', component: () => import('../pages/Display.vue'), meta: { title: '库存大屏' } },
|
||
{
|
||
path: '/',
|
||
component: MainLayout,
|
||
children: [
|
||
{ path: '', name: 'Dashboard', component: () => import('../pages/Dashboard.vue'), meta: { title: '工作台', keepAlive: true, componentName: 'Dashboard' } },
|
||
{ path: 'inbound', name: 'Inbound', component: () => import('../pages/Inbound.vue'), meta: { title: '入库管理', keepAlive: true, componentName: 'Inbound' } },
|
||
{ path: 'finished-inbound', name: 'FinishedInbound', component: () => import('../pages/FinishedInbound.vue'), meta: { title: '成品入库', keepAlive: true, componentName: 'FinishedInbound' } },
|
||
{ path: 'project-outbound', name: 'ProjectOutbound', component: () => import('../pages/ProjectOutbound.vue'), meta: { title: '科技项目出库', keepAlive: true, componentName: 'ProjectOutbound' } },
|
||
{ path: 'general-outbound', name: 'GeneralOutbound', component: () => import('../pages/GeneralOutbound.vue'), meta: { title: '通用出库', keepAlive: true, componentName: 'GeneralOutbound' } },
|
||
{ path: 'outbound', name: 'Outbound', component: () => import('../pages/Outbound.vue'), meta: { title: '全部出库记录', keepAlive: true, componentName: 'Outbound' } },
|
||
{ path: 'call-queue', name: 'CallQueue', component: () => import('../pages/CallQueue.vue'), meta: { title: '叫料队列', keepAlive: true, componentName: 'CallQueue' } },
|
||
// 配送单(2026-11-05 拍板:叫料与送料拆开——按包建单、可分批送、派车与历史)
|
||
{ path: 'delivery', name: 'DeliveryOrders', component: () => import('../pages/DeliveryOrders.vue'), meta: { title: '配送单', keepAlive: true, componentName: 'DeliveryOrders' } },
|
||
{ path: 'return-order', name: 'ReturnOrder', component: () => import('../pages/ReturnOrder.vue'), meta: { title: '退库确认', keepAlive: true, componentName: 'ReturnOrder' } },
|
||
{ path: 'pallet-workbench', name: 'PalletWorkbench', component: () => import('../pages/PalletWorkbench.vue'), meta: { title: '托盘工作台', keepAlive: true, componentName: 'PalletWorkbench' } },
|
||
// P1(2026-11-04 用户拍板):备料清单——只读(无备料完成按钮、不管库存、无历史)
|
||
{ path: 'preparation', name: 'PreparationList', component: () => import('../pages/PreparationList.vue'), meta: { title: '备料清单', keepAlive: true, componentName: 'PreparationList' } },
|
||
{ path: 'production-return', name: 'DefectReturn', component: () => import('../pages/DefectReturn.vue'), meta: { title: '生产退不良', keepAlive: true, componentName: 'DefectReturn' } },
|
||
{ path: 'inventory', name: 'Inventory', component: () => import('../pages/Inventory.vue'), meta: { title: '库存查询', keepAlive: true, componentName: 'Inventory' } },
|
||
{ path: 'inspection-incoming', name: 'InspectionIncoming', component: () => import('../pages/Inspection.vue'), meta: { title: '来料检验', keepAlive: true, componentName: 'InspectionIncoming', inspectionType: 'incoming' } },
|
||
{ path: 'stocktake', name: 'Stocktake', component: () => import('../pages/Stocktake.vue'), meta: { title: '库存盘点', keepAlive: true, componentName: 'Stocktake' } },
|
||
{ path: 'semi', name: 'Semi', component: () => import('../pages/Semi.vue'), meta: { title: '半成品管理', keepAlive: true, componentName: 'Semi' } },
|
||
{ path: 'zone', name: 'Zone', component: () => import('../pages/BaseData.vue'), props: { mode: 'zone' }, meta: { title: '区域维护', keepAlive: true, componentName: 'BaseData' } },
|
||
{ path: 'material', name: 'Material', component: () => import('../pages/BaseData.vue'), props: { mode: 'material' }, meta: { title: '物料档案', keepAlive: true, componentName: 'BaseData' } },
|
||
{ path: 'change-password', name: 'ChangePassword', component: () => import('../pages/ChangePassword.vue'), meta: { title: '修改密码' } },
|
||
{ path: 'users', name: 'UserManage', component: () => import('../pages/UserManage.vue'), meta: { title: '账号管理', keepAlive: true, componentName: 'UserManage' } },
|
||
{ path: 'roles', name: 'RoleManage', component: () => import('../pages/RoleManage.vue'), meta: { title: '角色管理', keepAlive: true, componentName: 'RoleManage' } },
|
||
{ path: 'event-log', name: 'EventLog', component: () => import('../pages/EventLog.vue'), meta: { title: '操作日志', keepAlive: true, componentName: 'EventLog' } },
|
||
{ path: 'attachment', name: 'AttachmentCenter', component: () => import('../pages/AttachmentCenter.vue'), meta: { title: '附件中心', keepAlive: true, componentName: 'AttachmentCenter' } },
|
||
{ path: 'data-archive', name: 'DataArchive', component: () => import('../pages/DataArchive.vue'), meta: { title: '数据归档', keepAlive: true, componentName: 'DataArchive' } },
|
||
{ path: 'settings', name: 'Settings', component: () => import('../pages/Settings.vue'), meta: { title: '基础设置', keepAlive: true, componentName: 'Settings' } },
|
||
{ path: 'alert-center', name: 'AlertCenter', component: () => import('../pages/AlertCenter.vue'), meta: { title: '预警中心', keepAlive: true, componentName: 'AlertCenter' } },
|
||
{ path: 'alert-rule', name: 'AlertRule', component: () => import('../pages/AlertRule.vue'), meta: { title: '预警规则', keepAlive: true, componentName: 'AlertRule' } }
|
||
]
|
||
},
|
||
{ path: '/:pathMatch(.*)*', redirect: '/' }
|
||
]
|
||
|
||
const router = createRouter({
|
||
history: createWebHistory(),
|
||
routes
|
||
})
|
||
|
||
// 路由守卫:除 /login 和 /display 外校验 token
|
||
router.beforeEach((to) => {
|
||
if (to.path !== '/login' && to.path !== '/display' && !to.path.startsWith('/display')) {
|
||
if (!localStorage.getItem('token')) {
|
||
return { path: '/login', query: to.fullPath ? { redirect: to.fullPath } : {} }
|
||
}
|
||
}
|
||
})
|
||
|
||
router.afterEach((to) => {
|
||
document.title = to.meta?.title ? `${to.meta.title} - WMS库房管理` : 'WMS库房管理'
|
||
})
|
||
|
||
export default router |