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

65 lines
3.1 KiB

  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. $(".btn-add").data("area",["100%","100%"]);
  5. $(".btn-edit").data("area",["100%","100%"]);
  6. // 初始化表格参数配置
  7. Table.api.init({
  8. extend: {
  9. index_url: 'order_main/index' + location.search,
  10. add_url: 'order_main/add',
  11. edit_url: 'order_main/edit',
  12. del_url: 'order_main/del',
  13. multi_url: 'order_main/multi',
  14. import_url: 'order_main/import',
  15. table: 'order_main',
  16. }
  17. });
  18. var table = $("#table");
  19. table.on('post-body.bs.table',function(){
  20. $(".btn-editone").data("area",["100%","100%"]);
  21. });
  22. // 初始化表格
  23. table.bootstrapTable({
  24. url: $.fn.bootstrapTable.defaults.extend.index_url,
  25. pk: 'id',
  26. sortName: 'id',
  27. columns: [
  28. [
  29. {field: 'id', title: __('Id')},
  30. {field: 'commissioner', title: __('Commissioner'), operate: 'LIKE'},
  31. {field: 'channel_name', title: __('下单渠道'), operate: 'LIKE'},
  32. {field: 'channel_order_no', title: __('Channel_order_no'), operate: 'LIKE'},
  33. {field: 'nickname', title: __('下单用户'), operate: 'LIKE'},
  34. {field: 'user_phone', title: __('User_phone'), operate: 'LIKE'},
  35. {field: 'total_amount', title: __('Total_amount'), operate:'BETWEEN'},
  36. {field: 'cost_amount', title: __('Cost_amount'), operate:'BETWEEN'},
  37. {field: 'profit_amount', title: __('Profit_amount'), operate:'BETWEEN'},
  38. {field: 'order_status', title: __('订单状态')},
  39. {field: 'order_memo', title: __('Order_memo'), operate: 'LIKE'},
  40. {field: 'success_time', title: __('Success_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  41. {field: 'create_time', title: __('下单时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  42. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate},
  43. ]
  44. ]
  45. });
  46. // 为表格绑定事件
  47. Table.api.bindevent(table);
  48. },
  49. add: function () {
  50. Controller.api.bindevent();
  51. },
  52. edit: function () {
  53. Controller.api.bindevent();
  54. },
  55. api: {
  56. bindevent: function () {
  57. Form.api.bindevent($("form[role=form]"));
  58. }
  59. }
  60. };
  61. return Controller;
  62. });