KKSU
2025-02-12 9f26478244294ba6d0b878092ea13cc5c74f2e82
refactor(mall): 优化订单商品名称的显示格式

- 修改了 AdminMallOrderService 中商品名称的拼接方式,增加了商品数量信息
- 优化了 CommonService 中的 checkTraceInfo 方法,移除了冗余的代码
1 files modified
60 ■■■■ changed files
src/main/resources/templates/febs/views/modules/order/orderList.html 60 ●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/order/orderList.html
@@ -132,7 +132,7 @@
<!-- 表格操作栏 end -->
<script data-th-inline="none" type="text/javascript">
    // 引入组件并初始化
    layui.use([ 'jquery', 'form', 'table', 'febs', 'formSelects', 'upload','laydate'], function () {
    layui.use([ 'jquery', 'form', 'table', 'febs', 'formSelects', 'upload','laydate', 'layer'], function () {
        var $ = layui.jquery,
            febs = layui.febs,
            form = layui.form,
@@ -146,6 +146,7 @@
            sortObject = {field: 'orderTime', type: 'desc'},
            formSelects = layui.formSelects,
            laydate = layui.laydate,
            layer = layui.layer, // 新增此行
            tableIns;
        let currPageOrder = 1;//首先默认值为1,防止出错
@@ -357,7 +358,8 @@
                });
            }
            if (layEvent === 'deliverPdfGoods') {
                febs.modal.confirm('一键发货', '确认一键发货?', function () {
                febs.modal.confirm('一键发货', '确认一键发货?', function (index) {
                    layer.close(index);
                    deliverPdfGoods(data.id);
                });
            }
@@ -384,7 +386,9 @@
        });
        function cancelDeliver(id) {
            var loadIndex = layer.load(1); // 显示加载中
            febs.get(ctx + 'admin/order/cancelDeliver/' + id, null, function (data) {
                layer.close(loadIndex);
                febs.alert.success(data.message);
                $query.click();
            });
@@ -398,38 +402,68 @@
        }
        function deliverPdfGoods(id) {
            var loadIndex = layer.load(1); // 显示加载中
            febs.get(ctx + 'admin/order/deliverPdfGoods/' + id, null, function (e) {
                layer.close(loadIndex);
                $query.click();
                if (e.code == 200) {
                    // 创建弹层容器
                    const content = `
                                        <div style="position:relative;min-height:500px">
                                          <div id="pdfContainer" style="margin:20px auto;max-width:800px"></div>
                                          <div class="layui-form" style="text-align:center;margin-top:20px">
                                            <button class="layui-btn layui-btn-normal" onclick="printPdf()">打印</button>
                                          </div>
                                            <div id="pdfContainer" style="margin:20px auto;max-width:800px"></div>
                                            <div class="layui-form" style="text-align:center;margin-top:20px">
                                                <button class="layui-btn layui-btn-normal" onclick="printPdf()">打印</button>
                                            </div>
                                        </div>
                                      `;
                    // 显示弹层
                                    `;
                    const index = layer.open({
                        type: 1,
                        title: "电子面单",
                        content: content,
                        area: ['90%', '90%'],
                        success: function() {
                            // 渲染PDF
                            renderPdf(e.data.pdfStream);
                        }
                    });
                    // 存储当前PDF数据
                    window.currentPDF = e.data.pdfStream;
                } else {
                    febs.alert.warn(e.message);
                }
            });
            $query.click();
        }
        // function deliverPdfGoods(id) {
        //     febs.get(ctx + 'admin/order/deliverPdfGoods/' + id, null, function (e) {
        //         if (e.code == 200) {
        //             // 创建弹层容器
        //             const content = `
        //                                 <div style="position:relative;min-height:500px">
        //                                   <div id="pdfContainer" style="margin:20px auto;max-width:800px"></div>
        //                                   <div class="layui-form" style="text-align:center;margin-top:20px">
        //                                     <button class="layui-btn layui-btn-normal" onclick="printPdf()">打印</button>
        //                                   </div>
        //                                 </div>
        //                               `;
        //
        //             // 显示弹层
        //             const index = layer.open({
        //                 type: 1,
        //                 title: "电子面单",
        //                 content: content,
        //                 area: ['90%', '90%'],
        //                 success: function() {
        //                     // 渲染PDF
        //                     renderPdf(e.data.pdfStream);
        //                 }
        //             });
        //             // 存储当前PDF数据
        //             window.currentPDF = e.data.pdfStream;
        //         } else {
        //             febs.alert.warn(e.message);
        //         }
        //     });
        //     $query.click();
        // }
        // PDF渲染函数
        function renderPdf(base64Data) {
            // 清理容器