酒店预订平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

61 lines
2.7 KiB

  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: 'advance_charge/index' + location.search,
  8. add_url: 'advance_charge/add',
  9. edit_url: 'advance_charge/edit',
  10. del_url: 'advance_charge/del',
  11. multi_url: 'advance_charge/multi',
  12. import_url: 'advance_charge/import',
  13. table: 'advance_charge',
  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: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag},
  27. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  28. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  29. {field: 'create_id', title: __('Create_id')},
  30. {field: 'group_id', title: __('Group_id')},
  31. {field: 'supplier_id', title: __('Supplier_id')},
  32. {field: 'balance', title: __('Balance'), operate:'BETWEEN'},
  33. {field: 'payment_ids', title: __('Payment_ids'), operate: 'LIKE'},
  34. {field: 'memo', title: __('Memo'), operate: 'LIKE'},
  35. {field: 'file', title: __('File'), operate: false},
  36. {field: 'money', title: __('Money'), operate:'BETWEEN'},
  37. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  38. ]
  39. ]
  40. });
  41. // 为表格绑定事件
  42. Table.api.bindevent(table);
  43. },
  44. add: function () {
  45. Controller.api.bindevent();
  46. },
  47. edit: function () {
  48. Controller.api.bindevent();
  49. },
  50. api: {
  51. bindevent: function () {
  52. Form.api.bindevent($("form[role=form]"));
  53. }
  54. }
  55. };
  56. return Controller;
  57. });