1
cp
2025-03-27 a3bea567c554c2c57809ceed2a040baf473aa95f
zy-asrs-wms/src/main/webapp/static/js/order/order.js
@@ -12,26 +12,26 @@
    var layDate = layui.laydate;
    var laytpl = layui.laytpl;
    // // 渲染搜索模板
    // $.ajax({
    //     url: baseUrl+"/docType/page/auth",
    //     headers: {'token': localStorage.getItem('token')},
    //     data: {
    //         limit: 9999
    //     },
    //     method: 'POST',
    //     success: function (res) {
    //         if (res.code === 200){
    //             let template = Handlebars.compile($('#docTypeTpl').html());
    //             $('#docType-query').html(template(res.data));
    //             layui.form.render('select');
    //         } else if (res.code === 403){
    //             top.location.href = baseUrl+"/";
    //         } else {
    //             layer.msg(res.msg, {icon: 2})
    //         }
    //     }
    // })
    // 渲染搜索模板
    $.ajax({
        url: baseUrl+"/docType/page/auth",
        headers: {'token': localStorage.getItem('token')},
        data: {
            limit: 9999
        },
        method: 'POST',
        success: function (res) {
            if (res.code === 200){
                let template = Handlebars.compile($('#docTypeTpl').html());
                $('#docType-query').html(template(res.data));
                layui.form.render('select');
            } else if (res.code === 403){
                top.location.href = baseUrl+"/";
            } else {
                layer.msg(res.msg, {icon: 2})
            }
        }
    })
    let docName = getQueryVariable('docName')
    let where = {};
@@ -51,7 +51,7 @@
        limits: [16, 30, 50, 100, 200, 500],
        cols: [[
            {type: 'numbers'},
            {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl'},
            {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl',sort:true},
            {field: 'docType$', align: 'center', title: '类型',  minWidth: 160, width: 160},
            {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160},
            {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200},
@@ -104,6 +104,8 @@
            showWrkTrace(data.id);
        } else if (layEvent === 'del') {
            doDel(data.id);
        } else if (layEvent === 'dy') {
            doDy(data.id);
        } else if (layEvent === 'complete') {
            doModify(data.id, 4);
        } else if (layEvent === 'cancel') {
@@ -159,7 +161,7 @@
                        cellMinWidth: 100,
                        cols: [[
                            {type: 'numbers'},
                            {field: 'matnr', title: '商品编码', width: 160},
                            {field: 'matnr', title: '品号', width: 160},
                            {field: 'maktx', title: '商品名称', width: 160},
                            {field: 'batch', title: '序列码'},
                            {field: 'anfme', title: '数量'},
@@ -311,7 +313,7 @@
                    cellMinWidth: 100,
                    cols: [[
                        {type: 'numbers', title: '#'},
                        {field: 'matnr', title: '品名', width: 160},
                        {field: 'matnr', title: '品号', width: 160},
                        {field: 'maktx', title: '名称', width: 200},
                        {field: 'batch', title: '序列码', edit: true},
                        {field: 'specs', title: '规格'},
@@ -503,6 +505,40 @@
        });
    }
    // 打印
    function doDy(orderId) {
        layer.confirm('确定要打印吗?', {
            shade: .1,
            skin: 'layui-layer-admin'
        }, function (i) {
            layer.close(i);
            layer.load(2);
            $.ajax({
                url: baseUrl+"/order/dy",
                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 doModify(orderId, settle) {