中扬CRM客户关系管理系统
#
luxiaotao1123
2022-11-23 2d1e72379f4096386c6046ddcf0d7274ad03cc17
#
3个文件已修改
58 ■■■■ 已修改文件
src/main/java/com/zy/crm/manager/controller/PlanController.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/plan/plan.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/plan/plan_more.html 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/PlanController.java
@@ -238,8 +238,8 @@
    @RequestMapping(value = "/plan/followers/table/auth")
    @ManagerAuth
    public R planFollowersTable(@RequestParam("orderId") Long orderId) {
        List<PlanFoll> planFolls = planFollService.selectList(new EntityWrapper<PlanFoll>().eq("plan_id", orderId).orderBy("id", false));
    public R planFollowersTable(@RequestParam("planId") Long planId) {
        List<PlanFoll> planFolls = planFollService.selectList(new EntityWrapper<PlanFoll>().eq("plan_id", planId).orderBy("id", false));
        List<FollowerTableVo> result = new ArrayList<>();
        for (PlanFoll planFoll : planFolls) {
            User user = userService.selectById(planFoll.getUserId());
@@ -254,15 +254,15 @@
    @RequestMapping(value = "/plan/followers/add/auth")
    @ManagerAuth
    @Transactional
    public R planFollowersAdd(@RequestParam("orderId") Long orderId,
    public R planFollowersAdd(@RequestParam("planId") Long planId,
                               @RequestParam("followerIds[]") Long[] followerIds) {
        if (Cools.isEmpty(orderId, followerIds)) {
        if (Cools.isEmpty(planId, followerIds)) {
            return R.parse(BaseRes.PARAM);
        }
        for (Long userId : followerIds) {
            if (planFollService.selectCount(new EntityWrapper<PlanFoll>().eq("plan_id", orderId).eq("user_id", userId)) == 0) {
            if (planFollService.selectCount(new EntityWrapper<PlanFoll>().eq("plan_id", planId).eq("user_id", userId)) == 0) {
                PlanFoll planFoll = new PlanFoll();
                planFoll.setPlanId(orderId);
                planFoll.setPlanId(planId);
                planFoll.setUserId(userId);
                if (!planFollService.insert(planFoll)) {
                    throw new CoolException("添加失败,请联系管理员");
@@ -274,12 +274,12 @@
    @RequestMapping(value = "/plan/followers/remove/auth")
    @ManagerAuth
    public R planFollowersRemove(@RequestParam("orderId") Long orderId,
    public R planFollowersRemove(@RequestParam("planId") Long planId,
                                  @RequestParam("userId") Long userId) {
        if (Cools.isEmpty(orderId, userId)) {
        if (Cools.isEmpty(planId, userId)) {
            return R.parse(BaseRes.PARAM);
        }
        if (!planFollService.delete(new EntityWrapper<PlanFoll>().eq("plan_id", orderId).eq("user_id", userId))) {
        if (!planFollService.delete(new EntityWrapper<PlanFoll>().eq("plan_id", planId).eq("user_id", userId))) {
            throw new CoolException("删除失败,请联系管理员");
        }
        return R.ok("删除成功");
src/main/webapp/static/js/plan/plan.js
@@ -141,7 +141,7 @@
            // ,{field: 'hostId$', align: 'center',title: '所属商户'}
            ,{field: 'userId$', align: 'left',title: '业务员'}
            ,{field: 'planType$', align: 'left',title: '业务类型', width: 150}
            ,{field: 'name', align: 'left',title: '售前规划申请单名称', width: 220, style: 'color: #1890ff;cursor:pointer', event: 'planMore',}
            ,{field: 'name', align: 'left',title: '售前规划申请单名称', width: 220, style: 'color: #1890ff;cursor:pointer', event: 'more'}
            ,{field: 'uuid', align: 'left',title: '规划单号', width: 100}
            ,{field: 'planNeed$', align: 'left',title: '所需', templet:function(d){return emptyShow(d.planNeed$)}}
            ,{field: 'deptId$', align: 'left',title: '所属部门'}
src/main/webapp/views/plan/plan_more.html
@@ -44,9 +44,9 @@
        <div class="layui-card">
            <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px">
                <div>
                    <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold">&#xe609;</i>
                    <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold">&#xe656;</i>
                    <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span>
                    <span style="opacity: .5;font-size: small;margin-left: 5px">跟踪项目</span>
                    <span style="opacity: .5;font-size: small;margin-left: 5px">售前规划申请单</span>
                </div>
            </div>
        </div>
@@ -188,7 +188,7 @@
</script>
<script>
    var orderId = top.orderByMore;
    var planId = top.planByMore;
    $('.layui-layer-close').hide();
    layui.config({
        base: baseUrl + "/static/layui/lay/modules/"
@@ -208,19 +208,19 @@
        function init(){
            notice.msg('正在载入数据......', {icon: 4, position: "topRight"});
            $.ajax({
                url: baseUrl + "/order/" + orderId + "/auth",
                url: baseUrl + "/plan/" + planId + "/auth",
                headers: {'token': localStorage.getItem('token')},
                method: 'GET',
                success: function (res) {
                    notice.destroy();
                    if (res.code === 200) {
                        let order = res.data;
                        top.orderByMore = null;
                        $("#form-name").html(order.name);
                        let plan = res.data;
                        top.planByMore = null;
                        $("#form-name").html(plan.name);
                        // 设备明细
                        form.val('formAdvForm', order);
                        form.val('formAdvForm', plan);
                        // 跟进人
                        initFollowers(order.id);
                        initFollowers(plan.id);
                        layDateRender();
                    } else if (res.code === 403) {
                        top.location.href = baseUrl + "/";
@@ -241,15 +241,15 @@
        layDateRender();
        // 渲染跟进人模块
        function initFollowers(orderId) {
            if (!orderId) {
        function initFollowers(planId) {
            if (!planId) {
                return;
            }
            $.ajax({
                url: baseUrl+"/order/followers/table/auth",
                url: baseUrl+"/plan/followers/table/auth",
                headers: {'token': localStorage.getItem('token')},
                data: {
                    orderId: orderId
                    planId: planId
                },
                method: 'GET',
                success: function (res) {
@@ -274,17 +274,17 @@
                                case "del":
                                    let loadIndex = layer.load(2);
                                    $.ajax({
                                        url: baseUrl+"/order/followers/remove/auth",
                                        url: baseUrl+"/plan/followers/remove/auth",
                                        headers: {'token': localStorage.getItem('token')},
                                        data: {
                                            orderId: orderId,
                                            planId: planId,
                                            userId: data.userId
                                        },
                                        method: 'POST',
                                        success: function (res) {
                                            layer.close(loadIndex);
                                            if (res.code === 200){
                                                initFollowers(orderId);
                                                initFollowers(planId);
                                            } else if (res.code === 403){
                                                top.location.href = baseUrl+"/";
                                            } else {
@@ -324,10 +324,10 @@
                        }
                        let loadIndex = layer.load(2);
                        $.ajax({
                            url: baseUrl+"/order/followers/add/auth",
                            url: baseUrl+"/plan/followers/add/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {
                                orderId: orderId,
                                planId: planId,
                                followerIds: selectList.map(function (d) {
                                    return d.value;
                                })
@@ -336,7 +336,7 @@
                            success: function (res) {
                                if (res.code === 200){
                                    layer.close(loadIndex);
                                    initFollowers(orderId);
                                    initFollowers(planId);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                }else {