中扬CRM客户关系管理系统
#
LSH
2023-11-04 93ef3f2ab542b7b6fe941c30bf56b35e743cf299
#
3个文件已修改
159 ■■■■■ 已修改文件
src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/priOnline2/priOnline.js 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/priOnline2/priOnline.html 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
@@ -16,6 +16,7 @@
import com.zy.crm.common.web.BaseController;
import com.zy.crm.manager.entity.*;
import com.zy.crm.manager.service.*;
import com.zy.crm.manager.utils.CompanySearchUtils;
import com.zy.crm.system.entity.User;
import com.zy.crm.system.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -142,6 +143,69 @@
            wrapper.or().eq("host_id", 1);
        }
    }
    @RequestMapping(value = "/priOnline2/HJ/add/auth")
    @ManagerAuth(memo = "接取集成核价任务")
    public R addHJ(PriOnline2 priOnline2) {
        PriOnline2 priOnline21 = priOnline2Service.selectById(priOnline2.getId());
        if (priOnline21.getSettle()!=1 || !priOnline21.getMemberId().equals(0L)){
            return R.error("此集成核价单状态已改变,请刷新页面重新选择!");
        }
        Date now = new Date();
        priOnline21.setMemberId(getUserId());
        List<SettleDto> planDtos = JSON.parseArray(priOnline21.getSettleMsg(), SettleDto.class);
        List<SettleDto> planDtoList = new ArrayList<>();
        for (SettleDto dto : planDtos) {
            if (dto.getStep().equals(2)) {
                dto.setUserId(getUserId());
                dto.setUsername(getUser().getNickname());
                if (Cools.isEmpty(dto.getMsg())) {
                    dto.setMsg(getUser().getNickname() + "接取核价");
                } else {
                    dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(now) + " " + getUser().getNickname() + "接取核价");
                }
                dto.setTime(DateUtils.convert(new Date()));
            }
            planDtoList.add(dto);
        }
        priOnline21.setSettleMsg(JSON.toJSONString(planDtoList));
        priOnline21.setUpdateUserId(getUserId());
        priOnline21.setUpdateTime(now);
        priOnline2Service.updateById(priOnline21);
        return R.ok("接取成功");
    }
    @RequestMapping(value = "/priOnline2/HJ/search/auth")
    @ManagerAuth
    public R priOnline2Search(String condition) {
        EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
        wrapper.like("template_name", condition);
        wrapper.eq("member_id",0L);
        List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5));//2:核价流程
        int type =0;
        for (ProcessPermissions processPermissions:processPermissionsList){
            if (getUserId().equals(processPermissions.getUserId())){
                type=1;
                break;
            }
        }
        if (type==0){
            return R.error("你不是核价员,无权接任务");
        }
        List<Map<String, Object>> result = new ArrayList<>();
        List<PriOnline2> priOnline2s = priOnline2Service.selectList(wrapper);
        for (PriOnline2 priOnline2 : priOnline2s){
            Map<String, Object> map = new HashMap<>();
            map.put("id", priOnline2.getId());
            map.put("name", priOnline2.getTemplateName()+" - ID:"+priOnline2.getId());
            result.add(map);
        }
        return R.ok(result);
    }
    @RequestMapping(value = "/priOnline2/add/auth")
    @ManagerAuth(memo = "添加核价管理")
@@ -208,7 +272,7 @@
        users.add(getUser());
        users.add(getUser());
        if (planType.getType().equals(2)) {
            users.add(userService.selectById(73));
            users.add(new User());
        }
        users.add(userUp);
        priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.InItFlowPath(users, initNames, users.size())));
@@ -529,7 +593,11 @@
                }
                dto.setTime(DateUtils.convert(new Date()));
            } else if (dto.getStep().equals(priOnline2.getSettle() + 2)) {
                nextUserId=dto.getUserId();
                if (priOnline2.getSettleSize().equals(4)){
                    nextUserId = 0L;
                }else {
                    nextUserId=dto.getUserId();
                }
            }
        }
        priOnline2.setSettleMsg(JSON.toJSONString(list));
src/main/webapp/static/js/priOnline2/priOnline.js
@@ -177,6 +177,9 @@
            case 'addBlank':
                showEditModel();
                break;
            case 'addBlank2':
                showEditModel2();
                break;
            case 'refreshData':
                tableIns.reload({
                    page: {
@@ -547,6 +550,42 @@
        });
    }
    /* 弹窗 - 新增、修改 */
    function showEditModel2(mData) {
        admin.open({
            type: 1,
            area: '800px',
            title: '接取' + '核价',
            content: $('#editDialogHJ').html(),
            success: function (layero, dIndex) {
                let loadNameXml = loadNameXmlSel()
                form.val('detailHJ', mData);
                form.on('submit(editSubmitHJ)', function (data) {
                    data.field.id = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].id : null;
                    $.ajax({
                        url: baseUrl+"/priOnline2/HJ/add/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: data.field,
                        method: 'POST',
                        success: function (res) {
                            if (res.code === 200){
                                layer.close(dIndex);
                                layer.msg(res.msg, {icon: 1});
                                tableReload()
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
                                layer.msg(res.msg, {icon: 2});
                            }
                        }
                    })
                });
                $(layero).children('.layui-layer-content').css('overflow', 'visible');
                layui.form.render('select');
            }
        });
    }
    //更新form
    function showEditForm(mData) {
        admin.open({
@@ -640,6 +679,35 @@
        })
    }
    window.loadNameXmlSel = function () {
        return xmSelect.render({
            el: '#nameXmlSel',
            autoRow: true,
            filterable: true,
            remoteSearch: true,
            clickClose: true,
            radio: true,
            remoteMethod: function (val, cb, show) {
                $.ajax({
                    url: baseUrl + "/priOnline2/HJ/search/auth",
                    headers: {'token': localStorage.getItem('token')},
                    data: {
                        condition: val
                    },
                    method: 'POST',
                    success: function (res) {
                        if (res.code === 200) {
                            cb(res.data)
                        } else {
                            cb([]);
                            layer.msg(res.msg, {icon: 2});
                        }
                    }
                });
            }
        });
    }
});
// 关闭动作
src/main/webapp/views/priOnline2/priOnline.html
@@ -66,6 +66,7 @@
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="addBlank">新增核价</button>
        <button class="layui-btn layui-btn-sm" lay-event="addBlank2">接取集成核价任务</button>
        <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteData">删除</button>
    </div>
</script>
@@ -169,6 +170,24 @@
    </div>
</script>
<script type="text/html" id="editDialogHJ">
    <div id="detailHJ" lay-filter="detail" class="layui-form admin-form model-form">
        <input name="id" type="hidden">
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-required">客户名称: </label>
            <div class="layui-input-block">
                <div id="nameXmlSel" name="nameXmlSel">
                </div>
            </div>
        </div>
        <hr class="layui-bg-gray">
        <div class="layui-form-item text-right">
            <button class="layui-btn" lay-filter="editSubmitHJ" lay-submit="">保存</button>
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        </div>
    </div>
</script>
<!-- 表单弹窗 -->
<script type="text/html" id="editStatus">
    <div id="editStatusDetail" lay-filter="editStatusDetail" class="layui-form admin-form model-form">