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

55 lines
2.3 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: 'receipt_order/index' + location.search,
  8. add_url: 'receipt_order/add',
  9. edit_url: 'receipt_order/edit',
  10. del_url: 'receipt_order/del',
  11. multi_url: 'receipt_order/multi',
  12. import_url: 'receipt_order/import',
  13. table: 'receipt_order',
  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: 'nickname', title: __('创建人')},
  25. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  26. {field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  27. {field: 'name', title: __('Name'), operate: 'LIKE'},
  28. {field: 'status', title: __('收款状态')},
  29. {field: 'order_ids', title: __('关联的订单id'), operate: 'LIKE'},
  30. {field: 'money', title: __('Money'), operate:'BETWEEN'},
  31. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  32. ]
  33. ]
  34. });
  35. // 为表格绑定事件
  36. Table.api.bindevent(table);
  37. },
  38. add: function () {
  39. Controller.api.bindevent();
  40. },
  41. edit: function () {
  42. Controller.api.bindevent();
  43. },
  44. api: {
  45. bindevent: function () {
  46. Form.api.bindevent($("form[role=form]"));
  47. }
  48. }
  49. };
  50. return Controller;
  51. });