| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import zy.cloud.wms.common.web.BaseController; |
| | | import zy.cloud.wms.manager.entity.Cstmr; |
| | | import zy.cloud.wms.manager.entity.Item; |
| | | import zy.cloud.wms.manager.entity.ProjectPlan; |
| | | import zy.cloud.wms.manager.entity.ProjectType; |
| | | import zy.cloud.wms.manager.service.CstmrService; |
| | | import zy.cloud.wms.manager.service.ItemService; |
| | | import zy.cloud.wms.manager.service.ProjectPlanService; |
| | | import zy.cloud.wms.manager.service.ProjectTypeService; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.service.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | private ItemService itemService; |
| | | @Autowired |
| | | private ProjectPlanService planService; |
| | | @Autowired |
| | | private FlowStatusService flowStatusService; |
| | | |
| | | @RequestMapping(value = "/item/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 初始化生成项目节点 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/item/initPlan/auth") |
| | | @ManagerAuth |
| | | public R initPlan(@RequestParam("id") String param){ |
| | | if (param != null){ |
| | | List<ProjectPlan> projectPlans = planService.selectList(new EntityWrapper<ProjectPlan>().eq("item_id",param)); |
| | | if(!Cools.isEmpty(projectPlans) && projectPlans.size()>0){ |
| | | return R.error("该项目已有节点计划"); |
| | | } |
| | | List<FlowStatus> flowStatuses = flowStatusService.selectList(new EntityWrapper<FlowStatus>()); |
| | | if(!Cools.isEmpty(flowStatuses) && flowStatuses.size()>0){ |
| | | for(FlowStatus flowStatus : flowStatuses){ |
| | | ProjectPlan projectPlan = new ProjectPlan(); |
| | | projectPlan.setItemId(Long.parseLong(param)); |
| | | projectPlan.setWeightNum(flowStatus.getWeightNum()); |
| | | projectPlan.setFlowId(flowStatus.getId()); |
| | | planService.insert(projectPlan); |
| | | } |
| | | } else { |
| | | return R.error("项目计划节点基础数据为空"); |
| | | } |
| | | } else { |
| | | return R.error("项目参数错误"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | // ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:180} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | var ids = [data.id]; |
| | | del(ids); |
| | | break; |
| | | case "initPlan": |
| | | initPlan(data.id); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | /* 初始化项目节点 */ |
| | | function initPlan(id) { |
| | | layer.confirm('确定要生成该项目计划节点吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/item/initPlan/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {id: id}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | |
| | |
| | | '</p>'].join(''),*/ |
| | | defaultToolbar: [], |
| | | cols: [[ |
| | | {field: 'id', title: '编号', width: 70, align: 'center'}, |
| | | {field: 'uuid', title: '订单号', width: 100, align: 'center'}, |
| | | {field: 'inUuid', title: '项目编号'}, |
| | | {field: 'name', title: '项目名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | |
| | | {type: 'checkbox', hide:true} |
| | | // ,{field: 'id', align: 'center',title: '唯一ID'} |
| | | ,{field: 'itemId$', align: 'center',title: '项目名称'} |
| | | ,{field: 'flowId$', align: 'center',title: '节点名称'} |
| | | ,{field: 'weightNum', align: 'center',title: '权重值'} |
| | | ,{field: 'flowId$', align: 'center',title: '节点名称', width:180} |
| | | ,{field: 'weightNum', align: 'center',title: '权重值', hide:true} |
| | | // ,{field: 'flowId', align: 'center',title: '节点ID'} |
| | | |
| | | ,{field: 'startTime$', align: 'center',title: '计划开始时间'} |
| | | ,{field: 'endTime$', align: 'center',title: '计划结束时间'} |
| | | ,{field: 'realStartTime$', align: 'center',title: '实际开始时间'} |
| | | ,{field: 'realEndTime$', align: 'center',title: '实际结束时间'} |
| | | ,{field: 'delay', align: 'center',title: '延期天数'} |
| | | ,{field: 'startTime$', align: 'center',title: '计划开始时间', width:115} |
| | | ,{field: 'endTime$', align: 'center',title: '计划结束时间', width:115} |
| | | ,{field: 'realStartTime$', align: 'center',title: '实际开始时间', width:115} |
| | | ,{field: 'realEndTime$', align: 'center',title: '实际结束时间', width:115} |
| | | ,{field: 'delay', align: 'center',title: '延期天数', width:90} |
| | | ,{field: 'delayReason', align: 'center',title: '延期原因'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'dutyDepartment', align: 'center',title: '责任部门'} |
| | | ,{field: 'dutyMan', align: 'center',title: '责任人'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ,{field: 'dutyMan', align: 'center',title: '责任人', width:80} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:70} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | data:{}, |
| | | success:function(res){ |
| | | if(res.code==200){ |
| | | console.log(res) |
| | | // console.log(res) |
| | | data=res.data |
| | | // 判断时间是否有null 有null的改为 "" |
| | | for(var i = 0;i<data.length;i++){ |
| | |
| | | |
| | | <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-primary layui-btn-xs btn-edit" lay-event="initPlan">生成计划节点</a> |
| | | <!-- <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">禁用</a>--> |
| | | </script> |
| | | |
| | |
| | | <label class="layui-icon layui-icon-password"></label> |
| | | <input type="password" id="password" name="password" placeholder="请输入登录密码" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | <div id="code-box" class="layui-form-item"> |
| | | <label class="layui-icon layui-icon-vercode"></label> |
| | | <input type="text" id="code" name="code" placeholder="图形验证码" autocomplete="off" class="layui-input verification captcha"> |
| | | <div class="captcha-img" style="margin-right: 5px"> |
| | | <img id="codeImg" title="看不清?点击换一张。"> |
| | | </div> |
| | | </div> |
| | | <!-- <div id="code-box" class="layui-form-item">--> |
| | | <!-- <label class="layui-icon layui-icon-vercode"></label>--> |
| | | <!-- <input type="text" id="code" name="code" placeholder="图形验证码" autocomplete="off" class="layui-input verification captcha">--> |
| | | <!-- <div class="captcha-img" style="margin-right: 5px">--> |
| | | <!-- <img id="codeImg" title="看不清?点击换一张。">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="layui-form-item"> |
| | | <input type="checkbox" id="rememberPwd" value="true" lay-skin="primary" title="记住密码"> |
| | | </div> |
| | |
| | | notice.msg('密码不能为空', {icon: 2}); |
| | | return false; |
| | | } |
| | | if (data.code === '' && codeSwitch === 'Y') { |
| | | $("#code").focus(); |
| | | notice.msg('验证码不能为空', {icon: 2}); |
| | | return false; |
| | | } |
| | | if (sessionStorage.getItem("code").toUpperCase() !== data.code.toUpperCase() && codeSwitch==='Y'){ |
| | | $("#code").focus(); |
| | | notice.msg('验证码错误', {icon: 2}); |
| | | return false; |
| | | } |
| | | // if (data.code === '' && codeSwitch === 'Y') { |
| | | // $("#code").focus(); |
| | | // notice.msg('验证码不能为空', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | // if (sessionStorage.getItem("code").toUpperCase() !== data.code.toUpperCase() && codeSwitch==='Y'){ |
| | | // $("#code").focus(); |
| | | // notice.msg('验证码错误', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | var user = { |
| | | username: data.username, |
| | | password: hex_md5(data.password) |
| | |
| | | <div class="layui-col-md9"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <form class="layui-form toolbar"> |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">编号:</label> |
| | |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | <table class="layui-hide" id="projectPlan" lay-filter="projectPlan"></table> |
| | | </div> |
| | | </div> |