check.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. <!-- 导航栏开始-->
  7. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  8. <!-- 导航栏结束-->
  9. <div class="layout-gap">
  10. <section class="anc-top flex status_1 ">
  11. <div class="flex-one flex">
  12. <p class="anc-title">导入成绩</p>
  13. </div>
  14. <div class="anc-opt-btn green-font pointer give-up-check">重新上传</div>
  15. </section>
  16. <section class="anc-main-con">
  17. <!-- 检测状态部分 -->
  18. <ul class="anc-status-con " >
  19. <li class="anc-status-list now-status first <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
  20. <p class="status-top-msg">检查Excel</p>
  21. <p class="gray-font status-charact ">正在检查excel格式与模版是否一致...</p>
  22. </li>
  23. <?php if($need_check_name==1):?>
  24. <li class="anc-status-list second <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
  25. <p class="status-top-msg">
  26. <?php echo $check_field_name; ?>
  27. </p>
  28. <p class="gray-font status-charact"></p>
  29. </li>
  30. <?php endif;?>
  31. <li class="anc-status-list third <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
  32. <p class="status-top-msg">
  33. <?php if($need_check_name==1):?>
  34. 匹配学生信息
  35. <?php else:?>
  36. 检测<?php echo $check_field_name; ?>
  37. <?php endif;?>
  38. </p>
  39. <p class="gray-font status-charact">
  40. </p>
  41. </li>
  42. </ul>
  43. </section>
  44. <section class="anc-finish-opt gray-border-top" >
  45. <div class="anc-finish-btn save_result hide" >确认导入成绩</div>
  46. </section>
  47. </div>
  48. </div>
  49. <div class="anc-pop">
  50. <div class="confirm-pop-con">
  51. <div class="need-pop-top clearfix">
  52. <div class="npt-title put-need fl">提示</div>
  53. <div class="npt-close fr">×</div>
  54. </div>
  55. <div class="confirm-msg red-font tac">
  56. 确认要放弃本次上传的数据吗?
  57. </div>
  58. <div class="pop-btns">
  59. <div class="confirm-pop-btn-sure">确认</div>
  60. <div class="confirm-pop-btn-cancel cancel-btn">取消</div>
  61. </div>
  62. </div>
  63. </div>
  64. <script>
  65. $(function(){
  66. /*
  67. $('.begain-check-btn').click(function(){
  68. $('.anc-status-con').removeClass('hide');
  69. $(this).hide();
  70. $('.anc-index-msg').hide();
  71. loadStudent();
  72. });
  73. */
  74. checkFirst();
  75. //保存结果
  76. $('.save_result').click(function(){
  77. var l_index=layer.msg('导入中,请稍候......',{time:0});
  78. $.ajax({
  79. url:'<?php echo $this->createUrl('record/update_score')?>',
  80. dataType:'json',
  81. type:'POST',
  82. success:function(res){
  83. layer.close(l_index);
  84. if(res.status==1){
  85. layer.msg('导入成功',function(){
  86. window.location.href="<?php echo $this->createUrl('record/importscore')?>";
  87. });
  88. }else{
  89. layer.msg('导入失败');
  90. }
  91. }
  92. });
  93. });
  94. //第一步,检测数据
  95. function checkFirst(){
  96. var count=0;
  97. $.ajax({
  98. url:'<?php echo $this->createUrl('record/Check_field_first')?>',
  99. dataType:'json',
  100. type:'POST',
  101. success:function(res){
  102. if(res.status==1){
  103. $('.first').addClass('finish-status');
  104. $('.first').removeClass('now-status');
  105. $('.first .status-charact').html('检查完成,导入的excel格式正确');
  106. <?php if($need_check_name==1):?>
  107. checkAbnormal();
  108. <?php else:?>
  109. checkRepeat();
  110. <?php endif;?>
  111. }else{
  112. $('.first').addClass('error-status');
  113. $('.first').removeClass('now-status');
  114. $('.first .status-charact').html('导入的excel格式与模版不一致,请重新上传:'+res.msg);
  115. }
  116. }
  117. });
  118. }
  119. //第二步,姓名异常
  120. function checkAbnormal(){
  121. $('.second .status-charact').html('正在检测...');
  122. $('.second').addClass('now-status');
  123. $.ajax({
  124. url:'<?php echo $this->createUrl('record/check_student_name')?>',
  125. dataType:'json',
  126. type:'POST',
  127. success:function(res){
  128. if(res.status==1){
  129. count=res.count;
  130. $('.second .status-charact').html('检测完成,已为'+count+'名学生去除姓名中的非汉字字符');
  131. $('.second').addClass('finish-status');
  132. $('.second').removeClass('now-status');
  133. checkRepeat();
  134. }else{
  135. $('.second .status-charact').html('检测失败');
  136. $('.second').addClass('error-status');
  137. $('.second').removeClass('now-status');
  138. }
  139. }
  140. });
  141. }
  142. //第三步
  143. function checkRepeat(){
  144. $('.fourth .status-charact').html('正在检测...');
  145. $('.fourth').addClass('now-status');
  146. $.ajax({
  147. url:'<?php echo $this->createUrl('record/matching')?>',
  148. dataType:'json',
  149. type:'POST',
  150. success:function(res){
  151. if(res.status==1){
  152. var html='';
  153. if(res.repeat>0){
  154. html+='<p>重名学生<span class="handle"><a href="<?php echo $this->createUrl('record/handle_repeat')?>">'+res.repeat+'组</a></span></p>';
  155. }else{
  156. html+='<p>重名学生<span class="handle">'+res.repeat+'组</span></p>';
  157. }
  158. if(res.noExistent>0){
  159. html+='<p>学生在系统中不存在<span class="handle"><a href="<?php echo $this->createUrl('record/handle_existent')?>">'+res.noExistent+'人</a></span></p>';
  160. }else{
  161. html+='<p>学生在系统中不存在<span class="handle">'+res.noExistent+'人</span></p>';
  162. }
  163. html+='<p>匹配成功<span class="handle">'+res.success+'人</span></p>';
  164. $('.third .status-charact').html(html);
  165. if(res.repeat==0 && res.success>0){
  166. $('.save_result').removeClass('hide');
  167. }
  168. $('.third').addClass('now-status');
  169. }else{
  170. $('.third .status-charact').html('检测失败,请稍后再试');
  171. $('.third').addClass('error-status');
  172. $('.third').removeClass('now-status');
  173. }
  174. }
  175. });
  176. }
  177. $('.give-up-check').click(function(){
  178. $('.anc-pop').show()
  179. })
  180. $('.npt-close,.confirm-pop-btn-cancel').click(function(){
  181. $('.anc-pop').hide()
  182. })
  183. $('.confirm-pop-btn-sure').click(function () {
  184. $.ajax({
  185. url:'<?php echo $this->createUrl('record/giveup')?>',
  186. dataType:'json',
  187. type:'POST',
  188. success:function(res){
  189. if(res.status==1){
  190. $('.anc-pop').hide();
  191. window.location.href='<?php echo $this->createUrl('record/importscore')?>?exam_group_id='+res.data['exam_group_id']+'&check_field='+res.data['exam_group_id']+'&renew='+res.data['renew'];
  192. }else{
  193. $('.anc-pop').hide();
  194. }
  195. }
  196. });
  197. });
  198. })
  199. </script>