feat(production): 新增排产支撑功能并移除手动报工页面
- 在main.go中更新排产物料需求注释说明,明确WMS与MES系统间交互方式 - 从前端help.js中移除手动报工(helpScan)相关帮助文档 - 更新工艺流程、绩效报表等页面帮助文档中的报工流程说明 - 在主布局中添加排产支撑菜单项并移除手动报工菜单项 - 新增ProducibleSupport.vue组件实现排产支撑页面功能 - 移除Scan.vue手动报工页面组件 - 更新相关帮助文档内容以匹配新的业务流程
This commit is contained in:
@@ -24,7 +24,7 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
codes := []string{"*"}
|
||||
if r.code == "OPERATOR" {
|
||||
codes = []string{
|
||||
"produce.workorder", "produce.dailyplan", "produce.bom", "produce.material", "produce.scan",
|
||||
"produce.workorder", "produce.dailyplan", "produce.bom", "produce.material", "produce.producible",
|
||||
"produce.trace", "produce.wip", "produce.torque", "produce.plc", "produce.product",
|
||||
"produce.processflow", "produce.station", "produce.performance", "produce.processcard",
|
||||
// 按钮级权限(块2)
|
||||
@@ -74,6 +74,7 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
{"produce.workorder", "工单管理", "MENU", "/work-order"},
|
||||
{"produce.dailyplan", "日排产", "MENU", "/daily-plan"},
|
||||
{"produce.bom", "产品物料清单", "MENU", "/bom"},
|
||||
{"produce.producible", "排产支撑", "MENU", "/producible-support"},
|
||||
{"produce.material", "备料单", "MENU", "/material-request"},
|
||||
{"produce.qty", "数量不符处理", "MENU", "/qty-report"},
|
||||
{"produce.plc", "工位组合下发", "MENU", "/plc-send"},
|
||||
@@ -81,7 +82,6 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
{"produce.processflow", "工艺流程", "MENU", "/process-flow"},
|
||||
{"produce.station", "关联工位", "MENU", "/station"}, {"produce.performance", "绩效报表", "MENU", "/performance"},
|
||||
{"produce.dock", "接驳台维护", "MENU", "/dock"},
|
||||
{"produce.scan", "手动报工", "MENU", "/scan"},
|
||||
{"produce.trace", "工件追溯", "MENU", "/trace"},
|
||||
{"produce.wip", "在制品", "MENU", "/wip"},
|
||||
{"produce.processcard", "生产流程卡", "MENU", "/process-card"},
|
||||
@@ -169,6 +169,10 @@ func (s *Service) Seed(ctx context.Context) error {
|
||||
// 清掉存量角色里的旧码与旧菜单定义行(幂等);新菜单 produce.qty 在 1. 的 seedMenus 中定义。
|
||||
migrateLegacyQtyReport(ctx, s)
|
||||
|
||||
// 3.5 「手动报工」网页功能已整块移除(2026-09-21,Scan.vue/produce.scan):清掉存量角色里的
|
||||
// produce.scan 码与旧菜单定义行(幂等);报工唯一入口改为工位终端内部接口。
|
||||
migrateLegacyScan(ctx, s)
|
||||
|
||||
// 4. 初始化产线工位(内置只读主数据);工艺流程/工序步骤由用户在「工艺流程」页自建,不预置
|
||||
seedStations(ctx, s)
|
||||
// 5. 接驳台主数据(真源在 MES,2026-09-21 自 WMS 迁入);系统预置只读
|
||||
@@ -342,3 +346,27 @@ func migrateLegacyQtyReport(ctx context.Context, s *Service) {
|
||||
_, _ = s.ctx.EntClient.Permission.Delete().
|
||||
Where(permission.Code("produce.qtyreport")).Exec(ctx)
|
||||
}
|
||||
|
||||
// migrateLegacyScan 清理已下线的「手动报工」菜单码 produce.scan(幂等,可重复执行):
|
||||
// 该网页功能(Scan.vue 手动报工页)已整块移除(2026-09-21),报工唯一入口改为工位终端内部接口。
|
||||
// 从存量角色的 permissionCodes 摘除 produce.scan 并删除其权限定义行。
|
||||
func migrateLegacyScan(ctx context.Context, s *Service) {
|
||||
roleList, _ := s.ctx.EntClient.Role.Query().All(ctx)
|
||||
for _, rl := range roleList {
|
||||
kept := make([]string, 0, len(rl.PermissionCodes))
|
||||
changed := false
|
||||
for _, c := range rl.PermissionCodes {
|
||||
if c == "produce.scan" {
|
||||
changed = true
|
||||
continue
|
||||
}
|
||||
kept = append(kept, c)
|
||||
}
|
||||
if changed {
|
||||
_ = s.ctx.EntClient.Role.UpdateOneID(rl.ID).
|
||||
SetPermissionCodes(mergeCodes(kept, nil)).Exec(ctx)
|
||||
}
|
||||
}
|
||||
_, _ = s.ctx.EntClient.Permission.Delete().
|
||||
Where(permission.Code("produce.scan")).Exec(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user