balance.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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. <th:block th:include="include :: bootstrap-editable-css" />
  6. </head>
  7. <body class="gray-bg">
  8. <div class="container-div">
  9. <div class="row">
  10. <div class="col-sm-12 search-collapse">
  11. <form id="formId">
  12. <div class="select-list">
  13. <ul>
  14. <li>
  15. <label>用户ID:</label>
  16. <!-- <input type="text" name="userId"/>-->
  17. <select name="userId" th:with="users=${@user.getUserList()}">
  18. <option value="">所有</option>
  19. <option th:each="user : ${users}" th:text="${user.userName}" th:value="${user.userId}"></option>
  20. </select>
  21. </li>
  22. <li>
  23. <label>结余周期:</label>
  24. <!-- <input type="text" name="duration"/>-->
  25. <select name="duration" th:with="commons=${@common.getDurationList()}">
  26. <option value="">所有</option>
  27. <option th:each="common : ${commons}" th:text="${common}" th:value="${common}"></option>
  28. </select>
  29. </li>
  30. <!-- <li>-->
  31. <!-- <label>期初数:</label>-->
  32. <!-- <input type="text" name="openingBalance"/>-->
  33. <!-- </li>-->
  34. <!-- <li>-->
  35. <!-- <label>收入:</label>-->
  36. <!-- <input type="text" name="income"/>-->
  37. <!-- </li>-->
  38. <!-- <li>-->
  39. <!-- <label>支出:</label>-->
  40. <!-- <input type="text" name="payment"/>-->
  41. <!-- </li>-->
  42. <!-- <li>-->
  43. <!-- <label>期末数:</label>-->
  44. <!-- <input type="text" name="closingBalance"/>-->
  45. <!-- </li>-->
  46. <li>
  47. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  48. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  49. </li>
  50. </ul>
  51. </div>
  52. </form>
  53. </div>
  54. <div class="btn-group-sm" id="toolbar" role="group">
  55. <!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:balance:add">-->
  56. <!-- <i class="fa fa-plus"></i> 添加-->
  57. <!-- </a>-->
  58. <!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:balance:edit">-->
  59. <!-- <i class="fa fa-edit"></i> 修改-->
  60. <!-- </a>-->
  61. <!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:balance:remove">-->
  62. <!-- <i class="fa fa-remove"></i> 删除-->
  63. <!-- </a>-->
  64. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:balance:export">
  65. <i class="fa fa-download"></i> 导出
  66. </a>
  67. </div>
  68. <div class="col-sm-12 select-table table-striped">
  69. <table id="bootstrap-table"></table>
  70. </div>
  71. </div>
  72. </div>
  73. <th:block th:include="include :: footer" />
  74. <th:block th:include="include :: bootstrap-table-editable-js" />
  75. <script th:inline="javascript">
  76. var editFlag = [[${@permission.hasPermi('business:balance:edit')}]];
  77. var removeFlag = [[${@permission.hasPermi('business:balance:remove')}]];
  78. var prefix = ctx + "business/balance";
  79. $(function() {
  80. var options = {
  81. url: prefix + "/list",
  82. createUrl: prefix + "/add",
  83. updateUrl: prefix + "/edit/{id}",
  84. removeUrl: prefix + "/remove",
  85. exportUrl: prefix + "/export",
  86. modalName: "用户结余",
  87. onEditableSave: onEditableSave,
  88. columns: [{
  89. checkbox: true
  90. },
  91. {
  92. field: 'balanceId',
  93. title: '主键',
  94. visible: false
  95. },
  96. {
  97. field: 'userId',
  98. title: '用户ID',
  99. visible: false
  100. },
  101. {
  102. field: 'userName',
  103. title: '用户名称'
  104. },
  105. {
  106. field: 'duration',
  107. title: '结余周期'
  108. },
  109. {
  110. field: 'openingBalance',
  111. title: '期初数',
  112. editable : {
  113. type : 'text',
  114. title : '期初数',
  115. emptytext : "0",
  116. validate : function(value) {
  117. if (value.length == 0) {
  118. return '期初数不能为空';
  119. }
  120. if (!$.common.isCurrency(value)) {
  121. return '期初数应为正的金额';
  122. }
  123. }
  124. }
  125. },
  126. {
  127. field: 'income',
  128. title: '收入'
  129. },
  130. {
  131. field: 'payment',
  132. title: '支出'
  133. },
  134. {
  135. field: 'closingBalance',
  136. title: '期末数'
  137. }
  138. // {
  139. // title: '操作',
  140. // align: 'center',
  141. // formatter: function(value, row, index) {
  142. // var actions = [];
  143. // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="adjustOpening(\'' + row.balanceId + '\',' + row.openingBalance + ')"><i class="fa fa-edit"></i>编辑期初数</a> ');
  144. // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.balanceId + '\')"><i class="fa fa-remove"></i>删除</a>');
  145. // return actions.join('');
  146. // }
  147. // }
  148. ]
  149. };
  150. $.table.init(options);
  151. });
  152. function onEditableSave (field, row, rowIndex, oldValue, $el) {
  153. $.operate.post(prefix + "/adjustOpening", {"balanceId": row.balanceId, "openingBalance": row.openingBalance}, refreshTable);
  154. }
  155. function refreshTable() {
  156. $.table.refresh();
  157. }
  158. </script>
  159. </body>
  160. </html>