| | |
| | | businessTrip.setStatus(0); |
| | | businessTrip.setSettle(1); |
| | | |
| | | User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | User manager = new User(); |
| | | try{ |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager = getUser(); |
| | | } |
| | | |
| | | businessTrip.setSettleMsg(JSON.toJSONString(SettleDto.initBusiness(manager,getUser()))); |
| | | |
| | |
| | | case 1: |
| | | // 本部门经理审核 |
| | | User user = userService.selectById(businessTrip.getUserId()); |
| | | User manager = userService.getDeptManager(getHostId(), user.getDeptId()); |
| | | User manager = new User(); |
| | | try{ |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager = user; |
| | | } |
| | | if (manager.getId().equals(getUserId())) { |
| | | |
| | | // 修改 settle 步骤数据 |
New file |
| | |
| | | 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.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | 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.BusinessTripOther; |
| | | import com.zy.crm.manager.service.BusinessTripOtherService; |
| | | import com.zy.crm.manager.utils.CarNumberUtils; |
| | | import com.zy.crm.manager.utils.TimeCalculatorUtils; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.UserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class BusinessTripOtherController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BusinessTripOtherService businessTripOtherService; |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @RequestMapping(value = "/businessTripOther/{id}/auth2") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | BusinessTripOther businessTripOther = businessTripOtherService.selectById(String.valueOf(id)); |
| | | assert businessTripOther != null; |
| | | JSONObject resultObj = JSON.parseObject(JSON.toJSONString(businessTripOther)); |
| | | // 步骤条相关 |
| | | resultObj.put("step", businessTripOther.getSettle() == 3 ? 0 : businessTripOther.getSettle() + 1); |
| | | return R.ok().add(resultObj); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTripOther/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BusinessTripOther> 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(businessTripOtherService.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 = "/businessTripOther/add/auth") |
| | | @ManagerAuth(memo = "添加出差申请") |
| | | public R add(BusinessTripOther businessTripOther) { |
| | | if (Cools.isEmpty(businessTripOther)){ |
| | | return R.error(); |
| | | } |
| | | Date now = new Date(); |
| | | businessTripOther.setCarNumber("无"); |
| | | businessTripOther.setKilometers("无"); |
| | | businessTripOther.setBusinessPeersId(System.currentTimeMillis()); |
| | | |
| | | businessTripOther.setBusinessDuration(0.0); |
| | | businessTripOther.setBusinessTripDays(0); |
| | | businessTripOther.setUserId(getUserId()); |
| | | businessTripOther.setDeptId(getDeptId()); |
| | | businessTripOther.setCreateTime(now); |
| | | businessTripOther.setUserId(getUserId()); |
| | | businessTripOther.setUpdateTime(now); |
| | | businessTripOther.setUpdateId(getUserId()); |
| | | businessTripOther.setStatus(0); |
| | | businessTripOther.setSettle(1); |
| | | |
| | | User manager = new User(); |
| | | try{ |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager = getUser(); |
| | | } |
| | | businessTripOther.setSettleMsg(JSON.toJSONString(SettleDto.initBusiness(manager,getUser()))); |
| | | |
| | | businessTripOtherService.insert(businessTripOther); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTripOther/update/auth") |
| | | @ManagerAuth(memo = "更新出差申请") |
| | | public R update(BusinessTripOther businessTripOther){ |
| | | if (Cools.isEmpty(businessTripOther) || null==businessTripOther.getId()){ |
| | | return R.error(); |
| | | } |
| | | Date now = new Date(); |
| | | businessTripOther.setUpdateTime(now); |
| | | businessTripOther.setUpdateId(getUserId()); |
| | | businessTripOtherService.updateById(businessTripOther); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTripOther/delete/auth") |
| | | @ManagerAuth(memo = "删除出差申请") |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | businessTripOtherService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTripOther/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BusinessTripOther> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("businessTrip")); |
| | | convert(map, wrapper); |
| | | List<BusinessTripOther> list = businessTripOtherService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTripOtherQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BusinessTripOther> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BusinessTripOther> page = businessTripOtherService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BusinessTripOther businessTripOther : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", businessTripOther.getId()); |
| | | map.put("value", businessTripOther.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/businessTripOther/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BusinessTripOther> wrapper = new EntityWrapper<BusinessTripOther>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != businessTripOtherService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BusinessTripOther.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping(value = "/businessTripOther/approval/auth") |
| | | @ManagerAuth |
| | | public R approvalBusinessTrip(@RequestParam Long planId, |
| | | @RequestParam(required = false) Long plannerId){ |
| | | BusinessTripOther businessTripOther = businessTripOtherService.selectById(planId); |
| | | assert businessTripOther != null; |
| | | Date now = new Date(); |
| | | switch (businessTripOther.getSettle()) { |
| | | case 1: |
| | | // 本部门经理审核 |
| | | User user = userService.selectById(businessTripOther.getUserId()); |
| | | User manager = new User(); |
| | | try{ |
| | | manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | }catch (Exception e){ |
| | | manager = user; |
| | | } |
| | | if (manager.getId().equals(getUserId())) { |
| | | |
| | | // 修改 settle 步骤数据 |
| | | List<SettleDto> list = JSON.parseArray(businessTripOther.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; |
| | | } |
| | | } |
| | | businessTripOther.setSettleMsg(JSON.toJSONString(list)); |
| | | |
| | | // 修改规划单状态 |
| | | businessTripOther.setSettle(2); // 申请通过 |
| | | businessTripOther.setStatus(1); |
| | | businessTripOther.setUpdateId(getUserId()); |
| | | businessTripOther.setUpdateTime(now); |
| | | if (!businessTripOtherService.updateById(businessTripOther)) { |
| | | throw new CoolException("审核失败,请联系管理员"); |
| | | } |
| | | } else { |
| | | return R.error("抱歉,您没有批准的权限!!!"); |
| | | } |
| | | break; |
| | | default: |
| | | return R.error(); |
| | | } |
| | | return R.ok("审批成功"); |
| | | } |
| | | |
| | | } |
| | |
| | | @RequestMapping("/dashboard/popup/auth") |
| | | public R popup(String token) { |
| | | String item = "false"; |
| | | if (Cools.isEmpty(token)){ |
| | | return R.ok(item); |
| | | } |
| | | User user = getUser(token); |
| | | if (Cools.isEmpty(user) || Cools.isEmpty(user.getRoleId())){ |
| | | return R.ok(item); |
| | | } |
| | | if (user.getRoleId()<3){ |
| | | item="true"; |
| | | } |
| | |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 跟踪项目ID |
| | | */ |
| | | @ApiModelProperty(value= "跟踪项目ID") |
| | | @TableField("order_id") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
New file |
| | |
| | | package com.zy.crm.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.zy.crm.manager.utils.TimeCalculatorUtils; |
| | | import com.zy.crm.system.entity.Dept; |
| | | import com.zy.crm.system.entity.Dic; |
| | | import com.zy.crm.system.entity.User; |
| | | import com.zy.crm.system.service.DeptService; |
| | | import com.zy.crm.system.service.DicService; |
| | | import com.zy.crm.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_business_trip_other") |
| | | public class BusinessTripOther implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 出差事由 |
| | | */ |
| | | @ApiModelProperty(value= "出差事由") |
| | | @TableField("business_trip_reasons") |
| | | private String businessTripReasons; |
| | | |
| | | /** |
| | | * 交通工具 |
| | | */ |
| | | @ApiModelProperty(value= "交通工具") |
| | | @TableField("business_transportation") |
| | | private Integer businessTransportation; |
| | | |
| | | /** |
| | | * 单程往返 |
| | | */ |
| | | @ApiModelProperty(value= "单程往返") |
| | | @TableField("business_return") |
| | | private Integer businessReturn; |
| | | |
| | | /** |
| | | * 出发省 |
| | | */ |
| | | @ApiModelProperty(value= "出发省") |
| | | @TableField("business_start_province") |
| | | private String businessStartProvince; |
| | | |
| | | /** |
| | | * 出发市 |
| | | */ |
| | | @ApiModelProperty(value= "出发市") |
| | | @TableField("business_start_city") |
| | | private String businessStartCity; |
| | | |
| | | /** |
| | | * 出发县 |
| | | */ |
| | | @ApiModelProperty(value= "出发县") |
| | | @TableField("business_start_district") |
| | | private String businessStartDistrict; |
| | | |
| | | /** |
| | | * 出发镇 |
| | | */ |
| | | @ApiModelProperty(value= "出发镇") |
| | | @TableField("business_start_town") |
| | | private String businessStartTown; |
| | | |
| | | /** |
| | | * 出发地 |
| | | */ |
| | | @ApiModelProperty(value= "出发地") |
| | | @TableField("business_start_addr") |
| | | private String businessStartAddr; |
| | | |
| | | /** |
| | | * 目的省 |
| | | */ |
| | | @ApiModelProperty(value= "目的省") |
| | | @TableField("business_end_province") |
| | | private String businessEndProvince; |
| | | |
| | | /** |
| | | * 目的市 |
| | | */ |
| | | @ApiModelProperty(value= "目的市") |
| | | @TableField("business_end_city") |
| | | private String businessEndCity; |
| | | |
| | | /** |
| | | * 目的县 |
| | | */ |
| | | @ApiModelProperty(value= "目的县") |
| | | @TableField("business_end_district") |
| | | private String businessEndDistrict; |
| | | |
| | | /** |
| | | * 目的镇 |
| | | */ |
| | | @ApiModelProperty(value= "目的镇") |
| | | @TableField("business_end_town") |
| | | private String businessEndTown; |
| | | |
| | | /** |
| | | * 目的地 |
| | | */ |
| | | @ApiModelProperty(value= "目的地") |
| | | @TableField("business_end_addr") |
| | | private String businessEndAddr; |
| | | |
| | | /** |
| | | * 出发日期 |
| | | */ |
| | | @ApiModelProperty(value= "出发日期") |
| | | @TableField("business_start_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date businessStartTime; |
| | | |
| | | /** |
| | | * 结束日期 |
| | | */ |
| | | @ApiModelProperty(value= "结束日期") |
| | | @TableField("business_end_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date businessEndTime; |
| | | |
| | | /** |
| | | * 出差时长 |
| | | */ |
| | | @ApiModelProperty(value= "出差时长") |
| | | @TableField("business_duration") |
| | | private Double businessDuration; |
| | | |
| | | /** |
| | | * 出差天数 |
| | | */ |
| | | @ApiModelProperty(value= "出差天数") |
| | | @TableField("business_trip_days") |
| | | private Integer businessTripDays; |
| | | |
| | | /** |
| | | * 出差备注 |
| | | */ |
| | | @ApiModelProperty(value= "出差备注") |
| | | @TableField("business_notes") |
| | | private String businessNotes; |
| | | |
| | | /** |
| | | * 出行人、同行人 |
| | | */ |
| | | @ApiModelProperty(value= "出行人、同行人") |
| | | @TableField("business_peers") |
| | | private String businessPeers; |
| | | |
| | | /** |
| | | * 同行人ID |
| | | */ |
| | | @ApiModelProperty(value= "同行人ID") |
| | | @TableField("business_peers_id") |
| | | private Long businessPeersId; |
| | | |
| | | /** |
| | | * 自驾私家车车牌号 |
| | | */ |
| | | @ApiModelProperty(value= "自驾私家车车牌号") |
| | | @TableField("car_number") |
| | | private String carNumber; |
| | | |
| | | /** |
| | | * 自驾私家车行程明细及公里数 |
| | | */ |
| | | @ApiModelProperty(value= "自驾私家车行程明细及公里数") |
| | | private String kilometers; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value= "创建人") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 所属部门 |
| | | */ |
| | | @ApiModelProperty(value= "所属部门") |
| | | @TableField("dept_id") |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * hostId |
| | | */ |
| | | @ApiModelProperty(value= "hostId") |
| | | @TableField("host_id") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 跟踪项目ID |
| | | */ |
| | | @ApiModelProperty(value= "跟踪项目ID") |
| | | @TableField("order_id") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 更新时间 |
| | | */ |
| | | @ApiModelProperty(value= "更新时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 更新人员ID |
| | | */ |
| | | @ApiModelProperty(value= "更新人员ID") |
| | | @TableField("update_id") |
| | | private Long updateId; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String form; |
| | | |
| | | /** |
| | | * 进度 |
| | | */ |
| | | @ApiModelProperty(value= "进度") |
| | | private Integer settle; |
| | | |
| | | /** |
| | | * 流程进度 |
| | | */ |
| | | @ApiModelProperty(value= "流程进度") |
| | | @TableField("settle_msg") |
| | | private String settleMsg; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 已完成 0: 未完成 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @ApiModelProperty(value= "类型") |
| | | @TableField("business_trip_type") |
| | | private Integer businessTripType; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @ApiModelProperty(value= "开始时辰") |
| | | @TableField("business_start_time_day") |
| | | private Integer businessStartTimeDay; |
| | | |
| | | /** |
| | | * 类型 |
| | | */ |
| | | @ApiModelProperty(value= "结束时辰") |
| | | @TableField("business_end_time_day") |
| | | private Integer businessEndTimeDay; |
| | | |
| | | @TableField(exist = false) |
| | | private String pcdStart; |
| | | |
| | | @TableField(exist = false) |
| | | private String pcdEnd; |
| | | |
| | | /** |
| | | * 出差时长 |
| | | */ |
| | | @ApiModelProperty(value= "金额") |
| | | @TableField("amount_of_money") |
| | | private Double amountOfMoney; |
| | | |
| | | public BusinessTripOther() {} |
| | | |
| | | public BusinessTripOther(String businessTripReasons, Integer businessTransportation, Integer businessReturn, String businessStartProvince, String businessStartCity, String businessStartDistrict, String businessStartTown, String businessStartAddr, String businessEndProvince, String businessEndCity, String businessEndDistrict, String businessEndTown, String businessEndAddr, Date businessStartTime, Date businessEndTime, Double businessDuration, Integer businessTripDays, String businessNotes, String businessPeers, Long businessPeersId, String carNumber, String kilometers, Long userId, Long deptId, Long hostId, Date createTime, Date updateTime, Long updateId, String form, Integer settle, String settleMsg, Integer status, Integer businessTripType, Integer businessStartTimeDay, Integer businessEndTimeDay,Double amountOfMoney) { |
| | | this.businessTripReasons = businessTripReasons; |
| | | this.businessTransportation = businessTransportation; |
| | | this.businessReturn = businessReturn; |
| | | this.businessStartProvince = businessStartProvince; |
| | | this.businessStartCity = businessStartCity; |
| | | this.businessStartDistrict = businessStartDistrict; |
| | | this.businessStartTown = businessStartTown; |
| | | this.businessStartAddr = businessStartAddr; |
| | | this.businessEndProvince = businessEndProvince; |
| | | this.businessEndCity = businessEndCity; |
| | | this.businessEndDistrict = businessEndDistrict; |
| | | this.businessEndTown = businessEndTown; |
| | | this.businessEndAddr = businessEndAddr; |
| | | this.businessStartTime = businessStartTime; |
| | | this.businessEndTime = businessEndTime; |
| | | this.businessDuration = businessDuration; |
| | | this.businessTripDays = businessTripDays; |
| | | this.businessNotes = businessNotes; |
| | | this.businessPeers = businessPeers; |
| | | this.businessPeersId = businessPeersId; |
| | | this.carNumber = carNumber; |
| | | this.kilometers = kilometers; |
| | | this.userId = userId; |
| | | this.deptId = deptId; |
| | | this.hostId = hostId; |
| | | this.createTime = createTime; |
| | | this.updateTime = updateTime; |
| | | this.updateId = updateId; |
| | | this.form = form; |
| | | this.settle = settle; |
| | | this.settleMsg = settleMsg; |
| | | this.status = status; |
| | | this.businessTripType = businessTripType; |
| | | this.businessStartTimeDay = businessStartTimeDay; |
| | | this.businessEndTimeDay = businessEndTimeDay; |
| | | this.amountOfMoney = amountOfMoney; |
| | | } |
| | | |
| | | // BusinessTrip businessTrip = new BusinessTrip( |
| | | // null, // 出差事由[非空] |
| | | // null, // 交通工具[非空] |
| | | // null, // 单程往返[非空] |
| | | // null, // 出发省 |
| | | // null, // 出发市 |
| | | // null, // 出发县 |
| | | // null, // 出发镇 |
| | | // null, // 出发地[非空] |
| | | // null, // 目的省 |
| | | // null, // 目的市 |
| | | // null, // 目的县 |
| | | // null, // 目的镇 |
| | | // null, // 目的地[非空] |
| | | // null, // 出发日期[非空] |
| | | // null, // 结束日期[非空] |
| | | // null, // 出差时长 |
| | | // null, // 出差天数 |
| | | // null, // 出差备注 |
| | | // null, // 出行人、同行人[非空] |
| | | // null, // 同行人ID |
| | | // null, // 自驾私家车车牌号[非空] |
| | | // null, // 自驾私家车行程明细及公里数[非空] |
| | | // null, // 创建人 |
| | | // null, // 所属部门 |
| | | // null, // hostId |
| | | // null, // 创建时间 |
| | | // null, // 更新时间 |
| | | // null, // 更新人员ID |
| | | // null, // |
| | | // null, // 进度 |
| | | // null, // 流程进度 |
| | | // null, // 状态 |
| | | // null // 类型 |
| | | // ); |
| | | |
| | | public String getBusinessStartTime$(){ |
| | | if (Cools.isEmpty(this.businessStartTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.businessStartTime); |
| | | } |
| | | |
| | | public String getBusinessEndTime$(){ |
| | | if (Cools.isEmpty(this.businessEndTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.businessEndTime); |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getUpdateId$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateId); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUserId$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.userId); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getDeptId$(){ |
| | | DeptService service = SpringUtils.getBean(DeptService.class); |
| | | Dept dept = service.selectById(this.deptId); |
| | | if (!Cools.isEmpty(dept)){ |
| | | return String.valueOf(dept.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getSettle$(){ |
| | | if (null == this.settle){ return null; } |
| | | switch (this.settle){ |
| | | case 1: |
| | | return "等待批准"; |
| | | case 2: |
| | | return "申请通过"; |
| | | default: |
| | | return String.valueOf(this.settle); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "已完成"; |
| | | case 0: |
| | | return "未完成"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getBusinessTransportation$(){ |
| | | if (null == this.businessTransportation){ return null; } |
| | | switch (this.businessTransportation){ |
| | | case 1: |
| | | return "飞机"; |
| | | case 2: |
| | | return "高铁"; |
| | | case 3: |
| | | return "火车"; |
| | | case 4: |
| | | return "汽车"; |
| | | case 5: |
| | | return "摩托"; |
| | | case 6: |
| | | return "电车"; |
| | | default: |
| | | // return String.valueOf(this.status); |
| | | return "其它"; |
| | | } |
| | | } |
| | | |
| | | public String getBusinessReturn$(){ |
| | | if (null == this.businessTransportation){ return null; } |
| | | switch (this.businessTransportation){ |
| | | case 1: |
| | | return "单程"; |
| | | case 2: |
| | | return "往返"; |
| | | default: |
| | | // return String.valueOf(this.status); |
| | | return "其它"; |
| | | } |
| | | } |
| | | |
| | | public String getBusinessStartTimeDay$(){ |
| | | if (null == this.businessStartTimeDay){ return null; } |
| | | switch (this.businessStartTimeDay){ |
| | | case 1: |
| | | return TimeCalculatorUtils.timeYestMonthDay(this.businessStartTime)+ "上午"; |
| | | case 2: |
| | | return TimeCalculatorUtils.timeYestMonthDay(this.businessStartTime)+ "下午"; |
| | | default: |
| | | // return String.valueOf(this.status); |
| | | return "未知"; |
| | | } |
| | | } |
| | | |
| | | public String getBusinessEndTimeDay$(){ |
| | | if (null == this.businessEndTimeDay){ return null; } |
| | | switch (this.businessTransportation){ |
| | | case 1: |
| | | return TimeCalculatorUtils.timeYestMonthDay(this.businessEndTime)+ "上午"; |
| | | case 2: |
| | | return TimeCalculatorUtils.timeYestMonthDay(this.businessEndTime)+ "下午"; |
| | | default: |
| | | // return String.valueOf(this.status); |
| | | return "未知"; |
| | | } |
| | | } |
| | | |
| | | 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(); |
| | | if (!Cools.isEmpty(businessStartProvince)) { |
| | | sb.append(businessStartProvince).append(","); |
| | | } |
| | | if (!Cools.isEmpty(businessStartCity)) { |
| | | sb.append(businessStartCity).append(","); |
| | | } |
| | | if (!Cools.isEmpty(businessStartDistrict)) { |
| | | sb.append(businessStartDistrict).append(","); |
| | | } |
| | | String s = sb.toString(); |
| | | if (s.endsWith(",")) { |
| | | s = s.substring(0, s.length() - 1); |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | public String getPcdStart$() { |
| | | StringBuilder sb = new StringBuilder(); |
| | | DicService service = SpringUtils.getBean(DicService.class); |
| | | if (!Cools.isEmpty(businessStartProvince)) { |
| | | Dic provinceDic = service.selectById(businessStartProvince); |
| | | if (!Cools.isEmpty(provinceDic)) { |
| | | sb.append(provinceDic.getName()).append(","); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(businessStartCity)) { |
| | | Dic cityDic = service.selectById(businessStartCity); |
| | | if (!Cools.isEmpty(cityDic)) { |
| | | sb.append(cityDic.getName()).append(","); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(businessStartDistrict)) { |
| | | Dic districtDic = service.selectById(businessStartDistrict); |
| | | if (!Cools.isEmpty(districtDic)) { |
| | | sb.append(districtDic.getName()).append(","); |
| | | } |
| | | } |
| | | String s = sb.toString(); |
| | | if (s.endsWith(",")) { |
| | | s = s.substring(0, s.length() - 1); |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | public void setPcdStart(String pcdStart) { |
| | | this.pcdStart = pcdStart; |
| | | if (!Cools.isEmpty(pcdStart)) { |
| | | String[] split = this.pcdStart.split(","); |
| | | for (int i = 0;i< split.length; i++) { |
| | | switch (i) { |
| | | case 0: |
| | | this.businessStartProvince = split[0]; |
| | | break; |
| | | case 1: |
| | | this.businessStartCity = split[1]; |
| | | break; |
| | | case 2: |
| | | this.businessStartDistrict = split[2]; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | this.businessStartProvince = ""; |
| | | this.businessStartCity = ""; |
| | | this.businessStartDistrict = ""; |
| | | } |
| | | } |
| | | |
| | | public String getPcdEnd() { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (!Cools.isEmpty(businessEndProvince)) { |
| | | sb.append(businessEndProvince).append(","); |
| | | } |
| | | if (!Cools.isEmpty(businessEndCity)) { |
| | | sb.append(businessEndCity).append(","); |
| | | } |
| | | if (!Cools.isEmpty(businessEndDistrict)) { |
| | | sb.append(businessEndDistrict).append(","); |
| | | } |
| | | String s = sb.toString(); |
| | | if (s.endsWith(",")) { |
| | | s = s.substring(0, s.length() - 1); |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | public String getPcdEnd$() { |
| | | StringBuilder sb = new StringBuilder(); |
| | | DicService service = SpringUtils.getBean(DicService.class); |
| | | if (!Cools.isEmpty(businessEndProvince)) { |
| | | Dic provinceDic = service.selectById(businessEndProvince); |
| | | if (!Cools.isEmpty(provinceDic)) { |
| | | sb.append(provinceDic.getName()).append(","); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(businessEndCity)) { |
| | | Dic cityDic = service.selectById(businessEndCity); |
| | | if (!Cools.isEmpty(cityDic)) { |
| | | sb.append(cityDic.getName()).append(","); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(businessEndDistrict)) { |
| | | Dic districtDic = service.selectById(businessEndDistrict); |
| | | if (!Cools.isEmpty(districtDic)) { |
| | | sb.append(districtDic.getName()).append(","); |
| | | } |
| | | } |
| | | String s = sb.toString(); |
| | | if (s.endsWith(",")) { |
| | | s = s.substring(0, s.length() - 1); |
| | | } |
| | | return s; |
| | | } |
| | | |
| | | public void setPcdEnd(String pcdEnd) { |
| | | this.pcdEnd = pcdEnd; |
| | | if (!Cools.isEmpty(pcdEnd)) { |
| | | String[] split = this.pcdEnd.split(","); |
| | | for (int i = 0;i< split.length; i++) { |
| | | switch (i) { |
| | | case 0: |
| | | this.businessEndProvince = split[0]; |
| | | break; |
| | | case 1: |
| | | this.businessEndCity = split[1]; |
| | | break; |
| | | case 2: |
| | | this.businessEndDistrict = split[2]; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | this.businessEndProvince = ""; |
| | | this.businessEndCity = ""; |
| | | this.businessEndDistrict = ""; |
| | | } |
| | | } |
| | | |
| | | public String getBusinessStartAddr$(){ |
| | | if (!Cools.isEmpty(businessStartAddr)){ |
| | | return getPcdStart$()+"--"+businessStartAddr; |
| | | } |
| | | return getPcdStart$(); |
| | | } |
| | | |
| | | public String getBusinessEndAddr$(){ |
| | | if (!Cools.isEmpty(businessEndAddr)){ |
| | | return getPcdEnd$()+"--"+businessEndAddr; |
| | | } |
| | | return getPcdStart$(); |
| | | } |
| | | |
| | | public String getAmountOfMoney$(){ |
| | | if (null == this.amountOfMoney) return "0\t元"; |
| | | return this.amountOfMoney+"\t元"; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.crm.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.crm.manager.entity.BusinessTripOther; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface BusinessTripOtherMapper extends BaseMapper<BusinessTripOther> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.crm.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.crm.manager.entity.BusinessTripOther; |
| | | |
| | | public interface BusinessTripOtherService extends IService<BusinessTripOther> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.crm.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.crm.manager.entity.BusinessTripOther; |
| | | import com.zy.crm.manager.mapper.BusinessTripOtherMapper; |
| | | import com.zy.crm.manager.service.BusinessTripOtherService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("businessTripOtherService") |
| | | public class BusinessTripOtherServiceImpl extends ServiceImpl<BusinessTripOtherMapper, BusinessTripOther> implements BusinessTripOtherService { |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.crm.manager.mapper.BusinessTripOtherMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.BusinessTripOther"> |
| | | <id column="id" property="id" /> |
| | | <result column="business_trip_reasons" property="businessTripReasons" /> |
| | | <result column="business_transportation" property="businessTransportation" /> |
| | | <result column="business_return" property="businessReturn" /> |
| | | <result column="business_start_province" property="businessStartProvince" /> |
| | | <result column="business_start_city" property="businessStartCity" /> |
| | | <result column="business_start_district" property="businessStartDistrict" /> |
| | | <result column="business_start_town" property="businessStartTown" /> |
| | | <result column="business_start_addr" property="businessStartAddr" /> |
| | | <result column="business_end_province" property="businessEndProvince" /> |
| | | <result column="business_end_city" property="businessEndCity" /> |
| | | <result column="business_end_district" property="businessEndDistrict" /> |
| | | <result column="business_end_town" property="businessEndTown" /> |
| | | <result column="business_end_addr" property="businessEndAddr" /> |
| | | <result column="business_start_time" property="businessStartTime" /> |
| | | <result column="business_end_time" property="businessEndTime" /> |
| | | <result column="business_duration" property="businessDuration" /> |
| | | <result column="business_trip_days" property="businessTripDays" /> |
| | | <result column="business_notes" property="businessNotes" /> |
| | | <result column="business_peers" property="businessPeers" /> |
| | | <result column="business_peers_id" property="businessPeersId" /> |
| | | <result column="car_number" property="carNumber" /> |
| | | <result column="kilometers" property="kilometers" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="host_id" property="hostId" /> |
| | | <result column="order_id" property="orderId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_id" property="updateId" /> |
| | | <result column="form" property="form" /> |
| | | <result column="settle" property="settle" /> |
| | | <result column="settle_msg" property="settleMsg" /> |
| | | <result column="status" property="status" /> |
| | | <result column="business_trip_type" property="businessTripType" /> |
| | | <result column="business_start_time_day" property="businessStartTimeDay" /> |
| | | <result column="business_end_time_day" property="businessEndTimeDay" /> |
| | | <result column="amount_of_money" property="amountOfMoney" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | ,{field: 'userId$', align: 'center',title: '申请人',hide: false} |
| | | ,{field: 'deptId$', align: 'center',title: '所属部门',hide: false} |
| | | ,{field: 'hostId', align: 'center',title: 'hostId',hide: true} |
| | | ,{field: 'orderId', 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} |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | | cascader: 'cascader/cascader', |
| | | }).use(['table','laydate', 'form', 'admin', 'cascader', 'tree', 'dropdown'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | 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({ |
| | | elem: '#businessTripOther', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/businessTripOther/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | // {type: 'checkbox'}, |
| | | {field: 'id', align: 'center',title: 'ID',hide: true} |
| | | ,{field: 'businessTripReasons', align: 'center',title: '出差事由',hide: false} |
| | | ,{field: 'amountOfMoney$', align: 'center',title: '金额',hide: false} |
| | | ,{field: 'userId$', align: 'center',title: '申请人',hide: false} |
| | | ,{field: 'deptId$', align: 'center',title: '所属部门',hide: true} |
| | | ,{field: 'hostId', align: 'center',title: 'hostId',hide: true} |
| | | ,{field: 'orderId', 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} |
| | | ,{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} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:180} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(businessTripOther)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(businessTripOther)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'businessTripOther': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/businessTripOther/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(businessTripOther)', 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: "businessTripOther_more.html", |
| | | end: function () { |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | }) |
| | | break; |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: ["95%", "75%"], |
| | | title: (mData ? '修改' : '添加') + '出差申请', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | if (mData) { |
| | | $('#cascaderValStart').val(mData.pcdStart); |
| | | } |
| | | if (mData) { |
| | | $('#cascaderValEnd').val(mData.pcdEnd); |
| | | } |
| | | layDateRender(mData); |
| | | cascaderRenderStart(); |
| | | cascaderRenderEnd(); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/businessTripOther/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | 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}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/businessTripOther/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | 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}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '#businessStartTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['businessStartTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#businessEndTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['businessEndTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | // 省市区选择 |
| | | function cascaderRenderStart() { |
| | | cascader.render({ |
| | | elem: '#cascaderValStart', |
| | | data: citysData, |
| | | itemHeight: '250px', |
| | | filterable: true, |
| | | onChange: function (values, data) { |
| | | // console.log(values);console.log(data); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 省市区选择 |
| | | function cascaderRenderEnd() { |
| | | cascader.render({ |
| | | elem: '#cascaderValEnd', |
| | | data: citysData, |
| | | itemHeight: '250px', |
| | | filterable: true, |
| | | onChange: function (values, data) { |
| | | // console.log(values);console.log(data); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function approval(planId, plannerId, dIdx) { |
| | | let loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/businessTripOther/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}); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| | |
| | | <div class="layui layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">项目名: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="orderId" placeholder="请输入项目名" style="display: none" lay-verify="required"> |
| | | <input id="orderId$" name="orderId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入项目名" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="planQueryNameBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="planQueryNameBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">出差事由: </label> |
| | | <div class="layui-input-block"> |
| | | <textarea class="layui-textarea" name="businessTripReasons" placeholder="请输入备注" maxlength="1024" autocomplete="off" lay-verify="required"></textarea> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/tree.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/layui/lay/modules/formDesigner/coolForm.css" /> |
| | | <style> |
| | | .nav-box { |
| | | position: absolute; |
| | | top: 1px; |
| | | left: 5px; |
| | | } |
| | | .nav-box-item { |
| | | display: inline-block; |
| | | vertical-align: middle; |
| | | margin-right: 5px; |
| | | } |
| | | |
| | | .layui-menu li { |
| | | width: inherit; |
| | | } |
| | | |
| | | .layui-form-radio:hover *, .layui-form-radioed, .layui-form-radioed>i { |
| | | color: #2d8cf0; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <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>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="businessTripOther" lay-filter="businessTripOther"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">出差申请</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </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> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/layui/lay/modules/cascader/citys-data.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/businessTrip/businessTripOther.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form" style="height: 100%;overflow-y: hidden;"> |
| | | <div class="model-form" style="height: 87%;overflow-x: hidden;overflow-y: scroll"> |
| | | <input name="id" type="hidden"> |
| | | <!--基本信息--> |
| | | <blockquote class="layui-elem-quote" style="margin-left: 30px;padding: 8px 15px;">基本信息</blockquote> |
| | | <div class="layui layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">项目名: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="orderId" placeholder="请输入项目名" style="display: none" lay-verify="required"> |
| | | <input id="orderId$" name="orderId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入项目名" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="planQueryNameBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="planQueryNameBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">出差事由: </label> |
| | | <div class="layui-input-block"> |
| | | <textarea class="layui-textarea" name="businessTripReasons" placeholder="请输入备注" maxlength="1024" autocomplete="off" lay-verify="required"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">预估金额: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="amountOfMoney" placeholder="请输入金额(元)" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--其它--> |
| | | <blockquote class="layui-elem-quote" style="margin-left: 30px;padding: 8px 15px;">其它信息</blockquote> |
| | | <div class="layui layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <textarea class="layui-textarea" name="businessNotes" placeholder="请输入备注" maxlength="1024" autocomplete="off"></textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <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> |
| | | </html> |
| | | |
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 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 + "/businessTripOther/" + businessTripId + "/auth2", |
| | | 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> |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">完成时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="finishTime" id="finishTime$" placeholder="请输入完成时间"> |
| | | <input class="layui-input" name="finishTime" id="finishTime$" placeholder="请输入完成时间" readonly="readonly"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |