自动化立体仓库 - WMS系统
lty
7 天以前 539a56279625242c497b4b4093f2defbb9d80334
src/main/webapp/static/js/ioWorks/stockOut.js
@@ -2,9 +2,9 @@
var locDetlData = [];
function getCol() {
    var cols = [
        {field: 'count', align: 'center',title: '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: '原数量'}
        ,{field: 'locNo', align: 'center',title: '库位号'}
        {field: 'count', align: 'center',title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('outbound_quantity') : '出库数量', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
        ,{field: 'anfme', align: 'center',title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('original_quantity') : '原数量'}
        ,{field: 'locNo', align: 'center',title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('location_no') : '库位号'}
    ];
    arrRemove(detlCols,  'field', 'anfme');
    cols.push.apply(cols, detlCols);
@@ -43,7 +43,7 @@
        switch (obj.event) {
            case 'outbound':
                if (data.length === 0){
                    layer.msg('请先添加库位物料');
                    layer.msg(I18n.t('please_add_location_material'));
                } else {
                    var locDetls = [];
                    data.forEach(function(elem) {
@@ -62,11 +62,11 @@
                                    limit();
                                    // getOutBound();
                                }});
                                layer.msg(res.msg, {icon: 1});
                                layer.msg(I18n.t(res.msg, res), {icon: 1});
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                                layer.msg(I18n.t(res.msg, res))
                            }
                        }
                    });
@@ -95,13 +95,13 @@
    function updateLocDetlData(locNo, matnr, count) {
        if (isNaN(count)) {
            layer.msg("请输入数字");
            layer.msg(I18n.t("please_enter_number"));
        } else {
            if (count > 0) {
                for (var i=0;i<locDetlData.length;i++){
                    if (locDetlData[i]["locNo"] === locNo && locDetlData[i]["matnr"] === matnr){
                        if (count > locDetlData[i]["anfme"]) {
                            layer.msg("不能超过原数量");
                            layer.msg(I18n.t("cannot_exceed_original_quantity"));
                        } else {
                            locDetlData[i]["count"] = count;
                        }
@@ -109,7 +109,7 @@
                    }
                }
            } else {
                layer.msg("数量必须大于零");
                layer.msg(I18n.t("quantity_must_be_greater_than_zero"));
            }
        }
        tableIns.reload({data: locDetlData,done:function (res) {
@@ -127,15 +127,30 @@
            async: false,
            success: function (res) {
                if (res.code === 200){
                    var list = res.data;
                    if (typeof I18n !== 'undefined') {
                        $.each(list, function(index, item) {
                            var desc = item.desc;
                            var start = desc.indexOf('(');
                            var end = desc.indexOf(')');
                            if (start !== -1 && end !== -1) {
                                var key = desc.substring(start + 1, end);
                                var translated = I18n.t(key);
                                if (translated !== key) {
                                    item.desc = desc.substring(0, start + 1) + translated + desc.substring(end);
                                }
                            }
                        });
                    }
                    var tpl = $("#takeSiteSelectTemplate").html();
                    var template = Handlebars.compile(tpl);
                    var html = template(res);
                    var html = template({data: list});
                    $('#staNoSelect').append(html);
                    form.render('select');
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                    layer.msg(I18n.t(res.msg, res))
                }
            }
        })
@@ -147,7 +162,7 @@
function getLocDetl() {
    locDetlLayerIdx = layer.open({
        type: 2,
        title: '提取出货内容',
        title: (typeof I18n !== 'undefined' && I18n.t) ? I18n.t('extract_delivery_content') : '提取出货内容',
        maxmin: true,
        area: [top.detailWidth, top.detailHeight],
        shadeClose: true,