mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 07:11:52 +08:00
code review:crm 商机
This commit is contained in:
parent
d1978d318b
commit
973b710992
@ -2,63 +2,6 @@ SET NAMES utf8mb4;
|
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `crm_clue`;
|
||||
CREATE TABLE `crm_clue` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号,主键自增',
|
||||
`transform_status` tinyint DEFAULT NULL COMMENT '转化状态',
|
||||
`follow_up_status` tinyint DEFAULT NULL COMMENT '跟进状态',
|
||||
`name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '线索名称',
|
||||
`customer_id` bigint NOT NULL COMMENT '客户id',
|
||||
`contact_next_time` datetime DEFAULT NULL COMMENT '下次联系时间',
|
||||
`telephone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电话',
|
||||
`mobile` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '手机号',
|
||||
`address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
|
||||
`owner_user_id` bigint NOT NULL COMMENT '负责人的用户编号',
|
||||
`contact_last_time` datetime DEFAULT NULL COMMENT '最后跟进时间',
|
||||
`remark` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
|
||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
|
||||
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '线索表' ;
|
||||
|
||||
-- ----------------------------
|
||||
-- 商机表
|
||||
-- ----------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `crm_business`;
|
||||
CREATE TABLE `crm_business` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(100) NOT NULL COMMENT '商机名称',
|
||||
`status_type_id` bigint DEFAULT NULL COMMENT '商机状态类型编号',
|
||||
`status_id` bigint DEFAULT NULL COMMENT '商机状态编号',
|
||||
`contact_next_time` datetime DEFAULT NULL COMMENT '下次联系时间',
|
||||
`customer_id` bigint NOT NULL COMMENT '客户编号',
|
||||
`deal_time` datetime DEFAULT NULL COMMENT '预计成交日期',
|
||||
`price` decimal(18,2) DEFAULT NULL COMMENT '商机金额',
|
||||
`discount_percent` decimal(10,2) DEFAULT NULL COMMENT '整单折扣',
|
||||
`product_price` decimal(18,2) DEFAULT NULL COMMENT '产品总金额',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
|
||||
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '创建人',
|
||||
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '更新人',
|
||||
`owner_user_id` bigint DEFAULT NULL COMMENT '负责人的用户编号',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`ro_user_ids` longtext NOT NULL COMMENT '只读权限的用户编号数组',
|
||||
`rw_user_ids` longtext NOT NULL COMMENT '读写权限的用户编号数组',
|
||||
`end_status` int NOT NULL COMMENT '1赢单2输单3无效',
|
||||
`end_remark` varchar(500) DEFAULT NULL COMMENT '结束时的备注',
|
||||
`deleted` bit(1) DEFAULT b'0' COMMENT '逻辑删除',
|
||||
`contact_last_time` datetime DEFAULT NULL COMMENT '最后跟进时间',
|
||||
`follow_up_status` int DEFAULT NULL COMMENT '跟进状态',
|
||||
`tenant_id` bigint DEFAULT '0' COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商机表';
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 回款表
|
||||
@ -148,33 +91,3 @@ CREATE TABLE `crm_contact` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='crm联系人';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- 商机状态表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `crm_business_status`;
|
||||
CREATE TABLE `crm_business_status` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`type_id` bigint NOT NULL COMMENT '状态类型编号',
|
||||
`name` varchar(100) NOT NULL COMMENT '状态名',
|
||||
`percent` varchar(20) DEFAULT NULL COMMENT '赢单率',
|
||||
`sort` int DEFAULT NULL COMMENT '排序',
|
||||
`tenant_id` bigint DEFAULT '1' COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商机状态表'
|
||||
|
||||
-- ----------------------------
|
||||
-- 商机状态类型表
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `crm_business_status_type`;
|
||||
CREATE TABLE `crm_business_status_type` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`name` varchar(100) NOT NULL COMMENT '状态类型名',
|
||||
`dept_ids` varchar(200) NOT NULL COMMENT '使用的部门编号',
|
||||
`status` bit(1) NOT NULL DEFAULT b'0' COMMENT '开启状态',
|
||||
`creator` varchar(64) NOT NULL COMMENT '创建人',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`tenant_id` bigint DEFAULT '1' COMMENT '租户ID',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商机状态类型表'
|
||||
|
@ -1,63 +1,6 @@
|
||||
|
||||
-- ----------------------------
|
||||
-- 线索菜单
|
||||
-- ----------------------------
|
||||
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name
|
||||
)
|
||||
VALUES (
|
||||
'线索管理', '', 2, 0, 2375,
|
||||
'clue', '', 'crm/clue/index', 0, 'CrmClue'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'线索查询', 'crm:clue:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'线索创建', 'crm:clue:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'线索更新', 'crm:clue:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'线索删除', 'crm:clue:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'线索导出', 'crm:clue:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
@ -114,65 +57,6 @@ VALUES (
|
||||
'', '', '', 0
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- 合同菜单
|
||||
-- ----------------------------
|
||||
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name
|
||||
)
|
||||
VALUES (
|
||||
'商机管理', '', 2, 0, '',
|
||||
'business', '', 'crm/business/index', 0, 'CrmBusiness'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'商机查询', 'crm:business:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'商机创建', 'crm:business:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'商机更新', 'crm:business:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'商机删除', 'crm:business:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'商机导出', 'crm:business:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
|
||||
-- ----------------------------
|
||||
-- 回款菜单
|
||||
|
Loading…
Reference in New Issue
Block a user