talentInfo_base.js 23 KB

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