|  |  |  | 
|---|
|  |  |  | <div class="layui-form-item"> | 
|---|
|  |  |  | <div class="layui-col-md10"> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label">购买人:</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" placeholder="用户名" name="name" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | <input type="text" placeholder="购买人" name="name" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label">订单编号:</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" placeholder="订单编号" name="orderNo" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">订单状态</label> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">状态</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="status"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | 
|---|
|  |  |  | <option value="2">待发货</option> | 
|---|
|  |  |  | <option value="3">待收货</option> | 
|---|
|  |  |  | <option value="4">已完成</option> | 
|---|
|  |  |  | <option value="5">退款中</option> | 
|---|
|  |  |  | <option value="6">已退款</option> | 
|---|
|  |  |  | <!--                                            <option value="5">退款中</option>--> | 
|---|
|  |  |  | <!--                                            <option value="6">已退款</option>--> | 
|---|
|  |  |  | <option value="7">已取消</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label">团长:</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="uniqueCode" class="order-takeUniqueCode"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">配送方式</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="isHome"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="1">送货上门</option> | 
|---|
|  |  |  | <option value="2">自提</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--                                <div class="layui-inline">--> | 
|---|
|  |  |  | <!--                                    <label class="layui-form-label">团长:</label>--> | 
|---|
|  |  |  | <!--                                    <div class="layui-input-inline">--> | 
|---|
|  |  |  | <!--                                        <select name="uniqueCode" class="order-takeUniqueCode">--> | 
|---|
|  |  |  | <!--                                            <option value="">请选择</option>--> | 
|---|
|  |  |  | <!--                                        </select>--> | 
|---|
|  |  |  | <!--                                    </div>--> | 
|---|
|  |  |  | <!--                                </div>--> | 
|---|
|  |  |  | <!--                                <div class="layui-inline">--> | 
|---|
|  |  |  | <!--                                    <label class="layui-form-label layui-form-label-sm">配送方式</label>--> | 
|---|
|  |  |  | <!--                                    <div class="layui-input-inline">--> | 
|---|
|  |  |  | <!--                                        <select name="isHome">--> | 
|---|
|  |  |  | <!--                                            <option value="">请选择</option>--> | 
|---|
|  |  |  | <!--                                            <option value="1">送货上门</option>--> | 
|---|
|  |  |  | <!--                                            <option value="2">自提</option>--> | 
|---|
|  |  |  | <!--                                        </select>--> | 
|---|
|  |  |  | <!--                                    </div>--> | 
|---|
|  |  |  | <!--                                </div>--> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">支付状态</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">开始时间</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" name="startTime" id="febs-form-group-date-start" lay-verify="date" | 
|---|
|  |  |  | placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">结束时间</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <input type="text" name="endTime" id="febs-form-group-date-end" lay-verify="date" | 
|---|
|  |  |  | placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input"> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | </form> | 
|---|
|  |  |  | <table lay-filter="orderTable" lay-data="{id: 'orderTable'}"></table> | 
|---|
|  |  |  | <style type="text/css"> | 
|---|
|  |  |  | .layui-table-cell{ | 
|---|
|  |  |  | .layui-table cell{ | 
|---|
|  |  |  | text-align:center; | 
|---|
|  |  |  | height: auto; | 
|---|
|  |  |  | white-space: nowrap; /*文本不会换行,在同一行显示*/ | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .layui-table img{ | 
|---|
|  |  |  | max-width:100px | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ::-webkit-scrollbar { | 
|---|
|  |  |  | height: 20px !important; | 
|---|
|  |  |  | background-color: #f4f4f4; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <a lay-event="edit" shiro:hasPermission="user:update"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="tableToolBar"> | 
|---|
|  |  |  | <script type="text/html" id="tableToolBarOrder"> | 
|---|
|  |  |  | <div class="layui-btn-container"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="exportDeliverOne">导出待发货订单,系统自动发货</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="confirmOrder">确认到货</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="exportDeliverOne">导出待发货订单,系统自动发货</button>--> | 
|---|
|  |  |  | <!--        <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain" lay-event="confirmOrder">确认到货</button>--> | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- 表格操作栏 end --> | 
|---|
|  |  |  | 
|---|
|  |  |  | $reset = $view.find('#reset'), | 
|---|
|  |  |  | $searchForm = $view.find('form'), | 
|---|
|  |  |  | $add = $view.find('#add'), | 
|---|
|  |  |  | sortObject = {field: 'phone', type: null}, | 
|---|
|  |  |  | sortObject = {field: 'orderTime', type: 'desc'}, | 
|---|
|  |  |  | formSelects = layui.formSelects, | 
|---|
|  |  |  | laydate = layui.laydate, | 
|---|
|  |  |  | tableIns; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | let currPageOrder = 1;//首先默认值为1,防止出错 | 
|---|
|  |  |  | //获取当前页 | 
|---|
|  |  |  | currPageOrder = $view.find(".layui-laypage-em").next().html(); | 
|---|
|  |  |  | //日期范围 | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-form-group-date-start' | 
|---|
|  |  |  | elem: '#febs-form-group-date-start',type: 'datetime' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | laydate.render({ | 
|---|
|  |  |  | elem: '#febs-form-group-date-end' | 
|---|
|  |  |  | elem: '#febs-form-group-date-end',type: 'datetime' | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | var event = obj.event; | 
|---|
|  |  |  | var id = obj.config.id; | 
|---|
|  |  |  | var checkStatus = table.checkStatus(id); | 
|---|
|  |  |  | if(event === 'printSelect'){ | 
|---|
|  |  |  | var checkStatus = table.checkStatus('orderTable') | 
|---|
|  |  |  | console.log(checkStatus) | 
|---|
|  |  |  | // 判断是否选中数据 | 
|---|
|  |  |  | if (checkStatus.data.length === 0) { | 
|---|
|  |  |  | layer.msg('请选择数据', { | 
|---|
|  |  |  | icon: 2 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | printSelect(checkStatus.data) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | let statisticIds = 0; | 
|---|
|  |  |  | if(event === 'goodsStatistics'){ | 
|---|
|  |  |  | var data = checkStatus.data; | 
|---|
|  |  |  | let statistics = 0; | 
|---|
|  |  |  | for(let i = 0;i < data.length;i++){ | 
|---|
|  |  |  | statistics = statistics+ "," + data[i].id; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | console.log(statistics); | 
|---|
|  |  |  | if(statistics == null || statistics == ""){ | 
|---|
|  |  |  | febs.alert.warn('请选择需要统计的订单'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | statisticIds = statistics; | 
|---|
|  |  |  | console.log(statisticIds); | 
|---|
|  |  |  | febs.modal.open( '商品数量统计', 'modules/order/goodsStatistics/'+statisticIds, { | 
|---|
|  |  |  | maxmin: true, | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | statistics = 0; | 
|---|
|  |  |  | // febs.get(ctx + 'admin/order/goodsStatistics?orderIds='+ids, null, function () { | 
|---|
|  |  |  | //     febs.alert.success('操作成功'); | 
|---|
|  |  |  | //     $query.click(); | 
|---|
|  |  |  | // }); | 
|---|
|  |  |  | // window.location.href = ctx + "admin/order/confirmOrder?takeUniqueCode="+uniqueCodeValue+"&orderIds="+ids; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(event === 'confirmOrder'){ | 
|---|
|  |  |  | let uniqueCodeValue = $searchForm.find("select[name='uniqueCode']").val(); | 
|---|
|  |  |  | // let uniqueCodeValue = $searchForm.find("select[name='uniqueCode']").val(); | 
|---|
|  |  |  | // if(uniqueCodeValue == '' || uniqueCodeValue == null){ | 
|---|
|  |  |  | //     febs.alert.warn('请选择团长'); | 
|---|
|  |  |  | //     return; | 
|---|
|  |  |  | 
|---|
|  |  |  | febs.alert.warn('请选择确认到货的订单'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/confirmOrder?takeUniqueCode='+uniqueCodeValue+'&orderIds='+ids, null, function () { | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/confirmOrder?orderIds='+ids, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // window.location.href = ctx + "admin/order/confirmOrder?takeUniqueCode="+uniqueCodeValue+"&orderIds="+ids; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (event == 'exportDeliverOne') { | 
|---|
|  |  |  | let uniqueCodeValue = $searchForm.find("select[name='uniqueCode']").val(); | 
|---|
|  |  |  | if(uniqueCodeValue == '' || uniqueCodeValue == null){ | 
|---|
|  |  |  | febs.alert.warn('请选择团长'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // let uniqueCodeValue = $searchForm.find("select[name='uniqueCode']").val(); | 
|---|
|  |  |  | // if(uniqueCodeValue == '' || uniqueCodeValue == null){ | 
|---|
|  |  |  | //     febs.alert.warn('请选择团长'); | 
|---|
|  |  |  | //     return; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | var data = checkStatus.data; | 
|---|
|  |  |  | let ids = ""; | 
|---|
|  |  |  | for(let i = 0;i < data.length;i++){ | 
|---|
|  |  |  | 
|---|
|  |  |  | febs.alert.warn('请选择待发货的订单'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | window.location.href = ctx + "admin/order/exportOrderListOne?orderType=1&status=2&deliveryType=1&takeUniqueCode="+uniqueCodeValue+'&orderIds='+ids; | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/deliverOrder?takeUniqueCode='+uniqueCodeValue+'&orderIds='+ids, null, function () { | 
|---|
|  |  |  | window.location.href = ctx + "admin/order/exportOrderListOne?orderType=1&status=2&deliveryType=1&orderIds="+ids; | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/deliverOrder?&orderIds='+ids, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (event == 'exportDeliverTwo') { | 
|---|
|  |  |  | window.location.href = ctx + "admin/order/exportOrderList?orderType=1&status=2&deliveryType=2"; | 
|---|
|  |  |  | var data = checkStatus.data; | 
|---|
|  |  |  | let ids = ""; | 
|---|
|  |  |  | for(let i = 0;i < data.length;i++){ | 
|---|
|  |  |  | if(data[i].status != 2){ | 
|---|
|  |  |  | febs.alert.warn('请选择待发货的订单'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | }else if(data[i].deliveryState != 1){ | 
|---|
|  |  |  | febs.alert.warn('请选择待配送的订单'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | ids = ids + data[i].id+","; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // layer.alert(layui.util.escape(JSON.stringify(data))); | 
|---|
|  |  |  | console.log(ids); | 
|---|
|  |  |  | if(ids == null || ids == ""){ | 
|---|
|  |  |  | febs.alert.warn('请选择待发货的订单'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | window.location.href = ctx + "admin/order/exportOrderList?orderType=1&status=2&deliveryType=2&orderIds="+ids; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | ,accept: 'file' //普通文件 | 
|---|
|  |  |  | ,done: function(res){ | 
|---|
|  |  |  | console.log("123"); | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | layEvent = obj.event; | 
|---|
|  |  |  | if (layEvent === 'deliverGoods') { | 
|---|
|  |  |  | febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, { | 
|---|
|  |  |  | btn: ['确认', '取消'], | 
|---|
|  |  |  | btn: ['确认','取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#deliver-update').find('#submit').trigger('click'); | 
|---|
|  |  |  | // $query.click(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'updateDeliver') { | 
|---|
|  |  |  | febs.modal.open('修改物流信息', 'modules/order/deliverGoods/' + data.id, { | 
|---|
|  |  |  | btn: ['确认','取消'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | $('#deliver-update').find('#deliverInfoSubmit').trigger('click'); | 
|---|
|  |  |  | // $query.click(); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | btn2: function () { | 
|---|
|  |  |  | layer.closeAll(); | 
|---|
|  |  |  | 
|---|
|  |  |  | // 查询按钮 | 
|---|
|  |  |  | $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: currPageOrder}}); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 刷新按钮 | 
|---|
|  |  |  | $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: currPageOrder}, initSort: sortObject}); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $add.on('click', function () { | 
|---|
|  |  |  | 
|---|
|  |  |  | elem: $view.find('table'), | 
|---|
|  |  |  | id: 'orderTable', | 
|---|
|  |  |  | url: ctx + 'admin/order/orderList?orderType=1', | 
|---|
|  |  |  | defaultToolbar: [], | 
|---|
|  |  |  | toolbar: '#tableToolBar', | 
|---|
|  |  |  | // defaultToolbar: [], | 
|---|
|  |  |  | //系统自带打印导出 | 
|---|
|  |  |  | totalRow : true, | 
|---|
|  |  |  | toolbar: '#tableToolBarOrder', | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox', fixed: 'left'}, | 
|---|
|  |  |  | {field: 'orderNo', title: '订单编号', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'memberName', title: '购买人', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'orderNo', title: '订单编号', minWidth: 200,align:'left' ,totalRowText:"合计"}, | 
|---|
|  |  |  | {field: 'memberName', title: '购买人', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'memberPhone', title: '联系方式', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | // {field: 'memberBindPhone', title: '联系方式', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'goodsName', title: '商品', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'amount', title: '订单金额', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'leaderName', title: '团长', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'refererName', title: '推荐人', minWidth: 100,align:'left'}, | 
|---|
|  |  |  | {field: 'goodsName', 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}, | 
|---|
|  |  |  | {field: 'orderTime', title: '下单时间', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'isHome', title: '配送方式', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.isHome === 2) { | 
|---|
|  |  |  | return '<span style="color:dodgerblue;">自提</span>' | 
|---|
|  |  |  | } else if (d.isHome === 1) { | 
|---|
|  |  |  | return '<span style="color:forestgreen;">送货上门</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 120,align:'center'}, | 
|---|
|  |  |  | {field: 'status', title: '状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.status === 1) { | 
|---|
|  |  |  | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'deliveryState', title: '配送状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.deliveryState === 1) { | 
|---|
|  |  |  | return '<span style="color:dodgerblue;">待配送</span>' | 
|---|
|  |  |  | } else if (d.deliveryState === 2) { | 
|---|
|  |  |  | return '<span style="color:forestgreen;">配送中</span>' | 
|---|
|  |  |  | } else if (d.deliveryState === 3) { | 
|---|
|  |  |  | return '<span style="color:forestgreen;">已送达</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 120,align:'center'}, | 
|---|
|  |  |  | {field: 'payMethod', title: '支付方式', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'payTime', title: '支付时间', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'wxOrderNo', title: '支付订单号', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | // {field: 'deliveryState', title: '配送状态', | 
|---|
|  |  |  | //     templet: function (d) { | 
|---|
|  |  |  | //         if (d.deliveryState === 1) { | 
|---|
|  |  |  | //             return '<span style="color:dodgerblue;">待配送</span>' | 
|---|
|  |  |  | //         } else if (d.deliveryState === 2) { | 
|---|
|  |  |  | //             return '<span style="color:forestgreen;">配送中</span>' | 
|---|
|  |  |  | //         } else if (d.deliveryState === 3) { | 
|---|
|  |  |  | //             return '<span style="color:forestgreen;">已送达</span>' | 
|---|
|  |  |  | //         }else{ | 
|---|
|  |  |  | //             return '' | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {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) { | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder" shiro:hasPermission="user:update">详情</button>' | 
|---|
|  |  |  | if(d.status === 2){ | 
|---|
|  |  |  | 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="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="updateDeliver" 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'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | * layui打印表格自定义函数 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | function print(tablelayid) { | 
|---|
|  |  |  | var v = document.createElement("div"); | 
|---|
|  |  |  | var f = ["<head>", "<style>", "body{font-size: 12px; color: #666;}", | 
|---|
|  |  |  | "table{width: 100%; border-collapse: collapse; border-spacing: 0;}", | 
|---|
|  |  |  | "th,td{line-height: 20px; padding: 9px 15px; border: 1px solid #ccc; text-align: left; font-size: 12px; color: #666;}", | 
|---|
|  |  |  | "a{color: #666; text-decoration:none;}", "*.layui-hide{display: none}", "</style>", "</head>" | 
|---|
|  |  |  | ].join(""); | 
|---|
|  |  |  | $(v).append($(".layui-table-box").find(".layui-table-header").html()); | 
|---|
|  |  |  | $(v).find("tr").after($("[lay-id=\"" + tablelayid + "\"] .layui-table-body.layui-table-main table").html()); | 
|---|
|  |  |  | $(v).find("th.layui-table-patch").remove(); | 
|---|
|  |  |  | $(v).find(".layui-table-col-special").remove(); | 
|---|
|  |  |  | var h = window.open("打印窗口", "_blank"); | 
|---|
|  |  |  | h.document.write(f + $(v).prop("outerHTML")); | 
|---|
|  |  |  | h.document.close(); | 
|---|
|  |  |  | h.print(); | 
|---|
|  |  |  | h.close(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 监听打印选中行按钮 */ | 
|---|
|  |  |  | // $('#printSelect').click(function() { | 
|---|
|  |  |  | //     layui.use(['table', 'layer'], function() { | 
|---|
|  |  |  | //         var table = layui.table, | 
|---|
|  |  |  | //             layer = layui.layer; | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //         var checkStatus = table.checkStatus('orderTable') | 
|---|
|  |  |  | //         console.log(checkStatus) | 
|---|
|  |  |  | //         // 判断是否选中数据 | 
|---|
|  |  |  | //         if (checkStatus.data.length === 0) { | 
|---|
|  |  |  | //             layer.msg('请选择数据', { | 
|---|
|  |  |  | //                 icon: 2 | 
|---|
|  |  |  | //             }) | 
|---|
|  |  |  | //         } else { | 
|---|
|  |  |  | //             printSelect(checkStatus.data) | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  | //     }) | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | * [自定义打印选中行数据] | 
|---|
|  |  |  | * @param  {[type]}  allData [传入选中行] | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | function printSelect(allData) { | 
|---|
|  |  |  | //用于包含内容 | 
|---|
|  |  |  | var v = document.createElement("div"); | 
|---|
|  |  |  | //页面头部,导入css  ,media="print"表示打印时使用该样式 | 
|---|
|  |  |  | var f = ["<head>", "<style>", "div{font-size:8px;}", ".main{width:100%;}", | 
|---|
|  |  |  | ".main div{width:100%;display:inline-block;}", "</style>", "</head>" | 
|---|
|  |  |  | ].join(""); | 
|---|
|  |  |  | var contentHtml = ""; | 
|---|
|  |  |  | for (let i = 0; i < allData.length; i++) { | 
|---|
|  |  |  | let data = allData[i] | 
|---|
|  |  |  | var template = | 
|---|
|  |  |  | "<div class='main'>" + | 
|---|
|  |  |  | "<div style='text-align: center;font-size: 10px;font-weight: bold;margin-bottom: 10px'>订单编号:" + data.orderNo + "</div>" + | 
|---|
|  |  |  | "<span style='font-size: 10px;font-weight: bold;'>收货人:</span><span>" + data.name + ",</span>" + | 
|---|
|  |  |  | "<span style='font-size: 10px;font-weight: bold;'>电话:</span><span>" + data.phone + ",</span>" + | 
|---|
|  |  |  | "<span style='font-size: 10px;font-weight: bold;'>地址:</span><span>" + data.address + "</span><br>" + | 
|---|
|  |  |  | "<span style='font-size: 10px;font-weight: bold;'>商品:</span><span>" + data.goodsName + "</span><br>" + | 
|---|
|  |  |  | "<span style='font-size: 10px;font-weight: bold;'>备注:</span><span>" + data.remark + "</span><br>" + | 
|---|
|  |  |  | "</div>" | 
|---|
|  |  |  |  | 
|---|
|  |  |  | contentHtml += template; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //contentHtml为已拼凑好的内容 | 
|---|
|  |  |  | $(v).append(contentHtml) | 
|---|
|  |  |  | //新建窗口 | 
|---|
|  |  |  | var h = window.open("打印窗口", "_blank"); | 
|---|
|  |  |  | //写入拼凑内容 | 
|---|
|  |  |  | h.document.write(f + $(v).prop("outerHTML")); | 
|---|
|  |  |  | //调用打印 | 
|---|
|  |  |  | h.print(); | 
|---|
|  |  |  | //关闭页面 | 
|---|
|  |  |  | h.close(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | </script> | 
|---|