自动化立体仓库 - WMS系统
whycq
2024-05-14 c32b5055bf1c71faab49325d513a927cba2cbc59
src/main/webapp/static/js/agvBasDevp/basDevp.js
@@ -10,7 +10,7 @@
    tableIns = table.render({
        elem: '#agvBasDevp',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/agvBasDevp/list/auth',
        url: baseUrl+'/agv/basDevp/list/auth',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
@@ -20,8 +20,7 @@
        cols: [[
            {type: 'checkbox', fixed: 'left'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'stationCode', align: 'center',sort:true,title: '工作站编号'}
            ,{field: 'devNo', align: 'center',sort:true,title: '工作位编号'}
            ,{field: 'devNo', align: 'center',sort:true,title: '工作位编号',width:150}
            // ,{field: 'decDesc', align: 'center',title: '设备描述'}
            // ,{field: 'devMk', align: 'center',title: '备注'}
            ,{field: 'inEnable', align: 'center',title: '可入', templet:function(row){
@@ -36,57 +35,14 @@
                    html += ">";
                    return html;
                }}
            ,{field: 'autoing', align: 'center',title: '自动', templet:function(row){
                    var html = "<input value='autoing' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.autoing === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                }}
            // ,{field: 'loading', align: 'center',title: '有物', templet:function(row){
            //         var html = "<input value='loading' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.loading === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            // ,{field: 'canining', align: 'center',title: '能入', templet:function(row){
            //         var html = "<input value='canining' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.canining === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            // ,{field: 'canouting', align: 'center',title: '能出', templet:function(row){
            //         var html = "<input value='canouting' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.canouting === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            // ,{field: 'fronting', align: 'center',title: ''}
            // ,{field: 'rearing', align: 'center',title: ''}
            // ,{field: 'uping', align: 'center',title: ''}
            // ,{field: 'downing', align: 'center',title: ''}
            // ,{field: 'inreq1', align: 'center',title: '需求1', templet:function(row){
            //         var html = "<input value='inreq1' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.inreq1 === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            ,{field: 'cacheShelves', align: 'center',title: '是否缓存货架', templet:function(row){
                    var html = "<input value='cacheShelves' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.cacheShelves === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                }}
            ,{field: 'locSts$', align: 'center',title: '货位状态'}
            ,{field: 'wrkNo', align: 'center',title: '工作号', edit:true,  style:'color: blue;font-weight: bold'}
            //,{field: 'wrkNo', align: 'center',title: '工作号', edit:true,  style:'color: blue;font-weight: bold'}
            ,{field: 'floor', align: 'center',title: '楼'}
            //,{field: 'locType1$', align: 'center',title: '高低'}
            ,{field: 'barcode', align: 'center',title: '条形码'}
            ,{field: 'inQty', align: 'center',title: '入库暂存'}
            // ,{field: 'row1', align: 'center',title: ''}
            // ,{field: 'ioTime$', align: 'center',title: ''}
            // ,{field: 'area', align: 'center',title: ''}
            // ,{field: 'inOk', align: 'center',title: ''}
            // ,{field: 'outOk', align: 'center',title: ''}
            ,{field: 'locType1$', align: 'center',title: '库位类型'}
            ,{field: 'locType2', align: 'center',title: "容器类型"}
            ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser', hide:true}
            ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true}
            // ,{field: 'appeUser$', align: 'center',title: '创建者',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'}
@@ -97,7 +53,7 @@
            //,{field: 'grossWt', align: 'center',title: '重量'}
            // ,{field: 'cartPos', align: 'center',title: ''}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:200}
        ]],
        request: {
            pageName: 'curr',
@@ -139,7 +95,7 @@
            return;
        }
        $.ajax({
            url: baseUrl+"/basDevp/update/auth",
            url: baseUrl+"/agv/basDevp/update/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject({
                devNo: obj.data.devNo,
@@ -217,7 +173,7 @@
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                        $.ajax({
                            url: baseUrl+"/basDevp/delete/auth",
                            url: baseUrl+"/agv/basDevp/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
@@ -235,6 +191,61 @@
                        })
                    });
                }
                break;
            case "createWrk":
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择数据');
                } else {
                    layer.confirm('确定入库'+(data.length===1?'此':data.length)+'个站点货物吗?', function(){
                        $.ajax({
                            url: baseUrl+"/agv/create/waitPain/wrkMast/start",
                            headers: {'token': localStorage.getItem('token')},
                            data: {param: JSON.stringify(data)},
                            method: 'POST',
                            traditional:true,
                            success: function (res) {
                                if (res.code === 200){
                                    layer.closeAll();
                                    tableReload(false);
                                } else if (res.code === 403){
                                    top.location.href = baseUrl+"/";
                                } else {
                                    layer.msg(res.msg)
                                }
                            }
                        })
                    })
                }
                break;
            case "init":
                layer.prompt({title: '请输入口令,并重置库位', formType: 1,   shadeClose: true}, function(pass, idx){
                    http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) {
                        if (res.data) {
                            $.ajax({
                                url: baseUrl+"/agv/basDevp/init/auth",
                                headers: {'token': localStorage.getItem('token')},
                                data: {param: JSON.stringify(data)},
                                method: 'POST',
                                traditional:true,
                                success: function (res) {
                                    if (res.code === 200){
                                        layer.closeAll();
                                        tableReload(false);
                                    } else if (res.code === 403){
                                        top.location.href = baseUrl+"/";
                                    } else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        } else {
                            layer.msg("口令错误");
                        }
                        layer.close(idx);
                    })
                });
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
@@ -255,7 +266,7 @@
                        'fields': fields
                    };
                    $.ajax({
                        url: baseUrl+"/basDevp/export/auth",
                        url: baseUrl+"/agv/basDevp/export/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        dataType:'json',
@@ -319,6 +330,43 @@
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                break;
            case 'detl':
                // locDetl(data.locNo);
                if (data.locSts.trim() === ''
                    || data.locSts.trim() === 'S'
                    || data.locSts.trim() === 'D'
                    || data.locSts.trim() === 'O')  {
                    layer.msg("此站点的状态不存在物料");
                    return;
                }
                locDetlToLayer(data.devNo,data.barcode);
                break;
            case 'unbind':
                // locDetl(data.locNo);
                if (data.barcode === null || data.barcode.trim() === '')  {
                    layer.msg("此站点暂未绑定任何条码");
                    return;
                }
                layer.confirm('确定解绑'+(data.devNo)+'站点的托盘码?', function(){
                    $.ajax({
                        url: baseUrl+"/agv/basDevp/unbind/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: {param: JSON.stringify(data)},
                        method: 'POST',
                        traditional:true,
                        success: function (res) {
                            if (res.code === 200){
                                layer.closeAll();
                                tableReload(false);
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
                        }
                    })
                });
                break;
            case 'modiUser':
@@ -423,8 +471,8 @@
            cacheShelves: $('#cacheShelves').val(),
            decDesc: $('#decDesc').val(),
            devMk: $('#devMk').val(),
            inEnable: $('#inEnable').val(),
            outEnable: $('#outEnable').val(),
            inEnable: $('#inEnable').next().hasClass('layui-form-checked') ? "Y" : "N",
            outEnable: $('#outEnable').next().hasClass('layui-form-checked') ? "Y" : "N",
            autoing: $('#autoing').val(),
            loading: $('#loading').val(),
            canining: $('#canining').val(),
@@ -454,11 +502,14 @@
            maxWt: $('#maxWt').val(),
            grossWt: $('#grossWt').val(),
            cartPos: $('#cartPos').val(),
            floor: $('#floor').val(),
            locType1: $('#locType1').val(),
            locType2: $('#locType2').val(),
        };
        console.log(data);
        $.ajax({
            url: baseUrl+"/agvBasDevp/"+name+"/auth",
            url: baseUrl+"/agv/basDevp/"+name+"/auth",
            headers: {'token': localStorage.getItem('token')},
            data: top.reObject(data),
            method: 'POST',
@@ -479,15 +530,21 @@
        })
    }
    // 复选框事件
    form.on('checkbox(detailCheckbox)', function (data) {
        var el = data.elem;
        if (el.checked) {
            $(el).val('Y');
        } else {
            $(el).val('N');
        }
    });
    // iframe物料详情
    function locDetlToLayer(val1,val2) {
        devNo = val1;
        barcode = val2;
        layer.open({
            type: 2,
            title: '站点明细',
            maxmin: true,
            area: [top.detailWidth, top.detailHeight],
            shadeClose: true,
            content: '../agvBasDevp/basDevpWaitPakinDetail.html',
            success: function(layero, index){
            }
        });
    }
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {