截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. {layout name="layout1" /}
  2. <div class="wrapper">
  3. <div class="layui-card">
  4. <!-- 提示 -->
  5. <div class="layui-card-body">
  6. <div class="layui-collapse like-layui-collapse" style="baccount:1px dashed #c4c4c4">
  7. <div class="layui-colla-item">
  8. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  9. <div class="layui-colla-content layui-show">
  10. <p>*查看商家账户余额流水记录。</p>
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. <!-- 搜索 -->
  16. <div class="layui-card-body layui-form">
  17. <div class="layui-form-item">
  18. <div class="layui-row">
  19. <div class="layui-inline">
  20. <label class="layui-form-label">商家名称:</label>
  21. <div class="layui-input-block">
  22. <input type="text" name="shop_name" id="shop_name" placeholder="请输入商家名称" autocomplete="off" class="layui-input">
  23. </div>
  24. </div>
  25. <div class="layui-inline">
  26. <label class="layui-form-label">明细类型:</label>
  27. <div class="layui-input-block">
  28. <select name="search_key" id="search_key">
  29. <option value="">全部</option>
  30. <option value="settle">结算入账</option>
  31. <option value="withdrawal">商家提现</option>
  32. <option value="withdrawal_stay">商家提现中</option>
  33. <option value="withdrawal_error">商家提现失败</option>
  34. </select>
  35. </div>
  36. </div>
  37. <div class="layui-inline">
  38. <label class="layui-form-label">记录时间:</label>
  39. <div class="layui-input-inline">
  40. <div class="layui-input-inline">
  41. <input type="text" id="start_time" name="start_time" class="layui-input" autocomplete="off">
  42. </div>
  43. </div>
  44. <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
  45. <label class="layui-form-mid">至</label>
  46. </div>
  47. <div class="layui-input-inline">
  48. <input type="text" id="end_time" name="end_time" class="layui-input" autocomplete="off">
  49. </div>
  50. </div>
  51. <div class="layui-inline">
  52. <div class="layui-btn-group">
  53. <button type="button" day="1" class="layui-btn layui-btn-sm layui-btn-primary day">今天</button>
  54. <button type="button" day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
  55. <button type="button" day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
  56. <button type="button" day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
  57. </div>
  58. </div>
  59. <div class="layui-inline">
  60. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="account-search">查询</button>
  61. <button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="account-clear-search">重置</button>
  62. <button class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="data-export">导出</button>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <!-- 列表 -->
  68. <div class="layui-tab-item layui-show">
  69. <div class="layui-card">
  70. <div class="layui-card-body">
  71. <table id="like-table-lists" lay-filter="like-table-lists"></table>
  72. <script type="text/html" id="shop">
  73. <div style="text-align: left;">
  74. <img src="{{ d.logo }}" style="height:80px;width:80px;margin-right:5px;" class="layui-col-md4">
  75. <p>商家编号:{{d.id}}</p>
  76. <p>商家名称:{{d.name}}</p>
  77. <p>商家类型:{{d.type}}</p>
  78. </div>
  79. </script>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <script>
  86. layui.use(['form'], function(){
  87. var $ = layui.$
  88. ,form = layui.form
  89. ,table = layui.table
  90. ,laydate = layui.laydate;
  91. laydate.render({elem:'#start_time' ,type:'datetime', theme:'#1E9FFF'});
  92. laydate.render({elem:'#end_time' ,type:'datetime', theme:'#1E9FFF'});
  93. like.tableLists("#like-table-lists", "{:url()}", [
  94. {field: 'shop', title: '商家信息', align: 'center',templet:'#shop',width:300}
  95. ,{field: 'log_sn', title: '明细流水号', align: 'center',width:180}
  96. ,{field: 'source_sn', title: '来源单号', align: 'center',width:180}
  97. ,{field: 'source_type', title: '明细类型', align: 'center',width:120}
  98. ,{field: 'change_amount', title: '变动金额', align: 'center',width:120}
  99. ,{field: 'left_amount', title: '剩余金额', align: 'center',width:120}
  100. ,{field: 'create_time', title: '记录时间', align: 'center',width:160}
  101. ]);
  102. /**
  103. * 监听搜索
  104. */
  105. form.on('submit(account-search)', function (data) {
  106. table.reload('like-table-lists', {
  107. where: data.field,
  108. page: {
  109. curr: 1
  110. }
  111. });
  112. });
  113. /**
  114. * 清空查询
  115. */
  116. form.on('submit(account-clear-search)', function () {
  117. $('#shop_name').val('');
  118. $('#start_time').val('');
  119. $('#end_time').val('');
  120. $('#search_key').val('');
  121. form.render('select');
  122. $(".day.layui-btn-normal").addClass("layui-btn-primary");
  123. $("button.day.layui-btn-normal").removeClass("layui-btn-normal");
  124. table.reload('like-table-lists', {
  125. where: [],
  126. page: {
  127. curr: 1
  128. }
  129. });
  130. });
  131. // 导出
  132. form.on('submit(data-export)', function (data) {
  133. var field = data.field;
  134. like.ajax({
  135. url: '{:url("finance.Shop/accountExport")}'
  136. , data: field
  137. , type: 'get'
  138. , success: function (res) {
  139. if (res.code == 1) {
  140. window.location.href = res.data.url;
  141. }
  142. }
  143. });
  144. });
  145. $(document).on("click", ".day", function () {
  146. var day = parseInt($(this).attr("day"));
  147. var start_time = "";
  148. var end_time = "";
  149. switch (day) {
  150. case 1:
  151. start_time = "{$dateTime.today[0]}";
  152. end_time = "{$dateTime.today[1]}";
  153. break;
  154. case -1:
  155. start_time = "{$dateTime.yesterday[0]}";
  156. end_time = "{$dateTime.yesterday[1]}";
  157. console.log(start_time);
  158. break;
  159. case 7:
  160. start_time = "{$dateTime.days_ago7[0]}";
  161. end_time = "{$dateTime.days_ago7[1]}";
  162. break;
  163. case 30:
  164. start_time = "{$dateTime.days_ago30[0]}";
  165. end_time = "{$dateTime.days_ago30[1]}";
  166. break;
  167. }
  168. $(this).siblings().removeClass('layui-btn-normal');
  169. $(this).siblings().addClass('layui-btn-primary');
  170. $(this).removeClass("layui-btn-primary");
  171. $(this).addClass('layui-btn-normal');
  172. $("#start_time").val(start_time);
  173. $("#end_time").val(end_time);
  174. })
  175. });
  176. </script>