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

order_main.js 4.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. table.on('post-common-search.bs.table', function (event, table) {
  23. var form = $("form", table.$commonsearch);
  24. $("input[name='channel_name']", form).addClass("selectpage").data("source", "cf_channel_info/index").data("primaryKey", "channel_name").data("field", "channel_name").data("orderBy", "id desc");
  25. $("input[name='commissioner']", form).addClass("selectpage").data("source", "auth/admin/index").data("primaryKey", "nickname").data("field", "nickname").data("orderBy", "id desc");
  26. $("input[name='hbp_admin.nickname']", form).addClass("selectpage").data("source", "auth/admin/index").data("primaryKey", "nickname").data("field", "nickname").data("orderBy", "id desc");
  27. Form.events.cxselect(form);
  28. Form.events.selectpage(form);
  29. });
  30. // 初始化表格
  31. table.bootstrapTable({
  32. url: $.fn.bootstrapTable.defaults.extend.index_url,
  33. pk: 'id',
  34. sortName: 'id',
  35. columns: [
  36. [
  37. {field: 'id', title: __('Id'),operate:"false"},
  38. {field: 'commissioner', title: __('Commissioner'),formatter: Table.api.formatter.search},
  39. {field: 'channel_name', title: __('下单渠道'), operate: 'LIKE'},
  40. {field: 'channel_order_no', title: __('Channel_order_no'), operate: 'LIKE'},
  41. {field: 'hbp_admin.nickname', title: __('订单提交人'), operate: 'LIKE'},
  42. {field: 'user_name', title: __('订单联系人'), operate: 'LIKE'},
  43. {field: 'user_phone', title: __('User_phone'), operate: 'LIKE'},
  44. {field: 'total_amount', title: __('Total_amount'), operate:'BETWEEN'},
  45. {field: 'cost_amount', title: __('Cost_amount'), operate:'BETWEEN'},
  46. {field: 'profit_amount', title: __('Profit_amount'), operate:'BETWEEN'},
  47. {field: 'order_status', title: __('订单状态')},
  48. {field: 'order_memo', title: __('Order_memo'), operate: 'LIKE'},
  49. {field: 'success_time', title: __('Success_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  50. {field: 'create_time', title: __('下单时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  51. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate},
  52. ]
  53. ]
  54. });
  55. // 为表格绑定事件
  56. Table.api.bindevent(table);
  57. },
  58. add: function () {
  59. Controller.api.bindevent();
  60. },
  61. edit: function () {
  62. Controller.api.bindevent();
  63. },
  64. api: {
  65. bindevent: function () {
  66. Form.api.bindevent($("form[role=form]"));
  67. }
  68. }
  69. };
  70. return Controller;
  71. });