activepeoplemodify.js 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: 'activepeoplemodify/index' + location.search,
  8. // add_url: 'activepeoplemodify/add',
  9. edit_url: 'activepeoplemodify/edit',
  10. // del_url: 'activepeoplemodify/del',
  11. multi_url: 'activepeoplemodify/multi',
  12. // import_url: 'activepeoplemodify/import',
  13. table: 'active_people_modify',
  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. fixedColumns: true,
  23. fixedRightNumber: 1,
  24. columns: [
  25. [
  26. {checkbox: true},
  27. {field: 'id', title: __('Id')},
  28. {field: 'user_id', title: __('User_id')},
  29. {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
  30. {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
  31. {field: 'active_id', title: __('Active_id')},
  32. {field: 'active.title', title: __('Active.title'), operate: 'LIKE'},
  33. {field: 'active.desc', title: __('Active.desc'), operate: 'LIKE'},
  34. {field: 'order_id', title: __('Order_id')},
  35. {field: 'activeorder.order_sn', title: __('Order.order_sn'), operate: 'LIKE'},
  36. {field: 'people_id', title: __('报名记录ID')},
  37. {field: 'activepeople.name', title: '原'+__('People.name'), operate: 'LIKE'},
  38. {field: 'activepeople.idcard', title: '原'+__('People.idcard'), operate: 'LIKE'},
  39. {field: 'activepeople.mobile', title: '原'+__('People.mobile'), operate: 'LIKE'},
  40. {field: 'activepeople.emergencycontact', title: '原'+__('People.emergencycontact'), operate: 'LIKE'},
  41. {field: 'activepeople.contactmobile', title: '原'+__('People.contactmobile'), operate: 'LIKE'},
  42. {field: 'collectionplace', title: __('集合地点'), operate: 'LIKE'},
  43. {field: 'name', title: __('Name'), operate: 'LIKE'},
  44. {field: 'credtype', title: __('Credtype'), operate: 'LIKE'},
  45. {field: 'idcard', title: __('Idcard'), operate: 'LIKE'},
  46. {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
  47. {field: 'emergencycontact', title: __('Emergencycontact'), operate: 'LIKE'},
  48. {field: 'contactmobile', title: __('Contactmobile'), operate: 'LIKE'},
  49. // {field: 'insurance', title: __('Insurance'), operate: 'LIKE'},
  50. // {field: 'originalprice', title: __('Originalprice'), operate: 'LIKE'},
  51. // {field: 'vipprice', title: __('Vipprice'), operate: 'LIKE'},
  52. // {field: 'coupon_id', title: __('Coupon_id')},
  53. // {field: 'coupontype', title: __('Coupontype'), searchList: {"1":__('Coupontype 1'),"2":__('Coupontype 2')}, formatter: Table.api.formatter.normal},
  54. // {field: 'couponprice', title: __('Couponprice'), operate: 'LIKE'},
  55. // {field: 'is_free', title: __('Is_free'), searchList: {"0":__('Is_free 0'),"1":__('Is_free 1')}, formatter: Table.api.formatter.normal},
  56. // {field: 'price', title: __('Price'), operate: 'LIKE'},
  57. {field: 'is_self', title: __('Is_self'), searchList: {"0":__('Is_self 0'),"1":__('Is_self 1')}, formatter: Table.api.formatter.normal},
  58. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
  59. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  60. {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  61. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  62. ]
  63. ]
  64. });
  65. // 为表格绑定事件
  66. Table.api.bindevent(table);
  67. },
  68. add: function () {
  69. Controller.api.bindevent();
  70. },
  71. edit: function () {
  72. Controller.api.bindevent();
  73. },
  74. api: {
  75. bindevent: function () {
  76. Form.api.bindevent($("form[role=form]"));
  77. }
  78. }
  79. };
  80. return Controller;
  81. });