check.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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')?>',
  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/matching')?>',
  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_existent')?>">'+res.noExistent+'组</a></span></p>';
  118. }else{
  119. html+='<p>班级名称与系统中不一致<span class="handle">'+res.noExistent+'组</span></p>';
  120. }
  121. if(res.studentCard>0){
  122. html+='<p>系统准考证号不正确<span class="handle"><a href="<?php echo $this->createUrl('importstudent/handle_existent_card')?>">'+res.studentCard+'人</a></span></p>';
  123. }
  124. if(res.repeat>0){
  125. html+='<p>重名学生<span class="handle"><a href="<?php echo $this->createUrl('importstudent/handle_repeat')?>">'+res.repeat+'组</a></span></p>';
  126. }else{
  127. html+='<p>重名学生<span class="handle">'+res.repeat+'组</span></p>';
  128. }
  129. html+='<p>匹配成功<span class="handle"><a href="<?php echo $this->createUrl("importstudent/normal")?>">'+res.success+'人</span></p>';
  130. $('.third .status-charact').html(html);
  131. if(res.repeat==0 && res.success>0){
  132. $('.save_result').removeClass('hide');
  133. }
  134. $('.third').addClass('now-status');
  135. }else{
  136. $('.third .status-charact').html('检测失败,请稍后再试');
  137. $('.third').addClass('error-status');
  138. $('.third').removeClass('now-status');
  139. }
  140. }
  141. });
  142. }
  143. $('.give-up-check').click(function(){
  144. $('.anc-pop').show()
  145. })
  146. $('.npt-close,.confirm-pop-btn-cancel').click(function(){
  147. $('.anc-pop').hide()
  148. })
  149. $('.confirm-pop-btn-sure').click(function () {
  150. $.ajax({
  151. url:'<?php echo $this->createUrl('importstudent/giveup')?>',
  152. dataType:'json',
  153. type:'POST',
  154. success:function(res){
  155. if(res.status==1){
  156. $('.anc-pop').hide();
  157. window.location.href='<?php echo $this->createUrl('importstudent/index')?>';
  158. }else{
  159. $('.anc-pop').hide();
  160. }
  161. }
  162. });
  163. });
  164. $('.save_result').click(function(){
  165. window.location.href="<?php echo $this->createUrl('importstudent/confirm_import')?>";
  166. });
  167. })
  168. </script>