index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**
  2. * 表格初始化
  3. */
  4. var DirectlyIdentify = {
  5. id: "directlyIdentifyTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. DirectlyIdentify.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '人才层次', field: 'talentLevel', visible: true, align: 'center', valign: 'middle'},
  17. {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',
  18. formatter: function (value, row, index) {
  19. if (value == 1) {
  20. return "晋江市现代产业体系人才";
  21. }
  22. if (value == 2) {
  23. return "集成电路优秀人才";
  24. }
  25. }
  26. },
  27. {title: '名称', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
  28. {title: '有效期', field: 'activeYear', visible: true, align: 'center', valign: 'middle'},
  29. {title: '是否启用', field: 'active', visible: true, align: 'center', valign: 'middle',
  30. formatter: function (value, row, index) {
  31. if (value == 1) {
  32. return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">启用</button>";
  33. }
  34. if (value == 2) {
  35. return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">停用</button>";
  36. }
  37. }
  38. },
  39. {title: '审核单位', field: 'companyNames', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
  40. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'},
  41. ];
  42. };
  43. //模板下载
  44. DirectlyIdentify.download_enterprise_template = function () {
  45. window.location.href = Feng.ctxPath + "/static/downloadFile/directly_identify_enterprise_template.xlsx";
  46. }
  47. DirectlyIdentify.enterprise_import = function () {
  48. $("#enterprise-import-form")[0].reset();
  49. $("#enterpriseImportModal").modal("show");
  50. }
  51. DirectlyIdentify.enterpriseImportSubmit = function () {
  52. $("#enterprise-import-form")[0].submit();
  53. }
  54. $(function () {
  55. var defaultColunms = DirectlyIdentify.initColumn();
  56. var table = new BSTable(DirectlyIdentify.id, "/admin/directly_identify/list", defaultColunms);
  57. table.setPaginationType("server");
  58. DirectlyIdentify.table = table.init();
  59. //下拉框数据动态加载
  60. Feng.addAjaxSelect({
  61. "id": "talentLevel",
  62. "displayCode": "code",
  63. "displayName": "name",
  64. "type": "GET",
  65. "url": "/admin/dict/findChildDictByCode?code=talent_arrange"
  66. });
  67. });