talentInfo_library.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. /**
  2. * 人才认定申报管理初始化
  3. */
  4. var TalentInfo = {
  5. id: "TalentInfoTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. TalentInfo.initColumn = function () {
  14. var type = $("#type").val();
  15. var isShow = true;
  16. if (type == 2) {
  17. isShow = false;
  18. }
  19. ;
  20. return [
  21. {field: 'selectItem', radio: true},
  22. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
  23. {title: '离职状态', field: 'active', visible: true, align: 'center', valign: 'middle', width: '80px',
  24. formatter: function (value, row, index) {
  25. if (value == 1) {
  26. return '<span style="color:#6495ED">在职</span>';
  27. }
  28. if (value == 2) {
  29. return '<span style="color:#FF82AB">离职</span>';
  30. }
  31. }
  32. },
  33. {title: '企业名称', field: 'enterprise_name', visible: true, align: 'center', valign: 'middle', width: '150px'},
  34. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: '120px',
  35. formatter: function (value, row, index) {
  36. if (row.sex == 1) {
  37. return value + '<span style="color:#6495ED">【男】</span>';
  38. }
  39. if (row.sex == 2) {
  40. return value + '<span style="color:#FF82AB">【女】</span>';
  41. }
  42. }
  43. },
  44. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: '150px', 'class': 'uitd_showTip'},
  45. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: '100px'},
  46. {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px',
  47. formatter: function (value, row, index) {
  48. if (!row.talent_condition) {
  49. return "积分认定";
  50. }
  51. return value;
  52. }
  53. },
  54. {title: '人才证书有效期', field: 'identifyGetTime', visible: isShow, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '150px',
  55. formatter: function (value, row, index) {
  56. return row.certificateGetTime + "至" + row.certificateExpireTime;
  57. }
  58. },
  59. {title: '公布入选月份', field: 'identifyMonth', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '100px'},
  60. {title: '人才编号', field: 'certificateNo', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: '100px'},
  61. {title: '是否过期', field: 'isEffect', visible: isShow, align: 'center', valign: 'middle', width: '120px',
  62. formatter: function (value, row, index) {
  63. if (value == 1) {
  64. return '有效';
  65. } else if (value == 4) {
  66. return "失效";
  67. } else {
  68. return "已过期";
  69. }
  70. }
  71. },
  72. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
  73. formatter: function (value, row, index) {
  74. return "<span class='label label-success' onclick=\"TalentInfo.showLog('" + value + "')\" >" +
  75. "<i class=\"fa fa-book\"></i>日志" +
  76. "</span>";
  77. }
  78. }
  79. ];
  80. };
  81. /**
  82. * 检查是否选中
  83. */
  84. TalentInfo.check = function () {
  85. var selected = $('#' + this.id).bootstrapTable('getSelections');
  86. if (selected.length == 0) {
  87. Feng.info("请先选中表格中的某一记录!");
  88. return false;
  89. } else {
  90. TalentInfo.seItem = selected[0];
  91. return true;
  92. }
  93. };
  94. /**
  95. * 打开查看人才认定-初级审核详情
  96. */
  97. TalentInfo.openTalentInfoDetail = function () {
  98. var process = 6;
  99. if (this.check()) {
  100. var index = layer.open({
  101. type: 2,
  102. title: '人才认定申报详情',
  103. area: ['800px', '420px'], //宽高
  104. fix: false, //不固定
  105. maxmin: true,
  106. content: '/admin/talent/common_check/id/' + TalentInfo.seItem.id + '/process/' + process,
  107. });
  108. layer.full(index);
  109. TalentInfo.layerIndex = index;
  110. }
  111. };
  112. //取消优秀人才
  113. TalentInfo.cancle = function () {
  114. if (this.check()) {
  115. if (TalentInfo.seItem.isEffect == 4) {
  116. Feng.info("无法重复取消");
  117. return;
  118. }
  119. var operation = function () {
  120. var ajax = new $ax(Feng.ctxPath + "/admin/talent/removeFromLibrary", function (data) {
  121. if (data.code == 200) {
  122. Feng.success(data.msg);
  123. TalentInfo.table.refresh();
  124. } else {
  125. Feng.error(data.msg);
  126. }
  127. }, function (data) {
  128. Feng.error("取消优秀人才失败!" + data.responseJSON.message + "!");
  129. });
  130. ajax.setData({"id": TalentInfo.seItem.id});
  131. ajax.start();
  132. }
  133. Feng.confirm("一旦取消将无法恢复,确认取消吗?", operation);
  134. }
  135. }
  136. /**
  137. * 恢复优秀人才
  138. */
  139. TalentInfo.recovery = function () {
  140. if (this.check()) {
  141. if (TalentInfo.seItem.isEffect != 4) {
  142. Feng.info("无法恢复有效数据");
  143. return;
  144. }
  145. var operation = function () {
  146. var ajax = new $ax(Feng.ctxPath + "/admin/talent/recovery", function (data) {
  147. if (data.code == 200) {
  148. Feng.success(data.msg);
  149. TalentInfo.table.refresh();
  150. } else {
  151. Feng.error(data.msg);
  152. }
  153. }, function (data) {
  154. Feng.error("恢复优秀人才失败!" + data.responseJSON.message + "!");
  155. });
  156. ajax.setData({"id": TalentInfo.seItem.id});
  157. ajax.start();
  158. }
  159. Feng.confirm("确认恢复吗?", operation);
  160. }
  161. }
  162. //公示导出
  163. TalentInfo.showExportModal = function () {
  164. $("#exportForm")[0].reset();
  165. $("#exportModal").modal("show");
  166. }
  167. //公示导出提交
  168. TalentInfo.export = function () {
  169. var names = '';
  170. var values = '';
  171. $("#field_info li input").each(function (index) {
  172. if ($(this).is(":checked")) {
  173. values = values + $(this).val() + ",";
  174. names = names + $(this).next().text() + ",";
  175. }
  176. });
  177. var name = $("#name").val();
  178. var sex = $("#sex").val();
  179. var idCard = $("#card_number").val();
  180. var nation = $("#nation").val();
  181. var nationality = $("#nationality").val();
  182. var talentType = $("#talent_type").val();
  183. var talentArrange = $("#talent_arrange").val();
  184. var active = $("#active").val();
  185. $("#exportModal").modal('hide');
  186. var url = Feng.ctxPath + "/talentInfoExport/libraryExport?name=" + name + "&names=" + names + "&values=" + values
  187. + "&sex=" + sex + "&idCard=" + idCard + "&nation=" + nation + "&nationality=" + nationality
  188. + "&talentType=" + talentType + "&talentArrange=" + talentArrange + "&active=" + active;
  189. window.location.href = encodeURI(encodeURI(url));
  190. }
  191. TalentInfo.editBasicInfo = function () {
  192. if (this.check()) {
  193. layer.open({
  194. type: 1,
  195. id: "neewFieldFormModel",
  196. title: '审核',
  197. area: ['800px', '450px'], //宽高
  198. fix: false, //不固定
  199. shade: 0,
  200. maxmin: true,
  201. content: '<form id="editBaiscInfo">' +
  202. ' <div class="form-group" style="margin: 10px;">' +
  203. ' <label for="checkMsgNotPass" class="control-label" >引进方式</label>' +
  204. ' <select class="form-control" id="introduceMode"></select>' +
  205. ' </div>' +
  206. ' <div class="form-group" style="margin: 10px;">' +
  207. ' <label for="checkMsgNotPass" class="control-label" >是否同步至津补贴申报</label>' +
  208. ' <select class="form-control" id="isSync">' +
  209. ' <option value="2">否</option> ' +
  210. ' <option value="1">是</option> ' +
  211. ' </select>' +
  212. ' </div>' +
  213. ' </form>',
  214. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  215. btnAlign: 'c',
  216. zIndex: layer.zIndex,
  217. success: function (layero, index) {
  218. var arr = [{"name": "introduceMode", "code": "un_introduction_mode"}];
  219. Feng.findChildDictBatch(JSON.stringify(arr));
  220. },
  221. yes: function (index, layero) {
  222. var introduceMode = $("#introduceMode").val();
  223. var isSync = $("#isSync").val();
  224. if (Feng.isEmptyStr(introduceMode)) {
  225. Feng.info("请选择引进方式");
  226. return;
  227. }
  228. var operation = function () {
  229. var ajax = new $ax(Feng.ctxPath + "/talentInfo/editBasicInfo", function (data) {
  230. if (data.code == 200) {
  231. Feng.success(data.msg);
  232. TalentInfo.table.refresh();
  233. layer.close(index);
  234. } else {
  235. Feng.error(data.msg);
  236. }
  237. }, function (data) {
  238. Feng.error("修改失败!" + data.responseJSON.message + "!");
  239. });
  240. ajax.set("id", TalentInfo.seItem.id);
  241. ajax.set("introductionMode", introduceMode);
  242. ajax.set("isSync", isSync);
  243. ajax.start();
  244. }
  245. Feng.confirm("确认修改吗?", operation);
  246. }
  247. });
  248. }
  249. }
  250. //回调
  251. TalentInfo.callBack = function (data) {
  252. Feng.info(data.msg);
  253. }
  254. /**
  255. * 查看首次申报基础信息
  256. */
  257. TalentInfo.selectFirstInfo = function () {
  258. var process = $("#process").val();
  259. if (this.check()) {
  260. var index = layer.open({
  261. type: 2,
  262. title: '人才认定首次申报信息',
  263. area: ['800px', '420px'], //宽高
  264. fix: false, //不固定
  265. maxmin: true,
  266. content: '/admin/talent/common_check/id/' + TalentInfo.seItem.id + '/process/' + process,
  267. });
  268. layer.full(index);
  269. TalentInfo.layerIndex = index;
  270. }
  271. }
  272. $(function () {
  273. var defaultColunms = TalentInfo.initColumn();
  274. var process = $("#process").val();
  275. var table = new BSTable(TalentInfo.id, "/admin/talent/base_verify_list/process/" + process, defaultColunms);
  276. table.setPaginationType("server");
  277. table.setOnDblClickRow(function () {
  278. TalentInfo.openTalentInfoDetail();
  279. });
  280. table.setRowStyle(function (row, index) {
  281. if (row.isEffect == 2) {
  282. return {classes: 'warning'};
  283. } else if (row.isEffect == 3) {
  284. return {classes: 'danger'};
  285. } else if (row.isEffect == 4) {
  286. return {classes: 'info'}
  287. } else {
  288. return {};
  289. }
  290. });
  291. var t = TalentInfo.table = table.init();
  292. TalentInfo.init();
  293. //批量加载时间控件
  294. $(".time").each(function () {
  295. laydate.render({
  296. elem: "#" + $(this).attr("id")
  297. , type: "date"
  298. , trigger: 'click'
  299. });
  300. });
  301. });