userwithdraw.js 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: 'userwithdraw/index' + location.search,
  8. add_url: 'userwithdraw/add',
  9. // edit_url: 'userwithdraw/edit',
  10. // del_url: 'userwithdraw/del',
  11. multi_url: 'userwithdraw/multi',
  12. import_url: 'userwithdraw/import',
  13. table: 'user_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. fixedColumns: true,
  23. fixedRightNumber: 1,
  24. columns: [
  25. [
  26. // {checkbox: true},
  27. {field: 'id', title: __('Id')},
  28. {field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
  29. {field: 'user_id', title: __('User_id')},
  30. {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
  31. {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
  32. {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
  33. {field: 'score', title: __('Score')},
  34. {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2'),"3":__('Type 3')}, formatter: Table.api.formatter.normal},
  35. {field: 'realname', title: __('Realname'), operate: 'LIKE'},
  36. {field: 'banknumber', title: __('Banknumber'), operate: 'LIKE'},
  37. {field: 'bankname', title: __('Bankname'), operate: 'LIKE'},
  38. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  39. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
  40. {field: 'from', title: __('from'), searchList: {"1":__('from 1'),"2":__('from 2')}, formatter: Table.api.formatter.status},
  41. {field: 'audittime', title: __('Audittime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  42. {field: 'auditremark', title: __('Auditremark'), operate: 'LIKE'},
  43. {field: 'operate', title: __('Operate'),
  44. buttons:[
  45. {
  46. name:'audit',
  47. text:'审核',
  48. title:'审核',
  49. icon:'fa fa-exclamation-circle',
  50. classname:'btn btn-xs btn-info btn-dialog',
  51. url:'userwithdraw/audit/id/{ids}?dialog=1',
  52. target:'_self',
  53. hidden:function(row){
  54. return row.status==0 ? false : true;
  55. }
  56. }
  57. ],
  58. table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  59. ]
  60. ]
  61. });
  62. // 为表格绑定事件
  63. Table.api.bindevent(table);
  64. },
  65. add: function () {
  66. Controller.api.bindevent();
  67. },
  68. edit: function () {
  69. Controller.api.bindevent();
  70. },
  71. audit: function () {
  72. Controller.api.bindevent();
  73. },
  74. api: {
  75. bindevent: function () {
  76. Form.api.bindevent($("form[role=form]"));
  77. }
  78. }
  79. };
  80. return Controller;
  81. });