card.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('用户会员卡列表')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="formId">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. <label>姓名:</label>
  15. <input type="text" name="realName"/>
  16. </li>
  17. <li>
  18. <label>手机号码:</label>
  19. <input type="text" name="mobile"/>
  20. </li>
  21. <li>
  22. <label>卡种名称:</label>
  23. <input type="text" name="cardName"/>
  24. </li>
  25. <li>
  26. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  27. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  28. </li>
  29. </ul>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="btn-group-sm" id="toolbar" role="group">
  34. <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:card:add">-->
  35. <!-- <i class="fa fa-plus"></i> 添加-->
  36. <!-- </a>-->
  37. <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:card:edit">-->
  38. <!-- <i class="fa fa-edit"></i> 修改-->
  39. <!-- </a>-->
  40. <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:card:remove">-->
  41. <!-- <i class="fa fa-remove"></i> 删除-->
  42. <!-- </a>-->
  43. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:card:export">
  44. <i class="fa fa-download"></i> 导出
  45. </a>
  46. </div>
  47. <div class="col-sm-12 select-table table-striped">
  48. <table id="bootstrap-table"></table>
  49. </div>
  50. </div>
  51. </div>
  52. <th:block th:include="include :: footer" />
  53. <script th:inline="javascript">
  54. var editFlag = [[${@permission.hasPermi('system:card:edit')}]];
  55. var refundCard = [[${@permission.hasPermi('system:record:add')}]];
  56. var cardType = [[${@dict.getType('card_status')}]];
  57. var prefix = ctx + "card";
  58. $(function() {
  59. var options = {
  60. url: prefix + "/list",
  61. createUrl: prefix + "/add",
  62. exportUrl: prefix + "/export",
  63. modalName: "用户会员卡",
  64. columns: [{
  65. checkbox: true
  66. },
  67. {
  68. field: 'id',
  69. title: '主键',
  70. visible: false
  71. },
  72. {
  73. field: 'userCardId',
  74. title: '用户会员卡id',
  75. visible: false
  76. },
  77. {
  78. field: 'userName',
  79. title: '用户账户'
  80. },
  81. {
  82. field: 'realName',
  83. title: '姓名'
  84. },
  85. {
  86. field: 'mobile',
  87. title: '手机号码'
  88. },
  89. {
  90. field: 'cardName',
  91. title: '卡种名称'
  92. },
  93. {
  94. field: 'totalNumber',
  95. title: '总次数'
  96. },
  97. {
  98. field: 'remainingNumber',
  99. title: '剩余次数'
  100. },
  101. {
  102. field: 'state',
  103. title: '状态',
  104. formatter: function (value, row, index) {
  105. return $.table.selectDictLabel(cardType, value);
  106. }
  107. },
  108. {
  109. title: '操作',
  110. align: 'center',
  111. formatter: function(value, row, index) {
  112. var actions = [];
  113. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="stream(\'' + row.id + '\')"><i class="fa fa-edit"></i>流水</a> ');
  114. if (row.state==='3'){
  115. actions.push('<a class="btn btn-danger btn-xs ' + refundCard + '" href="javascript:void(0)" onclick="refundCard1(\'' + row.id + '\', \'' + row.recordId + '\')"><i class="fa fa-remove"></i>退卡</a>');
  116. }
  117. return actions.join('');
  118. }
  119. }]
  120. };
  121. $.table.init(options);
  122. });
  123. function stream(id) {
  124. table.set();
  125. $.modal.open("查看流水", prefix + "/toStream/" + id);
  126. }
  127. function refundCard1(id,recordId) {
  128. console.log(id)
  129. console.log(recordId)
  130. $.modal.confirm("确认要退选中的会员卡吗?", function() {
  131. var data = { "id":id, "recordId": recordId };
  132. $.operate.submit(prefix + "/refundCard", "post", "json", data);
  133. });
  134. }
  135. </script>
  136. </body>
  137. </html>