talentInfo_library.js 11 KB

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