luxiaotao1123
2021-03-02 0be9b760e948e9c60ef5495a2e6bc66961c8fd17
src/main/webapp/static/js/pakStore/pakStore.js
@@ -1,12 +1,22 @@
var initCountVal = 0;
var matCodeData = [];
function getCol() {
    var cols = [
        {fixed: 'left', field: 'count', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        {type: 'checkbox', fixed: 'left'},
        {
            fixed: 'left',
            field: 'count',
            title: '数量(必填)',
            align: 'center',
            edit: 'text',
            width: 120,
            style: 'color: blue;font-weight: bold'
        }
    ];
    cols.push.apply(cols, matCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    cols.push({field: 'matStatus', title: '物料状态', align: 'center', width: 120, templet: '#matStatus'});
    cols.push({fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 80});
    return cols;
}
@@ -74,7 +84,12 @@
                        if (res.code === 200){
                            layer.msg("入库启动成功,目标库位:" + res.data);
                            matCodeData = [];
                            tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}});
                            tableIns.reload({
                                data: matCodeData, done: function (res) {
                                    limit();
                                    getInBound();
                                }
                            });
                        } else if (res.code === 403){
                            top.location.href = baseUrl+"/";
                        }else {
@@ -96,11 +111,13 @@
                        matCodeData.splice(i, 1);
                    }
                }
                tableIns.reload({data: matCodeData,done:function (res) {
                tableIns.reload({
                    data: matCodeData, done: function (res) {
                        limit();
                        getInBound();
                        // 覆盖render方法的done
                    }});
                    }
                });
                break;
        }
    });
@@ -127,11 +144,13 @@
            }
        }
        tableIns.reload({data: matCodeData,done:function (res) {
        tableIns.reload({
            data: matCodeData, done: function (res) {
                limit();
                getInBound();
                // 覆盖render方法的done
            }});
            }
        });
    }
    // 获取可用入库站点
@@ -194,3 +213,80 @@
    tableIns.reload({data: matCodeData});
    layer.close(matCodeLayerIdx);
}
// 打开批量修改物料状态弹窗
var matStatusConfirm;
function showMatStatus() {
    var layer = layui.layer;
    var table = layui.table;
    // 获取选中行
    var checkStatus = table.checkStatus('chooseData');
    // 选择行数据
    var checkData = checkStatus.data;
    if (checkData.length == 0) {
        layer.msg("请选择数据");
        return;
    }
    matStatusConfirm = layer.open({
        type: 2,
        title: '选择物料状态',
        area: ['300px', '175px'],
        content: 'matStatus.html',
        btn: ['确定'],
        success: function (layero, index) {
            // 成功打开弹窗
        },
        yes: function (index, layero) {
            //do something
            // 子页面
            var matStatus = layero.find('iframe')[0].contentDocument;
            // 页面选择数据监控
            var forms = matStatus.forms;
            var cho = forms[0][0].value;
            // 更新表单数据
            matCodeData.map(function (item) {
                checkData.map(function (e) {
                    if (item.matNo === e.matNo) {
                        item.matStatus = cho;
                    }
                });
            });
            // 表格数据重载
            tableIns.reload({data: matCodeData});
            // 关闭弹窗
            layer.close(index);
        }
    });
}
// 关闭批量修改物料状态弹窗
function closeMatStatus() {
    var layer = layui.layer;
    layer.close(matStatusConfirm);
}
// 批量移除
function batchRemove() {
    debugger
    var layer = layui.layer;
    var table = layui.table;
    // 获取选中行
    var checkStatus = table.checkStatus('chooseData');
    // 选择行数据
    var checkData = checkStatus.data;
    if (checkData.length == 0) {
        layer.msg("请选择数据");
        return;
    }
    // 更新表单数据
        for (var k =  checkData.length-1; k >= 0; k--) {
            for(var i = matCodeData.length-1; i >= 0; i--) {
                if (matCodeData[i].matNo === checkData[k].matNo) {
                    matCodeData.splice(i, 1);
                }
            }
        }
    // 表格数据重载
    tableIns.reload({data: matCodeData});
}