|  |  |  | 
|---|
|  |  |  | cancelOrder(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'takeGoods') { | 
|---|
|  |  |  | febs.modal.confirm('自提商品', '确认自提商品?', function () { | 
|---|
|  |  |  | takeGoods(data.id); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'delOrder') { | 
|---|
|  |  |  | febs.modal.confirm('删除订单', '确认删除订单?', function () { | 
|---|
|  |  |  | delOrder(data.id); | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function takeGoods(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/takeGoods/' + id, null, function () { | 
|---|
|  |  |  | febs.alert.success('操作成功'); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function cancelOrder(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/order/cancelOrder/' + id, null, function () { | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'goodsName', title: '商品信息', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'remark', title: '备注', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'amount', title: '订单金额', minWidth: 120,align:'left',totalRow: '{{= parseInt(d.amount) }}'}, | 
|---|
|  |  |  | {field: 'deliverType', title: '配送方式', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.deliverType === 1) { | 
|---|
|  |  |  | return '<span style="color:green;">快递寄送</span>' | 
|---|
|  |  |  | } else if (d.deliverType === 2) { | 
|---|
|  |  |  | return '<span style="color:blue;">到店自提</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '<span style="color:green;">快递寄送</span>' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 120,align:'center'}, | 
|---|
|  |  |  | {field: 'status', title: '状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.status === 1) { | 
|---|
|  |  |  | return '<span style="color:red;">待支付</span>' | 
|---|
|  |  |  | } else if (d.status === 2) { | 
|---|
|  |  |  | return '<span style="color:green;">待发货</span>' | 
|---|
|  |  |  | }else if (d.status === 3) { | 
|---|
|  |  |  | return '<span style="color:green;">待收货</span>' | 
|---|
|  |  |  | }else if (d.status === 4) { | 
|---|
|  |  |  | return '<span style="color:green;">已完成</span>' | 
|---|
|  |  |  | }else if (d.status === 5) { | 
|---|
|  |  |  | return '<span style="color:green;">退款中</span>' | 
|---|
|  |  |  | }else if (d.status === 6) { | 
|---|
|  |  |  | return '<span style="color:green;">已退款</span>' | 
|---|
|  |  |  | }else if (d.status === 7) { | 
|---|
|  |  |  | return '<span style="color:green;">已取消</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {field: 'carriage', title: '运费', minWidth: 120,align:'left'}, | 
|---|
|  |  |  | {field: 'orderTime', title: '下单时间', minWidth: 200,align:'left'}, | 
|---|
|  |  |  | {field: 'status', title: '状态', | 
|---|
|  |  |  | templet: function (d) { | 
|---|
|  |  |  | if (d.status === 1) { | 
|---|
|  |  |  | return '<span style="color:red;">待支付</span>' | 
|---|
|  |  |  | } else if (d.status === 2) { | 
|---|
|  |  |  | return '<span style="color:green;">待发货</span>' | 
|---|
|  |  |  | }else if (d.status === 3) { | 
|---|
|  |  |  | return '<span style="color:green;">待收货</span>' | 
|---|
|  |  |  | }else if (d.status === 4) { | 
|---|
|  |  |  | return '<span style="color:green;">已完成</span>' | 
|---|
|  |  |  | }else if (d.status === 5) { | 
|---|
|  |  |  | return '<span style="color:green;">退款中</span>' | 
|---|
|  |  |  | }else if (d.status === 6) { | 
|---|
|  |  |  | return '<span style="color:green;">已退款</span>' | 
|---|
|  |  |  | }else if (d.status === 7) { | 
|---|
|  |  |  | return '<span style="color:green;">已取消</span>' | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | return '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, minWidth: 80,align:'center'}, | 
|---|
|  |  |  | {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) { | 
|---|
|  |  |  | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' | 
|---|
|  |  |  | 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-normal layui-btn-xs" lay-event="delOrder" 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>' | 
|---|
|  |  |  | 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'} | 
|---|