自动化立体仓库 - WMS系统
zhou zhou
2 天以前 b06233aa71b70f7a30ff382ae1ba19c29b134d7c
src/main/webapp/static/js/checkOrder/checkOrder.js
@@ -96,6 +96,8 @@
            showEditModel(data);
        }else if (layEvent === 'createTask') {
            pakoutPreview(data.id);
        }else if (layEvent === 'createAdjust') {
            createAdjust(data.id);
        }else if (layEvent === 'export') {
            export1(data.id);
        }else if (layEvent === 'del') {
@@ -332,10 +334,17 @@
                        var isDuplicate = false;
                        for (var j = 0; j < xxDataList.length; j++) {
                            if (xxDataList[j].locNo === data[i].locNo && xxDataList[j].matnr === data[i].matnr && xxDataList[j].batch === data[i].batch) {
                                isDuplicate = true;
                                duplicateCount++;
                                break;
                                if (xxDataList[j].diffQty !== 0){
                                    isDuplicate = true;
                                    duplicateCount++;
                                    break;
                                }
                            }
                        }
                        if (data[j].diffQty !== 0){
                            isDuplicate = true;
                            duplicateCount++;
                        }
                        // 如果不重复,则添加到列表
                        if (!isDuplicate) {
@@ -346,7 +355,7 @@
                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
                    // 提示添加结果
                    if (duplicateCount > 0) {
                        layer.msg('成功添加 ' + addedCount + ' 条数据,' + duplicateCount + ' 条重复数据已忽略', {icon: 1});
                        layer.msg('成功添加 ' + addedCount + ' 条数据,' + duplicateCount + ' 条数据已忽略', {icon: 1});
                    } else if (addedCount > 0) {
                        layer.msg('成功添加 ' + addedCount + ' 条数据', {icon: 1});
                    }
@@ -445,6 +454,39 @@
        });
    }
    function createAdjust(orderId) {
        layer.confirm('确定要生成调整单吗?', {
            shade: .1,
            skin: 'layui-layer-admin'
        }, function (i) {
            layer.close(i);
            layer.load(2);
            $.ajax({
                url: baseUrl+"/adjustOrder/create/test",
                headers: {'token': localStorage.getItem('token')},
                data: {
                    orderId: orderId
                },
                method: 'POST',
                success: function (res) {
                    layer.closeAll('loading');
                    if (res.code === 200){
                        if (insTbCount === 0) {
                            insTb.reload({page: {curr: 1}});
                        } else {
                            $(".layui-laypage-btn")[0].click();
                        }
                        layer.msg(res.msg, {icon: 1});
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    }else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
        });
    }
    function pakoutPreview(id) {
        let loadIndex = layer.load(2);