| | |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="printSelect">自定义打印</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="goodsStatistics">统计商品份数</button> |
| | | <!-- <button id="printSelect" type="button" class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain">自定义打印</button>--> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="exportDeliverTwo">导出未发货订单(快递)</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" id="importDeliver" lay-event="importDeliver">导入发货</button> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="exportDeliverTwo">导出未发货订单(快递)</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" id="importDeliver" lay-event="importDeliver">导入发货</button>--> |
| | | </div> |
| | | </script> |
| | | <!-- 表格操作栏 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, |
| | |
| | | sortObject = {field: 'orderTime', type: 'desc'}, |
| | | formSelects = layui.formSelects, |
| | | laydate = layui.laydate, |
| | | layer = layui.layer, // 新增此行 |
| | | tableIns; |
| | | |
| | | let currPageOrder = 1;//首先默认值为1,防止出错 |
| | |
| | | }); |
| | | } |
| | | if (layEvent === 'deliverPdfGoods') { |
| | | febs.modal.confirm('一键发货', '确认一键发货?', function () { |
| | | febs.modal.confirm('一键发货', '确认一键发货?', function (index) { |
| | | layer.close(index); |
| | | deliverPdfGoods(data.id); |
| | | }); |
| | | } |
| | |
| | | }); |
| | | |
| | | 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(); |
| | | }); |
| | |
| | | } |
| | | |
| | | 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) { |
| | |
| | | {field: 'orderNo', title: '订单编号', minWidth: 200,align:'left' ,totalRowText:"合计"}, |
| | | {field: 'memberName', title: '购买人', minWidth: 100,align:'left'}, |
| | | {field: 'memberPhone', title: '联系方式', minWidth: 120,align:'left'}, |
| | | {field: 'refererName', title: '推荐人', minWidth: 100,align:'left'}, |
| | | // {field: 'refererName', title: '推荐人', minWidth: 100,align:'left'}, |
| | | {field: 'goodsName', title: '商品', minWidth: 160,align:'left'}, |
| | | {field: 'remark', title: '备注', minWidth: 160,align:'left'}, |
| | | // {field: 'remark', title: '备注', minWidth: 160,align:'left'}, |
| | | {field: 'goodsAmount', title: '价格', minWidth: 80,align:'left', totalRow:true}, |
| | | {field: 'carriage', title: '邮费', minWidth: 80,align:'left', totalRow:true}, |
| | | {field: 'amount', title: '总金额', minWidth: 100,align:'left', totalRow:true}, |
| | |
| | | // return '' |
| | | // } |
| | | // }, minWidth: 80,align:'center'}, |
| | | {field: 'payMethod', title: '支付方式', minWidth: 100,align:'left'}, |
| | | // {field: 'payMethod', title: '支付方式', minWidth: 100,align:'left'}, |
| | | {field: 'payTime', title: '支付时间', minWidth: 120,align:'left'}, |
| | | // {field: 'wxOrderNo', title: '支付订单号', minWidth: 120,align:'left'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if(d.status === 2){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverPdfGoods" shiro:hasPermission="user:update">一键发货</button>' |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | // +'' |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverPdfGoods" shiro:hasPermission="user:update">一键发货</button>' |
| | | // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | // // +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | }else if(d.status === 3){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="cancelDeliver" shiro:hasPermission="user:update">取消发货</button>' |