talentInfo_base.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  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', checkbox: true},
  22. {title: '企业名称', field: 'enterprise_name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  23. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  24. formatter: function (value, row, index) {
  25. if (row.sex == 1) {
  26. return value + '<span style="color:#6495ED">【男】</span>';
  27. }
  28. if (row.sex == 2) {
  29. return value + '<span style="color:#FF82AB">【女】</span>';
  30. }
  31. }
  32. },
  33. {title: '人才申报类型', field: 'talent_type', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  34. {title: '单位标签', field: 'enterprise_tag', visible: isShow, align: 'center', valign: 'middle', width: "120px", 'class': 'uitd_showTip'},
  35. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "150px"},
  36. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  37. {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  38. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', width: "100px",
  39. formatter: function (value, row, index) {
  40. if (typeof row.deptCheckState != "undefined") {
  41. if (row.deptCheckState == 12) {
  42. return "<span class='label label-primary'>部门已通过</span>"
  43. } else if (row.deptCheckState == 9) {
  44. if (row.lastState == 13) {
  45. return "<span class='label label-success'>待重新审核</span>"
  46. } else {
  47. return "<span class='label label-danger'>部门已驳回</span>"
  48. }
  49. } else {
  50. return "<span class='label label-success'>待审核</span>"
  51. }
  52. } else {
  53. if (value == 2) {
  54. if (row.lastState == 4) {
  55. return "<span class='label label-success'>待审核(重新提交)</span>"
  56. }
  57. if (row.realState == 6) {
  58. return "<span class='label label-danger'>复审驳回</span>"
  59. }
  60. return "<span class='label label-success'>待审核</span>"
  61. }
  62. if (value == 3) {
  63. return "<span class='label label-success'>待复审</span>"
  64. }
  65. if (value == 5) {
  66. return "<span class='label label-success'>复审通过</span>"
  67. }
  68. if (value == 10) {
  69. return "<span class='label label-success'>待审核</span>"
  70. }
  71. if (value == 8) {
  72. if (row.realState == 11) {
  73. return "<span class='label label-danger'>初审驳回</span>"
  74. }
  75. }
  76. if (value == 9) {
  77. if (row.realState == 13) {
  78. return "<span class='label label-danger'>部门驳回</span>"
  79. } else if (row.realState == 15) {
  80. return "<span class='label label-danger'>复审驳回</span>"
  81. } else {
  82. if (row.lastState == 11) {
  83. return "<span class='label label-success'>待审核(重新提交)</span>"
  84. }
  85. return "<span class='label label-success'>待审核</span>"
  86. }
  87. }
  88. if (value == 16 || value == -1 || value == -2 || value == 7) {
  89. return "<span class='label label-danger'>审核不通过</span>"
  90. }
  91. if (value == 4) {
  92. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 1) {
  93. return "<span class='label label-success'>上级驳回</span>"
  94. } else {
  95. return "<span class='label label-success'>待审核</span>"
  96. }
  97. }
  98. if (value == 11) {
  99. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 3) {
  100. return "<span class='label label-success'>上级驳回</span>"
  101. } else {
  102. return "<span class='label label-success'>待审核</span>"
  103. }
  104. }
  105. if (value == 12) {
  106. return "<span class='label label-success'>待复审</span>"
  107. }
  108. if (value == 13) {
  109. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 4) {
  110. return "<span class='label label-danger'>上级驳回</span>"
  111. } else {
  112. return "<span class='label label-success'>待审核</span>"
  113. }
  114. }
  115. if (value == 14) {
  116. return "<span class='label label-primary'>已通过</span>"
  117. }
  118. if (value == 15) {
  119. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 5) {
  120. return "<span class='label label-success'>上级驳回</span>"
  121. } else {
  122. return "<span class='label label-success'>待审核</span>"
  123. }
  124. }
  125. }
  126. }
  127. },
  128. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  129. formatter: function (value, row, index) {
  130. return "<span class='label label-success' onclick=\"TalentInfo.showLog('" + value + "')\" >" +
  131. "<i class=\"fa fa-book\"></i>日志" +
  132. "</span>";
  133. }
  134. }
  135. ];
  136. };
  137. /**
  138. * 检查是否选中
  139. */
  140. TalentInfo.check = function () {
  141. var selected = $('#' + this.id).bootstrapTable('getSelections');
  142. if (selected.length != 1) {
  143. Feng.info("请先选中表格中的某一记录!");
  144. return false;
  145. } else {
  146. TalentInfo.seItem = selected[0];
  147. return true;
  148. }
  149. };
  150. TalentInfo.openCheckTalentInfo = function () {
  151. var title = $("#title").val();
  152. if (this.check()) {
  153. var index = layer.open({
  154. type: 2,
  155. title: '人才认定' + " - " + title,
  156. area: ['800px', '420px'], //宽高
  157. fix: false, //不固定
  158. maxmin: true,
  159. shade: 0,
  160. content: '/admin/talent/common_check/id/' + TalentInfo.seItem.id + '/1',
  161. btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  162. btnAlign: 'c',
  163. btn1: function (index, layero) {
  164. var obj = layero.find("iframe")[0].contentWindow;
  165. obj.TalentInfoInfoDlg.showFirstCheckModal();
  166. }, btn2: function (index, layero) {
  167. var obj = layero.find("iframe")[0].contentWindow;
  168. obj.TalentInfoInfoDlg.submitCheck();
  169. return false;
  170. }
  171. });
  172. layer.full(index);
  173. TalentInfo.layerIndex = index;
  174. }
  175. }
  176. /**
  177. * 打开查看人才认定-初级审核详情
  178. */
  179. TalentInfo.openTalentInfoDetail = function () {
  180. if (this.check()) {
  181. var index = layer.open({
  182. type: 2,
  183. title: '人才认定申报详情',
  184. area: ['800px', '420px'], //宽高
  185. fix: false, //不固定
  186. maxmin: true,
  187. content: Feng.ctxPath + '/talentInfo/talentInfo_toDetail/' + TalentInfo.seItem.id + '/1'
  188. });
  189. layer.full(index);
  190. TalentInfo.layerIndex = index;
  191. }
  192. };
  193. /**
  194. * 修改驳回的字段及附件
  195. */
  196. TalentInfo.updateFieldsAndFiles = function () {
  197. if (this.check()) {
  198. var ajax = new $ax("/admin/talent/findFieldsAndFiles?id=" + TalentInfo.seItem.id, function (data) {
  199. if (data.code == 200) {
  200. layer.open({
  201. type: 1,
  202. id: "neewFieldFormModel",
  203. title: '修改',
  204. area: ['800px', '450px'], //宽高
  205. fix: false, //不固定
  206. shade: 0,
  207. maxmin: true,
  208. content: TalentInfo.creatFieldCheckModal(),
  209. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  210. btnAlign: 'c',
  211. zIndex: layer.zIndex,
  212. success: function (layero, index) {
  213. var html1 = '';
  214. if (typeof data.fieldList != "undefined" && data.fieldList.length > 0) {
  215. for (var key in data.fieldList) {
  216. html1 += '<li style="float:left;margin:0 10px 10px 0;"><input type="checkbox" value="' + data.fieldList[key]["key"] + '"><span>' + data.fieldList[key]["value"] + '</span></li>';
  217. }
  218. }
  219. var html2 = '';
  220. for (var key in data.fileList) {
  221. html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + data.fileList[key].id + '"><span>' + data.fileList[key].name + '</span></li></ul>';
  222. }
  223. $("#firstCheckForm #field_info ul").css("overflow", "hidden").html(html1);
  224. $("#field_file").css("overflow", "hidden").empty().append(html2);
  225. //$("#field_file").empty().append(html);
  226. if (data.select.fields != null && data.select.fields != '') {
  227. $("#firstCheckForm #field_info li input").each(function () {
  228. if (data.select.fields.indexOf($(this).val()) != -1) {
  229. this.checked = true;
  230. }
  231. });
  232. }
  233. if (data.select.files != null && data.select.files != '') {
  234. $("#field_file input").each(function () {
  235. if (data.select.files.indexOf($(this).val()) != -1) {
  236. this.checked = true;
  237. }
  238. });
  239. }
  240. },
  241. yes: function (index, layero) {
  242. TalentInfo.submitFieldsAndFiles(index, data.id);
  243. }
  244. });
  245. } else {
  246. Feng.error(data.msg);
  247. }
  248. }, function (data) {
  249. Feng.error("查询失败!" + data.responseJSON.message + "!");
  250. });
  251. ajax.start();
  252. }
  253. }
  254. /**
  255. * 修改提交
  256. * @param index
  257. * @param id
  258. */
  259. TalentInfo.submitFieldsAndFiles = function (index, id) {
  260. var fields = '';
  261. var files = '';
  262. $("#firstCheckForm #field_info li input").each(function (index) {
  263. if ($(this).is(":checked")) {
  264. fields = fields + $(this).val() + ",";
  265. }
  266. });
  267. $("#field_file li input").each(function (index) {
  268. if ($(this).is(":checked")) {
  269. files = files + $(this).val() + ",";
  270. }
  271. });
  272. if (fields == '' && files == '') {
  273. Feng.info("请选择可修改的字段或附件!");
  274. return;
  275. }
  276. var ajax = new $ax("/admin/talent/updateFieldsAndFiles", function (data) {
  277. if (data.code == 200) {
  278. layer.close(index);
  279. Feng.success(data.msg);
  280. } else {
  281. Feng.error(data.msg);
  282. }
  283. }, function (data) {
  284. Feng.error("修改失败!" + data.responseJSON.message + "!");
  285. });
  286. ajax.setData({"id": id, "fields": fields, "files": files})
  287. ajax.start();
  288. }
  289. /**
  290. * 审核不通过
  291. */
  292. TalentInfo.setNotPass = function () {
  293. var selecteds = $('#' + this.id).bootstrapTable('getSelections');
  294. if (selecteds.length == 0) {
  295. Feng.info("请选择需要设置审核不通过的行");
  296. return;
  297. }
  298. var ids = "";
  299. for (var key in selecteds) {
  300. ids = ids + selecteds[key].id + ",";
  301. }
  302. ids = ids.substring(0, ids.length - 1);
  303. layer.open({
  304. type: 1,
  305. id: "notPassModal",
  306. title: '修改',
  307. area: ['800px', '450px'], //宽高
  308. fix: false, //不固定
  309. shade: 0,
  310. maxmin: true,
  311. content: '<form id="checkNotPass">\n' +
  312. ' <div class="form-group" style="margin: 10px;">\n' +
  313. ' <label for="checkMsgNotPass" class="control-label" >审核不通过原因</label>\n' +
  314. ' <textarea class="form-control" id="checkMsgNotPass" placeholder="此功能适用于未在申报提交截止时间内提交的数据" rows="6"></textarea>\n' +
  315. ' </div>\n' +
  316. ' </form>',
  317. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  318. btnAlign: 'c',
  319. zIndex: layer.zIndex,
  320. yes: function (index, layero) {
  321. var checkMsg = $("#checkMsgNotPass").val();
  322. if (Feng.isEmptyStr(checkMsg)) {
  323. Feng.info("请填写审核不通过原因");
  324. return;
  325. }
  326. var operation = function () {
  327. var ajax = new $ax("/admin/talent/cancel_verify", function (data) {
  328. if (data.code == 200) {
  329. Feng.success(data.msg);
  330. TalentInfo.table.refresh();
  331. layer.close(index);
  332. } else {
  333. Feng.error(data.msg);
  334. }
  335. }, function (data) {
  336. Feng.error("设置审核不通过失败!" + data.responseJSON.message + "!");
  337. });
  338. ajax.set("ids", ids);
  339. ajax.set("msg", checkMsg);
  340. ajax.start();
  341. }
  342. Feng.confirm("一旦提交无法修改,确定设置所选数据为审核不通过?", operation);
  343. }
  344. });
  345. }
  346. TalentInfo.creatFieldCheckModal = function () {
  347. return '<form id="firstCheckForm">\n' +
  348. ' <div class="form-group" style="margin: 10px;">\n' +
  349. ' <div >\n' +
  350. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  351. ' <div id="field_info">\n' +
  352. ' <ul>\n' +
  353. ' <li style="width:10%"><input type="checkbox" value="name"><span>姓名</span></li>\n' +
  354. ' <li style="width:10%"><input type="checkbox" value="sex"><span>性别</span></li>\n' +
  355. ' <li style="width:10%"><input type="checkbox" value="birthday"><span>出生日期</span></li>\n' +
  356. ' <li style="width:10%"><input type="checkbox" value="nationality"><span>国籍/地区</span></li>\n' +
  357. ' <li style="width:10%"><input type="checkbox" value="provinceCode" onchange="TalentInfo.fieldCheckd(this)"><span>籍贯省</span></li>\n' +
  358. ' <li style="width:10%"><input type="checkbox" value="cityCode" onchange="TalentInfo.fieldCheckd(this)"><span>籍贯市</span></li>\n' +
  359. ' <li style="width:10%"><input type="checkbox" value="countyCode"><span>籍贯县</span></li>\n' +
  360. ' <li style="width:10%"><input type="checkbox" value="nation"><span>民族</span></li>\n' +
  361. ' <li style="width:10%"><input type="checkbox" value="politics"><span>政治面貌</span></li>\n' +
  362. ' <li style="width:10%"><input type="checkbox" value="cardType"><span>证件类型</span></li>\n' +
  363. ' <li style="width:10%"><input type="checkbox" value="idCard"><span>证件号码</span></li>\n' +
  364. ' <li style="width:20.5%"><input type="checkbox" value="firstInJJTime"><span>首次来晋工作时间</span></li>\n' +
  365. ' <li style="width:10%"><input type="checkbox" value="source" onchange="TalentInfo.sourceCheckd(this)"><span>申报来源</span></li>\n' +
  366. ' <li style="width:20.5%"><input type="checkbox" value="ourCitySource"><span>公布入选来源</span></li>\n' +
  367. ' <li style="width:20.5%"><input type="checkbox" value="fromCity"><span>入选来源县市</span></li>\n' +
  368. ' <li style="width:20.5%"><input type="checkbox" value="qzBatch"><span>入选名单的文件号及批次</span></li>\n' +
  369. ' <li style="width:31%"><input type="checkbox" value="certificateStartTime"><span>泉州高层次人才证书发证日期</span></li>\n' +
  370. ' <li style="width:31%"><input type="checkbox" value="qzgccrcActiveTime"><span>泉州高层次人才证书的有效期</span></li>\n' +
  371. ' <li style="width:10%"><input type="checkbox" id="talentArrangeCheckBox" value="talentArrange" onchange="TalentInfo.fieldCheckd(this)"><span>人才层次</span></li>\n' +
  372. ' <li style="width:10%"><input type="checkbox" value="identifyCondition"><span>认定条件</span></li>\n' +
  373. ' <li style="width:20.5%"><input type="checkbox" value="identifyConditionName"><span>认定条件名称</span></li>\n' +
  374. ' <li style="width:20.5%"><input type="checkbox" value="identifyGetTime"><span>认定条件证书取得时间</span></li>\n' +
  375. ' <li style="width:10%"><input type="checkbox" value="talentType"><span>人才标签</span></li>\n' +
  376. ' <li style="width:31%"><input type="checkbox" value="letterTime"><span>首次来晋行政介绍信时间</span></li>\n' +
  377. ' <li style="width:10%"><input type="checkbox" value="introductionMode"><span>引进方式</span></li>\n' +
  378. ' <li style="width:20.5%"><input type="checkbox" value="entryTime"><span>本单位入职时间</span></li>\n' +
  379. ' <li style="width:10%"><input type="checkbox" value="post"><span>职务</span></li>\n' +
  380. ' <li style="width:20.5%"><input type="checkbox" value="startTime"><span>工作合同开始时间</span></li>\n' +
  381. ' <li style="width:20.5%"><input type="checkbox" value="endTime"><span>工作合同结束时间</span></li>\n' +
  382. ' <li style="width:20.5%"><input type="checkbox" value="lastYearWages"><span>上一年度年薪</span></li>\n' +
  383. ' <li style="width:10%"><input type="checkbox" value="highEducation"><span>最高学历</span></li>\n' +
  384. ' <li style="width:10%"><input type="checkbox" value="graduateSchool"><span>毕业院校</span></li>\n' +
  385. ' <li style="width:10%"><input type="checkbox" value="major"><span>专业</span></li>\n' +
  386. ' <li style="width:10%"><input type="checkbox" value="title"><span>职称</span></li>\n' +
  387. ' <li style="width:20.5%"><input type="checkbox" value="professionalQualifications"><span>国家职业资格</span></li>\n' +
  388. ' <li style="width:20.5%"><input type="checkbox" value="studyAbroad"><span>是否有留学经历</span></li>\n' +
  389. ' <li style="width:10%"><input type="checkbox" value="phone"><span>手机号码</span></li>\n' +
  390. ' <li style="width:10%"><input type="checkbox" value="email"><span>电子邮箱</span></li>\n' +
  391. ' <li style="width:10%"><input type="checkbox" value="bank"><span>开户银行</span></li>\n' +
  392. ' <li style="width:20.5%"><input type="checkbox" value="bankNetwork"><span>开户银行网点</span></li>\n' +
  393. ' <li style="width:10%"><input type="checkbox" value="bankNumber"><span>银行行号</span></li>\n' +
  394. ' <li style="width:10%"><input type="checkbox" value="bankAccount"><span>银行账号</span></li>\n' +
  395. ' <li style="width:31%"><input type="checkbox" value="breakFaith"><span>曾被相关主管部门列为失信个人</span></li>\n' +
  396. ' <li style="width:20.5%"><input type="checkbox" value="educationAndResume"><span>教育背景及工作简历</span></li>\n' +
  397. ' <li style="width:20.5%"><input type="checkbox" value="mainHonours"><span>主要业绩及取得的荣誉</span></li>\n' +
  398. ' </ul>\n' +
  399. ' </div>\n' +
  400. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  401. ' <div id="field_file">\n' +
  402. ' </div>\n' +
  403. ' <div class="form-group" style="text-align: center">\n' +
  404. ' <button type="button" class="btn btn-primary" onclick="TalentInfo.checkAll()">全选</button>\n' +
  405. ' <button type="button" class="btn btn-success" onclick="TalentInfo.unCheckAll()">反选</button>\n' +
  406. ' </div>\n' +
  407. ' </div>\n' +
  408. ' </div>\n' +
  409. ' </form>';
  410. }
  411. TalentInfo.fieldCheckd = function (context) {
  412. if ($(context).get(0).checked) {
  413. $(context).parent().next().children()[0].checked = true;
  414. $(context).parent().next().children().eq(0).trigger("change");
  415. }
  416. }
  417. TalentInfo.sourceCheckd = function (context) {
  418. if ($(context).get(0).checked) {
  419. $("#talentArrangeCheckBox").attr("checked", true);
  420. $("#talentArrangeCheckBox").trigger("change");
  421. }
  422. }
  423. TalentInfo.getPhones = function () {
  424. var process = $("#process").val();
  425. var ajax = new $ax("/admin/talent/getPhones/process/" + process, function (data) {
  426. if (data.code == 200) {
  427. layer.open({
  428. type: 1,
  429. title: "手机号码",
  430. area: ['830px', '300px'], //宽高
  431. fix: false, //不固定
  432. maxmin: true,
  433. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  434. });
  435. } else {
  436. Feng.info(data.msg);
  437. }
  438. }, function (data) {
  439. Feng.error("操作失败!");
  440. });
  441. ajax.setData(TalentInfo.formParams());
  442. ajax.start();
  443. }
  444. TalentInfo.getEnterprisePhones = function () {
  445. var process = $("#process").val();
  446. var ajax = new $ax("/admin/talent/getEnterprisePhones/process/" + process, function (data) {
  447. if (data.code == 200) {
  448. layer.open({
  449. type: 1,
  450. title: "手机号码",
  451. area: ['830px', '300px'], //宽高
  452. fix: false, //不固定
  453. maxmin: true,
  454. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  455. });
  456. } else {
  457. Feng.info(data.msg);
  458. }
  459. }, function (data) {
  460. Feng.error("操作失败!");
  461. });
  462. ajax.setData(TalentInfo.formParams());
  463. ajax.start();
  464. }
  465. $(function () {
  466. var defaultColunms = TalentInfo.initColumn();
  467. var process = $("#process").val();
  468. var table = new BSTable(TalentInfo.id, "/admin/talent/base_verify_list/process/" + process, defaultColunms);
  469. table.setPaginationType("server");
  470. table.setSingleSelect(false);
  471. table.setOnDblClickRow(function () {
  472. TalentInfo.openCheckTalentInfo();
  473. });
  474. TalentInfo.table = table.init();
  475. TalentInfo.init();
  476. // var defaultColunms = TalentInfo.initColumn();
  477. // var table = new KDTable(TalentInfo.id, "/talentInfo/list/1", defaultColunms);
  478. // table.setPaginationType("server");
  479. // TalentInfo.table = table.init();
  480. });