refactor(menu): 菜单模块归属调整 - 勘察费用/运维费定价迁至基础数据(/base/*),项目勘察/项目安装迁至运营派单(/dispatch/*)并按序排列(电工→勘察→安装→报修→维保);同步前端路由/页面git mv/通知跳转与db_seed,生产库已执行迁移
This commit is contained in:
1 parent
77891bf4f2
commit
850cd92584
11 files changed
+121
-74
No files matched your search
@@ -402,8 +402,8 @@ const NOTICE_TYPE_ROUTE: Record<string, string> = {
|
||||
const NOTICE_BIZ_ROUTE: Record<string, string> = {
|
||||
repair_dispatch: '/dispatch/repair',
|
||||
maintenance_order: '/dispatch/maintenance',
|
||||
install_order: '/project/install',
|
||||
survey_order: '/project/survey',
|
||||
install_order: '/dispatch/install',
|
||||
survey_order: '/dispatch/survey',
|
||||
};
|
||||
|
||||
function resolveNoticeRoute(item: NoticeInfo): string | null {
|
||||
|
||||
+55
-55
@@ -88,39 +88,9 @@ const routes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "project",
|
||||
name: "Project",
|
||||
redirect: "/project/survey",
|
||||
redirect: "/project/plan",
|
||||
meta: { requiresAuth: true, title: "项目管理", permission: "project:list" }
|
||||
},
|
||||
{
|
||||
path: "project/survey",
|
||||
name: "ProjectSurvey",
|
||||
component: () => import("@/views/project/survey/index.vue"),
|
||||
meta: { requiresAuth: true, title: "项目勘察", permission: "project:survey" }
|
||||
},
|
||||
{
|
||||
path: "project/survey/create",
|
||||
name: "ProjectSurveyCreate",
|
||||
component: () => import("@/views/project/survey/form.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "新建勘察派单",
|
||||
permission: "project:survey",
|
||||
parentTitle: "现场勘察派单",
|
||||
parentPath: "/project/survey"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "project/survey/edit/:id",
|
||||
name: "ProjectSurveyEdit",
|
||||
component: () => import("@/views/project/survey/form.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "编辑勘察派单",
|
||||
permission: "project:survey",
|
||||
parentTitle: "现场勘察派单",
|
||||
parentPath: "/project/survey"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "project/plan",
|
||||
name: "ProjectPlan",
|
||||
@@ -145,18 +115,54 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import("@/views/project/visit/index.vue"),
|
||||
meta: { requiresAuth: true, title: "回访记录", permission: "project:visit" }
|
||||
},
|
||||
{
|
||||
path: "project/install",
|
||||
name: "ProjectInstall",
|
||||
component: () => import("@/views/project/install/index.vue"),
|
||||
meta: { requiresAuth: true, title: "安装派单", permission: "project:install" }
|
||||
},
|
||||
{
|
||||
path: "dispatch",
|
||||
name: "Dispatch",
|
||||
redirect: "/dispatch/repair",
|
||||
meta: { requiresAuth: true, title: "运营派单", permission: "dispatch:list" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/worker",
|
||||
name: "DispatchWorker",
|
||||
component: () => import("@/views/dispatch/worker/index.vue"),
|
||||
meta: { requiresAuth: true, title: "电工登记管理", permission: "dispatch:worker" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/survey",
|
||||
name: "DispatchSurvey",
|
||||
component: () => import("@/views/dispatch/survey/index.vue"),
|
||||
meta: { requiresAuth: true, title: "项目勘察", permission: "project:survey" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/survey/create",
|
||||
name: "DispatchSurveyCreate",
|
||||
component: () => import("@/views/dispatch/survey/form.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "新建勘察派单",
|
||||
permission: "project:survey",
|
||||
parentTitle: "现场勘察派单",
|
||||
parentPath: "/dispatch/survey"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "dispatch/survey/edit/:id",
|
||||
name: "DispatchSurveyEdit",
|
||||
component: () => import("@/views/dispatch/survey/form.vue"),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
title: "编辑勘察派单",
|
||||
permission: "project:survey",
|
||||
parentTitle: "现场勘察派单",
|
||||
parentPath: "/dispatch/survey"
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "dispatch/install",
|
||||
name: "DispatchInstall",
|
||||
component: () => import("@/views/dispatch/install/index.vue"),
|
||||
meta: { requiresAuth: true, title: "安装派单", permission: "project:install" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/repair",
|
||||
name: "DispatchRepair",
|
||||
@@ -169,24 +175,6 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import("@/views/dispatch/maintenance/index.vue"),
|
||||
meta: { requiresAuth: true, title: "维保派单", permission: "dispatch:maintenance" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/price",
|
||||
name: "DispatchPrice",
|
||||
component: () => import("@/views/dispatch/price/index.vue"),
|
||||
meta: { requiresAuth: true, title: "运维费定价", permission: "dispatch:price" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/cost",
|
||||
name: "DispatchCost",
|
||||
component: () => import("@/views/dispatch/cost/index.vue"),
|
||||
meta: { requiresAuth: true, title: "勘察费用", permission: "dispatch:cost" }
|
||||
},
|
||||
{
|
||||
path: "dispatch/worker",
|
||||
name: "DispatchWorker",
|
||||
component: () => import("@/views/dispatch/worker/index.vue"),
|
||||
meta: { requiresAuth: true, title: "电工登记管理", permission: "dispatch:worker" }
|
||||
},
|
||||
{
|
||||
path: "device",
|
||||
name: "Device",
|
||||
@@ -211,6 +199,18 @@ const routes: RouteRecordRaw[] = [
|
||||
component: () => import("@/views/device/smart-device/index.vue"),
|
||||
meta: { requiresAuth: true, title: "智电设备型号", permission: "device:model" }
|
||||
},
|
||||
{
|
||||
path: "base/price",
|
||||
name: "BasePrice",
|
||||
component: () => import("@/views/base/price/index.vue"),
|
||||
meta: { requiresAuth: true, title: "运维费定价", permission: "dispatch:price" }
|
||||
},
|
||||
{
|
||||
path: "base/cost",
|
||||
name: "BaseCost",
|
||||
component: () => import("@/views/base/cost/index.vue"),
|
||||
meta: { requiresAuth: true, title: "勘察费用", permission: "dispatch:cost" }
|
||||
},
|
||||
{
|
||||
path: "report",
|
||||
name: "Report",
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -798,7 +798,7 @@ function handleFollow(record: CustomerVisitInfo) {
|
||||
// 一键发起勘察派单:跳转勘察派单页并预填客户(不创建、不回写状态)
|
||||
function handleSurvey(record: CustomerVisitInfo) {
|
||||
if (!record.customerId) return;
|
||||
router.push({ path: '/project/survey', query: { customerId: String(record.customerId) } });
|
||||
router.push({ path: '/dispatch/survey', query: { customerId: String(record.customerId) } });
|
||||
}
|
||||
|
||||
// 查看关联工程
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
+19
-16
@@ -106,18 +106,19 @@ ON CONFLICT (id) DO UPDATE SET
|
||||
permission = EXCLUDED.permission,
|
||||
visible = EXCLUDED.visible;
|
||||
|
||||
-- 初始菜单(项目域子菜单 + 客户扩展子菜单,id:24-31 + 空间拓扑 32 + 安装派单 33)
|
||||
-- 项目域:客户拜访(customer:visit) / 项目勘察(project:survey) / 项目方案(project:plan)
|
||||
-- 合同管理(project:contract) / 安装派单(project:install)
|
||||
-- 初始菜单(项目域子菜单 + 客户扩展子菜单,id:24-31 + 空间拓扑 32)
|
||||
-- 项目域:客户拜访(customer:visit) / 项目方案(project:plan)
|
||||
-- 合同管理(project:contract)
|
||||
-- 项目验收(project:acceptance) / 回访记录(project:visit)
|
||||
-- 客户域:空间拓扑与用电架构(customer:topology)
|
||||
-- 注:客户拜访归属“项目管理”,但仍沿用 /customer/visit 路径与 customer:visit 权限码
|
||||
-- 注:项目勘察(27)/项目安装(33) 已迁至运营派单 parent_id=3(见下方运营派单块注释)
|
||||
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
||||
(24, 2, '客户拜访', '/customer/visit', 'customer/visit/index', 'xt-jihuabaifang', 1, 2, 'customer:visit', 1),
|
||||
(27, 2, '项目勘察', '/project/survey', 'project/survey/index', 'xt-xiangmukancha', 2, 2, 'project:survey', 1),
|
||||
(27, 3, '项目勘察', '/dispatch/survey', 'dispatch/survey/index', 'xt-xiangmukancha', 2, 2, 'project:survey', 1),
|
||||
(28, 2, '项目方案', '/project/plan', 'project/plan/index', 'xt-xiangmufangan', 3, 2, 'project:plan', 1),
|
||||
(29, 2, '合同管理', '/project/contract', 'project/contract/index', 'FileDoneOutlined', 4, 2, 'project:contract', 1),
|
||||
(33, 2, '项目安装', '/project/install', 'project/install/index', 'ToolOutlined', 5, 2, 'project:install', 1),
|
||||
(33, 3, '项目安装', '/dispatch/install', 'dispatch/install/index', 'ToolOutlined', 3, 2, 'project:install', 1),
|
||||
(30, 2, '项目验收', '/project/acceptance', 'project/acceptance/index', 'ThunderboltOutlined', 6, 2, 'project:acceptance',1),
|
||||
(31, 2, '回访记录', '/project/visit', 'project/visit/index', 'AuditOutlined', 7, 2, 'project:visit', 1),
|
||||
(32, 1, '空间拓扑与用电架构', '/customer/topology', 'customer/topology/index', 'xt-topology', 5, 2, 'customer:topology',1)
|
||||
@@ -132,11 +133,13 @@ ON CONFLICT (id) DO UPDATE SET
|
||||
permission = EXCLUDED.permission,
|
||||
visible = EXCLUDED.visible;
|
||||
|
||||
-- 初始菜单(运营派单子菜单,parent_id=3,id:55-56)
|
||||
-- 初始菜单(运营派单子菜单,parent_id=3)
|
||||
-- 运营派单域统一 id 分配(避免历史上 36/37 被两段 INSERT 复用而互相覆盖):
|
||||
-- 34 运维费定价 / 35 勘察费用(归属项目管理 parent_id=2) / 36 电工登记管理
|
||||
-- 27 项目勘察 / 33 项目安装(自项目管理 parent_id=2 迁入)
|
||||
-- 34 运维费定价 / 35 勘察费用(均归属基础数据 parent_id=59) / 36 电工登记管理
|
||||
-- 37-46 按钮权限
|
||||
-- 55 报修派单 / 56 维保派单
|
||||
-- 子菜单排序:36 电工登记管理(1) → 27 项目勘察(2) → 33 项目安装(3) → 55 报修派单(4) → 56 维保派单(5)
|
||||
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
||||
(55, 3, '报修派单', '/dispatch/repair', 'dispatch/repair/index', 'ToolOutlined', 4, 2, 'dispatch:repair', 1),
|
||||
(56, 3, '维保派单', '/dispatch/maintenance', 'dispatch/maintenance/index', 'ToolOutlined', 5, 2, 'dispatch:maintenance',1)
|
||||
@@ -151,17 +154,17 @@ ON CONFLICT (id) DO UPDATE SET
|
||||
permission = EXCLUDED.permission,
|
||||
visible = EXCLUDED.visible;
|
||||
|
||||
-- 运营派单子菜单(parent_id=3;其中 35 勘察费用及其按钮 40/41/42 已归属项目管理 parent_id=2;id:34/36 为菜单项,37-39/43-46 为按钮权限)
|
||||
-- 运营派单子菜单(parent_id=3;其中 34 运维费定价及按钮 37-39、35 勘察费用及按钮 40-42 已归属基础数据 parent_id=59;id:36 为菜单项,43-46 为按钮权限)
|
||||
INSERT INTO sys_menu (id, parent_id, menu_name, menu_path, component, icon, sort_order, menu_type, permission, visible) VALUES
|
||||
(34, 3, '运维费定价', '/dispatch/price', 'dispatch/price/index', 'MoneyCollectOutlined', 2, 2, 'dispatch:price', 1),
|
||||
(35, 2, '勘察费用', '/dispatch/cost', 'dispatch/cost/index', 'AccountBookOutlined', 8, 2, 'dispatch:cost', 1),
|
||||
(34, 59, '运维费定价', '/base/price', 'base/price/index', 'MoneyCollectOutlined', 2, 2, 'dispatch:price', 1),
|
||||
(35, 59, '勘察费用', '/base/cost', 'base/cost/index', 'AccountBookOutlined', 8, 2, 'dispatch:cost', 1),
|
||||
(36, 3, '电工登记管理', '/dispatch/worker', 'dispatch/worker/index', 'ToolOutlined', 1, 2, 'dispatch:worker', 1),
|
||||
(37, 3, '新增价目', NULL, NULL, NULL, 1, 3, 'price:create', 1),
|
||||
(38, 3, '编辑价目', NULL, NULL, NULL, 2, 3, 'price:update', 1),
|
||||
(39, 3, '删除价目', NULL, NULL, NULL, 3, 3, 'price:delete', 1),
|
||||
(40, 2, '新增勘察费用', NULL, NULL, NULL, 9, 3, 'cost:create', 1),
|
||||
(41, 2, '编辑勘察费用', NULL, NULL, NULL, 10, 3, 'cost:update', 1),
|
||||
(42, 2, '删除勘察费用', NULL, NULL, NULL, 11, 3, 'cost:delete', 1),
|
||||
(37, 34, '新增价目', NULL, NULL, NULL, 1, 3, 'price:create', 1),
|
||||
(38, 34, '编辑价目', NULL, NULL, NULL, 2, 3, 'price:update', 1),
|
||||
(39, 34, '删除价目', NULL, NULL, NULL, 3, 3, 'price:delete', 1),
|
||||
(40, 35, '新增勘察费用', NULL, NULL, NULL, 9, 3, 'cost:create', 1),
|
||||
(41, 35, '编辑勘察费用', NULL, NULL, NULL, 10, 3, 'cost:update', 1),
|
||||
(42, 35, '删除勘察费用', NULL, NULL, NULL, 11, 3, 'cost:delete', 1),
|
||||
(43, 3, '新增电工', NULL, NULL, NULL, 7, 3, 'worker:create', 1),
|
||||
(44, 3, '编辑电工', NULL, NULL, NULL, 8, 3, 'worker:update', 1),
|
||||
(45, 3, '删除电工', NULL, NULL, NULL, 9, 3, 'worker:delete', 1),
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
-- 将勘察费用(id=35)、运维费定价(id=34) 从项目管理(2)/运营派单(3) 迁移到 基础数据(parent_id=59)
|
||||
-- 1) 两个页面菜单改挂到逻辑基础数据(59),路径/组件改为 /base/*
|
||||
-- 2) 各自按钮(parent 原为模块 id)改挂到所属页面菜单下,保证随页面迁移
|
||||
-- 幂等:仅更新存在的行;重复执行结果一致
|
||||
UPDATE sys_menu
|
||||
SET parent_id = 59,
|
||||
menu_path = '/base/price',
|
||||
component = 'base/price/index',
|
||||
sort_order = 2
|
||||
WHERE id = 34;
|
||||
|
||||
UPDATE sys_menu
|
||||
SET parent_id = 59,
|
||||
menu_path = '/base/cost',
|
||||
component = 'base/cost/index',
|
||||
sort_order = 3
|
||||
WHERE id = 35;
|
||||
|
||||
-- 运维费定价按钮(price:create/update/delete) 挂到菜单 34
|
||||
UPDATE sys_menu SET parent_id = 34 WHERE id IN (37, 38, 39);
|
||||
|
||||
-- 勘察费用按钮(cost:create/update/delete) 挂到菜单 35
|
||||
UPDATE sys_menu SET parent_id = 35 WHERE id IN (40, 41, 42);
|
||||
@@ -0,0 +1,21 @@
|
||||
-- 将项目勘察(id=27)、项目安装(id=33) 从项目管理(parent_id=2) 迁移到 运营派单(parent_id=3)
|
||||
-- 目标子菜单顺序:电工登记管理(sort=1) → 项目勘察(27,sort=2) → 项目安装(33,sort=3) → 报修派单(sort=4) → 维保派单(sort=5)
|
||||
-- 路径/组件改为 /dispatch/*(按用户确认,URL 与菜单归属一致)
|
||||
-- 幂等:仅更新存在的行;重复执行结果一致
|
||||
UPDATE sys_menu
|
||||
SET parent_id = 3,
|
||||
menu_path = '/dispatch/survey',
|
||||
component = 'dispatch/survey/index',
|
||||
sort_order = 2
|
||||
WHERE id = 27;
|
||||
|
||||
UPDATE sys_menu
|
||||
SET parent_id = 3,
|
||||
menu_path = '/dispatch/install',
|
||||
component = 'dispatch/install/index',
|
||||
sort_order = 3
|
||||
WHERE id = 33;
|
||||
|
||||
-- 报修派单(55)/维保派单(56) 排序后移至 4/5(若已是 4/5 则不变,保证顺序稳定)
|
||||
UPDATE sys_menu SET sort_order = 4 WHERE id = 55;
|
||||
UPDATE sys_menu SET sort_order = 5 WHERE id = 56;
|
||||
Reference in new issue
Block a user