|  |  | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/plan/add/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     @Transactional | 
 |  |  |     public R add(@RequestParam Map<String, Object> param) { | 
 |  |  |         // pre | 
 |  |  |         Plan plan = JSON.parseObject(JSON.toJSONString(param), Plan.class); | 
 |  |  | 
 |  |  |         if (!planService.insert(plan)) { | 
 |  |  |             throw new CoolException("保持失败,请重试"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 自动添加跟进人 | 
 |  |  |         PlanFoll planFoll = new PlanFoll(); | 
 |  |  |         planFoll.setPlanId(plan.getId()); | 
 |  |  |         planFoll.setUserId(manager.getId()); | 
 |  |  |         if (!planFollService.insert(planFoll)) { | 
 |  |  |             throw new CoolException("保持失败,请重试"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return R.ok(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |         return R.ok(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @PostMapping(value = "/plan/approval/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R approval(@RequestParam Long planId){ | 
 |  |  |         return R.ok(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/planQuery/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R query(String condition) { | 
 
 |  |  | 
 |  |  |                 mp.id in | 
 |  |  |                 ( | 
 |  |  |                     select | 
 |  |  |                     order_id | 
 |  |  |                     from man_order_foll | 
 |  |  |                     plan_id | 
 |  |  |                     from man_plan_foll | 
 |  |  |                     where 1=1 | 
 |  |  |                     and user_id = #{userId} | 
 |  |  |                     ) | 
 
 |  |  | 
 |  |  |             ,{field: 'updateTime$', align: 'left',title: '修改时间', hide: true} | 
 |  |  |             ,{field: 'memo', align: 'left',title: '注释', hide: true} | 
 |  |  |  | 
 |  |  |             ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} | 
 |  |  |             ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 180} | 
 |  |  |         ]], | 
 |  |  |         request: { | 
 |  |  |             pageName: 'curr', | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |                 break; | 
 |  |  |             case 'approval': | 
 |  |  |                 layer.confirm('审批通过?', { | 
 |  |  |                     skin: 'layui-layer-admin', | 
 |  |  |                     shade: .1, | 
 |  |  |                     offset: '200px', | 
 |  |  |                     title: data.name | 
 |  |  |                 }, function (i) { | 
 |  |  |                     layer.close(i); | 
 |  |  |                     let loadIndex = layer.load(2); | 
 |  |  |                     $.ajax({ | 
 |  |  |                         url: baseUrl+"/plan/approval/auth", | 
 |  |  |                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                         data: {planId: data.id}, | 
 |  |  |                         method: 'POST', | 
 |  |  |                         success: function (res) { | 
 |  |  |                             layer.close(loadIndex); | 
 |  |  |                             if (res.code === 200){ | 
 |  |  |                                 layer.msg(res.msg, {icon: 1}); | 
 |  |  |                                 tableReload(); | 
 |  |  |                             } else if (res.code === 403){ | 
 |  |  |                                 top.location.href = baseUrl+"/"; | 
 |  |  |                             } else { | 
 |  |  |                                 layer.msg(res.msg, {icon: 2}); | 
 |  |  |                             } | 
 |  |  |                         } | 
 |  |  |                     }) | 
 |  |  |                 }); | 
 |  |  |                 break; | 
 |  |  |             case 'edit': | 
 |  |  |                 showEditModel(data); | 
 |  |  |                 break; | 
 
 |  |  | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <script type="text/html" id="operate"> | 
 |  |  |     {{# if (d.settle == 1 || d.settle == 2) { }} | 
 |  |  |         <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">审批</a> | 
 |  |  |     {{# } }} | 
 |  |  |     <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> | 
 |  |  |     <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> | 
 |  |  | </script> |