meetingorder.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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: 'meetingorder/index' + location.search,
  8. add_url: 'meetingorder/add',
  9. // edit_url: 'meetingorder/edit',
  10. del_url: 'meetingorder/del',
  11. multi_url: 'meetingorder/multi',
  12. import_url: 'meetingorder/import',
  13. table: 'meeting_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. showExport:false,
  23. columns: [
  24. [
  25. {checkbox: true},
  26. {field:'id', title: __('序号'),formatter: function(value, row, index){
  27. return ++index;
  28. }, operate: false},
  29. {field: 'number', title: __('Number')},
  30. {field: 'make_day', title: __('Make_day'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  31. {field: 'make_time', title: __('Make_time')},
  32. {field: 'money', title: __('Money')},
  33. {field: 'long_time', title: __('Long_time')},
  34. {field: 'notice', title: __('Notice')},
  35. {field: 'mian_time', title: __('Mian_time')},
  36. {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
  37. {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
  38. {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
  39. {field: 'meeting.image', title: __('Meeting.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  40. {field: 'meeting.images', title: __('Meeting.images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
  41. {field: 'meeting.title', title: __('Meeting.title')},
  42. {field: 'meeting.address', title: __('Meeting.address')},
  43. {field: 'meeting.mongey', title: __('Meeting.mongey')},
  44. {field: 'meeting.mianji', title: __('Meeting.mianji')},
  45. {field: 'meeting.yizi', title: __('Meeting.yizi')},
  46. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  47. ]
  48. ]
  49. });
  50. // 为表格绑定事件
  51. Table.api.bindevent(table);
  52. },
  53. add: function () {
  54. Controller.api.bindevent();
  55. },
  56. edit: function () {
  57. Controller.api.bindevent();
  58. },
  59. api: {
  60. bindevent: function () {
  61. Form.api.bindevent($("form[role=form]"));
  62. }
  63. }
  64. };
  65. return Controller;
  66. });