| | |
| | | |
| | | public static List<SettleDto> initPriQuote(Plan plan, User manager ,User president,User user) { |
| | | List<SettleDto> list = new ArrayList<>(); |
| | | for (int i = 1; i < 6; i++) { |
| | | for (int i = 1; i < 5; i++) { |
| | | SettleDto dto = new SettleDto(); |
| | | dto.setStep(i); |
| | | switch (i) { |
| | |
| | | |
| | | public static List<SettleDto> initBusiness(User manager ,User user) { |
| | | List<SettleDto> list = new ArrayList<>(); |
| | | for (int i = 0; i < 7; i++) { |
| | | for (int i = 0; i < 3; i++) { |
| | | SettleDto dto = new SettleDto(); |
| | | dto.setStep(i); |
| | | switch (i) { |
| | |
| | | return list; |
| | | } |
| | | |
| | | public static List<SettleDto> initSalesPricing(User manager ,User user,List<String> names ,int nodes) { |
| | | List<SettleDto> list = new ArrayList<>(); |
| | | for (int i = 0; i < nodes+1; i++) { |
| | | SettleDto dto = new SettleDto(); |
| | | dto.setStep(i); |
| | | switch (i) { |
| | | case 0: |
| | | dto.setTitle("开始"); |
| | | dto.setMsg(user.getUsername() + names.get(i)); |
| | | dto.setUserId(user.getId()); |
| | | dto.setUsername(user.getUsername()); |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | dto.setCurr(Boolean.TRUE); |
| | | list.add(dto); |
| | | break; |
| | | case 1: |
| | | dto.setTitle(names.get(i)); |
| | | dto.setUserId(user.getId()); |
| | | dto.setUsername(user.getNickname()); |
| | | list.add(dto); |
| | | break; |
| | | case 2: |
| | | dto.setTitle(names.get(i)); |
| | | dto.setUserId(manager.getId()); |
| | | dto.setUsername(manager.getNickname()); |
| | | list.add(dto); |
| | | break; |
| | | case 3: |
| | | dto.setTitle(names.get(i)); |
| | | list.add(dto); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.crm.manager.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.crm.common.model.SettleDto; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.*; |
| | | import com.zy.crm.manager.service.*; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.util.ClassUtils; |
| | |
| | | @Autowired |
| | | private CstmrService cstmrService; |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @RequestMapping(value = "/priOnline2/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(priOnline2Service.selectById(String.valueOf(id))); |
| | | PriOnline2 priOnline2 = priOnline2Service.selectById(String.valueOf(id)); |
| | | assert priOnline2 != null; |
| | | JSONObject resultObj = JSON.parseObject(JSON.toJSONString(priOnline2)); |
| | | // 步骤条相关 |
| | | resultObj.put("step", priOnline2.getSettle() == 4 ? 0 : priOnline2.getSettle() + 1); |
| | | return R.ok().add(resultObj); |
| | | } |
| | | |
| | | @RequestMapping(value = "/priOnline2/viewCheck/{id}/auth") |
| | |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId"); |
| | | wrapper.setSqlSelect("id,title,create_time as createTime,filepath,settle,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId"); |
| | | wrapper.in("member_id", getUserRoleBelongsToUserId("allopen")); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | |
| | | priOnline2.setUpdateUserId(getUserId()); |
| | | //状态,未完成 |
| | | priOnline2.setStatus(0); |
| | | |
| | | //业务员 |
| | | // Item item = itemService.selectById(priOnline.getItemId()); |
| | | Plan plan = planService.selectById(priOnline2.getItemId()); |
| | |
| | | Cstmr cstmr = cstmrService.selectById(plan.getCstmrId()); |
| | | priOnline2.setTemplateName(cstmr.getName()); //甲方单位名称 |
| | | |
| | | priOnline2.setSettle(0); |
| | | |
| | | User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | List<String> initNames = new ArrayList<>(); |
| | | initNames.add("创建核价单模板"); |
| | | initNames.add("提交核价"); |
| | | initNames.add("部门经理审核"); |
| | | initNames.add("业务员确认"); |
| | | priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricing(manager,getUser(),initNames,3))); |
| | | |
| | | //设置项目流程 |
| | | plan.setStep(2); |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PostMapping(value = "/priOnline2/approval/auth") |
| | | @ManagerAuth |
| | | public R approvalBusinessTrip(@RequestParam Long priOnlineId, |
| | | @RequestParam(required = false) Long plannerId){ |
| | | PriOnline2 priOnline2 = priOnline2Service.selectById(priOnlineId); |
| | | assert priOnline2 != null; |
| | | Date now = new Date(); |
| | | switch (priOnline2.getSettle()) { |
| | | case 0: |
| | | User user2 = userService.selectById(priOnline2.getUserId()); |
| | | User manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); |
| | | |
| | | if (Cools.isEmpty(getUser())) { |
| | | return R.error("抱歉,您没有提交的权限"); |
| | | } |
| | | if (!getUserId().equals(getUser().getId())) { |
| | | return R.error("抱歉,您没有提交的权限"); |
| | | } |
| | | // 修改 settle 步骤数据 |
| | | List<SettleDto> list1 = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); |
| | | for (SettleDto dto : list1) { |
| | | switch (dto.getStep()) { |
| | | case 0: |
| | | dto.setCurr(Boolean.FALSE); |
| | | break; |
| | | case 1: |
| | | dto.setCurr(Boolean.TRUE); |
| | | dto.setMsg(getUser().getNickname() + "提交完成"); |
| | | dto.setTime(DateUtils.convert(now)); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | priOnline2.setSettleMsg(JSON.toJSONString(list1)); |
| | | // 修改规划单状态 |
| | | priOnline2.setSettle(1); |
| | | priOnline2.setUpdateUserId(getUserId()); |
| | | priOnline2.setUpdateTime(now); |
| | | priOnline2.setMemberId(manager1.getId()); |
| | | |
| | | if (!priOnline2Service.updateById(priOnline2)) { |
| | | throw new CoolException("提交失败,请联系管理员"); |
| | | } |
| | | break; |
| | | case 1: |
| | | // 本部门经理审核 |
| | | User user = userService.selectById(priOnline2.getUserId()); |
| | | User manager = userService.getDeptManager(getHostId(), user.getDeptId()); |
| | | if (manager.getId().equals(getUserId())) { |
| | | |
| | | // 修改 settle 步骤数据 |
| | | List<SettleDto> list = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); |
| | | for (SettleDto dto : list) { |
| | | switch (dto.getStep()) { |
| | | case 1: |
| | | dto.setCurr(Boolean.FALSE); |
| | | break; |
| | | case 2: |
| | | dto.setCurr(Boolean.TRUE); |
| | | dto.setMsg("部门经理" + manager.getNickname() + "审批通过"); |
| | | dto.setTime(DateUtils.convert(now)); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | priOnline2.setSettleMsg(JSON.toJSONString(list)); |
| | | |
| | | // 修改规划单状态 |
| | | priOnline2.setSettle(2); // 申请通过 |
| | | priOnline2.setUpdateTime(now); |
| | | if (!priOnline2Service.updateById(priOnline2)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | } else { |
| | | return R.error("抱歉,您没有审核的权限!!!"); |
| | | } |
| | | break; |
| | | case 2: |
| | | // 业务员 |
| | | User salesman0 = userService.selectById(priOnline2.getUserId()); |
| | | if (!getUserId().equals(salesman0.getId())) { |
| | | return R.error("抱歉,您无需确认!!!"); |
| | | } |
| | | // 修改 settle 步骤数据 |
| | | List<SettleDto> list2 = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); |
| | | for (SettleDto dto : list2) { |
| | | switch (dto.getStep()) { |
| | | case 2: |
| | | dto.setCurr(Boolean.TRUE); |
| | | break; |
| | | case 3: |
| | | dto.setCurr(Boolean.TRUE); |
| | | dto.setMsg("业务员" + salesman0.getNickname() + "以确认"); |
| | | dto.setTime(DateUtils.convert(new Date())); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | priOnline2.setSettleMsg(JSON.toJSONString(list2)); |
| | | // 修改规划单状态 |
| | | priOnline2.setSettle(3); // 审批通过 |
| | | priOnline2.setUpdateTime(new Date()); |
| | | |
| | | if (!priOnline2Service.updateById(priOnline2)) { |
| | | throw new CoolException("确认失败,请联系管理员"); |
| | | } |
| | | break; |
| | | default: |
| | | return R.error(); |
| | | } |
| | | return R.ok("审批成功"); |
| | | } |
| | | |
| | | } |
| | |
| | | reimburseOnline.setMemberId(manager1.getId()); |
| | | |
| | | if (!reimburseOnlineService.updateById(reimburseOnline)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | throw new CoolException("提交失败,请联系管理员"); |
| | | } |
| | | break; |
| | | case 1: |
| | |
| | | @TableField("check_data_file") |
| | | private String checkDataFile; |
| | | |
| | | /** |
| | | * hostId |
| | | */ |
| | | @ApiModelProperty(value= "hostId") |
| | | @TableField("host_id") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 进度 |
| | | */ |
| | | @ApiModelProperty(value= "进度") |
| | | private Integer settle; |
| | | |
| | | /** |
| | | * 流程进度 |
| | | */ |
| | | @ApiModelProperty(value= "流程进度") |
| | | @TableField("settle_msg") |
| | | private String settleMsg; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String form; |
| | | |
| | | public PriOnline2() {} |
| | | |
| | | public PriOnline2(String title, String sheetData, Date createTime, String filepath) { |
| | | public PriOnline2(String title, String sheetData, Date createTime, String filepath,Integer settle) { |
| | | this.title = title; |
| | | this.sheetData = sheetData; |
| | | this.createTime = createTime; |
| | | this.filepath = filepath; |
| | | this.settle = settle; |
| | | } |
| | | |
| | | // PriOnline priOnline = new PriOnline( |
| | |
| | | // null // 创建时间 |
| | | // ); |
| | | |
| | | public String getSettle$(){ |
| | | if (null == this.settle){ return null; } |
| | | switch (this.settle){ |
| | | case 0: |
| | | return "等待提交"; |
| | | case 1: |
| | | return "等待审批"; |
| | | case 2: |
| | | return "等待确认"; |
| | | case 3: |
| | | return "审批通过"; |
| | | default: |
| | | return String.valueOf(this.settle); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | |
| | | <result column="status" property="status" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="check_data" property="checkData" /> |
| | | <result column="settle" property="settle" /> |
| | | </resultMap> |
| | | |
| | | <!-- 查询结果不包含excel数据data,以免结果集过大 --> |
| | |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="settle" property="settle" /> |
| | | </resultMap> |
| | | |
| | | <select id="listByPage" resultMap="NoDataResultMap"> |
| | |
| | | return(false); |
| | | } |
| | | var businessTripByMore; |
| | | var priOnlineByMore; |
| | |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true} |
| | | ,{field: 'templateName', align: 'center',title: '客户名称', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false} |
| | | ,{field: 'cstmrId$', align: 'center',title: '客户id',hide: true} |
| | | ,{field: 'orderNum', align: 'center',title: '核价单号'} |
| | | ,{field: 'planId$', align: 'center',title: '规划单号', style: 'color: #1890ff;cursor:pointer', event: 'morePlan'} |
| | | ,{field: 'orderNum', align: 'center',title: '核价单号',hide: false} |
| | | ,{field: 'planId$', align: 'center',title: '规划单号', style: 'color: #1890ff;cursor:pointer', event: 'morePlan',hide: false} |
| | | ,{field: 'itemId', align: 'center',title: '规划单号', hide: true} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间'} |
| | | ,{field: 'updateTime$', align: 'center',title: '更新时间'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'memberId$', align: 'center',title: '业务员'} |
| | | ,{field: 'settle$', align: 'center',title: '进度', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} |
| | | ,{field: 'user$', align: 'center',title: '创建人员'} |
| | | ,{field: 'updateUserId$', align: 'center',title: '更新人员'} |
| | | ,{field: 'checkDataStatus$', align: 'center',title: '报价数据'} |
| | |
| | | table.on('tool(priOnline)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'approval': |
| | | layer.confirm('审批通过?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1, |
| | | offset: '200px', |
| | | title: data.name |
| | | }, function (i) { |
| | | layer.close(i); |
| | | approval(data.id); |
| | | }); |
| | | break; |
| | | case 'moreCstmr': |
| | | top.cstmrByMore = data.cstmrId$; |
| | | admin.popupRight({ |
| | |
| | | window: "top", |
| | | area: "1250px", |
| | | url: "../plan/plan_more_other.html", |
| | | end: function () { |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | }) |
| | | break; |
| | | case 'more': |
| | | top.priOnlineByMore = data.id; |
| | | admin.popupRight({ |
| | | type: 1, |
| | | window: "top", |
| | | area: "1250px", |
| | | url: "priOnline_more.html", |
| | | end: function () { |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | function approval(priOnlineId, plannerId, dIdx) { |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/priOnline2/approval/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | priOnlineId: priOnlineId, |
| | | plannerId: plannerId |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (dIdx) { |
| | | layer.close(dIdx); |
| | | } |
| | | 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}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | |
| | | <script type="text/html" id="operate"> |
| | | {{# if (d.settle == 1) { }} |
| | | <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-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> |
| | |
| | | |
| | | |
| | | <script type="text/html" id="operate"> |
| | | {{# if (d.settle == 0) { }} |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">提交</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 1) { }} |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">审批</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 2) { }} |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">确认</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 0 || d.settle == 1) { }} |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | {{# } }} |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="check">核价</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="upload">上传询价</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="viewCheck">查看询价</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
New file |
| | |
| | | <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> |
| | | <style> |
| | | #formAdvForm { |
| | | background-color: #f3f3f3; |
| | | } |
| | | #formAdvForm .layui-form-item { |
| | | margin-top: 20px; |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | #formAdvForm .layui-form-item .layui-inline { |
| | | margin-bottom: 25px; |
| | | margin-right: 0; |
| | | } |
| | | |
| | | .form-group-bottom { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | padding: 10px 20px; |
| | | background-color: #fff; |
| | | box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); |
| | | } |
| | | </style> |
| | | <!-- 正文开始 --> |
| | | <form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> |
| | | <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> |
| | | <!-- 标题 --> |
| | | <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> |
| | | <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> |
| | | </div> |
| | | </div> |
| | | <div class="layui-card-body" style="padding: 30px 20px"> |
| | | |
| | | <div class="layui-tab layui-steps"> |
| | | <ul class="layui-tab-title" id="stepBox"> |
| | | </ul> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="layui-row"> |
| | | <!-- 数据 --> |
| | | <!-- <div class="layui-col-md9">--> |
| | | <!-- <div class="layui-card">--> |
| | | <!-- <div class="layui-card-header">--> |
| | | <!-- 基本信息--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-card-body">--> |
| | | |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- 动态 --> |
| | | <!-- <div class="layui-col-md3" style="width: 24%;margin-left: 1%">--> |
| | | <div class="layui-col-md3" style="width: 100%;"> |
| | | <!-- 时间线 --> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <span>流程动态</span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <ul class="layui-timeline" id="timelineBox"> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group-bottom text-right"> |
| | | <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 刷新 </button> |
| | | </div> |
| | | |
| | | </form> |
| | | |
| | | <script type="text/html" id="followerTabOperate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/template" id="stepTpl"> |
| | | {{#each list}} |
| | | <li id="step-{{step}}" style="pointer-events: none"> |
| | | <i class="layui-icon layui-icon-ok">{{step}}</i> |
| | | <span class="layui-steps-title">{{title}}</span> |
| | | {{# if username}} |
| | | <span class="layui-steps-content">{{username}}</span> |
| | | {{ else }} |
| | | <span class="layui-steps-content"> </span> |
| | | {{/if}} |
| | | </li> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <script type="text/template" id="timelineTpl"> |
| | | {{#each list}} |
| | | <li class="layui-timeline-item"> |
| | | <i class="layui-icon layui-timeline-axis"></i> |
| | | <div class="layui-timeline-content layui-text"> |
| | | <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> |
| | | <span>{{time}}</span> |
| | | <p> |
| | | {{msg}} |
| | | </p> |
| | | </div> |
| | | </li> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <script> |
| | | var priOnlineId = top.priOnlineByMore; |
| | | $('.layui-layer-close').hide(); |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | notice: 'notice/notice', |
| | | steps: 'steps/steps', |
| | | }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { |
| | | var $ = layui.jquery; |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var laydate = layui.laydate; |
| | | var notice = layui.notice; |
| | | var xmSelect = layui.xmSelect; |
| | | var steps = layui.steps; |
| | | |
| | | form.render('select'); |
| | | |
| | | init(); |
| | | function init(){ |
| | | notice.msg('正在载入数据......', {icon: 4, position: "topRight"}); |
| | | $.ajax({ |
| | | url: baseUrl + "/priOnline2/" + priOnlineId + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | | if (res.code === 200) { |
| | | let priOnlineId = res.data; |
| | | top.priOnlineIdByMore = null; |
| | | $("#form-name").html(priOnlineId.name); |
| | | // 进度步骤图 |
| | | let template0 = Handlebars.compile($('#stepTpl').html()); |
| | | $('#stepBox').html(template0({list: JSON.parse(priOnlineId.settleMsg)})); |
| | | $('#step-' + Number(priOnlineId.step)).addClass("layui-this"); |
| | | |
| | | let template1 = Handlebars.compile($('#timelineTpl').html()); |
| | | $('#timelineBox').html(template1({list: JSON.parse(priOnlineId.settleMsg)})); |
| | | // 补充html |
| | | $('#customizeBox').html(priOnlineId.formHtml); |
| | | // 设备明细 |
| | | // form.val('formAdvForm', priOnlineId); |
| | | // top.convertDisabled($('#formAdvForm :input'), true); |
| | | // 跟进人 |
| | | // initFollowers(priOnlineId.id); |
| | | layDateRender(); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /* 渲染laydate */ |
| | | function layDateRender() { |
| | | laydate.render({ |
| | | elem: '#endTime', |
| | | type: 'datetime' |
| | | }); |
| | | } |
| | | layDateRender(); |
| | | |
| | | /* 监听表单提交 */ |
| | | form.on('submit(refresh)', function (data) { |
| | | init(); |
| | | return false; |
| | | }); |
| | | |
| | | }) |
| | | </script> |