usertakecash.js 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: 'usertakecash/index' + location.search,
  8. add_url: 'usertakecash/add',
  9. // edit_url: 'usertakecash/edit',
  10. // del_url: 'usertakecash/del',
  11. multi_url: 'usertakecash/multi',
  12. import_url: 'usertakecash/import',
  13. table: 'user_take_cash',
  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: 'money', title: __('Money'), operate:'BETWEEN'},
  31. {field: 'real_money', title: __('Real_money'), operate:'BETWEEN'},
  32. {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE'},
  33. {field: 'bank_branchname', title: __('Bank_branchname'), operate: 'LIKE'},
  34. {field: 'bank_account', title: __('Bank_account'), operate: 'LIKE'},
  35. {field: 'bank_card', title: __('Bank_card'), operate: 'LIKE'},
  36. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
  37. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  38. {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  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'),
  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:'usertakecash/audit/id/{ids}?dialog=1',
  50. target:'_self',
  51. hidden:function(row){
  52. return row.status==0 ? false : true;
  53. }
  54. }
  55. ],
  56. table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  57. ]
  58. ]
  59. });
  60. // 为表格绑定事件
  61. Table.api.bindevent(table);
  62. },
  63. add: function () {
  64. Controller.api.bindevent();
  65. },
  66. edit: function () {
  67. Controller.api.bindevent();
  68. },
  69. audit: function () {
  70. Controller.api.bindevent();
  71. },
  72. api: {
  73. bindevent: function () {
  74. Form.api.bindevent($("form[role=form]"));
  75. }
  76. }
  77. };
  78. return Controller;
  79. });