自动化立体仓库 - WMS系统
lty
8 天以前 539a56279625242c497b4b4093f2defbb9d80334
src/main/webapp/static/js/basDevp/basDevp.js
@@ -7,6 +7,7 @@
    var form = layui.form;
    // 数据渲染
    var initTable = function() {
    tableIns = table.render({
        elem: '#basDevp',
        headers: {token: localStorage.getItem('token')},
@@ -20,40 +21,40 @@
        cols: [[
            {type: 'checkbox', fixed: 'left'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'devNo', align: 'center',sort:true,title: '编号'}
                ,{field: 'devNo', align: 'center',sort:true,title: I18n.t('id')}
            // ,{field: 'decDesc', align: 'center',title: '设备描述'}
            // ,{field: 'devMk', align: 'center',title: '备注'}
            ,{field: 'inEnable', align: 'center',title: '可入', templet:function(row){
                ,{field: 'inEnable', align: 'center',title: I18n.t('in_enable'), templet:function(row){
                    var html = "<input value='inEnable' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.inEnable === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                }}
            ,{field: 'outEnable', align: 'center',title: '可出', templet:function(row){
                ,{field: 'outEnable', align: 'center',title: I18n.t('out_enable'), templet:function(row){
                    var html = "<input value='outEnable' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.outEnable === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                }}
            ,{field: 'autoing', align: 'center',title: '自动', templet:function(row){
                ,{field: 'autoing', align: 'center',title: I18n.t('autoing'), 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){
                ,{field: 'loading', align: 'center',title: I18n.t('loading'), 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){
                ,{field: 'canining', align: 'center',title: I18n.t('can_in'), 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){
                ,{field: 'canouting', align: 'center',title: I18n.t('can_out'), 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 += ">";
@@ -63,39 +64,39 @@
            // ,{field: 'rearing', align: 'center',title: ''}
            // ,{field: 'uping', align: 'center',title: ''}
            // ,{field: 'downing', align: 'center',title: ''}
            ,{field: 'inreq1', align: 'center',title: '需求1', templet:function(row){
                ,{field: 'inreq1', align: 'center',title: I18n.t('req_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: 'inreq2', align: 'center',title: '需求2', templet:function(row){
                ,{field: 'inreq2', align: 'center',title: I18n.t('req_2'), templet:function(row){
                    var html = "<input value='inreq2' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.inreq2 === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                }}
            ,{field: 'wrkNo', align: 'center',title: '工作号', edit:true,  style:'color: blue;font-weight: bold'}
                ,{field: 'wrkNo', align: 'center',title: I18n.t('work_no'), edit:true,  style:'color: blue;font-weight: bold'}
            // ,{field: 'wrkNo1', align: 'center',title: ''}
            ,{field: 'locType1$', align: 'center',title: '高低'}
            ,{field: 'barcode', align: 'center',title: '条形码'}
            ,{field: 'inQty', align: 'center',title: '入库暂存'}
                ,{field: 'locType1$', align: 'center',title: I18n.t('high_low_type')}
                ,{field: 'barcode', align: 'center',title: I18n.t('barcode')}
                ,{field: 'inQty', align: 'center',title: I18n.t('in_temp_store')}
            // ,{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: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser', hide:true}
            ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true}
                ,{field: 'modiUser$', align: 'center',title: I18n.t('modifier'),event: 'modiUser', hide:true}
                ,{field: 'modiTime$', align: 'center',title: I18n.t('modify_time'), hide:true}
            // ,{field: 'appeUser$', align: 'center',title: '创建者',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'}
            // ,{field: 'appeTime$', align: 'center',title: '添加时间'}
            // ,{field: 'stdQty', align: 'center',title: ''}
            // ,{field: 'minWt', align: 'center',title: ''}
            // ,{field: 'maxWt', align: 'center',title: ''}
            ,{field: 'grossWt', align: 'center',title: '重量'}
                ,{field: 'grossWt', align: 'center',title: I18n.t('weight')}
            // ,{field: 'cartPos', align: 'center',title: ''}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
                ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:150}
        ]],
        request: {
            pageName: 'curr',
@@ -117,6 +118,10 @@
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
                I18n.updatePage();
                setTimeout(function() {
                    I18n.updateLayuiPagination();
                }, 100);
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
@@ -128,11 +133,22 @@
            });
        }
    });
    }
    if (I18n.isReady()) {
        initTable();
    } else {
        $(document).on('i18n:ready', initTable);
    }
    $(document).on('i18n:languageChanged', function() {
        initTable();
    });
    // 页面修改
    table.on('edit(basDevp)', function (obj) {
        if (isNaN(obj.value)) {
            layer.msg("请输入数字");
            layer.msg(I18n.t('please_enter_number'));
            tableReload();
            return;
        }
@@ -175,6 +191,10 @@
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                I18n.updatePage();
                setTimeout(function() {
                    I18n.updateLayuiPagination();
                }, 100);
                limit();
            }
        });
@@ -187,7 +207,7 @@
            case 'addData':
                layer.open({
                    type: 2,
                    title: '新增',
                    title: I18n.t('add'),
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
@@ -201,12 +221,12 @@
                });
                break;
            case 'init':
                layer.prompt({title: '请输入口令,并初始化站点', formType: 1,   shadeClose: true}, function(pass, idx){
                layer.prompt({title: I18n.t('please_enter_password_init_station'), formType: 1,   shadeClose: true}, function(pass, idx){
                    http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) {
                        if (res.data) {
                            layer.open({
                                type: 1,
                                title: '初始化站点',
                                title: I18n.t('init_station'),
                                area: ["400px"],
                                maxmin: true,
                                shadeClose: true,
@@ -216,7 +236,7 @@
                                }
                            })
                        } else {
                            layer.msg("口令错误");
                            layer.msg(I18n.t('password_error'));
                        }
                        layer.close(idx);
                    })
@@ -233,9 +253,9 @@
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择数据');
                    layer.msg(I18n.t('please_select_data'));
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                    layer.confirm(I18n.t('confirm_delete_prefix')+(data.length===1?I18n.t('this'):data.length)+I18n.t('confirm_delete_suffix'), function(){
                        $.ajax({
                            url: baseUrl+"/basDevp/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
@@ -257,7 +277,7 @@
                }
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                layer.confirm(I18n.t('confirm_export_excel'), {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
@@ -327,7 +347,7 @@
            case 'detail':
                layer.open({
                    type: 2,
                    title: '详情',
                    title: I18n.t('detail'),
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
@@ -347,7 +367,7 @@
            case 'edit':
                layer.open({
                    type: 2,
                    title: '修改',
                    title: I18n.t('edit'),
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
@@ -366,11 +386,11 @@
            case 'modiUser':
                var param = top.reObject(data).modiUser;
                if (param === undefined) {
                    layer.msg("无数据");
                    layer.msg(I18n.t('no_data_found'));
                } else {
                    layer.open({
                        type: 2,
                        title: '修改详情',
                        title: I18n.t('modify_detail'),
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
@@ -403,11 +423,11 @@
            case 'appeUser':
                var param = top.reObject(data).appeUser;
                if (param === undefined) {
                    layer.msg("无数据");
                    layer.msg(I18n.t('no_data_found'));
                } else {
                    layer.open({
                        type: 2,
                        title: '创详情',
                        title: I18n.t('create_detail'),
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
@@ -578,6 +598,10 @@
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            I18n.updatePage();
            setTimeout(function() {
                I18n.updateLayuiPagination();
            }, 100);
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,