withdraw.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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: 'withdraw/index' + location.search,
  8. add_url: 'withdraw/add',
  9. // edit_url: 'withdraw/edit',
  10. // del_url: 'withdraw/del',
  11. multi_url: 'withdraw/multi',
  12. import_url: 'withdraw/import',
  13. table: 'withdraw',
  14. }
  15. });
  16. var table = $("#table");
  17. // 初始化表格
  18. table.bootstrapTable({
  19. url: $.fn.bootstrapTable.defaults.extend.index_url,
  20. pk: 'id',
  21. sortName: 'id',
  22. columns: [
  23. [
  24. {checkbox: true},
  25. {field: 'id', title: __('Id')},
  26. // {field: 'user_id', title: __('User_id')},
  27. {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
  28. {field: 'agentjewel', title: __('Agentjewel'), operate:'BETWEEN'},
  29. {field: 'huilv', title: __('Huilv')},
  30. {field: 'money', title: __('Money'), operate:'BETWEEN'},
  31. {field: 'plat_bilv', title: __('Plat_bilv'), operate:'BETWEEN'},
  32. {field: 'plat_money', title: __('Plat_money'), operate:'BETWEEN'},
  33. {field: 'get_money', title: __('Get_money'), operate:'BETWEEN'},
  34. {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
  35. {field: 'account_info', title: '账号', operate:false},
  36. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  37. // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  38. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
  39. {field: 'audittime', title: __('Audittime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  40. {field: 'auditremark', title: __('Auditremark'), operate: 'LIKE'},
  41. {field: 'operate', title: __('Operate'), table: table,
  42. buttons:[
  43. {
  44. name:'audit',
  45. text:'审核',
  46. title:'审核',
  47. icon:'fa fa-exclamation-circle',
  48. classname:'btn btn-xs btn-info btn-dialog',
  49. url:'withdraw/audit/id/{ids}?dialog=1',
  50. target:'_self',
  51. refresh:true,
  52. hidden:function(row){
  53. return row.status==0 ? false : true;
  54. }
  55. }
  56. ],
  57. events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  58. ]
  59. ]
  60. });
  61. // 为表格绑定事件
  62. Table.api.bindevent(table);
  63. },
  64. add: function () {
  65. Controller.api.bindevent();
  66. },
  67. edit: function () {
  68. Controller.api.bindevent();
  69. },
  70. audit: function () {
  71. Controller.api.bindevent();
  72. },
  73. api: {
  74. bindevent: function () {
  75. Form.api.bindevent($("form[role=form]"));
  76. }
  77. }
  78. };
  79. return Controller;
  80. });