截流自动化的商城平台
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.

account.html 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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="type" id="type">
  66. <option value="">全部</option>
  67. <option value="admin_add_money">系统增加余额</option>
  68. <option value="admin_reduce_money">系统扣减余额</option>
  69. <option value="recharge_money">用户充值余额</option>
  70. <option value="balance_pay_order">下单扣减余额</option>
  71. <option value="cancel_order_refund">取消订单退回余额</option>
  72. <option value="after_sale_refund">售后退回余额</option>
  73. <option value="withdraw_to_balance">佣金提现</option>
  74. <option value="user_transfer_inc_balance">会员转账(收入方)</option>
  75. <option value="user_transfer_dec_balance">会员转账(支出方)</option>
  76. <option value="integral_order_inc_balance">积分商城订单</option>
  77. <option value="integral_order_dec_balance">余额支付积分订单</option>
  78. </select>
  79. </div>
  80. </div>
  81. <div class="layui-inline">
  82. <label class="layui-form-label">记录时间:</label>
  83. <div class="layui-input-inline">
  84. <div class="layui-input-inline">
  85. <input type="text" name="start_time" class="layui-input" id="start_time"
  86. placeholder="" autocomplete="off">
  87. </div>
  88. </div>
  89. <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
  90. <label class="layui-form-mid">至</label>
  91. </div>
  92. <div class="layui-input-inline">
  93. <input type="text" name="end_time" class="layui-input" id="end_time"
  94. placeholder="" autocomplete="off">
  95. </div>
  96. </div>
  97. <div class="layui-inline">
  98. <div class="layui-btn-group">
  99. <button type="button" id="today" day="1" class="layui-btn layui-btn-sm layui-btn-normal day">今天</button>
  100. <button type="button" day="-1" class="layui-btn layui-btn-sm layui-btn-primary day">昨天</button>
  101. <button type="button" day="7" class="layui-btn layui-btn-sm layui-btn-primary day">近7天</button>
  102. <button type="button" day="30" class="layui-btn layui-btn-sm layui-btn-primary day">近30天</button>
  103. </div>
  104. </div>
  105. <div class="layui-inline">
  106. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad {$view_theme_color}" lay-submit
  107. lay-filter="withdrawal-search">查询
  108. </button>
  109. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
  110. lay-filter="withdrawal-clear-search">重置
  111. </button>
  112. <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
  113. lay-filter="data-export">导出
  114. </button>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="layui-tab-item layui-show">
  120. <div class="layui-card">
  121. <div class="layui-card-body">
  122. <table id="withdrawal-lists" lay-filter="withdrawal-lists"></table>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <script>
  130. layui.config({
  131. version:"{$front_version}",
  132. base: '/static/lib/' //静态资源所在路径
  133. }).use(['form'], function(){
  134. var $ = layui.$
  135. , form = layui.form
  136. , table = layui.table
  137. , element = layui.element
  138. , laydate = layui.laydate;
  139. //图片放大
  140. $(document).on('click', '.image-show', function () {
  141. var src = $(this).attr('src');
  142. like.showImg(src,600);
  143. });
  144. //监听搜索
  145. form.on('submit(withdrawal-search)', function (data) {
  146. var field = data.field;
  147. //执行重载
  148. table.reload('withdrawal-lists', {
  149. where: field,
  150. page: {
  151. curr: 1
  152. }
  153. });
  154. });
  155. //清空查询
  156. form.on('submit(withdrawal-clear-search)', function () {
  157. $('#goods_name').val('');
  158. $('#type').val('');
  159. $('#keyword').val('');
  160. $('#start_time').val('{$today[0]}');
  161. $('#end_time').val('{$today[1]}');
  162. $('#today').trigger("click");
  163. form.render('select');
  164. //刷新列表
  165. table.reload('withdrawal-lists', {
  166. where: [],
  167. page: {
  168. curr: 1
  169. }
  170. });
  171. });
  172. // 导出
  173. form.on('submit(data-export)', function (data) {
  174. var field = data.field;
  175. like.ajax({
  176. url: '{:url("finance.User/accountExport")}'
  177. , data: field
  178. , type: 'get'
  179. , success: function (res) {
  180. if (res.code == 1) {
  181. window.location.href = res.data.url;
  182. }
  183. }
  184. });
  185. });
  186. //日期时间范围
  187. laydate.render({
  188. elem: '#start_time'
  189. , type: 'datetime'
  190. ,theme: '#1E9FFF'
  191. , value: "{$today[0]}"
  192. });
  193. laydate.render({
  194. elem: '#end_time'
  195. , type: 'datetime'
  196. ,theme: '#1E9FFF'
  197. ,value: "{$today[1]}"
  198. });
  199. //获取列表
  200. getList('');
  201. //切换列表
  202. element.on('tab(tab-all)', function (data) {
  203. $('#keyword').val('');
  204. $('#withdrawal_status').val('');
  205. $('#type').val('');
  206. $('#keyword').val('');
  207. $('#goods_name').val('');
  208. $('#pay_way').val('');
  209. $('#withdrawal_type').val('');
  210. $('#start_time').val('{$today[0]}');
  211. $('#end_time').val('{$today[1]}');
  212. $('#today').trigger("click");
  213. $('#delivery_type').val('');
  214. form.render('select');
  215. var type = $(this).attr('data-type');
  216. getList(type);
  217. if (type !== ''){
  218. $('.withdrawal_status').hide();
  219. }else {
  220. $('.withdrawal_status').show();
  221. }
  222. });
  223. function getList(type) {
  224. table.render({
  225. elem: '#withdrawal-lists'
  226. , url: '{:url("finance.User/account")}'
  227. , cols: [[
  228. {field: 'nickname', title: '会员昵称', align: 'center',width:240}
  229. , {field: 'user_sn', title: '会员编号', align: 'center',width:210}
  230. , {field: 'mobile', title: '手机号码', align: 'center',width:180}
  231. , {field: 'change_amount', title: '变动金额', align: 'center',width:180}
  232. , {field: 'left_amount', title: '剩余金额', align: 'center',width:180}
  233. , {field: 'source_type', title: '明细类型', align: 'center',width:210}
  234. , {field: 'source_sn', title: '来源单号', align: 'center',width:210}
  235. , {field: 'create_time', title: '记录时间', align: 'center',width:205}
  236. ]]
  237. , page: true
  238. , text: {none: '暂无数据!'}
  239. ,response: {
  240. statusCode: 1
  241. }
  242. , parseData: function (res) {
  243. return {
  244. "code": res.code,
  245. "msg": res.msg,
  246. "count": res.data.count,
  247. "data": res.data.lists,
  248. };
  249. }
  250. ,done: function(res, curr, count){
  251. // 解决操作栏因为内容过多换行问题
  252. $(".layui-table-main tr").each(function (index, val) {
  253. $($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
  254. $($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
  255. });
  256. }
  257. });
  258. }
  259. //监听工具条
  260. table.on('tool(withdrawal-lists)', function (obj) {
  261. var id = obj.data.id;
  262. if(obj.event === 'detail'){
  263. layer.open({
  264. type: 2
  265. ,title: '订单详情'
  266. ,content: '{:url("withdrawal.withdrawal/detail")}?id='+id
  267. ,area: ['90%', '90%']
  268. ,yes: function(index, layero){
  269. table.reload('withdrawal-lists');
  270. }
  271. })
  272. }
  273. //删除订单
  274. if(obj.event === 'del'){
  275. layer.confirm('删除后订单将消失,确认删除订单吗?', {
  276. btn: ['确认','取消'] //按钮
  277. }, function(){
  278. like.ajax({
  279. url: '{:url("withdrawal.withdrawal/del")}'
  280. , data: {'withdrawal_id': id}
  281. , type: 'post'
  282. , success: function (res) {
  283. if (res.code == 1) {
  284. layui.layer.msg(res.msg, {
  285. offset: '15px'
  286. , icon: 1
  287. , time: 1100
  288. },function () {
  289. table.reload('withdrawal-lists');
  290. });
  291. }
  292. },
  293. });
  294. });
  295. }
  296. //取消订单
  297. if(obj.event === 'cancel'){
  298. layer.confirm('确认取消订单吗?', {
  299. btn: ['确认','取消'] //按钮
  300. }, function(){
  301. like.ajax({
  302. url: '{:url("withdrawal.withdrawal/cancel")}'
  303. , data: {'withdrawal_id': id}
  304. , type: 'post'
  305. , success: function (res) {
  306. if (res.code == 1) {
  307. layui.layer.msg(res.msg, {
  308. offset: '15px'
  309. , icon: 1
  310. , time: 1100
  311. },function () {
  312. table.reload('withdrawal-lists');
  313. });
  314. }
  315. },
  316. });
  317. });
  318. }
  319. //发货
  320. if(obj.event === 'delivery'){
  321. layer.open({
  322. type: 2
  323. ,title: '订单发货'
  324. ,content: '{:url("withdrawal.withdrawal/delivery")}?id='+id
  325. ,area: ['90%', '90%']
  326. ,yes: function(index, layero){
  327. }
  328. })
  329. }
  330. //物流信息
  331. if(obj.event === 'express'){
  332. layer.open({
  333. type: 2
  334. ,title: '订单发货'
  335. ,content: '{:url("withdrawal.withdrawal/express")}?id='+id
  336. ,area: ['90%', '90%']
  337. ,yes: function(index, layero){
  338. }
  339. })
  340. }
  341. //确认收货
  342. if(obj.event === 'confirm'){
  343. layer.confirm('确认订单商家已收货吗?', {
  344. btn: ['确认','取消'] //按钮
  345. }, function(){
  346. like.ajax({
  347. url: '{:url("withdrawal.withdrawal/confirm")}'
  348. , data: {'withdrawal_id': id}
  349. , type: 'post'
  350. , success: function (res) {
  351. if (res.code == 1) {
  352. layui.layer.msg(res.msg, {
  353. offset: '15px'
  354. , icon: 1
  355. , time: 1100
  356. },function () {
  357. table.reload('withdrawal-lists');
  358. });
  359. }
  360. },
  361. });
  362. });
  363. }
  364. //商家备注
  365. if(obj.event === 'remarks') {
  366. like.ajax({
  367. url: '{:url("withdrawal.withdrawal/remarks")}'
  368. , data: {'id': id}
  369. , type: 'get'
  370. , success: function (res) {
  371. if (res.code === 1) {
  372. layer.prompt({title: '备注信息', formType: 2, value: res.data.withdrawal_remarks}, function(value, index){
  373. layer.close(index);
  374. like.ajax({
  375. url: '{:url("withdrawal.withdrawal/remarks")}'
  376. , data: {'id': id, "withdrawal_remarks": value }
  377. , type: 'post'
  378. , success: function (res) {
  379. if (res.code === 1) {
  380. layui.layer.msg(res.msg, {
  381. offset: '15px'
  382. , icon: 1
  383. , time: 1100
  384. });
  385. }
  386. }
  387. });
  388. });
  389. }
  390. }
  391. });
  392. }
  393. if(obj.event ==='print'){
  394. layer.confirm('确定要打印订单吗?', function(index){
  395. like.ajax({
  396. url:'{:url("withdrawal.withdrawal/withdrawalPrint")}',
  397. data:{id:id},
  398. type:"post",
  399. success:function(res)
  400. {
  401. if(res.code == 1)
  402. {
  403. layui.layer.msg(res.msg, {
  404. offset: '15px'
  405. , icon: 1
  406. , time: 1100
  407. });
  408. layer.close(index); //关闭弹层
  409. table.reload('printer-lists'); //数据刷新
  410. }
  411. }
  412. });
  413. layer.close(index);
  414. })
  415. }
  416. });
  417. $('.day').click(function(){
  418. $('.day').removeClass('layui-btn-normal');
  419. $('.day').removeClass('layui-btn-primary');
  420. $('.day').addClass('layui-btn-primary');
  421. $(this).removeClass('layui-btn-primary');
  422. $(this).addClass('layui-btn-normal');
  423. var day = $(this).attr('day');
  424. switch (day) {
  425. case '-1':
  426. $('#start_time').val('{$yesterday[0]}');
  427. $('#end_time').val('{$yesterday[1]}');
  428. break;
  429. case '1':
  430. $('#start_time').val('{$today[0]}');
  431. $('#end_time').val('{$today[1]}');
  432. break;
  433. case '7':
  434. $('#start_time').val('{$days_ago7[0]}');
  435. $('#end_time').val('{$days_ago7[1]}');
  436. break;
  437. case '30':
  438. $('#start_time').val('{$days_ago30[0]}');
  439. $('#end_time').val('{$days_ago30[1]}');
  440. break;
  441. }
  442. });
  443. });
  444. </script>