| | |
| | | <script src="layui/layui.js" type="text/javascript" charset="utf-8"></script> |
| | | <script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script> |
| | | <script src="js/http_api.js"></script> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <!-- <button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm" lay-event="getCheckLength">获取选中数目</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm" lay-event="isAll">验证是否全选</button>--> |
| | | </div> |
| | | </script> |
| | | <script> |
| | | layui.use(['form', 'jquery', 'layer', 'table', 'laydate'], function () { |
| | | var table = layui.table; |
| | |
| | | "data": res.data.list // 解析数据列表 |
| | | }; |
| | | }, |
| | | toolbar: '#toolbarDemo', |
| | | defaultToolbar: ['filter', 'exports', { //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可 |
| | | title: '提示' |
| | | ,layEvent: 'LAYTABLE_TIPS' |
| | | ,icon: 'layui-icon-tips' |
| | | }], |
| | | page: true, // 开启分页 |
| | | cols: [ |
| | | [ |
| | | {field: 'id', title: 'ID', width: 100, fixed: 'left'}, |
| | | {type:'checkbox',fixed: 'left'}, |
| | | {field: 'id', title: 'ID', width: 100}, |
| | | {field: 'uid', title: '用户ID', width: 150}, |
| | | {field: 'exchangeType', title: '兑换类型', width: 150}, |
| | | {field: 'exchangeValue', title: '兑换数值', width: 150}, |
| | | {field: 'exchangeValue', title: '兑换金额(元)', width: 150}, |
| | | {field: 'consumedCredits', title: '消耗积分', width: 150}, |
| | | {field: 'creditBalance', title: '积分余额', width: 150}, |
| | | {field: 'status', title: '状态', width: 150, templet: function (d) { |
| | |
| | | } |
| | | return "未知"; |
| | | }}, |
| | | {field: 'createTime', title: '创建时间', width: 180} |
| | | {field: 'createTime', title: '创建时间', width: 180}, |
| | | {field: 'updateTime', title: '更新时间', width: 180} |
| | | ] |
| | | ] |
| | | }; |
| | |
| | | let ids = checkStatus.data.map(item => item.id); |
| | | if (ids.length === 0) { |
| | | layer.msg("请至少选择一条记录"); |
| | | return; |
| | | return true; |
| | | } |
| | | $.post('/admin/api/credit/exchange-record/approve', {ids: ids}, function (response) { |
| | | $.post('/admin/api/credit/exchange-record/approve', {ids: JSON.stringify(ids)}, function (response) { |
| | | if (response.code === 0) { |
| | | layer.msg(response.msg); |
| | | tableIns.reload(); |
| | |
| | | layer.msg("请至少选择一条记录"); |
| | | return; |
| | | } |
| | | $.post('/admin/api/credit/exchange-record/reject', {ids: ids}, function (response) { |
| | | $.post('/admin/api/credit/exchange-record/reject', {ids: JSON.stringify(ids)}, function (response) { |
| | | if (response.code === 0) { |
| | | layer.msg(response.msg); |
| | | tableIns.reload(); |