index.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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: 'ID', field: 'id', visible: true, align: 'center', valign: 'middle'},
  17. {title: '任务名称', field: 'task_name', visible: true, align: 'center', valign: 'middle'},
  18. {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
  19. {title: '任务结果', field: 'task_status', visible: true, align: 'center', valign: 'middle',
  20. formatter: function (value, row, index) {
  21. if (value == 0) {
  22. return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-danger btn-xs\">处理失败</button>";
  23. }
  24. if (value == 1) {
  25. return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">处理成功</button>";
  26. }
  27. if (value == -1) {
  28. return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">处理中</button>";
  29. }
  30. }
  31. },
  32. {title: '结果文件', field: 'task_result', visible: true, align: 'center', valign: 'middle',
  33. formatter: function (value, row, index){
  34. if(value != ''){
  35. return "<a href='/storage/" + value+"' style=\"line-height: 1.3\">下载导入结果</a>";
  36. }
  37. }
  38. },
  39. {title: '完成时间', field: 'updateTime', visible: true, align: 'center', valign: 'middle'},
  40. ];
  41. };
  42. //模板下载
  43. DirectlyIdentify.download_enterprise_template = function () {
  44. window.location.href = Feng.ctxPath + "/static/downloadFile/directly_identify_enterprise_template.xlsx";
  45. }
  46. DirectlyIdentify.download_fj_talent_template = function () {
  47. window.location.href = Feng.ctxPath + "/static/downloadFile/directly_identify_fj_talent_template.xlsx";
  48. }
  49. DirectlyIdentify.download_qz_talent_template = function () {
  50. window.location.href = Feng.ctxPath + "/static/downloadFile/directly_identify_qz_talent_template.xlsx";
  51. }
  52. DirectlyIdentify.enterprise_import = function () {
  53. $("#enterprise-import-form")[0].reset();
  54. $("#enterpriseImportModal").modal("show");
  55. }
  56. DirectlyIdentify.enterpriseImportSubmit = function () {
  57. $("#enterprise-import-form")[0].submit();
  58. }
  59. DirectlyIdentify.fj_talent_import = function () {
  60. $("#import_type").val("2");
  61. $("#talent-import-form")[0].reset();
  62. $("#talentImportModal").modal("show");
  63. }
  64. DirectlyIdentify.qz_talent_import = function () {
  65. $("#import_type").val("3");
  66. $("#talent-import-form")[0].reset();
  67. $("#talentImportModal").modal("show");
  68. }
  69. DirectlyIdentify.talentImportSubmit = function () {
  70. $("#talent-import-form")[0].submit();
  71. }
  72. //回调
  73. DirectlyIdentify.callBack = function (data) {
  74. Feng.info(data.msg);
  75. if (data.code == 200) {
  76. $("#enterpriseImportModal").modal("hide");
  77. $("#talentImportModal").modal("hide");
  78. DirectlyIdentify.table.refresh();
  79. }
  80. }
  81. $(function () {
  82. var defaultColunms = DirectlyIdentify.initColumn();
  83. var table = new BSTable(DirectlyIdentify.id, "/admin/directly_identify/list", defaultColunms);
  84. table.setPaginationType("server");
  85. DirectlyIdentify.table = table.init();
  86. //下拉框数据动态加载
  87. Feng.addAjaxSelect({
  88. "id": "talentLevel",
  89. "displayCode": "code",
  90. "displayName": "name",
  91. "type": "GET",
  92. "url": "/admin/dict/findChildDictByCode?code=talent_arrange"
  93. });
  94. });