feat: CRM 线索表 crud

This commit is contained in:
913752709@qq.com
2023-10-18 19:53:15 +08:00
parent b133acd8cd
commit a09ee495b6
20 changed files with 1065 additions and 3 deletions

View File

@ -37,3 +37,27 @@ CREATE TABLE `crm_contract`
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='合同表';
DROP TABLE IF EXISTS `crm_clue`;
CREATE TABLE `crm_clue` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号主键自增',
`transform_status` tinyint NOT NULL COMMENT '转化状态',
`follow_up_status` tinyint NOT NULL COMMENT '跟进状态',
`name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '线索名称',
`customer_id` bigint NOT NULL COMMENT '客户id',
`contact_next_time` datetime NULL DEFAULT NULL COMMENT '下次联系时间',
`telephone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '电话',
`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '手机号',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '地址',
`owner_user_id` bigint NULL DEFAULT NULL COMMENT '负责人的用户编号',
`contact_last_time` datetime NULL DEFAULT NULL COMMENT '最后跟进时间',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL 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 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '线索表' ROW_FORMAT = Dynamic;

View File

@ -59,5 +59,61 @@ VALUES (
);
-- ----------------------------
-- ...菜单
-- ----------------------------
-- 线索菜单
-- ----------------------------
-- 菜单 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如果你是 OraclePostgreSQLSQLServer 的话需要手动修改 @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
);