| | |
| | | table.on('tool(orderRefundTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'deliverGoods') { |
| | | febs.modal.open('发货', 'modules/order/deliverGoods/' + data.id, { |
| | | btn: ['确认', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#deliver-update').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'seeOrder') { |
| | | febs.modal.open( '订单详情', 'modules/order/orderDetail/' + data.id, { |
| | | if (layEvent === 'refunding') { |
| | | febs.modal.open( '退款进度', 'modules/order/seeRefund/' + data.id, { |
| | | maxmin: true, |
| | | }); |
| | | } |
| | | if (layEvent === 'agree') { |
| | | febs.modal.confirm('同意', '同意此次退款申请?', function () { |
| | | agreeRefund(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'disagree') { |
| | | febs.modal.confirm('拒绝', '拒绝此次退款申请?', function () { |
| | | disagreeRefund(data.id); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function agreeRefund(id) { |
| | | febs.get(ctx + 'admin/order/agreeRefund/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | function disagreeRefund(id) { |
| | | febs.get(ctx + 'admin/order/disagreeRefund/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | | } |
| | | |
| | | // 查询按钮 |
| | | $query.on('click', function () { |
| | |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | |
| | | $add.on('click', function () { |
| | | febs.view.tab.change("/modules/goods/goodsAddNew/"); |
| | | }); |
| | | |
| | | function initTable() { |
| | |
| | | // } |
| | | // }, minWidth: 80,align:'center'}, |
| | | // {field: 'createdTime', title: '注册时间', minWidth: 180,align:'center'}, |
| | | // {title: '操作', |
| | | // templet: function (d) { |
| | | // if (d.status === 1) { |
| | | // 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="seeOrder" shiro:hasPermission="user:update">详情</button>' |
| | | // } |
| | | // },minWidth: 300,align:'center'} |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if(d.status === 1){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="agree" shiro:hasPermission="user:update">同意</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="disagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="refunding" shiro:hasPermission="user:update">退款进度</button>' |
| | | } |
| | | |
| | | },minWidth: 300,align:'center'} |
| | | ]] |
| | | }); |
| | | } |