自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-18 0b83d075e78acfded07fafe8da133376b2260ef6
src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -11,25 +11,26 @@
    tableIns = table.render({
        elem: '#wrkMast',
        headers: {token: localStorage.getItem('token')},
        url: '/wrkMast/list/auth',
        url: baseUrl+'/wrkMast/list/auth',
        page: true,
        limit: 10,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox'}
            ,{field: 'wrkNo', align: 'center',title: '工作号',sort: true,event: 'detlShow'}
            ,{field: 'ioTime$', align: 'center',title: '工作时间',sort: true,event: 'detlShow', width:200}
            ,{field: 'wrkSts$', align: 'center',title: '工作状态',event: 'detlShow', width:150}
            ,{field: 'ioType$', align: 'center',title: '入出库类型',event: 'detlShow', width:150}
            ,{field: 'ioPri', align: 'center',title: '优先级',event: 'detlShow'}
            ,{field: 'crnNo$', align: 'center',title: '堆垛机',event: 'detlShow'}
            ,{field: 'sourceStaNo$', align: 'center',title: '源站',event: 'detlShow'}
            ,{field: 'staNo$', align: 'center',title: '目标站',event: 'detlShow'}
            ,{field: 'sourceLocNo$', align: 'center',title: '源库位',event: 'detlShow', width:100}
            ,{field: 'locNo$', align: 'center',title: '目标库位',event: 'detlShow', width:100}
            ,{field: 'barcode', align: 'center',title: '条码',event: 'detlShow'}
            ,{field: 'wrkNo', align: 'center',title: '工作号',sort: true}
            ,{field: 'ioTime$', align: 'center',title: '工作时间',sort: true, width: 160}
            ,{field: 'wrkSts$', align: 'center',title: '工作状态'}
            ,{field: 'ioType$', align: 'center',title: '入出库类型'}
            ,{field: 'ioPri', align: 'center',title: '优先级'}
            ,{field: 'crnNo$', align: 'center',title: '堆垛机'}
            ,{field: 'sourceStaNo$', align: 'center',title: '源站'}
            ,{field: 'staNo$', align: 'center',title: '目标站'}
            ,{field: 'sourceLocNo$', align: 'center',title: '源库位'}
            ,{field: 'locNo$', align: 'center',title: '目标库位'}
            ,{field: 'barcode', align: 'center',title: '条码'}
            // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){
            //         var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.picking === 'Y'){html += " checked ";}
@@ -63,7 +64,7 @@
            //         return html;
            //     }}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:130}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:200}
        ]],
        request: {
            pageName: 'curr',
@@ -82,7 +83,7 @@
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
@@ -112,7 +113,7 @@
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
@@ -139,7 +140,7 @@
                } else {
                    layer.confirm('确定增加'+(list.length===1?'此':list.length)+'条数据的优先级吗', function(){
                        $.ajax({
                            url: "/wrkMast/add/pri/auth",
                            url: baseUrl+"/wrkMast/add/pri/auth",
                            headers: {'token': localStorage.getItem('token')},
                            contentType:'application/json;charset=UTF-8',
                            data: JSON.stringify(list),
@@ -149,8 +150,9 @@
                                layer.closeAll();
                                if (res.code === 200){
                                    $(".layui-laypage-btn")[0].click();
                                    layer.msg(res.msg);
                                } else if (res.code === 403){
                                    top.location.href = "/";
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
@@ -174,7 +176,7 @@
                } else {
                    layer.confirm('确定降低'+(list.length===1?'此':list.length)+'条数据的优先级吗', function(){
                        $.ajax({
                            url: "/wrkMast/red/pri/auth",
                            url: baseUrl+"/wrkMast/red/pri/auth",
                            headers: {'token': localStorage.getItem('token')},
                            contentType:'application/json;charset=UTF-8',
                            data: JSON.stringify(list),
@@ -184,8 +186,9 @@
                                layer.closeAll();
                                if (res.code === 200){
                                    $(".layui-laypage-btn")[0].click();
                                    layer.msg(res.msg);
                                } else if (res.code === 403){
                                    top.location.href = "/";
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
@@ -216,7 +219,7 @@
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                        $.ajax({
                            url: "/wrkMast/delete/auth",
                            url: baseUrl+"/wrkMast/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
@@ -226,7 +229,7 @@
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = "/";
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
@@ -236,7 +239,7 @@
                }
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', function(){
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
@@ -254,7 +257,7 @@
                        'fields': fields
                    };
                    $.ajax({
                        url: "/wrkMast/export/auth",
                        url: baseUrl+"/wrkMast/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
@@ -265,7 +268,7 @@
                            if (res.code === 200) {
                                table.exportFile(titles,res.data,'xls');
                            } else if (res.code === 403) {
                                top.location.href = "/";
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
@@ -295,6 +298,27 @@
                    content: 'wrkDetl.html',
                    success: function(layero, index){
                    }
                });
                break;
            // 完成
            case 'complete':
                layer.confirm('确认完成该笔工作档?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                    http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:1}, function (res) {
                        $(".layui-laypage-btn")[0].click();
                        layer.msg(data.wrkNo + res.msg);
                    })
                    layer.closeAll();
                });
                break;
            // 取消
            case 'cancel':
                layer.confirm('确认取消该笔工作档?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                    http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:2}, function (res) {
                        $(".layui-laypage-btn")[0].click();
                        layer.msg(data.wrkNo + res.msg);
                    })
                    layer.closeAll();
                });
                break;
            // 详情
@@ -353,7 +377,7 @@
                       content: '../locMast/locMast_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: "/locMast/"+ param +"/auth",
                               url: baseUrl+"/locMast/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
@@ -389,7 +413,7 @@
                       content: '../basDevp/basDevp_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: "/basDevp/"+ param +"/auth",
                               url: baseUrl+"/basDevp/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
@@ -425,7 +449,7 @@
                       content: '../basDevp/basDevp_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: "/basDevp/"+ param +"/auth",
                               url: baseUrl+"/basDevp/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
@@ -461,7 +485,7 @@
                       content: '../locMast/locMast_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: "/locMast/"+ param +"/auth",
                               url: baseUrl+"/locMast/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
@@ -563,7 +587,7 @@
        };
        $.ajax({
            url: "/wrkMast/"+name+"/auth",
            url: baseUrl+"/wrkMast/"+name+"/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject(data),
            method: 'POST',
@@ -575,7 +599,7 @@
                        $(this).val("");
                    });
                } else if (res.code === 403){
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
@@ -668,10 +692,11 @@
        tableIns1 = table.render({
            elem: '#wrkDetlByMap',
            headers: {token: localStorage.getItem('token')},
            url: '/wrkDetl/list/auth',
            url: baseUrl+'/wrkDetl/list/auth',
            where: {wrk_no: param},
            page: true,
            limit: 16,
            limits: [16, 30, 50, 100, 200, 500],
            even: true,
            toolbar: '#toolbar',
            cellMinWidth: 50,
@@ -711,7 +736,7 @@
            },
            done: function(res, curr, count) {
                if (res.code === 403) {
                    top.location.href = "/";
                    top.location.href = baseUrl+"/";
                }
                pageCur=curr;
                form.on('checkbox(tableCheckbox)', function (data) {
@@ -745,7 +770,7 @@
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = "/";
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {