中扬CRM客户关系管理系统
#
LSH
2023-11-03 4301e57b85b3d882835199ee1af99426b54546dd
#
3个文件已修改
70 ■■■■■ 已修改文件
src/main/java/com/zy/crm/manager/controller/CstmrController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/cstmr/cstmr2.js 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/cstmr/cstmr2.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/CstmrController.java
@@ -231,6 +231,35 @@
        return R.ok();
    }
    @RequestMapping(value = "/cstmr/add2/auth")
    @ManagerAuth(memo = "添加甲方单位信息公海")
    public R add22(Cstmr cstmr) {
        Long hostId = getHostId();
        if (cstmrService.selectByUuid(hostId, cstmr.getUuid()) != null) {
            throw new CoolException("客户已存在");
        }
        if (cstmrService.selectByName(hostId, cstmr.getName()) != null) {
            throw new CoolException("客户已存在");
        }
        Cstmr cstmr1 = cstmrService.selectByName(hostId, cstmr.getName());
        if (cstmr1!=null){
            throw new CoolException("该客户信息已存在,业务员是:"+cstmr1.getDirector$());
        }
        cstmr.setHostId(hostId);
        cstmr.setUuid(cstmrService.getUuid(hostId));  // 客户代号
        cstmr.setDeptId(getDeptId());               // 所属部门
        cstmr.setUserId(getUserId());               // 所属人员
        cstmr.setCreateBy(getUserId());
        cstmr.setCreateTime(new Date());
        cstmr.setUpdateBy(getUserId());
        cstmr.setUpdateTime(new Date());
        cstmr.setDirector(getUserId());
        cstmr.setStatus(1);
        cstmrService.insert(cstmr);
        return R.ok();
    }
    @RequestMapping(value = "/cstmr2/add/auth")
    @ManagerAuth(memo = "接取甲方单位")
    public R add2(Cstmr cstmr) {
src/main/webapp/static/js/cstmr/cstmr2.js
@@ -196,6 +196,19 @@
    });
    // 添加
    $("#cstmrAddBtn1").click(function () {
        form.verify({
            account: function(value, item){
                var min = item.getAttribute('lay-min');
                if(value.length < min){
                    return '客户名称不能小于'+min+'个字符的长度';
                }
            }
        });
        showEditModel2();
    });
    // 添加
    $("#cstmrAddBtn").click(function () {
        form.verify({
            account: function(value, item){
@@ -395,7 +408,7 @@
                    }
                    var loadIndex = layer.load(2);
                    $.ajax({
                        url: baseUrl+"/cstmr/"+(mData?'update':'add')+"/auth",
                        url: baseUrl+"/cstmr/"+(mData?'update':'add2')+"/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
@@ -552,7 +565,7 @@
            radio: true,
            remoteMethod: function (val, cb, show) {
                $.ajax({
                    url: baseUrl + "/cstmr2/all/get/kv",
                    url: baseUrl + "/cstmrSearch/auth",
                    headers: {'token': localStorage.getItem('token')},
                    data: {
                        condition: val
@@ -568,6 +581,28 @@
                    }
                });
            },
            on: function (data) {
                console.log(data)
                let arr = data.arr
                let change = data.change;
                if (arr.length > 0 && change.length>0) {
                    let name = arr[0].name;
                    $.ajax({
                        url: baseUrl + "/cstmr/name/check/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: {
                            name: name
                        },
                        method: 'POST',
                        success: function (res) {
                            if (res.code === 200) {
                            } else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    });
                }
            }
        });
    }
src/main/webapp/views/cstmr/cstmr2.html
@@ -95,6 +95,8 @@
                        </button>
                        <button id="cstmrAddBtn" class="layui-btn icon-btn btn-add layui-btn-sm"><i class="layui-icon">&#xe654;</i>接取
                        </button>
                        <button id="cstmrAddBtn1" class="layui-btn icon-btn btn-add layui-btn-sm"><i class="layui-icon">&#xe654;</i>添加
                        </button>
<!--                        <button class="layui-btn layui-btn-danger icon-btn layui-btn-sm" lay-filter="cstmrDel" lay-submit>-->
<!--                            <i class="layui-icon">&#xe640;</i>删除-->
<!--                        </button>-->