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

71 lines
3.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: 'order_item/index' + location.search,
  8. add_url: 'order_item/add',
  9. edit_url: 'order_item/edit',
  10. del_url: 'order_item/del',
  11. multi_url: 'order_item/multi',
  12. import_url: 'order_item/import',
  13. table: 'order_item',
  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: 'item_id', title: __('Item_id')},
  28. {field: 'item_type', title: __('Item_type')},
  29. {field: 'item_name', title: __('Item_name'), operate: 'LIKE'},
  30. {field: 'item_memo', title: __('Item_memo'), operate: 'LIKE'},
  31. {field: 'item_unit', title: __('Item_unit'), operate: 'LIKE'},
  32. {field: 'use_date', title: __('Use_date'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  33. {field: 'prod_num', title: __('Prod_num')},
  34. {field: 'total_price', title: __('Total_price'), operate: 'LIKE'},
  35. {field: 'total_cost', title: __('Total_cost'), operate:'BETWEEN'},
  36. {field: 'profit', title: __('Profit'), operate:'BETWEEN'},
  37. {field: 'log', title: __('Log'), operate: 'LIKE'},
  38. {field: 'country_name', title: __('Country_name'), operate: 'LIKE'},
  39. {field: 'province_name', title: __('Province_name'), operate: 'LIKE'},
  40. {field: 'city_name', title: __('City_name'), operate: 'LIKE'},
  41. {field: 'detail_address', title: __('Detail_address'), operate: 'LIKE'},
  42. {field: 'del_flag', title: __('Del_flag'), formatter: Table.api.formatter.flag},
  43. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  44. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  45. {field: 'confirm_status', title: __('Confirm_status')},
  46. {field: 'confirm_no', title: __('Confirm_no'), operate: 'LIKE'},
  47. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  48. ]
  49. ]
  50. });
  51. // 为表格绑定事件
  52. Table.api.bindevent(table);
  53. },
  54. add: function () {
  55. Controller.api.bindevent();
  56. },
  57. edit: function () {
  58. Controller.api.bindevent();
  59. },
  60. api: {
  61. bindevent: function () {
  62. Form.api.bindevent($("form[role=form]"));
  63. }
  64. }
  65. };
  66. return Controller;
  67. });