enterprise_examine.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. var EpExam = {};
  2. var locked = false;
  3. EpExam.save = function (submit) {
  4. var id = $("#id").val();
  5. var checkState = $("#checkState").val();
  6. var checkMsg = $("#checkMsg").val();
  7. if (checkState == null || checkState == "") {
  8. Feng.info("请选择审核状态");
  9. return;
  10. }
  11. if (checkMsg == null || checkMsg == "") {
  12. Feng.info("请填写审核意见");
  13. return;
  14. }
  15. if ((checkState == 2 || checkState == 5) && $("#field input[type=checkbox]:checked").length == 0) {
  16. Feng.info("请选择驳回修改的字段或者附件");
  17. return;
  18. }
  19. var fieldCount = $("#field_info input[type=checkbox]:checked").length;
  20. var fields = new Array();
  21. for (var i = 0; i < fieldCount; i++) {
  22. fields.push($("#field_info input[type=checkbox]:checked").eq(i).val());
  23. }
  24. var fileCount = $("#field_file input[type=checkbox]:checked").length;
  25. var files = new Array();
  26. for (var i = 0; i < fileCount; i++) {
  27. files.push($("#field_file input[type=checkbox]:checked").eq(i).val());
  28. }
  29. var da = {"id": id, "checkState": checkState, "checkMsg": checkMsg, fields: fields, files: files, submit: submit};
  30. //var operation = function () {
  31. var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doExamine", function (data) {
  32. if (data.code == 200) {
  33. if (submit) {
  34. window.parent.Enterprise.table.refresh();
  35. parent.layer.closeAll();
  36. }
  37. }
  38. Feng.info(data.msg);
  39. }, function (data) {
  40. Feng.error("操作失败!" + data.responseJSON.message + "!");
  41. });
  42. ajax.set(da);
  43. ajax.start();
  44. //};
  45. //Feng.confirm("确定提交吗?", operation);
  46. }
  47. EpExam.addSubmit = function () {
  48. EpExam.save(0);
  49. };
  50. EpExam.submitToCheck = function () {
  51. EpExam.save(1);
  52. };
  53. EpExam.submitToReject = function () {
  54. var id = $("#id").val();
  55. var checkMsg = $("#checkMsg").val();
  56. if (checkMsg == null || checkMsg == "") {
  57. Feng.info("请填写审核意见");
  58. return;
  59. }
  60. if ($("#field input[type=checkbox]:checked").length == 0) {
  61. Feng.info("请选择驳回修改的字段或者附件");
  62. return;
  63. }
  64. var fieldCount = $("#field_info input[type=checkbox]:checked").length;
  65. var fields = new Array();
  66. for (var i = 0; i < fieldCount; i++) {
  67. fields.push($("#field_info input[type=checkbox]:checked").eq(i).val());
  68. }
  69. var fileCount = $("#field_file input[type=checkbox]:checked").length;
  70. var files = new Array();
  71. for (var i = 0; i < fileCount; i++) {
  72. files.push($("#field_file input[type=checkbox]:checked").eq(i).val());
  73. }
  74. var da = {"id": id, "checkMsg": checkMsg, fields: fields, files: files};
  75. var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doReject", function (data) {
  76. if (data.code == 200) {
  77. window.parent.Enterprise.table.refresh();
  78. parent.layer.closeAll();
  79. }
  80. Feng.info(data.msg);
  81. }, function (data) {
  82. Feng.error("操作失败!" + data.responseJSON.message + "!");
  83. });
  84. ajax.set(da);
  85. ajax.start();
  86. }
  87. EpExam.checkAll = function () {
  88. $("#field input[type=checkbox]").prop("checked", true);
  89. }
  90. EpExam.unCheckAll = function () {
  91. $("#field input[type=checkbox]").removeAttr("checked");
  92. }
  93. EpExam.toggleField = function () {
  94. var type = $("#type").val();
  95. var checkState = $("#checkState").val();
  96. var checkMsg = $("#checkMsg").val();
  97. var typeName = "";
  98. if (type == 5) {
  99. typeName = "医院";
  100. } else if (type == 6) {
  101. typeName = "学校";
  102. } else {
  103. typeName = "机构账号";
  104. }
  105. if (checkState == 3) {
  106. $("#field").css("display", "none");
  107. if (checkMsg == null || checkMsg == '') {
  108. $("#checkMsg").val(typeName + "注册审核通过。");
  109. }
  110. } else if (checkState == 2 || checkState == 5) {
  111. $("#checkMsg").val("");
  112. $("#field").css("display", "block");
  113. } else {
  114. $("#field").css("display", "none");
  115. }
  116. }