| | |
| | | private PriQuoteBudgetService priQuoteBudgetService; |
| | | |
| | | @Autowired |
| | | private ProcessPermissionsService processPermissionsService; |
| | | |
| | | @Autowired |
| | | private PlanTypeService planTypeService; |
| | | |
| | | @RequestMapping(value = "/priQuote/{id}/auth") |
| | |
| | | priQuote.setForm(JSON.toJSONString(map)); // 自定义表单内容 |
| | | priQuote.setSettle(1); // 1.开始 |
| | | User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 获取部门领导 |
| | | User president = userService.selectOne(new EntityWrapper<User>().eq("role_id",1).eq("username","王开杰")); // 获取总裁办确认人 |
| | | ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 2).eq("process", 3));//2:报价流程 |
| | | User president = userService.selectById(processPermissions.getUserId()); // 获取报价流程节点3确认人 |
| | | priQuote.setSettleMsg(JSON.toJSONString(SettleDto.initPriQuote(plan, manager,president,getUser()))); |
| | | |
| | | planService.updateById(plan); |
| | |
| | | break; |
| | | case 2: |
| | | // 查找规划组长 |
| | | User planLeader = userService.selectOne(new EntityWrapper<User>().eq("username","王开杰")); |
| | | ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 2).eq("process", 3));//2:报价流程 |
| | | User planLeader = userService.selectById(processPermissions.getUserId()); // 获取报价流程节点3确认人 |
| | | if (Cools.isEmpty(planLeader)) { |
| | | throw new CoolException("未查找总裁办,请联系管理员"); |
| | | throw new CoolException("未查找到报价流程节点3确认人,请联系在审批权限添加确认人!"); |
| | | } |
| | | if (!getUserId().equals(planLeader.getId())) { |
| | | return R.error("抱歉,您没有审核的权限"); |
New file |
| | |
| | | package com.zy.crm.manager.controller; |
| | | |
| | | 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.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.manager.entity.ProcessPermissions; |
| | | import com.zy.crm.manager.service.ProcessPermissionsService; |
| | | 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.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class ProcessPermissionsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ProcessPermissionsService processPermissionsService; |
| | | @Autowired |
| | | private UserService userService; |
| | | |
| | | @RequestMapping(value = "/processPermissions/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(processPermissionsService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissions/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<ProcessPermissions> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(processPermissionsService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | 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 { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissions/add/auth") |
| | | @ManagerAuth |
| | | public R add(ProcessPermissions processPermissions) { |
| | | int count = processPermissionsService.selectCount(new EntityWrapper<ProcessPermissions>().eq("process_memo", processPermissions.getProcessMemo()).eq("process", processPermissions.getProcess())); |
| | | if (count>0){ |
| | | return R.error("权限类型:"+processPermissions.getProcessMemo$()+"、权限节点:"+processPermissions.getProcess()+"已存在"); |
| | | } |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("username", processPermissions.getUserName())); |
| | | processPermissions.setUserId(user.getId()); |
| | | processPermissionsService.insert(processPermissions); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissions/update/auth") |
| | | @ManagerAuth |
| | | public R update(ProcessPermissions processPermissions){ |
| | | if (Cools.isEmpty(processPermissions) || null==processPermissions.getId()){ |
| | | return R.error(); |
| | | } |
| | | int count = processPermissionsService.selectCount(new EntityWrapper<ProcessPermissions>() |
| | | .eq("process_memo", processPermissions.getProcessMemo()).eq("process", processPermissions.getProcess()).ne("id",processPermissions.getId())); |
| | | if (count>0){ |
| | | return R.error("权限类型:"+processPermissions.getProcessMemo$()+"、权限节点:"+processPermissions.getProcess()+"已存在"); |
| | | } |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("username", processPermissions.getUserName())); |
| | | processPermissions.setUserId(user.getId()); |
| | | processPermissionsService.updateById(processPermissions); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissions/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | processPermissionsService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissions/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<ProcessPermissions> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("processPermissions")); |
| | | convert(map, wrapper); |
| | | List<ProcessPermissions> list = processPermissionsService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissionsQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<ProcessPermissions> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<ProcessPermissions> page = processPermissionsService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ProcessPermissions processPermissions : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", processPermissions.getId()); |
| | | map.put("value", processPermissions.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/processPermissions/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<ProcessPermissions> wrapper = new EntityWrapper<ProcessPermissions>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != processPermissionsService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(ProcessPermissions.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
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 io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_process_permissions") |
| | | public class ProcessPermissions implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 员工姓名 |
| | | */ |
| | | @ApiModelProperty(value= "员工姓名") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 员工ID |
| | | */ |
| | | @ApiModelProperty(value= "员工ID") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 报价单权限 |
| | | */ |
| | | @ApiModelProperty(value= "报价单权限") |
| | | @TableField("pri_quote") |
| | | private String priQuote; |
| | | |
| | | /** |
| | | * 报销权限 |
| | | */ |
| | | @ApiModelProperty(value= "报销权限") |
| | | private String reimburse; |
| | | |
| | | /** |
| | | * 备用字段1 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段1") |
| | | private String standby1; |
| | | |
| | | /** |
| | | * 备用字段2 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段2") |
| | | private String standby2; |
| | | |
| | | /** |
| | | * 备用字段3 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段3") |
| | | private String standby3; |
| | | |
| | | /** |
| | | * 备用字段4 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段4") |
| | | private String standby4; |
| | | |
| | | /** |
| | | * 备用字段5 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段5") |
| | | private String standby5; |
| | | |
| | | /** |
| | | * 备用字段6 |
| | | */ |
| | | @ApiModelProperty(value= "备用字段6") |
| | | private String standby6; |
| | | |
| | | /** |
| | | * 权限节点 |
| | | */ |
| | | @ApiModelProperty(value= "权限节点") |
| | | private Integer process; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 权限类型 |
| | | */ |
| | | @ApiModelProperty(value= "权限类型") |
| | | @TableField("process_memo") |
| | | private Integer processMemo; |
| | | |
| | | public ProcessPermissions() {} |
| | | |
| | | public ProcessPermissions(String userName, Long userId, String priQuote, String reimburse, String standby1, String standby2, String standby3, String standby4, String standby5, String standby6, Integer process, String memo, Integer processMemo) { |
| | | this.userName = userName; |
| | | this.userId = userId; |
| | | this.priQuote = priQuote; |
| | | this.reimburse = reimburse; |
| | | this.standby1 = standby1; |
| | | this.standby2 = standby2; |
| | | this.standby3 = standby3; |
| | | this.standby4 = standby4; |
| | | this.standby5 = standby5; |
| | | this.standby6 = standby6; |
| | | this.process = process; |
| | | this.memo = memo; |
| | | this.processMemo = processMemo; |
| | | } |
| | | |
| | | public String getProcessMemo$(){ |
| | | if (null == this.processMemo){ return null; } |
| | | switch (this.processMemo){ |
| | | case 1: |
| | | return "核价流程"; |
| | | case 2: |
| | | return "报价流程"; |
| | | case 3: |
| | | return "报销流程"; |
| | | case 4: |
| | | return "出差流程"; |
| | | default: |
| | | return String.valueOf(this.processMemo); |
| | | } |
| | | } |
| | | |
| | | // ProcessPermissions processPermissions = new ProcessPermissions( |
| | | // null, // 员工姓名[非空] |
| | | // null, // 员工ID[非空] |
| | | // null, // 报价单权限 |
| | | // null, // 报销权限 |
| | | // null, // 备用字段1 |
| | | // null, // 备用字段2 |
| | | // null, // 备用字段3 |
| | | // null, // 备用字段4 |
| | | // null, // 备用字段5 |
| | | // null, // 备用字段6 |
| | | // null, // 权限节点[非空] |
| | | // null, // 备注 |
| | | // null // 权限类型[非空] |
| | | // ); |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("check_data_file") |
| | | private String checkDataFile; |
| | | |
| | | /** |
| | | * 表单内容 |
| | | */ |
| | | @ApiModelProperty(value= "表单内容") |
| | | private String form; |
| | | |
| | | /** |
| | | * 进度 1: 开始 2: 组长审核 3: 售前组长审核 4: 规划员审核 5: 审批通过 |
| | | */ |
| | | @ApiModelProperty(value= "进度 1: 开始 2: 组长审核 3: 售前审核 4: 审批通过 ") |
| | | private Integer settle; |
| | | |
| | | /** |
| | | * 审核进度 |
| | | */ |
| | | @ApiModelProperty(value= "审核进度") |
| | | @TableField("settle_msg") |
| | | private String settleMsg; |
| | | |
| | | public ReimburseOnline() {} |
| | | |
| | | public ReimburseOnline(String title, String sheetData, Date createTime, String filepath) { |
New file |
| | |
| | | package com.zy.crm.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.crm.manager.entity.ProcessPermissions; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface ProcessPermissionsMapper extends BaseMapper<ProcessPermissions> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.crm.manager.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.crm.manager.entity.ProcessPermissions; |
| | | |
| | | public interface ProcessPermissionsService extends IService<ProcessPermissions> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.crm.manager.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.crm.manager.entity.ProcessPermissions; |
| | | import com.zy.crm.manager.mapper.ProcessPermissionsMapper; |
| | | import com.zy.crm.manager.service.ProcessPermissionsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("processPermissionsService") |
| | | public class ProcessPermissionsServiceImpl extends ServiceImpl<ProcessPermissionsMapper, ProcessPermissions> implements ProcessPermissionsService { |
| | | |
| | | } |
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.ProcessPermissionsMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.ProcessPermissions"> |
| | | <id column="id" property="id" /> |
| | | <result column="user_name" property="userName" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="pri_quote" property="priQuote" /> |
| | | <result column="reimburse" property="reimburse" /> |
| | | <result column="standby1" property="standby1" /> |
| | | <result column="standby2" property="standby2" /> |
| | | <result column="standby3" property="standby3" /> |
| | | <result column="standby4" property="standby4" /> |
| | | <result column="standby5" property="standby5" /> |
| | | <result column="standby6" property="standby6" /> |
| | | <result column="process" property="process" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="process_memo" property="processMemo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <result column="status" property="status" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="check_data" property="checkData" /> |
| | | <result column="form" property="form" /> |
| | | <result column="settle" property="settle" /> |
| | | <result column="settle_msg" property="settleMsg" /> |
| | | </resultMap> |
| | | |
| | | <!-- 查询结果不包含excel数据data,以免结果集过大 --> |
| | |
| | | <result column="dept_id" property="deptId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="form" property="form" /> |
| | | <result column="settle" property="settle" /> |
| | | <result column="settle_msg" property="settleMsg" /> |
| | | </resultMap> |
| | | |
| | | <select id="listByPage" resultMap="NoDataResultMap"> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#processPermissions', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/processPermissions/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: 'userName', align: 'center',title: '员工姓名' ,hide : false} |
| | | ,{field: 'userId', align: 'center',title: '员工ID' ,hide : false} |
| | | ,{field: 'processMemo$', align: 'center',title: '权限类型' ,hide : false} |
| | | ,{field: 'process', align: 'center',title: '权限节点' ,hide : false} |
| | | ,{field: 'memo', align: 'center',title: '备注' ,hide : false} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120 ,hide : false} |
| | | ]], |
| | | 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(processPermissions)', 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(processPermissions)', 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 = { |
| | | 'processPermissions': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/processPermissions/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(processPermissions)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/processPermissions/"+(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+"/processPermissions/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 () { |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(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} |
| | | }); |
| | | } |
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"> |
| | | </head> |
| | | <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-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="processPermissions" lay-filter="processPermissions"></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"> |
| | | <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/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/js/processPermissions/processPermissions.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">员工姓名: </label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="userName" class="layui-input" name="userName" type="text" placeholder="请选择员工" autocomplete="off" style="display: none" lay-verify="required"> |
| | | <input id="userName$" name="userName" 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="userQueryBywrkSts" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBywrkStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label layui-form-required">员工ID: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="userId" placeholder="请输入员工ID" lay-vertype="tips" lay-verify="required">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">报价单权限: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="priQuote" placeholder="请输入报价单权限">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">报销权限: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="reimburse" placeholder="请输入报销权限">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">备用字段1: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="standby1" placeholder="请输入备用字段1">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">备用字段2: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="standby2" placeholder="请输入备用字段2">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">备用字段3: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="standby3" placeholder="请输入备用字段3">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">备用字段4: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="standby4" placeholder="请输入备用字段4">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">备用字段5: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="standby5" placeholder="请输入备用字段5">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">备用字段6: </label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input class="layui-input" name="standby6" placeholder="请输入备用字段6">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">权限类型: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="processMemo" lay-vertype="tips" lay-verify="required"> |
| | | <option value="">请选择状态</option> |
| | | <option value="1">核价流程</option> |
| | | <option value="2">报价流程</option> |
| | | <option value="3">报销流程</option> |
| | | <option value="4">出差流程</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">权限节点: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="process" lay-vertype="tips" lay-verify="required"> |
| | | <option value="">请选择状态</option> |
| | | <option value="1">1</option> |
| | | <option value="2">2</option> |
| | | <option value="3">3</option> |
| | | <option value="4">4</option> |
| | | <option value="5">5</option> |
| | | <option value="6">6</option> |
| | | <option value="7">7</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="memo" placeholder="请输入备注"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <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> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |