.
18516761980
2022-04-06 e52ba640d14d79570345aa766dacbd15c7bad1cf
.
8个文件已修改
139 ■■■■ 已修改文件
src/main/java/zy/cloud/wms/manager/controller/ItemController.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/item/item.js 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/itemTable.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/projectPlan/projectPlan.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/tableData.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/item/item.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/login.html 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/projectPlan/projectPlan.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/zy/cloud/wms/manager/controller/ItemController.java
@@ -15,14 +15,8 @@
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.*;
@@ -34,6 +28,8 @@
    private ItemService itemService;
    @Autowired
    private ProjectPlanService planService;
    @Autowired
    private FlowStatusService flowStatusService;
    @RequestMapping(value = "/item/{id}/auth")
    @ManagerAuth
@@ -239,4 +235,36 @@
        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();
    }
}
src/main/webapp/static/js/item/item.js
@@ -49,7 +49,7 @@
            // ,{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',
@@ -159,6 +159,9 @@
                var ids = [data.id];
                del(ids);
                break;
            case "initPlan":
                initPlan(data.id);
                break;
        }
    });
@@ -228,6 +231,34 @@
        });
    }
    /* 初始化项目节点 */
    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) {
src/main/webapp/static/js/itemTable.js
@@ -37,7 +37,8 @@
            '</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) {
src/main/webapp/static/js/projectPlan/projectPlan.js
@@ -33,20 +33,20 @@
            {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',
src/main/webapp/static/js/tableData.js
@@ -72,7 +72,7 @@
            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++){
src/main/webapp/views/item/item.html
@@ -41,6 +41,7 @@
<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>
src/main/webapp/views/login.html
@@ -148,13 +148,13 @@
                    <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>
@@ -251,16 +251,16 @@
                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)
src/main/webapp/views/projectPlan/projectPlan.html
@@ -90,7 +90,7 @@
        <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>
@@ -104,7 +104,7 @@
                                </button>
                            </div>
                        </div>
                    </form>
                    </div>
                        <table class="layui-hide" id="projectPlan" lay-filter="projectPlan"></table>
                </div>
            </div>