activepeople.js 4.7 KB

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