educationSchool_check.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /**
  2. * 初始化子女就学详情对话框
  3. */
  4. var EducationSchoolInfoDlg = {
  5. educationSchoolInfoData: {},
  6. };
  7. /**
  8. * 关闭此对话框
  9. */
  10. EducationSchoolInfoDlg.close = function () {
  11. parent.layer.close(window.parent.EducationSchool.layerIndex);
  12. }
  13. /**
  14. * 项目选择变更
  15. * @param content
  16. */
  17. EducationSchoolInfoDlg.projectChange = function (content) {
  18. var project = $(content).val();
  19. if (Feng.isEmptyStr(project)) {
  20. $("#applySchool").parent().css("display", "none");
  21. }
  22. if (project == CONFIG.education_school) {
  23. $("#applySchool").parent().css("display", "block");
  24. }
  25. if (project == CONFIG.education_score) {
  26. $("#applySchool").parent().css("display", "none");
  27. }
  28. }
  29. /**
  30. * 显示审核
  31. */
  32. EducationSchoolInfoDlg.showCheckModal = function () {
  33. var ajax = new $ax(Feng.ctxPath + "/admin/education_school/validateIsCheck", function (data) {
  34. if (data.code == 200) {
  35. layer.open({
  36. type: 1,
  37. id: "neewFieldFormModel",
  38. title: '审核',
  39. area: ['800px', '450px'], //宽高
  40. fix: false, //不固定
  41. shade: 0,
  42. maxmin: true,
  43. content: EducationSchoolInfoDlg.creatFieldCheckModal(),
  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 (layero, index) {
  48. layer.setTop(layero);
  49. $("#checkStateModel").val(data.obj.checkState);
  50. $("#checkMsg").val(data.obj.checkMsg);
  51. },
  52. yes: function (index, layero) {
  53. EducationSchoolInfoDlg.check(index);
  54. }
  55. });
  56. } else {
  57. Feng.error(data.msg);
  58. }
  59. }, function (data) {
  60. Feng.error("校验失败!" + data.responseJSON.message + "!");
  61. });
  62. ajax.setData({"id": $("#id").val()})
  63. ajax.start();
  64. }
  65. /**
  66. * 审核
  67. * @param index
  68. */
  69. EducationSchoolInfoDlg.check = function (index) {
  70. var checkState = $("#checkStateModel").val();
  71. var checkMsg = $("#checkMsg").val();
  72. if (checkState == null || checkState == '') {
  73. Feng.info("请选择审核状态");
  74. return;
  75. }
  76. if (checkMsg == null || checkMsg == '') {
  77. Feng.info("请填写审核意见");
  78. return;
  79. }
  80. var ajax = new $ax(Feng.ctxPath + "/admin/education_school/check", function (data) {
  81. if (data.code == 200) {
  82. layer.close(index);
  83. Feng.success(data.msg);
  84. } else {
  85. Feng.error(data.msg);
  86. }
  87. locked = false;
  88. }, function (data) {
  89. Feng.error("审核失败!" + data.responseJSON.message + "!");
  90. locked = false;
  91. });
  92. ajax.setData({"id": $("#id").val(), "checkState": checkState, "checkMsg": checkMsg});
  93. ajax.start();
  94. }
  95. /**
  96. * 提交审核
  97. */
  98. EducationSchoolInfoDlg.submitCheck = function () {
  99. var checkState = $("#checkState").val();
  100. if (checkState != 1 && checkState != 9) {
  101. Feng.info("不在审核范围内");
  102. return;
  103. }
  104. var operation = function () {
  105. var ajax = new $ax(Feng.ctxPath + "/admin/education_school/submitCheck", function (data) {
  106. if (data.code == 200) {
  107. Feng.success(data.msg);
  108. window.parent.EducationSchool.table.refresh();
  109. EducationSchoolInfoDlg.close();
  110. } else {
  111. Feng.error(data.msg);
  112. }
  113. }, function (data) {
  114. Feng.error("提交审核失败!" + data.responseJSON.message + "!");
  115. });
  116. ajax.setData({"id": $("#id").val()});
  117. ajax.start();
  118. }
  119. Feng.confirm("一旦提交无法修改,是否审核完毕且无误?", operation);
  120. }
  121. /**
  122. *
  123. */
  124. EducationSchoolInfoDlg.creatFieldCheckModal = function () {
  125. return '<form id="checkForm">\n' +
  126. ' <div class="form-group" style="margin: 10px;">\n' +
  127. ' <label for="checkState" class="control-label">审核状态</label>\n' +
  128. ' <select class="form-control" id="checkStateModel" >\n' +
  129. ' <option value="">请选择</option>\n' +
  130. ' <option value="3">审核通过</option>\n' +
  131. ' <option value="2">审核驳回</option>\n' +
  132. ' </select>\n' +
  133. ' </div>\n' +
  134. ' <div class="form-group" style="margin: 10px;">\n' +
  135. ' <label for="checkMsg" class="control-label" >审核意见</label>\n' +
  136. ' <textarea class="form-control" id="checkMsg" rows="6"></textarea>\n' +
  137. ' </div>\n' +
  138. ' </form>';
  139. }
  140. $(function () {
  141. Feng.initValidatorTip("educationSchoolForm", EducationSchoolInfoDlg.validateFields);
  142. //批量加载字典表数据
  143. var arr = [
  144. {"name": "companyStreet", "code": "street"},
  145. {"name": "houseStreet", "code": "street"},
  146. {"name": "talentArrange", "code": "talent_arrange"},
  147. {"name": "cRelation", "code": "education_relation"},
  148. {"name": "nowGrade", "code": "education_grade"},
  149. {"name": "project", "code": "education_project"},
  150. {"name": "applySchool", "code": "education_school_pool"}];
  151. Feng.findChildDictBatch(JSON.stringify(arr));
  152. $("#applySchool").on('chosen:ready', function (e, params) {
  153. $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
  154. });
  155. $("#applySchool").chosen({
  156. search_contains: true,    //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
  157. disable_search: false,
  158. width: "100%",
  159. enable_split_word_search: true
  160. });
  161. $("select").each(function () {
  162. $(this).val($(this).attr("value")).trigger("change").trigger("chosen:updated");
  163. });
  164. var id = $("#id").val();
  165. Feng.getCheckLog("logTable", {"type": CONFIG.project_school, "mainId": id, "typeFileId": "", "active": 1})
  166. Feng.showMiniFileModal(CONFIG.project_school, $("#type").val(), $("#id").val());
  167. });