自动化立体仓库 - WMS系统
18516761980
2022-06-21 873f0e8c1bad2dc77affd40d381919ac26317d39
src/main/webapp/static/js/order/out.js
@@ -32,7 +32,7 @@
            ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160}
            ,{field: 'matnr', align: 'center',title: '商品编码', width: 160}
            ,{field: 'maktx', align: 'center',title: '商品名称', width: 200}
            ,{field: 'batch', align: 'center',title: '序列码'}
            ,{field: 'batch', align: 'center',title: '批号'}
            ,{field: 'specs', align: 'center',title: '规格'}
            // ,{field: 'anfme', align: 'center',title: '数量'}
            // ,{field: 'qty', align: 'center',title: '作业数量', style: 'font-weight: bold'}
@@ -134,7 +134,7 @@
                        type: 1
                        ,title: false
                        ,closeBtn: false
                        ,offset: '100px'
                        ,offset: '50px'
                        ,area: ['1200px', '700px']
                        ,shade: 0.5
                        ,shadeClose: false
@@ -154,7 +154,7 @@
                                    // {type: 'checkbox', merge: ['orderNo']},
                                    {field: 'orderNo', title: '单据编号', merge: true, align: 'center'},
                                    {field: 'title', title: '商品', merge: true, align: 'center', width: 350},
                                    {field: 'batch', title: '序列码', align: 'center'},
                                    {field: 'batch', title: '批号', align: 'center'},
                                    {field: 'anfme', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'},
                                    {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'},
                                    {field: 'staNos', align: 'center', title: '出库站', merge: ['locNo'], templet: '#tbBasicTbStaNos'},
@@ -175,7 +175,6 @@
                                        tableCache[i]['staNo'] = Number(obj.elem.value);
                                    }
                                }
                                // data['staNo'] = Number(obj.elem.value);
                                obj.othis.children().find("input").css("color", "blue");
                                return false;
                            });
@@ -193,15 +192,22 @@
                                // 出库站取交集
                                let staBatchSelectVal = [];
                                for(let i = 0; i<stoPreTabData.length; i++) {
                                    if (i === 0) {
                                        staBatchSelectVal = stoPreTabData[i].staNos;
                                    } else {
                                        let staNos = stoPreTabData[i].staNos;
                                        staBatchSelectVal = staBatchSelectVal.filter( val => {
                                                return new Set(staNos).has(val)
                                            }
                                        )
                                    let staNos = stoPreTabData[i].staNos;
                                    if (staNos !== null) {
                                        if (staBatchSelectVal.length === 0) {
                                            staBatchSelectVal = staNos;
                                        } else {
                                            staBatchSelectVal = staBatchSelectVal.filter(val =>
                                                {
                                                    return new Set(staNos).has(val)
                                                }
                                            )
                                        }
                                    }
                                }
                                if (staBatchSelectVal.length === 0) {
                                    layer.msg("出库站没有交集,无法批量修改", {icon: 2});
                                    return;
                                }
                                admin.open({
                                    type: 1,
@@ -209,20 +215,34 @@
                                    offset: 'auto',
                                    title: '请选择站点',
                                    content: $('#staBatchSelectDialog').html(),
                                    success: function (layero, dIndex) {
                                    success: function (layero, ddIndex) {
                                        // 渲染下拉框
                                        let template = Handlebars.compile($('#batchStaSelectTpl').html());
                                        $('#batchSelectStaBox').html(template({list: staBatchSelectVal}));
                                        // 确认
                                        form.on('submit(staBatchSelectConfirm)', function (obj) {
                                            obj.field;
                                            for (let i = 0; i<tableCache.length; i++) {
                                                // if (tableCache[i].locNo === data.locNo) {
                                                tableCache[i]['staNo'] = Number(181);
                                                // }
                                            let loadIdx = layer.load(2);
                                            let batchSta = Number(obj.field.batchSta);
                                            let arr = [];
                                            for (let j = 0; j<stoPreTabData.length; j++) {
                                                for (let i = 0; i<tableCache.length; i++) {
                                                    if (tableCache[i].orderNo === stoPreTabData[j].orderNo
                                                        && tableCache[i].matnr === stoPreTabData[j].matnr
                                                        && tableCache[i].locNo === stoPreTabData[j].locNo) {
                                                        tableCache[i]['staNo'] = batchSta;
                                                        arr.push(i);
                                                    }
                                                }
                                            }
                                            $('.order-sta-select').val(181);
                                            stoPreTabIdx.reload({data: tableCache})
                                            stoPreTabIdx.reload({data: tableCache});
                                            arr.forEach(item => {
                                                $('div[lay-id=stoPreTab] tr[data-index="' + item + '"] .order-sta-select').val(batchSta);
                                            });
                                            layui.form.render('select');
                                            arr.forEach(item => {
                                                $('div[lay-id=stoPreTab] tr[data-index="' + item + '"] .layui-select-title').find("input").css("color", "blue");
                                            });
                                            layer.close(loadIdx); layer.close(ddIndex);
                                            return false;
                                        });
                                        // 弹窗不出现滚动条