talentInfo_base.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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 superpriv = $("#superpriv").val();
  16. var process = $("#process").val();
  17. var isShowVerifyDept = false;
  18. isShowVerifyDept = process == 4 && superpriv ? true : false;
  19. return [
  20. {field: 'selectItem', checkbox: true},
  21. {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  22. {title: '医院名称', field: 'enterprise_name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px",
  23. formatter: function (value, row, index) {
  24. return value + (row.isGeneral == 1 ? "(总院)" : "");
  25. }
  26. },
  27. {title: '医共体', field: 'medicalCommunityName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  28. {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  29. formatter: function (value, row, index) {
  30. if (row.sex == 1) {
  31. return value + '<span style="color:#6495ED">【男】</span>';
  32. }
  33. if (row.sex == 2) {
  34. return value + '<span style="color:#FF82AB">【女】</span>';
  35. }
  36. }
  37. },
  38. {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
  39. {title: '认定层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "80px"},
  40. {title: '认定条件', field: 'talentConditionName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "150px"},
  41. {title: '审核部门', field: 'verifyDepts', visible: isShowVerifyDept, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "150px",
  42. formatter: function (value, row, index) {
  43. var html = "";
  44. for (var i in value) {
  45. let checkState = "";
  46. if (value[i].active == 1) {
  47. if (value[i].checkState == 9) {
  48. checkState = "<span style='color:#ff0000;'>审核驳回</span>";
  49. }
  50. if (value[i].checkState == 12) {
  51. checkState = "<span style='color:green;'>审核通过</span>";
  52. }
  53. } else {
  54. checkState = "<span style='color:gray;'>待审核</span>";
  55. }
  56. html += "<p style='margin:0 auto;'>" + value[i].name + "(" + checkState + ")</p>"
  57. }
  58. return html
  59. }
  60. },
  61. {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  62. {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
  63. {title: '审核状态', field: 'checkState', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px",
  64. formatter: function (value, row, index) {
  65. if (typeof row.deptCheckState != "undefined") {
  66. if ((row.deptActive == 0 && row.realState == 10) || !row.deptActive) {
  67. if (row.resubmit) {
  68. return "<span class='label label-success'>待部门并审(重新提交)</span>";
  69. } else {
  70. return "<span class='label label-success'>待部门并审(首次提交)</span>";
  71. }
  72. }
  73. if (row.deptActive == 1 && row.newState == 12) {
  74. return "<span class='label label-primary'>部门并审通过</span>";
  75. }
  76. if (row.deptActive == 1 && row.newState == 9) {
  77. return "<span class='label label-danger'>部门并审驳回</span>";
  78. }
  79. } else {
  80. if (value == 2) {
  81. if (row.lastState == 4) {
  82. return "<span class='label label-success'>待审核(重新提交)</span>"
  83. }
  84. if (row.realState == 6) {
  85. return "<span class='label label-danger'>复审驳回</span>"
  86. }
  87. return "<span class='label label-success'>待审核</span>"
  88. }
  89. if (value == 3) {
  90. return "<span class='label label-success'>待复审</span>"
  91. }
  92. if (value == 5) {
  93. return "<span class='label label-success'>复审通过</span>"
  94. }
  95. if (value == 10) {
  96. if (process == 3) {
  97. if (row.pass_dept_check == 1) {
  98. return "<span class='label label-success'>初审通过(待复审)</span>"
  99. }
  100. return "<span class='label label-success'>初审通过(待部门并审)</span>"
  101. }
  102. if (process == 4) {
  103. if (row.resubmit) {
  104. return "<span class='label label-success'>待部门并审(重新提交)</span>";
  105. } else {
  106. return "<span class='label label-success'>待部门并审(首次提交)</span>";
  107. }
  108. }
  109. if (row.resubmit) {
  110. return "<span class='label label-success'>待复审(重新提交)</span>";
  111. } else {
  112. return "<span class='label label-success'>待复审(首次提交)</span>";
  113. }
  114. }
  115. if (value == 8) {
  116. if (row.realState == 11) {
  117. return "<span class='label label-danger'>初审驳回</span>"
  118. } else {
  119. return "<span class='label label-success'>保存未提交</span>"
  120. }
  121. }
  122. if (value == 9) {
  123. if (row.realState == 13) {
  124. if (process == 3) {
  125. return "<span class='label label-danger'>待初审(部门并审驳回)</span>";
  126. }
  127. return "<span class='label label-danger'>部门并审驳回</span>";
  128. } else if (row.realState == 15) {
  129. if (process == 3) {
  130. return "<span class='label label-danger'>待初审(复审驳回)</span>";
  131. }
  132. return "<span class='label label-danger'>复审驳回</span>";
  133. } else {
  134. if (row.lastState == 11) {
  135. return "<span class='label label-success'>待初审(重新提交)</span>"
  136. }
  137. return "<span class='label label-success'>待初审(首次提交)</span>"
  138. }
  139. }
  140. if (value == -2) {
  141. return "<span class='label label-danger'>初审不通过</span>"
  142. }
  143. if (value == 16) {
  144. return "<span class='label label-danger'>复审不通过</span>"
  145. }
  146. if (value == -1 || value == 7) {
  147. return "<span class='label label-danger'>审核不通过</span>"
  148. }
  149. if (value == 4) {
  150. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 1) {
  151. return "<span class='label label-success'>上级驳回</span>"
  152. } else {
  153. return "<span class='label label-success'>待审核</span>"
  154. }
  155. }
  156. if (value == 11) {
  157. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 3) {
  158. return "<span class='label label-success'>上级驳回</span>"
  159. } else {
  160. return "<span class='label label-success'>待审核</span>"
  161. }
  162. }
  163. if (value == 12) {
  164. if (process == 4) {
  165. return "<span class='label label-success'>部门并审通过</span>";
  166. }
  167. if (process == 3) {
  168. return "<span class='label label-success'>待复审(部门并审通过)</span>";
  169. }
  170. if (row.resubmit) {
  171. return "<span class='label label-success'>待复审(重新提交)</span>";
  172. } else {
  173. return "<span class='label label-success'>待复审(首次提交)</span>";
  174. }
  175. }
  176. if (value == 13) {
  177. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 4) {
  178. return "<span class='label label-danger'>上级驳回</span>"
  179. } else {
  180. return "<span class='label label-success'>待审核</span>"
  181. }
  182. }
  183. if (value == 14) {
  184. return "<span class='label label-primary'>复审通过</span>"
  185. }
  186. if (value == 15) {
  187. if (row.highProcess != null && row.highProcess != '' && row.highProcess >= 5) {
  188. return "<span class='label label-success'>上级驳回</span>"
  189. } else {
  190. return "<span class='label label-success'>待审核</span>"
  191. }
  192. }
  193. }
  194. }
  195. },
  196. {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
  197. formatter: function (value, row, index) {
  198. return "<span class='label label-success' onclick=\"TalentInfo.showLog('" + value + "')\" >" +
  199. "<i class=\"fa fa-book\"></i>日志" +
  200. "</span>";
  201. }
  202. }
  203. ];
  204. };
  205. /**
  206. * 检查是否选中
  207. */
  208. TalentInfo.check = function () {
  209. var selected = $('#' + this.id).bootstrapTable('getSelections');
  210. if (selected.length != 1) {
  211. Feng.info("请先选中表格中的某一记录!");
  212. return false;
  213. } else {
  214. TalentInfo.seItem = selected[0];
  215. return true;
  216. }
  217. };
  218. TalentInfo.openCheckTalentInfo = function () {
  219. var title = $("#title").val();
  220. var process = $("#process").val();
  221. if (this.check()) {
  222. var index = layer.open({
  223. type: 2,
  224. title: '人才认定' + " - " + title,
  225. area: ['800px', '420px'], //宽高
  226. fix: false, //不固定
  227. maxmin: true,
  228. shade: 0,
  229. content: '/admin/talent/common_check/id/' + TalentInfo.seItem.id + '/process/' + process,
  230. 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;关闭'],
  231. btnAlign: 'c',
  232. btn1: function (index, layero) {
  233. var obj = layero.find("iframe")[0].contentWindow;
  234. obj.TalentInfoInfoDlg.showFirstCheckModal();
  235. }, btn2: function (index, layero) {
  236. var obj = layero.find("iframe")[0].contentWindow;
  237. obj.TalentInfoInfoDlg.submitCheck();
  238. return false;
  239. }
  240. });
  241. layer.full(index);
  242. TalentInfo.layerIndex = index;
  243. }
  244. }
  245. /**
  246. * 打开查看人才认定-初级审核详情
  247. */
  248. TalentInfo.openTalentInfoDetail = function () {
  249. if (this.check()) {
  250. var index = layer.open({
  251. type: 2,
  252. title: '人才认定申报详情',
  253. area: ['800px', '420px'], //宽高
  254. fix: false, //不固定
  255. maxmin: true,
  256. content: Feng.ctxPath + '/talentInfo/talentInfo_toDetail/' + TalentInfo.seItem.id + '/1'
  257. });
  258. layer.full(index);
  259. TalentInfo.layerIndex = index;
  260. }
  261. };
  262. TalentInfo.cancleThirdCheck = function () {
  263. if (this.check()) {
  264. var index = layer.open({
  265. type: 1,
  266. title: '撤销复核',
  267. area: ['800px', '420px'], //宽高
  268. fix: false, //不固定
  269. maxmin: true,
  270. content: '<form >\n' +
  271. ' <div class="form-group" style="margin: 10px;">\n' +
  272. ' <label for="checkMsg" class="control-label">撤销原因</label>\n' +
  273. ' <textarea class="form-control" id="msg" rows="6"></textarea>\n' +
  274. ' </div>\n' +
  275. ' </form>',
  276. btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  277. yes: function (index, layero) {
  278. var cancleMsg = $("#msg").val();
  279. if (Feng.isEmptyStr(cancleMsg)) {
  280. Feng.error("撤销原因不能为空");
  281. return;
  282. }
  283. var operation = function () {
  284. var ajax = new $ax(Feng.ctxPath + "/admin/talent/cancleThirdCheck", function (data) {
  285. if (data.code == 200) {
  286. Feng.success(data.msg);
  287. TalentInfo.table.refresh();
  288. layer.close(index);
  289. } else {
  290. Feng.error(data.msg);
  291. }
  292. locked = false;
  293. }, function (data) {
  294. Feng.error("撤销复核失败!" + data.responseJSON.message + "!");
  295. locked = false;
  296. });
  297. ajax.setData({"id": TalentInfo.seItem.id, "checkMsg": cancleMsg})
  298. ajax.start();
  299. };
  300. Feng.confirm("一旦提交无法修改,确定要撤销吗?", operation);
  301. }
  302. });
  303. }
  304. }
  305. /**
  306. * 修改驳回的字段及附件
  307. */
  308. TalentInfo.updateFieldsAndFiles = function () {
  309. if (this.check()) {
  310. var ajax = new $ax("/admin/talent/findFieldsAndFiles?id=" + TalentInfo.seItem.id, function (data) {
  311. if (data.code == 200) {
  312. layer.open({
  313. type: 1,
  314. id: "neewFieldFormModel",
  315. title: '修改',
  316. area: ['800px', '450px'], //宽高
  317. fix: false, //不固定
  318. shade: 0,
  319. maxmin: true,
  320. content: TalentInfo.creatFieldCheckModal(),
  321. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  322. btnAlign: 'c',
  323. zIndex: layer.zIndex,
  324. success: function (layero, index) {
  325. var html1 = '';
  326. if (typeof data.fieldList != "undefined" && data.fieldList.length > 0) {
  327. for (var key in data.fieldList) {
  328. 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>';
  329. }
  330. }
  331. var html2 = '';
  332. for (var key in data.fileList) {
  333. html2 = html2 + '<ul><li style="width: 100%"><input type="checkbox" value="' + data.fileList[key].id + '"><span>' + data.fileList[key].name + '</span></li></ul>';
  334. }
  335. $("#firstCheckForm #field_info ul").css("overflow", "hidden").html(html1);
  336. $("#field_file").css("overflow", "hidden").empty().append(html2);
  337. //$("#field_file").empty().append(html);
  338. if (data.select.fields != null && data.select.fields != '') {
  339. $("#firstCheckForm #field_info li input").each(function () {
  340. if (data.select.fields.indexOf($(this).val()) != -1) {
  341. this.checked = true;
  342. }
  343. });
  344. }
  345. if (data.select.files != null && data.select.files != '') {
  346. $("#field_file input").each(function () {
  347. if (data.select.files.indexOf($(this).val()) != -1) {
  348. this.checked = true;
  349. }
  350. });
  351. }
  352. },
  353. yes: function (index, layero) {
  354. TalentInfo.submitFieldsAndFiles(index, data.id);
  355. }
  356. });
  357. } else {
  358. Feng.error(data.msg);
  359. }
  360. }, function (data) {
  361. Feng.error("查询失败!" + data.responseJSON.message + "!");
  362. });
  363. ajax.start();
  364. }
  365. }
  366. /**
  367. * 修改提交
  368. * @param index
  369. * @param id
  370. */
  371. TalentInfo.submitFieldsAndFiles = function (index, id) {
  372. var fields = '';
  373. var files = '';
  374. $("#firstCheckForm #field_info li input").each(function (index) {
  375. if ($(this).is(":checked")) {
  376. fields = fields + $(this).val() + ",";
  377. }
  378. });
  379. $("#field_file li input").each(function (index) {
  380. if ($(this).is(":checked")) {
  381. files = files + $(this).val() + ",";
  382. }
  383. });
  384. if (fields == '' && files == '') {
  385. Feng.info("请选择可修改的字段或附件!");
  386. return;
  387. }
  388. var ajax = new $ax("/admin/talent/updateFieldsAndFiles", function (data) {
  389. if (data.code == 200) {
  390. layer.close(index);
  391. Feng.success(data.msg);
  392. } else {
  393. Feng.error(data.msg);
  394. }
  395. }, function (data) {
  396. Feng.error("修改失败!" + data.responseJSON.message + "!");
  397. });
  398. ajax.setData({"id": id, "fields": fields, "files": files})
  399. ajax.start();
  400. }
  401. /**
  402. * 审核不通过
  403. */
  404. TalentInfo.setNotPass = function () {
  405. var selecteds = $('#' + this.id).bootstrapTable('getSelections');
  406. if (selecteds.length == 0) {
  407. Feng.info("请选择需要设置审核不通过的行");
  408. return;
  409. }
  410. var ids = "";
  411. for (var key in selecteds) {
  412. ids = ids + selecteds[key].id + ",";
  413. }
  414. ids = ids.substring(0, ids.length - 1);
  415. layer.open({
  416. type: 1,
  417. id: "notPassModal",
  418. title: '修改',
  419. area: ['800px', '450px'], //宽高
  420. fix: false, //不固定
  421. shade: 0,
  422. maxmin: true,
  423. content: '<form id="checkNotPass">\n' +
  424. ' <div class="form-group" style="margin: 10px;">\n' +
  425. ' <label for="checkMsgNotPass" class="control-label" >审核不通过原因</label>\n' +
  426. ' <textarea class="form-control" id="checkMsgNotPass" placeholder="此功能适用于未在申报提交截止时间内提交的数据" rows="6"></textarea>\n' +
  427. ' </div>\n' +
  428. ' </form>',
  429. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  430. btnAlign: 'c',
  431. zIndex: layer.zIndex,
  432. yes: function (index, layero) {
  433. var checkMsg = $("#checkMsgNotPass").val();
  434. if (Feng.isEmptyStr(checkMsg)) {
  435. Feng.info("请填写审核不通过原因");
  436. return;
  437. }
  438. var operation = function () {
  439. var ajax = new $ax("/admin/talent/cancel_verify", function (data) {
  440. if (data.code == 200) {
  441. Feng.success(data.msg);
  442. TalentInfo.table.refresh();
  443. layer.close(index);
  444. } else {
  445. Feng.error(data.msg);
  446. }
  447. }, function (data) {
  448. Feng.error("设置审核不通过失败!" + data.responseJSON.message + "!");
  449. });
  450. ajax.set("ids", ids);
  451. ajax.set("msg", checkMsg);
  452. ajax.start();
  453. }
  454. Feng.confirm("一旦提交无法修改,确定设置所选数据为审核不通过?", operation);
  455. }
  456. });
  457. }
  458. TalentInfo.creatFieldCheckModal = function () {
  459. return '<form id="firstCheckForm">\n' +
  460. ' <div class="form-group" style="margin: 10px;">\n' +
  461. ' <div >\n' +
  462. ' <label for="checkMsg" class="control-label">可修改字段</label>\n' +
  463. ' <div id="field_info">\n' +
  464. ' <ul>\n' +
  465. ' </ul>\n' +
  466. ' </div>\n' +
  467. ' <label for="checkMsg" class="control-label">可修改附件</label>\n' +
  468. ' <div id="field_file">\n' +
  469. ' </div>\n' +
  470. ' <div class="form-group" style="text-align: center">\n' +
  471. ' <button type="button" class="btn btn-primary" onclick="TalentInfo.checkAll()">全选</button>\n' +
  472. ' <button type="button" class="btn btn-success" onclick="TalentInfo.unCheckAll()">反选</button>\n' +
  473. ' </div>\n' +
  474. ' </div>\n' +
  475. ' </div>\n' +
  476. ' </form>';
  477. }
  478. TalentInfo.fieldCheckd = function (context) {
  479. if ($(context).get(0).checked) {
  480. $(context).parent().next().children()[0].checked = true;
  481. $(context).parent().next().children().eq(0).trigger("change");
  482. }
  483. }
  484. TalentInfo.sourceCheckd = function (context) {
  485. if ($(context).get(0).checked) {
  486. $("#talentArrangeCheckBox").attr("checked", true);
  487. $("#talentArrangeCheckBox").trigger("change");
  488. }
  489. }
  490. TalentInfo.getPhones = function () {
  491. var process = $("#process").val();
  492. var ajax = new $ax("/admin/talent/getPhones/process/" + process, function (data) {
  493. if (data.code == 200) {
  494. layer.open({
  495. type: 1,
  496. title: "手机号码",
  497. area: ['830px', '300px'], //宽高
  498. fix: false, //不固定
  499. maxmin: true,
  500. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  501. });
  502. } else {
  503. Feng.info(data.msg);
  504. }
  505. }, function (data) {
  506. Feng.error("操作失败!");
  507. });
  508. ajax.setData(TalentInfo.formParams());
  509. ajax.start();
  510. }
  511. TalentInfo.getEnterprisePhones = function () {
  512. var process = $("#process").val();
  513. var ajax = new $ax("/admin/talent/getEnterprisePhones/process/" + process, function (data) {
  514. if (data.code == 200) {
  515. layer.open({
  516. type: 1,
  517. title: "手机号码",
  518. area: ['830px', '300px'], //宽高
  519. fix: false, //不固定
  520. maxmin: true,
  521. content: "<span style='word-break:break-all'>" + data.obj + "</span>"
  522. });
  523. } else {
  524. Feng.info(data.msg);
  525. }
  526. }, function (data) {
  527. Feng.error("操作失败!");
  528. });
  529. ajax.setData(TalentInfo.formParams());
  530. ajax.start();
  531. }
  532. $(function () {
  533. var defaultColunms = TalentInfo.initColumn();
  534. var process = $("#process").val();
  535. var table = new BSTable(TalentInfo.id, "/admin/talent/base_verify_list/process/" + process, defaultColunms);
  536. table.setPaginationType("server");
  537. table.setSingleSelect(false);
  538. table.setOnDblClickRow(function () {
  539. TalentInfo.openCheckTalentInfo();
  540. });
  541. TalentInfo.table = table.init();
  542. TalentInfo.init();
  543. // var defaultColunms = TalentInfo.initColumn();
  544. // var table = new KDTable(TalentInfo.id, "/talentInfo/list/1", defaultColunms);
  545. // table.setPaginationType("server");
  546. // TalentInfo.table = table.init();
  547. });