|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- 表格操作栏 start --> | 
|---|
|  |  |  | <script type="text/html" id="mall-order-option"> | 
|---|
|  |  |  | {{# if(d.status === 2) { }} | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs layui-btn-success" type="button" shiro:hasPermission="deliverGoods:update" lay-event="deliverGoods">发货</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderDetail:view" lay-event="seeOrder">详情</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="orderMoneyFlow">资金流水</button> | 
|---|
|  |  |  | {{# } else if(d.status === 7) { }} | 
|---|
|  |  |  | <!--    <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderDetail:view" lay-event="seeOrder">详情</button>--> | 
|---|
|  |  |  | <!--    <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="orderMoneyFlow">资金流水</button>--> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="delOrder">删除</button> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderDetail:view" lay-event="seeOrder">详情</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-xs" type="button" shiro:hasPermission="orderMoneyFlow:update" lay-event="orderMoneyFlow">资金流水</button> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="user-option"> | 
|---|
|  |  |  | <span shiro:lacksPermission="user:view,user:update,user:delete"> | 
|---|
|  |  |  | <span class="layui-badge-dot febs-bg-orange"></span> 无权限 | 
|---|
|  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="tableToolBar"> | 
|---|
|  |  |  | <div class="layui-btn-container"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="exportDeliver">导出未发货订单</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="exportDeliverDone">导出已发货订单</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" shiro:hasPermission="orderDetail:view" lay-event="exportDeliver">导出未发货订单</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" shiro:hasPermission="orderDetail:view" id="importDeliver" lay-event="importDeliver">导入发货</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" shiro:hasPermission="orderDetail:view" lay-event="exportDeliverDone">导出已发货订单</button> | 
|---|
|  |  |  | <button id="printSelect" type="button" class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" shiro:hasPermission="orderDetail:view">自定义打印</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | 
|---|
|  |  |  | laydate = layui.laydate, | 
|---|
|  |  |  | tableIns; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let mallOrderOption = $.trim($("#mall-order-option").html())==="" ? true : false; | 
|---|
|  |  |  | //日期范围 | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-form-group-date-start' | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.render(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let currPageGoods = 1;//首先默认值为1,防止出错 | 
|---|
|  |  |  | //获取当前页 | 
|---|
|  |  |  | currPageGoods = $view.find(".layui-laypage-em").next().html(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 表格初始化 | 
|---|
|  |  |  | initTable(); | 
|---|
|  |  |  | 
|---|
|  |  |  | delOrder(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'orderMoneyFlow') { | 
|---|
|  |  |  | febs.modal.open( '订单流水', 'modules/order/orderMoneyFlow/' + data.id, { | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'seePayImage') { | 
|---|
|  |  |  | var t = $view.find('#seePayImage'+data.id+''); | 
|---|
|  |  |  | //页面层 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 查询按钮 | 
|---|
|  |  |  | $query.on('click', function () { | 
|---|
|  |  |  | var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); | 
|---|
|  |  |  | tableIns.reload({where: params, page: {curr: 1}}); | 
|---|
|  |  |  | tableIns.reload({where: params, page: {curr: currPageGoods}}); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 刷新按钮 | 
|---|
|  |  |  | $reset.on('click', function () { | 
|---|
|  |  |  | $searchForm[0].reset(); | 
|---|
|  |  |  | sortObject.type = 'null'; | 
|---|
|  |  |  | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); | 
|---|
|  |  |  | tableIns.reload({where: getQueryParams(), page: {curr: currPageGoods}, initSort: sortObject}); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $add.on('click', function () { | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'status', title: '状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.status === 1) { | 
|---|
|  |  |  | return '<span style="color:red;">待支付</span>' | 
|---|
|  |  |  | return '<span style="color:blue;">待支付</span>' | 
|---|
|  |  |  | } else if (d.status === 2) { | 
|---|
|  |  |  | return '<span style="color:green;">待发货</span>' | 
|---|
|  |  |  | return '<span style="color:red;">待发货</span>' | 
|---|
|  |  |  | }else if (d.status === 3) { | 
|---|
|  |  |  | return '<span style="color:green;">待收货</span>' | 
|---|
|  |  |  | }else if (d.status === 4) { | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'payMethod', title: '支付方式', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'payTime', title: '支付时间', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'payOrderNo', title: '支付订单号', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {title: '操作', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.status === 2) { | 
|---|
|  |  |  | if(d.deliverType ===2){ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs layui-btn-success" lay-event="takeGoods" shiro:hasPermission="user:update">自提</button>' | 
|---|
|  |  |  | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs layui-btn-success" 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>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else if(d.status === 7){ | 
|---|
|  |  |  | 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-xs layui-btn-normal layui-btn-danger" lay-event="delOrder" shiro:hasPermission="user:update">删除</button>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs " lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | },minWidth: 200,align:'center', fixed:'right'} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | {title: '操作', minWidth: 200 ,toolbar: '#mall-order-option',hide:mallOrderOption,align:'left', fixed:'right'}, | 
|---|
|  |  |  | // {title: '操作', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //             if (d.status === 2) { | 
|---|
|  |  |  | //                 if(d.deliverType ===2){ | 
|---|
|  |  |  | //                     return '<button class="layui-btn layui-btn-normal layui-btn-xs layui-btn-success" lay-event="takeGoods" 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="orderMoneyFlow" shiro:hasPermission="orderMoneyFlow:update">资金流水</button>' | 
|---|
|  |  |  | //                 }else{ | 
|---|
|  |  |  | //                     return '<button class="layui-btn layui-btn-normal layui-btn-xs layui-btn-success" 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="orderMoneyFlow" shiro:hasPermission="orderMoneyFlow:update">资金流水</button>' | 
|---|
|  |  |  | //                 } | 
|---|
|  |  |  | //             }else if(d.status === 7){ | 
|---|
|  |  |  | //                 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-xs layui-btn-normal layui-btn-danger" lay-event="delOrder" shiro:hasPermission="user:update">删除</button>' | 
|---|
|  |  |  | //                     +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="orderMoneyFlow" shiro:hasPermission="orderMoneyFlow:update">资金流水</button>' | 
|---|
|  |  |  | //             }else{ | 
|---|
|  |  |  | //                 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="orderMoneyFlow" shiro:hasPermission="orderMoneyFlow:update">资金流水</button>' | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //     },minWidth: 200,align:'center', fixed:'right'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|