apply.js 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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: 'user/apply/index' + location.search,
  8. add_url: 'user/apply/add',
  9. edit_url: 'user/apply/edit',
  10. del_url: 'user/apply/del',
  11. multi_url: 'user/apply/multi',
  12. import_url: 'user/apply/import',
  13. table: 'user_apply',
  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. columns: [
  23. [
  24. {checkbox: true},
  25. {field: 'id', title: __('Id')},
  26. {field: 'cid', title: __('Cid')},
  27. {field: 'user_id', title: __('User_id')},
  28. {field: 'full_name', title: __('Full_name'), operate: 'LIKE'},
  29. {field: 'vocation', title: __('Vocation'), operate: 'LIKE'},
  30. {field: 'position', title: __('Position'), operate: 'LIKE'},
  31. {field: 'education', title: __('Education'), searchList: {"0":__('Education 0'),"1":__('Education 1'),"2":__('Education 2'),"3":__('Education 3'),"4":__('Education 4'),"5":__('Education 5'),"6":__('Education 6'),"7":__('Education 7'),"8":__('Education 8'),"9":__('Education 9')}, formatter: Table.api.formatter.normal},
  32. {field: 'tel', title: __('Tel'), operate: 'LIKE'},
  33. {field: 'address', title: __('Address'), operate: 'LIKE'},
  34. {field: 'company_name', title: __('Company_name'), operate: 'LIKE'},
  35. {field: 'nature', title: __('Nature'), operate: 'LIKE'},
  36. {field: 'legal_person', title: __('Legal_person'), operate: 'LIKE'},
  37. {field: 'zip_code', title: __('Zip_code'), operate: 'LIKE'},
  38. {field: 'compnay_address', title: __('Compnay_address'), operate: 'LIKE'},
  39. {field: 'company_email', title: __('Company_email'), operate: 'LIKE'},
  40. {field: 'certificateimage', title: __('Certificateimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
  41. {field: 'id_card', title: __('Id_card'), operate: 'LIKE'},
  42. {field: 'nation', title: __('Nation'), operate: 'LIKE'},
  43. {field: 'birthday', title: __('Birthday'), operate: 'LIKE'},
  44. {field: 'user_type', title: __('User_type'), searchList: {"0":__('User_type 0'),"1":__('User_type 1'),"2":__('User_type 2')}, formatter: Table.api.formatter.normal},
  45. {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
  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. });