check_classified.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
  2. <style>
  3. .handle{float: right}
  4. </style>
  5. <div class="main-content-inner">
  6. <ul class="clearfix main-content-inner-ul">
  7. <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
  8. <li class="pull-left">
  9. <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学期管理</button>
  10. <img src="/images/line.jpg" style="height:45px;" />
  11. </li>
  12. <?php }?>
  13. <li class="pull-left">
  14. <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" data-button="red">教师管理</button>
  15. <img src="/images/line.jpg" style="height:45px;" />
  16. </li>
  17. <li class="pull-left">
  18. <button onclick='location.href="<?php echo $this->createUrl("classes/index");?>"' class="button button_normal button_group button_arrow" data-button="red">班级管理</button>
  19. <img src="/images/line.jpg" style="height:45px;" />
  20. </li>
  21. <li class="pull-left">
  22. <button onclick='location.href="<?php echo $this->createUrl("studentinfo/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">学生管理</button>
  23. <img src="/images/line.jpg" style="height:45px;" />
  24. </li>
  25. <li class="pull-left">
  26. <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
  27. <img src="/images/line.jpg" style="height:45px;" />
  28. </li>
  29. </ul>
  30. <div class="layout-gap">
  31. <section class="anc-top flex status_1 ">
  32. <div class="flex-one flex">
  33. <p class="anc-title">导入教学班学生</p>
  34. </div>
  35. <div class="anc-opt-btn green-font pointer give-up-check">重新上传</div>
  36. </section>
  37. <section class="anc-main-con">
  38. <!-- 检测状态部分 -->
  39. <ul class="anc-status-con " >
  40. <li class="anc-status-list now-status first finish-status">
  41. <p class="status-top-msg">检查Excel</p>
  42. <p class="gray-font status-charact ">检查完成,导入的excel格式正确</p>
  43. </li>
  44. <li class="anc-status-list second <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
  45. <p class="status-top-msg">
  46. 检查学生姓名
  47. </p>
  48. <p class="gray-font status-charact"></p>
  49. </li>
  50. <li class="anc-status-list third <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
  51. <p class="status-top-msg">
  52. 匹配行政班学生
  53. </p>
  54. <p class="gray-font status-charact">
  55. </p>
  56. </li>
  57. </ul>
  58. </section>
  59. <section class="anc-finish-opt gray-border-top" >
  60. <!--<div class="anc-finish-btn save_result hide" >确认导入</div>-->
  61. </section>
  62. </div>
  63. </div>
  64. <div class="anc-pop">
  65. <div class="confirm-pop-con">
  66. <div class="need-pop-top clearfix">
  67. <div class="npt-title put-need fl">提示</div>
  68. <div class="npt-close fr">×</div>
  69. </div>
  70. <div class="confirm-msg red-font tac">
  71. 确认要放弃本次上传的数据吗?
  72. </div>
  73. <div class="pop-btns">
  74. <div class="confirm-pop-btn-sure">确认</div>
  75. <div class="confirm-pop-btn-cancel cancel-btn">取消</div>
  76. </div>
  77. </div>
  78. </div>
  79. <script>
  80. $(function(){
  81. checkAbnormal();
  82. //第一步,检测数据
  83. function checkAbnormal(){
  84. $('.second .status-charact').html('正在检测...');
  85. $('.second').addClass('now-status');
  86. $.ajax({
  87. url:'<?php echo $this->createUrl('importstudent/check_student_name_classified')?>',
  88. dataType:'json',
  89. type:'POST',
  90. success:function(res){
  91. if(res.status==1){
  92. count=res.count;
  93. $('.second .status-charact').html('检测完成,已为'+count+'名学生去除姓名中的非汉字字符');
  94. $('.second').addClass('finish-status');
  95. $('.second').removeClass('now-status');
  96. checkRepeat();
  97. }else{
  98. $('.second .status-charact').html('检测失败');
  99. $('.second').addClass('error-status');
  100. $('.second').removeClass('now-status');
  101. }
  102. }
  103. });
  104. }
  105. //第三步
  106. function checkRepeat(){
  107. $('.fourth .status-charact').html('正在检测...');
  108. $('.fourth').addClass('now-status');
  109. $.ajax({
  110. url:'<?php echo $this->createUrl('importstudent/matchingClassified')?>',
  111. dataType:'json',
  112. type:'POST',
  113. success:function(res){
  114. if(res.status==1){
  115. var html='';
  116. if(res.noExistent>0){
  117. html+='<p>班级名称不匹配<span class="handle"><a href="<?php echo $this->createUrl('importstudent/handle_classified_existent')?>">'+res.noExistent+'组</a></span></p>';
  118. }else{
  119. html+='<p>班级名称不匹配<span class="handle">'+res.noExistent+'组</span></p>';
  120. }
  121. if(res.repeat>0){
  122. html+='<p>匹配失败<span class="handle"><a href="<?php echo $this->createUrl('importstudent/handleClassifiedCard')?>">'+res.repeat+'组</a></span></p>';
  123. }else{
  124. html+='<p>匹配失败<span class="handle">'+res.repeat+'组</span></p>';
  125. }
  126. html+='<p>匹配成功<span class="handle"><a href="<?php echo $this->createUrl("importstudent/normalClassified")?>">'+res.success+'人</span></p>';
  127. $('.third .status-charact').html(html);
  128. if(res.repeat==0 && res.success>0){
  129. $('.save_result').removeClass('hide');
  130. }
  131. $('.third').addClass('now-status');
  132. }else{
  133. $('.third .status-charact').html('检测失败,请稍后再试');
  134. $('.third').addClass('error-status');
  135. $('.third').removeClass('now-status');
  136. }
  137. }
  138. });
  139. }
  140. $('.give-up-check').click(function(){
  141. $('.anc-pop').show()
  142. })
  143. $('.npt-close,.confirm-pop-btn-cancel').click(function(){
  144. $('.anc-pop').hide()
  145. })
  146. $('.confirm-pop-btn-sure').click(function () {
  147. $.ajax({
  148. url:'<?php echo $this->createUrl('importstudent/giveup')?>',
  149. dataType:'json',
  150. type:'POST',
  151. success:function(res){
  152. if(res.status==1){
  153. $('.anc-pop').hide();
  154. window.location.href='<?php echo $this->createUrl('importstudent/importStudentClassified')?>';
  155. }else{
  156. $('.anc-pop').hide();
  157. }
  158. }
  159. });
  160. });
  161. $('.save_result').click(function(){
  162. window.location.href="<?php echo $this->createUrl('importstudent/confirm_classified_import')?>";
  163. });
  164. })
  165. </script>