ledger_teac_ecoly_change.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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: 'ledger/ledger_teac_ecoly_change/index' + location.search,
  8. multi_url: 'ledger/ledger_teac_ecoly_change/multi',
  9. import_url: 'ledger/ledger_teac_ecoly_change/import',
  10. table: 'ledger_teac_ecoly_change',
  11. }
  12. });
  13. var table = $("#table");
  14. // 初始化表格
  15. table.bootstrapTable({
  16. url: $.fn.bootstrapTable.defaults.extend.index_url,
  17. pk: 'id',
  18. sortName: 'id',
  19. columns: [
  20. [
  21. {checkbox: true},
  22. {field: 'id', title: '编号'},
  23. {field: 'user_id', title: '用户ID'},
  24. {field: 'address', title: '用户地址'},
  25. {
  26. field: 'action', title: '账变类型', searchList: {
  27. '0': 'TeaC·生态发展划转',
  28. '1': '',
  29. }, operate: 'FIND_IN_SET', formatter: Table.api.formatter.label
  30. },
  31. {field: 'change_amount', title: '变动金额', operate:'BETWEEN'},
  32. {field: 'present_amount', title: '实时余额', operate:'BETWEEN'},
  33. {field: 'from_id', title: '来源ID'},
  34. {field: 'create_time', title: '变动时间', operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  35. ]
  36. ]
  37. });
  38. // 为表格绑定事件
  39. Table.api.bindevent(table);
  40. },
  41. add: function () {
  42. Controller.api.bindevent();
  43. },
  44. edit: function () {
  45. Controller.api.bindevent();
  46. },
  47. api: {
  48. bindevent: function () {
  49. Form.api.bindevent($("form[role=form]"));
  50. }
  51. }
  52. };
  53. return Controller;
  54. });