talentBasicChange_info.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /**
  2. * 初始化人才基础信息变更详情对话框
  3. */
  4. var TalentBasicChangeInfoDlg = {
  5. talentBasicChangeInfoData: {},
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. TalentBasicChangeInfoDlg.close = function () {
  11. parent.layer.close(window.parent.TalentBasicChange.layerIndex);
  12. }
  13. /**
  14. * 提交审核
  15. */
  16. TalentBasicChangeInfoDlg.showCheckModal = function () {
  17. var checkState = $("#checkState").val();
  18. if (checkState != 1 && checkState != 9) {
  19. Feng.info("不在审核范围内");
  20. return;
  21. }
  22. layer.open({
  23. type: 1,
  24. id: "checkModel",
  25. title: '审核',
  26. area: ['800px', '450px'], //宽高
  27. fix: false, //不固定
  28. shade: 0,
  29. maxmin: true,
  30. content: " <form id=\"checkForm\" style='margin: 5px'>\n" +
  31. " <div class=\"form-group\">\n" +
  32. " <label for=\"checkState\" class=\"control-label\">审核状态</label>\n" +
  33. " <select class=\"form-control\" id=\"checkStateNow\" onchange=\"TalentBasicChangeInfoDlg.toggleField()\">\n" +
  34. " <option value=\"\"></option>\n" +
  35. " <option value=\"3\">审核通过</option>\n" +
  36. " <option value=\"2\">审核驳回</option>\n" +
  37. " </select>\n" +
  38. " </div>\n" +
  39. " <div class=\"form-group\">\n" +
  40. " <label for=\"msg\" class=\"control-label\">审核意见</label>\n" +
  41. " <textarea class=\"form-control\" id=\"msg\" rows='6'></textarea>\n" +
  42. " </div>\n" +
  43. " </form>",
  44. btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
  45. btnAlign: 'c',
  46. zIndex: layer.zIndex,
  47. success: function () {
  48. $("#checkForm")[0].reset();
  49. },
  50. yes: function (index, layero) {
  51. var id = $("#id").val();
  52. var checkState = $("#checkStateNow").val();
  53. var msg = $("#msg").val();
  54. if (checkState == null || checkState == '') {
  55. Feng.error("请选择审核状态");
  56. return;
  57. }
  58. if (msg == null || msg == '') {
  59. Feng.error("请填写审核意见");
  60. return;
  61. }
  62. var operation = function () {
  63. var ajax = new $ax(Feng.ctxPath + "/admin/talentBasicChange/submitToCheck", function (data) {
  64. if (data.code == "200") {
  65. Feng.success(data.msg);
  66. window.parent.TalentBasicChange.table.refresh();
  67. layer.close(index);
  68. TalentBasicChangeInfoDlg.close();
  69. } else {
  70. Feng.error(data.msg);
  71. }
  72. }, function (data) {
  73. Feng.error("提交失败!" + data.responseJSON.message + "!");
  74. });
  75. ajax.setData({"id": id, "checkState": checkState, "checkMsg": msg});
  76. ajax.start();
  77. }
  78. Feng.confirm("一旦提交,无法修改,确认提交审核吗?", operation);
  79. }
  80. });
  81. }
  82. TalentBasicChangeInfoDlg.toggleField = function () {
  83. var checkState = $("#checkStateNow").val();
  84. if (checkState == 3) {
  85. $("#msg").val("审核通过。");
  86. } else if (checkState == 2) {
  87. $("#msg").val("");
  88. }
  89. }
  90. $(function () {
  91. var id = $("#id").val();
  92. $(".date").each(function () {
  93. laydate.render({
  94. elem: this,
  95. type: "date",
  96. range: true,
  97. trigger: "click"
  98. })
  99. })
  100. //批量加载字典表数据
  101. var arr = [
  102. {"name": "oldNationality", "code": "nationality"},
  103. {"name": "oldNation", "code": "nation"},
  104. {"name": "oldPolitics", "code": "politics"},
  105. {"name": "oldCardType", "code": "card_type"},
  106. {"name": "newNationality", "code": "nationality"},
  107. {"name": "newNation", "code": "nation"},
  108. {"name": "newPolitics", "code": "politics"},
  109. {"name": "newCardType", "code": "card_type"}
  110. ];
  111. Feng.findChildDictBatch(JSON.stringify(arr));
  112. //select初始化
  113. $("select").each(function () {
  114. $(this).val($(this).attr("value")).trigger("change");
  115. });
  116. Feng.getCheckLog("logTable", {"type": CONFIG.project_basicchange, "mainId": id, "typeFileId": "", "active": 1})
  117. $("input,select").attr("style", "pointer-events: none;background-color: #eee;");
  118. });