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

60 lines
2.6 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. {field: 'id', title: __('Id')},
  25. {field: 'hotel_name', title: __('酒店')},
  26. {field: 'room_name', title: __('房型')},
  27. {field: 'plan_name', title: __('Plan_name'), operate: 'LIKE'},
  28. {field: 'breakfast_num', title: __('Breakfast_num')},
  29. {field: 'book_end_day', title: __('Book_end_day')},
  30. {field: 'book_end_hour', title: __('Book_end_hour')},
  31. {field: 'continuity_type', title: __('Continuity_type')},
  32. {field: 'coutinuity_day', title: __('Coutinuity_day')},
  33. {field: 'purchase_user_name', title: __('Charge_person'), operate: 'LIKE'},
  34. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  35. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  36. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  37. ]
  38. ]
  39. });
  40. // 为表格绑定事件
  41. Table.api.bindevent(table);
  42. },
  43. add: function () {
  44. Controller.api.bindevent();
  45. },
  46. edit: function () {
  47. Controller.api.bindevent();
  48. },
  49. api: {
  50. bindevent: function () {
  51. Form.api.bindevent($("form[role=form]"));
  52. }
  53. }
  54. };
  55. return Controller;
  56. });