#
luxiaotao1123
2020-12-24 1fe4313bb3326afa12c827e2d620fa735b8e37fb
src/main/webapp/static/js/pakStore/stockAdjust.js
@@ -2,6 +2,17 @@
var initAnfmeVal = "-";
var matCodeData = [];
var currLocNo;
function getCol() {
    var cols = [
        {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '数量'}
    ];
    arrRemove(detlCols, "field", "anfme")
    cols.push.apply(cols, detlCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80})
    return cols;
}
layui.use(['table','laydate', 'form'], function() {
    var table = layui.table;
    var $ = layui.jquery;
@@ -16,22 +27,7 @@
        limit: 500,
        cellMinWidth: 50,
        toolbar: '#toolbar',
        cols: [[
            {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}
            ,{field: 'anfme', align: 'center',title: '数量'}
            ,{field: 'locNo$', align: 'center',title: '库位号'}
            ,{field: 'matnr', align: 'center',title: '物料'}
            ,{field: 'lgnum', align: 'center',title: '仓库号'}
            ,{field: 'tbnum', align: 'center',title: '转储请求编号'}
            // ,{field: 'tbpos', align: 'center',title: '行项目'}
            ,{field: 'zmatid', align: 'center',title: '物料标签ID'}
            ,{field: 'maktx', align: 'center',title: '物料描述'}
            ,{field: 'werks', align: 'center',title: '工厂'}
            ,{field: 'altme', align: 'center',title: '单位'}
            ,{field: 'zpallet', align: 'center',title: '托盘条码'}
            ,{field: 'bname', align: 'center',title: '用户ID'}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80}
        ]],
        cols: [getCol()],
        done: function (res, curr, count) {
            limit();
        }
@@ -79,7 +75,7 @@
                        success: function (res) {
                            if (res.code === 200){
                                layer.msg(currLocNo + res.msg);
                                reset();
                                init(currLocNo)
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            }else {
@@ -115,6 +111,15 @@
            layer.msg("请输入库位号");
            return;
        }
        init(locNo);
    });
    // 重置事件
    form.on('submit(reset)', function (data) {
        reset();
    });
    function init(locNo) {
        http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) {
            matCodeData = [];
            let data = res.data.records;
@@ -126,12 +131,7 @@
            locTips(true, locNo);
            tableReload();
        })
    });
    // 重置事件
    form.on('submit(reset)', function (data) {
        reset();
    });
    }
    function reset() {
        clearFormVal($('#search-box'));
@@ -154,7 +154,7 @@
                let data = res.data;
                if (data != null) {
                    $(".retrieve").show();
                    $("#locMsg").html(locNo + " ,库位状态:" + data.locType$);
                    $("#locMsg").html(locNo + " ,库位状态:" + data.locSts$);
                    $('.not-retrieve').hide();
                    currLocNo = locNo;
                } else {
@@ -226,12 +226,26 @@
function addTableData(data) {
    let applyData = [];
    for (var i=0;i<data.length;i++){
        applyData.push({
            count: initCountVal,
            anfme: initAnfmeVal,
            removeBtn: true,
            matnr: data[i].matNo
        })
        let pass = false;
        for (var j=0;j<matCodeData.length;j++){
            if (data[i].matNo === matCodeData[j].matnr) {
                pass = true;
                break;
            }
        }
        if (!pass) {
            applyData.push({
                count: initCountVal,
                anfme: initAnfmeVal,
                removeBtn: true,
                matnr: data[i].matNo,
                maktx: data[i].matName,
                lgnum: data[i].str2,
                color: data[i].str3,
                bname: data[i].str4,
                altme: data[i].str1,
            })
        }
    }
    matCodeData.push.apply(matCodeData,applyData);
    tableIns.reload({data: matCodeData});