| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | 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)) |
| | | } |
| | | } |
| | | }); |
| | |
| | | |
| | | 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; |
| | | } |
| | |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | layer.msg(I18n.t("quantity_must_be_greater_than_zero")); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData,done:function (res) { |
| | |
| | | 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)) |
| | | } |
| | | } |
| | | }) |
| | |
| | | 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, |