bank_card.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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="role-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 卿卿号:<input type="text" name="erBanNo" placeholder="请输入卿卿号"/>
  15. </li>
  16. <li>
  17. 银行:<select name="bankCode" th:with="type=${@dict.getType('bank_card_type')}">
  18. <option value="">所有</option>
  19. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  20. </select>
  21. </li>
  22. <li>
  23. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  24. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  25. </li>
  26. </ul>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="btn-group-sm" id="toolbar" role="group">
  31. <a class="btn btn-success" onclick="add()" shiro:hasPermission="users:bank:card:add">
  32. <i class="fa fa-plus"></i> 新增
  33. </a>
  34. </div>
  35. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  36. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  37. </div>
  38. </div>
  39. </div>
  40. <th:block th:include="include :: footer" />
  41. <script th:inline="javascript">
  42. var editFlag = [[${@permission.hasPermi('users:bank:card:edit')}]];
  43. var removeFlag = [[${@permission.hasPermi('users:bank:card:del')}]];
  44. var useFlag = [[${@permission.hasPermi('users:bank:card:use')}]];
  45. var bankCardType = [[${@dict.getType('bank_card_type')}]];
  46. var isUseStatus = [[${@dict.getType('use_type')}]];
  47. var prefix = ctx + "users/bank/card";
  48. $(function() {
  49. var options = {
  50. url: prefix + "/list",
  51. createUrl: prefix + "/add",
  52. updateUrl: prefix + "/edit/{id}",
  53. removeUrl: prefix + "/remove",
  54. modalName: "银行卡",
  55. height: $(window).height()-120,
  56. columns: [
  57. {
  58. field: 'id',
  59. title: 'ID'
  60. },
  61. {
  62. field: 'erbanNo',
  63. title: '卿卿号'
  64. },
  65. {
  66. field: 'nick',
  67. title: '昵称',
  68. align : 'center'
  69. },
  70. {
  71. field: 'bankCard',
  72. title: '卡号',
  73. align : 'center'
  74. },
  75. {
  76. field: 'bankCardName',
  77. title: '名字',
  78. align : 'center'
  79. },
  80. {
  81. field: 'openBankCode',
  82. title: '银行',
  83. align : 'center',
  84. formatter: function(value, row, index) {
  85. return $.table.selectDictLabel(bankCardType, value);
  86. }
  87. },
  88. {
  89. field: 'isUse',
  90. title: '状态',
  91. align: 'center',
  92. formatter: function(value, row, index) {
  93. return $.table.selectDictLabel(isUseStatus, value);
  94. }
  95. },
  96. {
  97. field: 'createTime',
  98. title: '创建时间',
  99. align : 'center'
  100. },
  101. {
  102. title: '操作',
  103. align: 'center',
  104. formatter: function(value, row, index) {
  105. var actions = [];
  106. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
  107. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i> 删除</a>');
  108. if(row.isUse == 0){
  109. actions.push(' ');
  110. actions.push('<a class="btn btn-danger btn-xs ' + useFlag + '" href="javascript:void(0)" onclick="use(\'' + row.id + '\',\'' + row.isUse + '\')"><i class="fa fa-toggle-on"></i> 设置默认</a>');
  111. }
  112. return actions.join('');
  113. }
  114. }]
  115. };
  116. $.table.init(options);
  117. });
  118. function use(id,isUse){
  119. $.modal.confirm("确认要该银行卡为默认使用吗?", function() {
  120. $.operate.post(prefix + "/use?id=" + id + "&use=" + isUse);
  121. });
  122. }
  123. function add(){
  124. var url = prefix + "/add";
  125. $.modal.open("新增银行卡信息",url,'800','400');
  126. }
  127. function edit(id){
  128. var url = prefix + "/edit/" + id;
  129. $.modal.open("编辑银行卡信息",url,'800','400');
  130. }
  131. function remove(id) {
  132. $.modal.confirm("确认要删除该记录吗?", function() {
  133. $.operate.post(prefix + "/del?id=" + id);
  134. });
  135. }
  136. </script>
  137. </body>
  138. </html>