| | |
| | | |
| | | @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()); |
| | |
| | | @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("添加失败,请联系管理员"); |
| | |
| | | |
| | | @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("删除成功"); |
| | |
| | | // ,{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: '所属部门'} |
| | |
| | | <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"></i> |
| | | <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></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> |
| | |
| | | </script> |
| | | |
| | | <script> |
| | | var orderId = top.orderByMore; |
| | | var planId = top.planByMore; |
| | | $('.layui-layer-close').hide(); |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | |
| | | 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 + "/"; |
| | |
| | | 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) { |
| | |
| | | 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 { |
| | |
| | | } |
| | | 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; |
| | | }) |
| | |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.close(loadIndex); |
| | | initFollowers(orderId); |
| | | initFollowers(planId); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |