luxiaotao1123
2021-06-18 e4ea838c20e94dff4fdbb4f82b542a8b5790fa9d
src/main/webapp/static/js/safeSto/safeSto.js
@@ -15,20 +15,18 @@
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox'}
            {type: 'numbers', fixed: 'left'}
            ,{field: 'node_name', align: 'center',title: '货位'}
            ,{field: 'matnr', align: 'center',title: '商品编号'}
            ,{field: 'maktx', align: 'center',title: '商品名称'}
            // ,{field: 'nodeId$', align: 'center',title: '关联货位'}
            ,{field: 'nodeId', align: 'center',title: '货位名称'}
            ,{field: 'safeQua', align: 'center',title: '安全库存'}
            ,{field: 'amount', align: 'center',title: '实际库存'}
            ,{field: 'progress', align: 'center',title: '进度', templet: '#progressTpl'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150}
            ,{field: 'progress', align: 'center',title: '使用情况', templet: '#progressTpl', width: 350}
            ,{field: 'status', align: 'center',title: '警报', templet: '#statusTpl', width: 100}
            ,{field: 'safe_qua', align: 'center',title: '安全库存量', style: 'font-weight: bold'}
            ,{field: 'amount', align: 'center',title: '当前库存量', style: 'font-weight: bold'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120}
        ]],
        request: {
            pageName: 'curr',
@@ -105,56 +103,20 @@
    table.on('tool(safeSto)', function(obj){
        var data = obj.data;
        switch (obj.event) {
            // 详情
            case 'detail':
            // 补仓
            case 'allot':
                layer.open({
                    type: 2,
                    title: '详情',
                    maxmin: true,
                    area: ['30%', top.detailHeight],
                    title: '补仓',
                    offset: '100px',
                    area: ['90%', '80%'],
                    shadeClose: true,
                    content: 'prior_detail.html',
                    content: 'locAllot.html?matnr=' + data.matnr + '&node_id=' + data.node_id + '&safe_qua=' + data.safe_qua,
                    success: function(layero, index){
                        setFormVal(layer.getChildFrame('#detail', index), data, true);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                })
                break;
            // 编辑
            case 'edit':
                layer.open({
                    type: 2,
                    title: '修改',
                    maxmin: true,
                    area: ['30%', top.detailHeight],
                    content: 'prior_detail.html',
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-save', index).hide();
                        setFormVal(layer.getChildFrame('#detail', index), data, false);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false);
                        top.convertDisabled(layer.getChildFrame('#id', index), true);
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
                });
                break;
        }
    });
    // 复选框事件
    form.on('checkbox(detailCheckbox)', function (data) {
        var el = data.elem;
        if (el.checked) {
            $(el).val('Y');
        } else {
            $(el).val('N');
        }
    });
@@ -198,22 +160,6 @@
        where: searchData,
        page: {
            curr: pageCurr
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
        }
    });
}