酒店预订平台
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.
 
 
 
 
 
 

64 lines
2.9 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: 'cf_room_plan/index' + location.search,
  8. add_url: 'cf_room_plan/add',
  9. edit_url: 'cf_room_plan/edit',
  10. del_url: 'cf_room_plan/del',
  11. multi_url: 'cf_room_plan/multi',
  12. import_url: 'cf_room_plan/import',
  13. table: 'cf_room_plan',
  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: 'hotel_id', title: __('Hotel_id')},
  27. {field: 'room_id', title: __('Room_id')},
  28. {field: 'plan_name', title: __('Plan_name'), operate: 'LIKE'},
  29. {field: 'breakfast_num', title: __('Breakfast_num')},
  30. {field: 'book_end_day', title: __('Book_end_day')},
  31. {field: 'book_end_hour', title: __('Book_end_hour')},
  32. {field: 'continuity_type', title: __('Continuity_type')},
  33. {field: 'coutinuity_day', title: __('Coutinuity_day')},
  34. {field: 'plan_memo', title: __('Plan_memo'), operate: 'LIKE'},
  35. {field: 'plan_log', title: __('Plan_log'), operate: 'LIKE'},
  36. {field: 'charge_person', title: __('Charge_person'), operate: 'LIKE'},
  37. {field: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag},
  38. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  39. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  40. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  41. ]
  42. ]
  43. });
  44. // 为表格绑定事件
  45. Table.api.bindevent(table);
  46. },
  47. add: function () {
  48. Controller.api.bindevent();
  49. },
  50. edit: function () {
  51. Controller.api.bindevent();
  52. },
  53. api: {
  54. bindevent: function () {
  55. Form.api.bindevent($("form[role=form]"));
  56. }
  57. }
  58. };
  59. return Controller;
  60. });