money_log.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: 'trade/money_log/index' + location.search +'&user_id='+Config.user_id,
  8. table: 'money_log',
  9. }
  10. });
  11. var table = $("#table");
  12. // 初始化表格
  13. table.bootstrapTable({
  14. url: $.fn.bootstrapTable.defaults.extend.index_url,
  15. pk: 'id',
  16. sortName: 'id',
  17. searchFormVisible: false,
  18. columns: [
  19. [
  20. {checkbox: true},
  21. {field: 'id', title: __('Id'), operate: false},
  22. {field: 'users.mobile', title: __('User_id')},
  23. {field: 'fromuser.mobile', title: __('From_id')},
  24. {field: 'amount', title: __('Amount'), operate: false},
  25. {field: 'balance', title: __('Balance'), operate: false},
  26. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  27. {field: 'action', title: __("Action"),
  28. searchList: {1:__('充值'), 2:__('提现'), 3:__('交易'), 4:__('交易'), 5:__('佣金'), 6:__('奖励'), 7:__('系统调整')},
  29. formatter: Table.api.formatter.status
  30. },
  31. //{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  32. ]
  33. ]
  34. });
  35. // 为表格绑定事件
  36. Table.api.bindevent(table);
  37. },
  38. add: function () {
  39. Controller.api.bindevent();
  40. },
  41. edit: function () {
  42. Controller.api.bindevent();
  43. },
  44. api: {
  45. bindevent: function () {
  46. Form.api.bindevent($("form[role=form]"));
  47. }
  48. }
  49. };
  50. return Controller;
  51. });