自动化立体仓库 - WMS系统
lty
7 天以前 539a56279625242c497b4b4093f2defbb9d80334
src/main/webapp/static/js/pakStore/pakStore.js
@@ -3,11 +3,11 @@
var matCodeData = [];
function getCol() {
    var cols = [
        {fixed: 'left', field: 'anfme', title: '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'},
        {field: 'batch', title: '批号(选填)', align: 'center', edit:'text', width: 200,  style:'color: block;font-weight: bold'}
        {fixed: 'left', field: 'anfme', title: typeof I18n !== 'undefined' ? I18n.t('quantity_required') : '数量(必填)', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'},
        {field: 'batch', title: typeof I18n !== 'undefined' ? I18n.t('batch_optional') : '批号(选填)', align: 'center', edit:'text', width: 200,  style:'color: block;font-weight: bold'}
    ];
    cols.push.apply(cols, matCols);
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 80})
    cols.push.apply(cols, getMatCols());
    cols.push({fixed: 'right', title: typeof I18n !== 'undefined' ? I18n.t('operation') : '操作', align: 'center', toolbar: '#operate', width: 80})
    return cols;
}
@@ -20,17 +20,36 @@
    var form = layui.form;
    var admin = layui.admin;
    tableIns = table.render({
        elem: '#chooseData',
        data: [],
        even: true,
        limit: 500,
        cellMinWidth: 50,
        toolbar: '#toolbar',
        cols: [getCol()],
        done: function (res, curr, count) {
            limit();
            getInBound();
    function initTable() {
        tableIns = table.render({
            elem: '#chooseData',
            data: [],
            even: true,
            limit: 500,
            cellMinWidth: 50,
            toolbar: '#toolbar',
            cols: [getCol()],
            done: function (res, curr, count) {
                limit();
                getInBound();
                if (typeof I18n !== 'undefined') {
                    I18n.updatePage($('.layui-table-view'));
                }
            }
        });
    }
    if (typeof I18n !== 'undefined' && I18n.isReady()) {
        initTable();
    } else {
        $(document).on('i18n:ready', initTable);
    }
    $(document).on('i18n:languageChanged', function() {
        if (tableIns) {
            tableIns.reload({
                cols: [getCol()]
            });
        }
    });
@@ -42,11 +61,11 @@
        if (obj.field === 'anfme'){
            let vle = Number(obj.value);
            if (isNaN(vle)) {
                layer.msg("请输入数字", {icon: 2});
                layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_enter_number') : "请输入数字", {icon: 2});
                modify = false;
            } else {
                if (vle <= 0) {
                    layer.msg("数量必须大于零", {icon: 2});
                    layer.msg(typeof I18n !== 'undefined' ? I18n.t('quantity_must_be_greater_than_zero') : "数量必须大于零", {icon: 2});
                    modify = false;
                }
            }
@@ -65,23 +84,23 @@
            case 'comb':
                // 判断是否存在物料
                if (matCodeData.length === 0) {
                    layer.msg("请先提取商品", {icon: 2});
                    layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_extract_item_first') : "请先提取商品", {icon: 2});
                    return;
                }
                // 判断物料数量是否存在异常
                for (var i=0;i<matCodeData.length;i++){
                    if (isNaN(matCodeData[i].anfme)) {
                        layer.msg("请输入数字", {icon: 2});
                        layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_enter_number') : "请输入数字", {icon: 2});
                        return;
                    }
                    if (matCodeData[i].anfme <= 0){
                        layer.msg("数量必须大于零", {icon: 2});
                        layer.msg(typeof I18n !== 'undefined' ? I18n.t('quantity_must_be_greater_than_zero') : "数量必须大于零", {icon: 2});
                        return;
                    }
                }
                let devpNo = $('#putSiteSelect').val();
                if (isEmpty(devpNo)) {
                    layer.msg("请选择入库站", {icon: 2});
                    layer.msg(typeof I18n !== 'undefined' ? I18n.t('please_select_inbound_station') : "请选择入库站", {icon: 2});
                    return;
                }
                console.log(matCodeData)
@@ -97,10 +116,16 @@
                    async: false,
                    success: function (res) {
                        if (res.code === 200){
                            layer.msg("入库启动成功,目标库位:" + res.data, {icon: 1});
                            layer.msg((typeof I18n !== 'undefined' ? I18n.t(res.msg) : res.msg) + ":" + res.data, {icon: 1});
                            matCodeData = [];
                            $('#focusMatByMat').val("");
                            tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}});
                            tableIns.reload({data: matCodeData,done:function (res) {
                                limit();
                                getInBound();
                                if (typeof I18n !== 'undefined') {
                                    I18n.updatePage($('.layui-table-view'));
                                }
                            }});
                        } else if (res.code === 403){
                            top.location.href = baseUrl+"/";
                        }else {
@@ -149,7 +174,7 @@
    // 提取物料
    $(document).on('click','#mat-query', function () {
        let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false});
        let loadIndex = layer.msg(typeof I18n !== 'undefined' ? I18n.t('requesting') : '请求中...', {icon: 16, shade: 0.01, time: false});
        matCodeLayerIdx = admin.open({
            type: 2,
            title: false,