截流自动化的商城平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

commission.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. {layout name="layout1" /}
  2. <style>
  3. .layui-table-cell {
  4. height:auto;
  5. }
  6. .goods-content>div:not(:last-of-type) {
  7. bwithdrawal-bottom:1px solid #DCDCDC;
  8. }
  9. .goods-data::after{
  10. display: block;
  11. content: '';
  12. clear: both;
  13. }
  14. .goods_name_hide{
  15. overflow:hidden;
  16. white-space:nowrap;
  17. text-overflow: ellipsis;
  18. }
  19. .operation-btn {
  20. margin: 5px;
  21. }
  22. .table-operate{
  23. text-align: left;
  24. font-size:14px;
  25. padding:0 5px;
  26. height:auto;
  27. overflow:visible;
  28. text-overflow:inherit;
  29. white-space:normal;
  30. word-break: break-all;
  31. }
  32. </style>
  33. <div class="wrapper">
  34. <div class="layui-card">
  35. <div class="layui-card-body">
  36. <div class="layui-collapse like-layui-collapse" lay-accordion="" style="bwithdrawal:1px dashed #c4c4c4">
  37. <div class="layui-colla-item">
  38. <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
  39. <div class="layui-colla-content layui-show">
  40. <p>*查看会员佣金钱包资金变动记录。</p>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="layui-tab layui-tab-card" lay-filter="tab-all">
  46. <div class="layui-card-body layui-form">
  47. <div class="layui-form-item">
  48. <div class="layui-row">
  49. <div class="layui-inline">
  50. <label class="layui-form-label">会员信息:</label>
  51. <div class="layui-input-block">
  52. <select name="search_key">
  53. <option value="user_sn">会员编号</option>
  54. <option value="nickname">会员昵称</option>
  55. </select>
  56. </div>
  57. </div>
  58. <div class="layui-inline">
  59. <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
  60. autocomplete="off" class="layui-input">
  61. </div>
  62. <div class="layui-inline">
  63. <label class="layui-form-label">明细类型:</label>
  64. <div class="layui-input-block">
  65. <select name="source_type" id="source_type">
  66. <option value="">全部</option>
  67. {foreach $source_type as $item => $val}
  68. <option value="{$item}">{$val}</option>
  69. {/foreach}
  70. </select>
  71. </div>
  72. </div>
  73. <div class="layui-inline">
  74. <label class="layui-form-label">记录时间:</label>
  75. <div class="layui-input-inline">
  76. <div class="layui-input-inline">
  77. <input type="text" name="start_time" class="layui-input" id="start_time"
  78. placeholder="" autocomplete="off">
  79. </div>
  80. </div>
  81. <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
  82. <label class="layui-form-mid">至</label>
  83. </div>
  84. <div class="layui-input-inline">
  85. <input type="text" name="end_time" class="layui-input" id="end_time"
  86. placeholder="" autocomplete="off">
  87. </div>
  88. </div>
  89. <div class="layui-inline">
  90. <div class="layui-btn-group">
  91. <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
  92. <button type="button" day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
  93. <button type="button" day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
  94. <button type="button" day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
  95. </div>
  96. </div>
  97. <div class="layui-inline">
  98. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
  99. lay-filter="withdrawal-search">查询
  100. </button>
  101. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
  102. lay-filter="withdrawal-clear-search">重置
  103. </button>
  104. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
  105. lay-filter="data-export">导出
  106. </button>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="layui-tab-item layui-show">
  112. <div class="layui-card">
  113. <div class="layui-card-body">
  114. <table id="withdrawal-lists" lay-filter="withdrawal-lists"></table>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <script>
  122. layui.config({
  123. version:"{$front_version}",
  124. base: '/static/lib/' //静态资源所在路径
  125. }).use(['form'], function(){
  126. var $ = layui.$
  127. , form = layui.form
  128. , table = layui.table
  129. , element = layui.element
  130. , laydate = layui.laydate;
  131. //图片放大
  132. $(document).on('click', '.image-show', function () {
  133. var src = $(this).attr('src');
  134. like.showImg(src,400);
  135. });
  136. //监听搜索
  137. form.on('submit(withdrawal-search)', function (data) {
  138. var field = data.field;
  139. //执行重载
  140. table.reload('withdrawal-lists', {
  141. where: field,
  142. page: {
  143. curr: 1
  144. }
  145. });
  146. });
  147. //清空查询
  148. form.on('submit(withdrawal-clear-search)', function () {
  149. $('#goods_name').val('');
  150. $('#source_type').val('');
  151. $('#keyword').val('');
  152. $('#start_time').val('{$today[0]}');
  153. $('#end_time').val('{$today[1]}');
  154. $('#today').trigger("click");
  155. form.render('select');
  156. //刷新列表
  157. table.reload('withdrawal-lists', {
  158. where: [],
  159. page: {
  160. curr: 1
  161. }
  162. });
  163. });
  164. // 导出
  165. form.on('submit(data-export)', function (data) {
  166. var field = data.field;
  167. like.ajax({
  168. url: '{:url("finance.User/commissionExport")}'
  169. , data: field
  170. , type: 'get'
  171. , success: function (res) {
  172. if (res.code == 1) {
  173. window.location.href = res.data.url;
  174. }
  175. }
  176. });
  177. });
  178. //日期时间范围
  179. laydate.render({
  180. elem: '#start_time'
  181. , type: 'datetime'
  182. ,theme: '#1E9FFF'
  183. , value: "{$today[0]}"
  184. });
  185. laydate.render({
  186. elem: '#end_time'
  187. , type: 'datetime'
  188. ,theme: '#1E9FFF'
  189. ,value: "{$today[1]}"
  190. });
  191. //获取列表
  192. getList('');
  193. //切换列表
  194. element.on('tab(tab-all)', function (data) {
  195. $('#keyword').val('');
  196. $('#withdrawal_status').val('');
  197. $('#goods_name').val('');
  198. $('#pay_way').val('');
  199. $('#withdrawal_type').val('');
  200. $('#start_time').val('{$today[0]}');
  201. $('#end_time').val('{$today[1]}');
  202. $('#today').trigger("click");
  203. $('#delivery_type').val('');
  204. form.render('select');
  205. var type = $(this).attr('data-type');
  206. getList(type);
  207. if (type !== ''){
  208. $('.withdrawal_status').hide();
  209. }else {
  210. $('.withdrawal_status').show();
  211. }
  212. });
  213. function getList(type) {
  214. table.render({
  215. elem: '#withdrawal-lists'
  216. , url: '{:url("finance.User/commission")}'
  217. , cols: [[
  218. {field: 'nickname', title: '会员昵称', align: 'center',width:210}
  219. , {field: 'user_sn', title: '会员编号', align: 'center',width:210}
  220. , {field: 'mobile', title: '手机号码', align: 'center',width:160}
  221. , {field: 'change_amount', title: '变动金额', align: 'center',width:160}
  222. , {field: 'left_amount', title: '剩余佣金', align: 'center',width:160}
  223. , {field: 'source_type', title: '明细类型', align: 'center',width:210}
  224. , {field: 'withdraw_sn', title: '来源单号', align: 'center',width:240}
  225. , {field: 'create_time', title: '记录时间', align: 'center',width:240}
  226. ]]
  227. , page: true
  228. , text: {none: '暂无数据!'}
  229. ,response: {
  230. statusCode: 1
  231. }
  232. , parseData: function (res) {
  233. return {
  234. "code": res.code,
  235. "msg": res.msg,
  236. "count": res.data.count,
  237. "data": res.data.lists,
  238. };
  239. }
  240. ,done: function(res, curr, count){
  241. // 解决操作栏因为内容过多换行问题
  242. $(".layui-table-main tr").each(function (index, val) {
  243. $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
  244. $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
  245. });
  246. }
  247. });
  248. }
  249. //监听工具条
  250. table.on('tool(withdrawal-lists)', function (obj) {
  251. var id = obj.data.id;
  252. if(obj.event === 'detail'){
  253. layer.open({
  254. type: 2
  255. ,title: '订单详情'
  256. ,content: '{:url("withdrawal.withdrawal/detail")}?id='+id
  257. ,area: ['90%', '90%']
  258. ,yes: function(index, layero){
  259. table.reload('withdrawal-lists');
  260. }
  261. })
  262. }
  263. });
  264. $('.day').click(function(){
  265. $('.day').removeClass('layui-btn-normal');
  266. $('.day').removeClass('layui-btn-primary');
  267. $('.day').addClass('layui-btn-primary');
  268. $(this).removeClass('layui-btn-primary');
  269. $(this).addClass('layui-btn-normal');
  270. var day = $(this).attr('day');
  271. switch (day) {
  272. case '-1':
  273. $('#start_time').val('{$yesterday[0]}');
  274. $('#end_time').val('{$yesterday[1]}');
  275. break;
  276. case '1':
  277. $('#start_time').val('{$today[0]}');
  278. $('#end_time').val('{$today[1]}');
  279. break;
  280. case '7':
  281. $('#start_time').val('{$days_ago7[0]}');
  282. $('#end_time').val('{$days_ago7[1]}');
  283. break;
  284. case '30':
  285. $('#start_time').val('{$days_ago30[0]}');
  286. $('#end_time').val('{$days_ago30[1]}');
  287. break;
  288. }
  289. });
  290. });
  291. </script>