#
luxiaotao1123
2021-03-11 064ef1fd2858c6185bd1b7d1e986fc08c7abd8aa
src/main/webapp/static/js/ioWorks/matQuery.js
@@ -43,7 +43,6 @@
                if (data.length === 0){
                    layer.msg('请添加物料');
                } else {
                    layer.open({
                        type: 1,
                        title: '定义销售单编号',
@@ -54,33 +53,10 @@
                        success: function(layero, index){
                            layer.iframeAuto(index)
                        },
                        cancel: function () {
                            $('#orderNo').val('');
                        }
                    });
                    // var matDetls = [];
                    // data.forEach(function(elem) {
                    //     matDetls.push({matnr: elem.matnr, count: elem.count});
                    // });
                    // $.ajax({
                    //     url: baseUrl+"/work/pakout/init",
                    //     headers: {'token': localStorage.getItem('token')},
                    //     data: JSON.stringify(matDetls),
                    //     contentType:'application/json;charset=UTF-8',
                    //     method: 'POST',
                    //     success: function (res) {
                    //         if (res.code === 200){
                    //             matData = [];
                    //             tableIns.reload({data: matData,done:function (res) {
                    //                 limit();
                    //             }});
                    //             layer.msg(res.msg, {icon: 1});
                    //         } else if (res.code === 403){
                    //             top.location.href = baseUrl+"/";
                    //         } else {
                    //             layer.msg(res.msg)
                    //         }
                    //     }
                    // });
                }
                break;
        }
@@ -103,8 +79,32 @@
        }
    });
    // 开始打印
    // 开始生成拣货单
    form.on('submit(confirm)', function (data) {
        var matDetls = [];
        matData.forEach(function(elem) {
            matDetls.push({matnr: elem.matnr, count: elem.count});
        });
        $.ajax({
            url: baseUrl+"/work/order/init",
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify({
                number: data.field.orderNo,
                list: matDetls
            }),
            contentType:'application/json;charset=UTF-8',
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    top.layui.layer.close(top.popupRight);
                    layer.msg(res.msg, {icon: 1});
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else {
                    layer.msg(res.msg, {icon: 2})
                }
            }
        });
    })