王佳豪
2021-03-09 b301170fd119b1519b2b2cc8dfabf0c3bb754440
src/main/webapp/static/js/locNormal/locNormal.js
@@ -1,5 +1,6 @@
var pageCurr;
var locNormalList = [];
var locArea = [];
function getCol() {
    var cols = [];
@@ -8,7 +9,8 @@
    )
    cols.push.apply(cols, locNormalCols);
    cols.push(
        {field: 'state', align: 'center', title: '出入库状态', templet: '#locNormalState'}
        {field: 'warehouse', align: 'center', title: '库区'}
        , {field: 'state', align: 'center', title: '出入库状态', templet: '#locNormalState'}
        , {field: 'modiUser$', align: 'center', title: '修改人员', hide: true}
        , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true}
        , {field: 'appeTime$', align: 'center', title: '创建时间', hide: true}
@@ -16,6 +18,19 @@
    );
    return cols;
}
// 获取仓库下拉
$.ajax({
    url: baseUrl+"/locArea/queryAll/auth",
    headers: {'token': localStorage.getItem('token')},
    // data: top.reObject(data),
    method: 'POST',
    success: function (res) {
        if (res.data && res.data.length > 0) {
            locArea = res.data;
        }
    },
});
layui.use(['table', 'laydate', 'form', 'upload'], function () {
    var table = layui.table;
@@ -61,7 +76,6 @@
    /* 导入 */
    table.on('toolbar(locNormal)', function (obj) {
        debugger
        switch(obj.event) {
            // 导入
            case 'intoData':
@@ -101,11 +115,20 @@
            pageSize: 'limit'
        },
        parseData: function (res) {
            // 解析库区名称
            var records = res.data.records;
            records.map(function (item) {
                locArea.map(function (d) {
                    if (d.id == item.warehouse) {
                        item.warehouse = d.name;
                    }
                })
            });
            return {
                'code': res.code,
                'msg': res.msg,
                'count': res.data.total,
                'data': res.data.records
                'data': res.data.records,
            }
        },
        response: {