talentInfo_library.js 12 KB

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