酒店预订平台
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.8 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_main/index' + location.search,
  8. add_url: 'order_main/add',
  9. edit_url: 'order_main/edit',
  10. del_url: 'order_main/del',
  11. multi_url: 'order_main/multi',
  12. import_url: 'order_main/import',
  13. table: 'order_main',
  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: 'commissioner', title: __('Commissioner'), operate: 'LIKE'},
  26. {field: 'channel_name', title: __('下单渠道'), operate: 'LIKE'},
  27. {field: 'channel_order_no', title: __('Channel_order_no'), operate: 'LIKE'},
  28. {field: 'nickname', title: __('下单用户'), operate: 'LIKE'},
  29. {field: 'user_phone', title: __('User_phone'), operate: 'LIKE'},
  30. {field: 'total_amount', title: __('Total_amount'), operate:'BETWEEN'},
  31. {field: 'cost_amount', title: __('Cost_amount'), operate:'BETWEEN'},
  32. {field: 'profit_amount', title: __('Profit_amount'), operate:'BETWEEN'},
  33. {field: 'order_status', title: __('订单状态')},
  34. {field: 'order_memo', title: __('Order_memo'), operate: 'LIKE'},
  35. {field: 'success_time', title: __('Success_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  36. {field: 'create_time', title: __('下单时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  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. });