activecollect.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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: 'subscrip/activecollect/index?aid='+Config.aid,
  8. table: 'subscrip_user',
  9. }
  10. });
  11. var table = $("#table");
  12. // 初始化表格
  13. table.bootstrapTable({
  14. url: $.fn.bootstrapTable.defaults.extend.index_url,
  15. search:false,
  16. commonSearch:false,
  17. columns: [
  18. [
  19. {checkbox: true},
  20. {field: 'channel_id', title: __('渠道ID')},
  21. {field: 'channel_name', title: __('渠道名称')},
  22. {field: 'num', title: __('报名成功人数'),operate:false},
  23. {field: 'price', title: __('报名金额'),operate:false},
  24. {field: 'success_num', title: __('完成人数'),operate:false},
  25. {field: 'back_price', title: __('返还金额'),operate:false},
  26. {field: 'state_text', title: __('活动状态'),operate:false},
  27. ]
  28. ]
  29. });
  30. // 为表格绑定事件
  31. Table.api.bindevent(table);
  32. },
  33. add: function () {
  34. Controller.api.bindevent();
  35. },
  36. edit: function () {
  37. Controller.api.bindevent();
  38. },
  39. channel_show:function(){
  40. // 初始化表格参数配置
  41. Table.api.init({
  42. extend: {
  43. index_url: 'subscrip/activecollect/channel_show',
  44. table: 'subscrip_user',
  45. }
  46. });
  47. var table = $("#table");
  48. // 初始化表格
  49. table.bootstrapTable({
  50. url: $.fn.bootstrapTable.defaults.extend.index_url,
  51. search:false,
  52. commonSearch:false,
  53. columns: [
  54. [
  55. {checkbox: true},
  56. {field: 'channel_id', title: __('渠道ID')},
  57. {field: 'active_title', title: __('活动名称')},
  58. {field: 'price', title: __('报名费(元)')},
  59. {field: 'days', title: __('活动周期')},
  60. {field: 'begin_date', title: __('活动开始时间')},
  61. {field: 'num', title: __('报名成功人数'),operate:false},
  62. {field: 'price', title: __('报名金额'),operate:false},
  63. {field: 'success_num', title: __('完成人数'),operate:false},
  64. {field: 'back_price', title: __('返还金额'),operate:false},
  65. {field: 'state_text', title: __('活动状态'),operate:false},
  66. ]
  67. ]
  68. });
  69. },
  70. api: {
  71. bindevent: function () {
  72. Form.api.bindevent($("form[role=form]"));
  73. }
  74. }
  75. };
  76. return Controller;
  77. });