| | |
| | | table.on('tool(orderTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'downGoods') { |
| | | febs.modal.confirm('下架', '确认下架该商品?', function () { |
| | | downGoods(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'upGoods') { |
| | | febs.modal.confirm('上架', '确认上架该商品?', function () { |
| | | upGoods(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'delGoods') { |
| | | febs.modal.confirm('删除', '确认删除该商品?', function () { |
| | | delGoods(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'deliverGoods') { |
| | | febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#user-update').find('#submit').trigger('click'); |
| | | $('#deliver-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'seeOrder') { |
| | | febs.modal.open( '订单详情', 'modules/order/orderDetail/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |
| | | }); |
| | | function downGoods(id) { |
| | | febs.get(ctx + 'admin/goods/downMallGoods/' + id, null, function () { |
| | | febs.alert.success('下架成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function delGoods(id) { |
| | | febs.get(ctx + 'admin/goods/delMallGoods/' + id, null, function () { |
| | | febs.alert.success('删除成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | function upGoods(id) { |
| | | febs.get(ctx + 'admin/goods/upMallGoods/' + id, null, function () { |
| | | febs.alert.success('上架成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | |
| | | id: 'orderTable', |
| | | url: ctx + 'admin/order/orderList', |
| | | cols: [[ |
| | | {field: 'orderNo', title: '商品名称', minWidth: 150,align:'left'}, |
| | | // {field: 'accountType', title: '账号类型', |
| | | // templet: function (d) { |
| | | // if (d.accountType === 2) { |
| | | // return '<span style="color:red;">测试账号</span>' |
| | | // } else if (d.accountType === 1) { |
| | | // return '<span style="color:green;">正常账号</span>' |
| | | // }else{ |
| | | // return '' |
| | | // } |
| | | // }, minWidth: 80,align:'center'}, |
| | | {field: 'orderNo', title: '商品名称', minWidth: 150,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: 'accountStatus', title: '账号状态', |
| | | // templet: function (d) { |
| | | // if (d.accountStatus === 1) { |
| | |
| | | // {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if (d.status === 2) { |
| | | if (d.status === 2) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="deliverGoods" shiro:hasPermission="user:update">发货</button>' |
| | | } |
| | | // else{ |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="upGoods" shiro:hasPermission="user:update">上架</button>' |
| | | // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="delGoods" shiro:hasPermission="user:update">删除</button>' |
| | | // + '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="updateGoods" 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: 300,align:'center'} |
| | | ]] |
| | | }); |