charge.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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" id="erbanNo" placeholder="请输入卿卿号"/>
  15. </li>
  16. <li>
  17. 订单ID:<input type="text" name="recordId" id="recordId" placeholder="请输入订单号"/>
  18. </li>
  19. <li>
  20. ping++单号:<input type="text" name="pingxxId" id="pingxxId" placeholder="请输入ping++单号"/>
  21. </li>
  22. <li>
  23. 金币:<select id="chargeType" name="chargeType" th:with="type=${@dict.getType('charge_type')}">
  24. <option value="">全部</option>
  25. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  26. </select>
  27. </li>
  28. <li>
  29. 类型:<select id="goldChargeType" name="goldChargeType" th:with="type=${@dict.getType('gold_charge_type')}">
  30. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  31. </select>
  32. </li>
  33. <li>
  34. 支付渠道:<select id="payChannel" name="payChannel" th:with="type=${@dict.getType('pay_channel')}">
  35. <option value="">全部</option>
  36. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  37. </select>
  38. </li>
  39. <li>
  40. 支付状态:<select id="payStatus" name="payStatus" th:with="type=${@dict.getType('pay_status')}">
  41. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  42. </select>
  43. </li>
  44. <li>
  45. 平台:<select id="osType" name="osType" th:with="type=${@dict.getType('os_type')}">
  46. <option value="">全部</option>
  47. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  48. </select>
  49. </li>
  50. <li>
  51. 性别:<select id="gender" name="gender" th:with="type=${@dict.getType('sys_user_sex')}">
  52. <option value="">全部</option>
  53. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  54. </select>
  55. </li>
  56. <li class="select-time">
  57. <label>创建时间: </label>
  58. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
  59. <span>-</span>
  60. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
  61. </li>
  62. <li>
  63. <a class="btn btn-primary btn-rounded btn-sm" id="btnSearch"><i class="fa fa-search"></i>&nbsp;搜索</a>
  64. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  65. <a class="btn btn-primary btn-rounded btn-sm" id="yesterdaySearch"><i class="fa fa-calendar"></i>&nbsp;昨天</a>
  66. </li>
  67. <li>
  68. <span style="font-size: 23px;">充值人数: </span><span id="chargeNum" style="color: red; margin-left: 10px;font-size: 23px"></span>
  69. <span style="font-size: 23px;">男: </span><span id="maleNum" style="color: red; margin-left: 10px;font-size: 23px"></span>
  70. <span style="font-size: 23px;">女: </span><span id="femaleNum" style="color: red; margin-left: 10px;font-size: 23px"></span>
  71. <span style="font-size: 23px;">其他: </span><span id="otherNum" style="color: red; margin-left: 10px;font-size: 23px"></span>
  72. <span style="font-size: 23px;">金额(RMB): </span><span id="total" style="color: red; margin-left: 10px;font-size: 23px"></span>
  73. </li>
  74. </ul>
  75. </div>
  76. </form>
  77. </div>
  78. <div class="btn-group-sm" id="toolbar" role="group">
  79. <a class="btn btn-success" onclick="$.table.exportExcel()" shiro:hasPermission="report:recharge:record:excel">
  80. <i class="fa fa-cloud-download"></i> 导出Excel
  81. </a>
  82. </div>
  83. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  84. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  85. </div>
  86. </div>
  87. </div>
  88. <th:block th:include="include :: footer" />
  89. <script th:inline="javascript">
  90. var prefix = ctx + "report/recharge/record";
  91. var sexs = [[${@dict.getType('sys_user_sex')}]];
  92. var os = [[${@dict.getType('os_type')}]];
  93. var payChannel = [[${@dict.getType('pay_channel')}]];
  94. var payStatus = [[${@dict.getType('pay_status')}]];
  95. $(function() {
  96. //设置时间初始值
  97. $("#startTime").val(new Date().Format("yyyy-MM-dd"));
  98. $("#endTime").val(new Date().Format("yyyy-MM-dd"));
  99. getChargeInfo();
  100. var options = {
  101. url: prefix + "/list",
  102. exportUrl: prefix + "/export",
  103. modalName: "充值记录",
  104. height: $(window).height()-170,
  105. columns: [
  106. {
  107. field: 'chargeRecordId',
  108. title: '订单ID'
  109. },
  110. {
  111. field: 'pingxxChargeId',
  112. title: 'ping++订单号',
  113. align : 'center'
  114. },
  115. {
  116. field: 'erbanNo',
  117. title: '卿卿号',
  118. align : 'center'
  119. },
  120. {
  121. field: 'nick',
  122. title: '昵称',
  123. align : 'center'
  124. },
  125. {
  126. field: 'phone',
  127. title: '电话',
  128. align : 'center'
  129. },
  130. {
  131. field: 'os',
  132. title: '平台',
  133. align: 'center',
  134. formatter: function(value, row, index) {
  135. return $.table.selectDictLabel(os, value);
  136. }
  137. },
  138. {
  139. field: 'gender',
  140. title: '性别',
  141. align: 'center',
  142. formatter: function(value, row, index) {
  143. return $.table.selectDictLabel(sexs, value);
  144. }
  145. },
  146. {
  147. field: 'clientIp',
  148. title: '用户IP',
  149. align : 'center'
  150. },
  151. {
  152. field: 'totalGold',
  153. title: '金币数量',
  154. align : 'center'
  155. },
  156. {
  157. field: 'chargeDesc',
  158. title: '产品描述',
  159. align : 'center'
  160. },
  161. {
  162. field: 'amount',
  163. title: '金额(元)',
  164. align : 'center',
  165. formatter: function (val, row, index) {
  166. return val;
  167. }
  168. },
  169. {
  170. field: 'channel',
  171. title: '支付渠道',
  172. align: 'center',
  173. formatter: function(value, row, index) {
  174. return $.table.selectDictLabel(payChannel, value);
  175. }
  176. },
  177. {
  178. field: 'chargeStatus',
  179. title: '支付状态',
  180. align: 'center',
  181. formatter: function(value, row, index) {
  182. return $.table.selectDictLabel(payStatus, value);
  183. }
  184. },
  185. {
  186. field: 'createTime',
  187. title: '购买时间',
  188. align : 'center'
  189. },
  190. {
  191. field: 'updateTime',
  192. title: '回调时间',
  193. align : 'center'
  194. }]
  195. };
  196. $.table.init(options);
  197. $('#btnSearch').on('click', function () {
  198. $.table.search();
  199. getChargeInfo();
  200. });
  201. $('#yesterdaySearch').on('click',function () {
  202. var today = new Date();
  203. today.setDate(today.getDate() - 1);
  204. $("#startTime").val(today.Format("yyyy-MM-dd"));
  205. $("#endTime").val(today.Format("yyyy-MM-dd"));
  206. $.table.search();
  207. getChargeInfo();
  208. });
  209. });
  210. Date.prototype.Format = function (fmt) { //author: meizz
  211. var o = {
  212. "M+": this.getMonth() + 1, //月份
  213. "d+": this.getDate(), //日
  214. "H+": this.getHours(), //小时
  215. "m+": this.getMinutes(), //分
  216. "s+": this.getSeconds(), //秒
  217. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  218. "S": this.getMilliseconds() //毫秒
  219. };
  220. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  221. for (var k in o)
  222. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  223. return fmt;
  224. };
  225. function getChargeInfo() {
  226. var param = {
  227. beginTime: $("#startTime").val(),
  228. endTime: $("#endTime").val(),
  229. erbanNo: $('#erbanNo').val(),
  230. osType: $("#osType").val(),
  231. gender: $("#gender").val(),
  232. chargeType:$("#chargeType").val(),
  233. goldChargeType:$("#goldChargeType").val(),
  234. payChannel:$("#payChannel").val(),
  235. payStatus:$("#payStatus").val()
  236. };
  237. $.post(prefix + "/getChargeRecordInfo", param, function (data){
  238. $("#chargeNum").text(data.userNum);
  239. $("#maleNum").text(data.male);
  240. $("#femaleNum").text(data.female);
  241. $("#otherNum").text(data.other);
  242. $("#total").text(data.totalAmount / 100);
  243. });
  244. }
  245. </script>
  246. </body>
  247. </html>