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

76 lines
4.1 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: 'order_hotel/index' + location.search,
  8. add_url: 'order_hotel/add',
  9. edit_url: 'order_hotel/edit',
  10. del_url: 'order_hotel/del',
  11. multi_url: 'order_hotel/multi',
  12. import_url: 'order_hotel/import',
  13. table: 'order_hotel',
  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: 'order_id', title: __('Order_id')},
  27. {field: 'hotel_id', title: __('Hotel_id')},
  28. {field: 'hotel_name', title: __('Hotel_name'), operate: 'LIKE'},
  29. {field: 'hotel_phone', title: __('Hotel_phone'), operate: 'LIKE'},
  30. {field: 'country_name', title: __('Country_name'), operate: 'LIKE'},
  31. {field: 'province_name', title: __('Province_name'), operate: 'LIKE'},
  32. {field: 'city_name', title: __('City_name'), operate: 'LIKE'},
  33. {field: 'detail_address', title: __('Detail_address'), operate: 'LIKE'},
  34. {field: 'room_id', title: __('Room_id')},
  35. {field: 'room_name', title: __('Room_name'), operate: 'LIKE'},
  36. {field: 'room_memo', title: __('Room_memo'), operate: 'LIKE'},
  37. {field: 'plan_id', title: __('Plan_id')},
  38. {field: 'plan_name', title: __('Plan_name'), operate: 'LIKE'},
  39. {field: 'plan_memo', title: __('Plan_memo'), operate: 'LIKE'},
  40. {field: 'check_in_date', title: __('Check_in_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  41. {field: 'check_out_date', title: __('Check_out_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  42. {field: 'prod_num', title: __('Prod_num')},
  43. {field: 'total_price', title: __('Total_price'), operate:'BETWEEN'},
  44. {field: 'total_cost', title: __('Total_cost'), operate:'BETWEEN'},
  45. {field: 'profit', title: __('Profit'), operate:'BETWEEN'},
  46. {field: 'log', title: __('Log'), operate: 'LIKE'},
  47. {field: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag},
  48. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  49. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  50. {field: 'confirm_status', title: __('Confirm_status')},
  51. {field: 'confirm_no', title: __('Confirm_no'), operate: 'LIKE'},
  52. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  53. ]
  54. ]
  55. });
  56. // 为表格绑定事件
  57. Table.api.bindevent(table);
  58. },
  59. add: function () {
  60. Controller.api.bindevent();
  61. },
  62. edit: function () {
  63. Controller.api.bindevent();
  64. },
  65. api: {
  66. bindevent: function () {
  67. Form.api.bindevent($("form[role=form]"));
  68. }
  69. }
  70. };
  71. return Controller;
  72. });