自动化立体仓库 - WMS系统
#
Junjie
2025-08-12 fff32dc747a54cfa796c3ebde3334d54c7a827a3
src/main/webapp/static/js/pakStore/stockOut.js
@@ -2,7 +2,8 @@
var locDetlData = [];
function getCol() {
    var cols = [
        {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        {field: 'countWeight', align: 'center',title: '出库辅数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        ,{field: 'count', align: 'center',title: '出库数量', width: 130,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '库存数量'}
        ,{field: 'locNo$', align: 'center',title: '库位号'}
    ];
@@ -28,6 +29,7 @@
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        limit: 500,
        cols: [getCol()],
        done: function(res, curr, count) {
            limit();
@@ -56,6 +58,27 @@
                }
            }
        }
        if (obj.field === 'countWeight'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    modify = false;
                }
                if (vle > Number(data.weight)) {
                    layer.msg("出库数量不得大于库存数量", {icon: 2});
                    modify = false;
                }
                let arr = data.origin.split("/")
                let mainAnfme = vle * parseFloat(arr[1]) * parseFloat(arr[0])
                let flooredNum = Math.floor(mainAnfme * 10000) / 10000; // 截断到小数点后4位
                data.count = flooredNum
            }
        }
        if (modify) {
            data[obj.field] = obj.value;
        }
@@ -70,6 +93,7 @@
                    layer.msg('请先提取商品库存', {icon: 2});
                } else {
                    var staNo = $("#staNoSelect").val();
                    var itemId = $("#itemId").val();
                    if (staNo === "" || staNo === null){
                        layer.msg("请选择出库口", {icon: 2});
                        return;
@@ -137,6 +161,7 @@
    $(document).on('click','#mat-query', function () {
        let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false});
        locDetlLayerIdx = layer.open({
            type: 2,
            title: false,
@@ -146,6 +171,7 @@
            shadeClose: true,
            content: 'locDetlQuery.html',
            success: function(layero, index){
                layer.close(loadIndex);
            }
        });
    })
@@ -166,6 +192,7 @@
            data.splice(i--, 1);
        } else {
            data[i]["count"] = data[i]["anfme"];
            data[i]["countWeight"] = data[i]["weight"];
        }
    }
    locDetlData.push.apply(locDetlData, data);