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,12 +161,12 @@
                        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: '数量'},
                            {field: 'qty', title: '作业数量', style: 'font-weight: bold'},
                            // {field: 'unit', title: '单位'},
                            {field: 'workQty', title: '作业数量', style: 'font-weight: bold'},
                            {field: 'qty', title: '完成数量'},
                            // {
                            //     field: 'createTime$', title: '创建时间', sort: true, templet: function (d) {
                            //         return util.toDateString(d.createTime);
@@ -172,7 +174,7 @@
                            // },
                            // {field: 'inQty', title: '已入库量'},
                            // {field: 'color', title: '颜色'},
                            {field: 'origin', title: '仓库号'}
                            {field: 'threeCode', title: '仓库号'}
                        ]],
                        request: {
                            pageName: 'curr',
@@ -244,8 +246,12 @@
                        condition: decodeURI(docName)
                    },
                    success: function (res) {
                        $("#docType").val(res.data[0].id)
                        $(document.getElementById("docType$")).val(res.data[0].value)
                        if (res.code == 200) {
                            if (res.data.length > 0) {
                                $("#docType").val(res.data[0].id);
                                $(document.getElementById("docType$")).val(res.data[0].value)
                            }
                        }
                    }
                })
@@ -307,8 +313,8 @@
                    cellMinWidth: 100,
                    cols: [[
                        {type: 'numbers', title: '#'},
                        {field: 'matnr', title: '商品编码', width: 160},
                        {field: 'maktx', title: '商品名称', width: 200},
                        {field: 'matnr', title: '品号', width: 160},
                        {field: 'maktx', title: '名称', width: 200},
                        {field: 'batch', title: '序列码', edit: true},
                        {field: 'specs', title: '规格'},
                        {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
@@ -499,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) {
@@ -561,7 +601,7 @@
                                var traceCharts = echarts.init(document.getElementById('wrkTraceCharts'));
                                var traceOptions = {
                                    title: {
                                        text: '作业/总量', x: 'center', y: '38%',
                                        text: '总量/作业/完成', x: 'center', y: '38%',
                                        textStyle: {fontSize: 18, color: '#262626', fontWeight: 'normal'},
                                        subtextStyle: {fontSize: 36, color: '#10B4E8'},
                                        itemGap: 20
@@ -574,7 +614,7 @@
                                // 赋值
                                traceCharts.setOption({
                                    title: {
                                        subtext: res.data.wrkQty+"/"+res.data.totalQty
                                        subtext: res.data.totalQty+"/"+res.data.wrkQty+"/"+res.data.endQty
                                    },
                                    series: [
                                        {