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