| | |
| | | dto.setTitle("提交出差"); |
| | | dto.setUserId(user.getId()); |
| | | dto.setUsername(user.getNickname()); |
| | | dto.setMsg(user.getNickname()+"提交出差申请"); |
| | | list.add(dto); |
| | | break; |
| | | case 2: |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | 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.BusinessTrip; |
| | | import com.zy.crm.manager.entity.PlanType; |
| | | import com.zy.crm.manager.entity.ProcessPermissions; |
| | | import com.zy.crm.manager.entity.ReimburseOnline; |
| | | import com.zy.crm.manager.service.BusinessTripService; |
| | | import com.zy.crm.manager.utils.CarNumberUtils; |
| | | import com.zy.crm.manager.utils.TimeCalculatorUtils; |
| | |
| | | @RequestMapping(value = "/businessTrip/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(businessTripService.selectById(String.valueOf(id))); |
| | | BusinessTrip businessTrip = businessTripService.selectById(String.valueOf(id)); |
| | | assert businessTrip != null; |
| | | JSONObject resultObj = JSON.parseObject(JSON.toJSONString(businessTrip)); |
| | | // 步骤条相关 |
| | | resultObj.put("step", businessTrip.getSettle() == 3 ? 0 : businessTrip.getSettle() + 1); |
| | | return R.ok().add(resultObj); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTrip/list/auth") |
| | |
| | | EntityWrapper<BusinessTrip> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | // wrapper.or().eq("member_id",getUserId()); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(businessTripService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | Long deptId = getDeptId(); |
| | | boolean signUserId = false; |
| | | boolean signDeptId = false; |
| | | boolean signHostId = false; |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().equals("dept_id")){ |
| | | signDeptId = true; |
| | | if (String.valueOf(entry.getValue()).equals("19")){ |
| | | signHostId = true; |
| | | } |
| | | } |
| | | } |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else if (entry.getKey().equals("dept_id")){ |
| | | if (!val.equals("19")){ |
| | | wrapper.eq(entry.getKey(), val); |
| | | } |
| | | } else if (entry.getKey().equals("user_id") && !signDeptId){ |
| | | signUserId = true; |
| | | wrapper.eq(entry.getKey(), val); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | if (!signUserId && !signDeptId){ |
| | | wrapper.eq("user_id", getUserId()); |
| | | } |
| | | if (signHostId){ |
| | | wrapper.or().eq("host_id",1); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTrip/add/auth") |
| | | @ManagerAuth |
| | | public R add(BusinessTrip businessTrip) { |
| | | if (Cools.isEmpty(businessTrip) || null==businessTrip.getId()){ |
| | | if (Cools.isEmpty(businessTrip)){ |
| | | return R.error(); |
| | | } |
| | | Date now = new Date(); |
| | |
| | | } |
| | | }else { |
| | | businessTrip.setCarNumber("无"); |
| | | businessTrip.setKilometers("无"); |
| | | } |
| | | businessTrip.setBusinessPeersId(System.currentTimeMillis()); |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/businessTrip/approval/auth") |
| | | @ManagerAuth |
| | | public R approvalBusinessTrip(@RequestParam Long planId, |
| | | @RequestParam(required = false) Long plannerId){ |
| | | BusinessTrip businessTrip = businessTripService.selectById(planId); |
| | | assert businessTrip != null; |
| | | Date now = new Date(); |
| | | switch (businessTrip.getSettle()) { |
| | | case 1: |
| | | // 本部门经理审核 |
| | | User user = userService.selectById(businessTrip.getUserId()); |
| | | User manager = userService.getDeptManager(getHostId(), user.getDeptId()); |
| | | if (manager.getId().equals(getUserId())) { |
| | | |
| | | // 修改 settle 步骤数据 |
| | | List<SettleDto> list = JSON.parseArray(businessTrip.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; |
| | | } |
| | | } |
| | | businessTrip.setSettleMsg(JSON.toJSONString(list)); |
| | | |
| | | // 修改规划单状态 |
| | | businessTrip.setSettle(2); // 申请通过 |
| | | businessTrip.setUpdateId(getUserId()); |
| | | businessTrip.setUpdateTime(now); |
| | | if (!businessTripService.updateById(businessTrip)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | } else { |
| | | return R.error("抱歉,您没有批准的权限!!!"); |
| | | } |
| | | break; |
| | | default: |
| | | return R.error(); |
| | | } |
| | | return R.ok("审批成功"); |
| | | } |
| | | |
| | | } |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(ReimburseOnline.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.or().eq("member_id",getUserId()); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(reimburseOnlineService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | case 1: |
| | | return "等待批准"; |
| | | case 2: |
| | | return "审批通过"; |
| | | return "申请通过"; |
| | | default: |
| | | return String.valueOf(this.settle); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | public String getBusinessDuration$(){ |
| | | if (null == this.businessDuration) return null; |
| | | return this.businessDuration+"\t天"; |
| | | } |
| | | |
| | | public String getBusinessTripDays$(){ |
| | | if (null == this.businessTripDays) return null; |
| | | return this.businessTripDays+"\t天"; |
| | | } |
| | | |
| | | public String getPcdStart() { |
| | | StringBuilder sb = new StringBuilder(); |
| | |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | cascader: 'cascader/cascader', |
| | | }).use(['table','laydate', 'form', 'admin', 'cascader'], function(){ |
| | | }).use(['table','laydate', 'form', 'admin', 'cascader', 'tree', 'dropdown'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | var cascader = layui.cascader; |
| | | var tree = layui.tree; |
| | | var dropdown = layui.dropdown; |
| | | |
| | | $('#organization').html(localStorage.getItem('nickname') + ' <i class="layui-icon"></i>'); |
| | | |
| | | // 部门人员 筛选 |
| | | dropdown.render({ |
| | | elem: '#organization' |
| | | ,content: ['<div id="organizationTree" style="height: calc(100vh - 525px);border: none"></div>'].join('') |
| | | ,style: 'width: 370px; height: 350px; padding: 0 15px; box-shadow: 1px 1px 30px rgb(0 0 0 / 12%);' |
| | | ,ready: function(){ |
| | | loadTree(); |
| | | } |
| | | }); |
| | | |
| | | // 树形图 |
| | | var organizationTree; |
| | | window.loadTree = function(condition){ |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/dept/user/tree/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'condition': condition |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | organizationTree = tree.render({ |
| | | elem: '#organizationTree', |
| | | id: 'organizationTree', |
| | | onlyIconControl: true, |
| | | data: res.data, |
| | | click: function (obj) { |
| | | treeCond = { |
| | | key: obj.data.key, |
| | | val: obj.data.id |
| | | } |
| | | $('#organization').html(obj.data.title + ' <i class="layui-icon"></i>'); |
| | | $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); |
| | | $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click'); |
| | | clearFormVal($('#search-box')); |
| | | tableIns.reload({ |
| | | where: {[obj.data.key]: obj.data.id}, |
| | | page: {curr: 1} |
| | | }); |
| | | } |
| | | }); |
| | | treeData = res.data; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | ,{field: 'businessEndAddr$', align: 'center',title: '目的地',hide: false} |
| | | ,{field: 'businessStartTimeDay$', align: 'center',title: '出发日期',hide: false,width: 165} |
| | | ,{field: 'businessEndTimeDay$', align: 'center',title: '结束日期',hide: false,width: 165} |
| | | ,{field: 'businessDuration', align: 'center',title: '出差时长',hide: false} |
| | | ,{field: 'businessTripDays', align: 'center',title: '出差天数',hide: false} |
| | | ,{field: 'businessPeers', align: 'center',title: '出行人',hide: false} |
| | | ,{field: 'businessDuration$', align: 'center',title: '出差时长',hide: false} |
| | | ,{field: 'businessTripDays$', align: 'center',title: '出差天数',hide: false} |
| | | ,{field: 'businessPeers', align: 'center',title: '同行人',hide: false} |
| | | ,{field: 'businessPeersId', align: 'center',title: '同行人ID',hide: true} |
| | | ,{field: 'carNumber', align: 'center',title: '自驾私家车车牌号',hide: false} |
| | | ,{field: 'kilometers', align: 'center',title: '自驾私家车行程明细及公里数',hide: false} |
| | |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间',hide: false,width: 125} |
| | | ,{field: 'updateTime$', align: 'center',title: '更新时间',hide: false,width: 125} |
| | | ,{field: 'updateId$', align: 'center',title: '更新人员',hide: false} |
| | | ,{field: 'settle$', align: 'center',title: '进度',hide: false} |
| | | ,{field: 'settle$', align: 'center',title: '进度', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} |
| | | ,{field: 'status$', align: 'center',title: '状态',hide: false} |
| | | ,{field: 'businessTripType', align: 'center',title: '类型',hide: true} |
| | | ,{field: 'businessNotes', align: 'center',title: '出差备注',hide: false} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:180} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | table.on('tool(businessTrip)', 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 'more': |
| | | top.businessTripByMore = data.id; |
| | | admin.popupRight({ |
| | | type: 1, |
| | | window: "top", |
| | | area: "1250px", |
| | | url: "businessTrip_more.html", |
| | | end: function () { |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | }) |
| | | break; |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: ["95%", "90%"], |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | area: ["95%", "75%"], |
| | | title: (mData ? '修改' : '添加') + '出差申请', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | if (mData) { |
| | |
| | | }); |
| | | } |
| | | |
| | | function approval(planId, plannerId, dIdx) { |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/businessTrip/approval/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | planId: planId, |
| | | 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}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | |
| | | var planByMore; |
| | | var priQuoteByMore; |
| | | var reimburseOnlineByMore; |
| | | var businessTripByMore; |
| | |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .layui-dropdown.layui-border-box.layui-panel.layui-anim.layui-anim-downbit,.layui-dropdown.layui-border-box.layui-panel.layui-anim.layui-anim-downbit * { |
| | | box-sizing:inherit; |
| | | } |
| | | |
| | | .layui-menu li { |
| | | width: inherit; |
| | | } |
| | | .layui-tree-icon { |
| | | height: 16px; |
| | | line-height: 15px; |
| | | width: 15px; |
| | | text-align: center; |
| | | border: 1px solid #c0c4cc; |
| | | } |
| | | |
| | | .site-dropdown-demo, |
| | | .site-dropdown-demo .layui-menu{background: #32363F;border-color: #484e58;} |
| | | .site-dropdown-demo .layui-menu li{color: #a1a8b8;} |
| | | .site-dropdown-demo .layui-menu li:hover{background-color: #32363F;} |
| | | .layui-menu-body-title>.layui-icon { |
| | | position: relative; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .layui-form-radio { |
| | | display: block; |
| | | } |
| | | .layui-unselect.layui-form-radio { |
| | | display: inline-block; |
| | | } |
| | | .layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i { |
| | | color: #2d8cf0; |
| | | } |
| | |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-card" style="margin-bottom: 5px"> |
| | | <div class="layui-card-body" style="padding-top: 5px;padding-bottom: 5px "> |
| | | <div class="layui-form toolbar" id="search-box" style="display: flex;justify-content: flex-end;position: relative"> |
| | | <div class="nav-box"> |
| | | <div class="nav-box-item"> |
| | | <i class="layui-icon" style="color: #1890ff;font-weight: bold"></i> |
| | | </div> |
| | | <div class="nav-box-item"> |
| | | <button id="organization" style="border: none;padding-right: 35px;" class="layui-btn layui-btn-primary icon-btn"> |
| | | 未知 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">编号:</label> |
| | |
| | | </script> |
| | | |
| | | <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-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">出差事由: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="businessTripReasons" placeholder="请输入出差事由" lay-vertype="tips" lay-verify="required"> |
| | | <textarea class="layui-textarea" name="businessTripReasons" placeholder="请输入备注" maxlength="1024" autocomplete="off" lay-verify="required"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-col-md6"> |
| | | </div> |
| | | <div class="layui-col-md12"> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">出差备注: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="businessNotes" placeholder="请输入出差备注">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">出差备注: </label> |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="businessNotes" placeholder="请输入出差备注"> |
| | | <textarea class="layui-textarea" name="businessNotes" placeholder="请输入备注" maxlength="1024" autocomplete="off"></textarea> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | </div> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <div style="height: 10%"> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right" style="padding-right: 30px"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </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); |
| | | } |
| | | |
| | | .card-body-item { |
| | | display: inline-block; |
| | | border-right: 1px solid #e0e0e0; |
| | | width: 250px; |
| | | padding: 0 30px 0 10px; |
| | | } |
| | | .header-desc { |
| | | overflow:hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | -o-text-overflow:ellipsis; |
| | | } |
| | | |
| | | </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 businessTripId = top.businessTripByMore; |
| | | $('.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 + "/businessTrip/" + businessTripId + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | notice.destroy(); |
| | | if (res.code === 200) { |
| | | let businessTrip = res.data; |
| | | top.businessTripByMore = null; |
| | | $("#form-name").html(businessTrip.name); |
| | | // 进度步骤图 |
| | | let template0 = Handlebars.compile($('#stepTpl').html()); |
| | | $('#stepBox').html(template0({list: JSON.parse(businessTrip.settleMsg)})); |
| | | $('#step-' + Number(businessTrip.step)).addClass("layui-this"); |
| | | |
| | | let template1 = Handlebars.compile($('#timelineTpl').html()); |
| | | $('#timelineBox').html(template1({list: JSON.parse(businessTrip.settleMsg)})); |
| | | // 补充html |
| | | $('#customizeBox').html(businessTrip.formHtml); |
| | | // 设备明细 |
| | | form.val('formAdvForm', businessTrip); |
| | | top.convertDisabled($('#formAdvForm :input'), true); |
| | | // 跟进人 |
| | | // initFollowers(businessTrip.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> |