123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <style>
- .handle{float: right}
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="layout-gap">
- <section class="anc-top flex status_1 ">
- <div class="flex-one flex">
- <p class="anc-title">导入成绩</p>
- </div>
- <div class="anc-opt-btn green-font pointer give-up-check">重新上传</div>
- </section>
- <section class="anc-main-con">
- <!-- 检测状态部分 -->
- <ul class="anc-status-con " >
- <li class="anc-status-list now-status first <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
- <p class="status-top-msg">检查Excel</p>
- <p class="gray-font status-charact ">正在检查excel格式与模版是否一致...</p>
- </li>
- <?php if($need_check_name==1):?>
- <li class="anc-status-list second <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
- <p class="status-top-msg">
- <?php echo $check_field_name; ?>
- </p>
- <p class="gray-font status-charact"></p>
- </li>
- <?php endif;?>
- <li class="anc-status-list third <?php if(isset($is_last) && $is_last==1) echo 'finish-status'?>">
- <p class="status-top-msg">
- <?php if($need_check_name==1):?>
- 匹配学生信息
- <?php else:?>
- 检测<?php echo $check_field_name; ?>
- <?php endif;?>
- </p>
- <p class="gray-font status-charact">
- </p>
- </li>
- </ul>
- </section>
- <section class="anc-finish-opt gray-border-top" >
- <div class="anc-finish-btn save_result hide" >确认导入成绩</div>
- </section>
- </div>
- </div>
- <div class="anc-pop">
- <div class="confirm-pop-con">
- <div class="need-pop-top clearfix">
- <div class="npt-title put-need fl">提示</div>
- <div class="npt-close fr">×</div>
- </div>
- <div class="confirm-msg red-font tac">
- 确认要放弃本次上传的数据吗?
- </div>
- <div class="pop-btns">
- <div class="confirm-pop-btn-sure">确认</div>
- <div class="confirm-pop-btn-cancel cancel-btn">取消</div>
- </div>
- </div>
- </div>
- <script>
- $(function(){
- /*
- $('.begain-check-btn').click(function(){
- $('.anc-status-con').removeClass('hide');
- $(this).hide();
- $('.anc-index-msg').hide();
- loadStudent();
- });
- */
- checkFirst();
- //保存结果
- $('.save_result').click(function(){
- var l_index=layer.msg('导入中,请稍候......',{time:0});
- $.ajax({
- url:'<?php echo $this->createUrl('zhiliao/update_score')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- layer.close(l_index);
- if(res.status==1){
- layer.msg('导入成功',function(){
- window.location.href="<?php echo $this->createUrl('zhiliao/index')?>";
- });
- }else{
- layer.msg('导入失败');
- }
- }
- });
- });
- //第一步,检测数据
- function checkFirst(){
- var count=0;
- $.ajax({
- url:'<?php echo $this->createUrl('zhiliao/Check_field_first')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- $('.first').addClass('finish-status');
- $('.first').removeClass('now-status');
- $('.first .status-charact').html('检查完成,导入的excel格式正确');
- <?php if($need_check_name==1):?>
- checkAbnormal();
- <?php else:?>
- checkRepeat();
- <?php endif;?>
- }else{
- $('.first').addClass('error-status');
- $('.first').removeClass('now-status');
- $('.first .status-charact').html('导入的excel格式与模版不一致,请重新上传:'+res.msg);
- }
- }
- });
- }
- //第二步,姓名异常
- function checkAbnormal(){
- $('.second .status-charact').html('正在检测...');
- $('.second').addClass('now-status');
- $.ajax({
- url:'<?php echo $this->createUrl('zhiliao/check_student_name')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- count=res.count;
- $('.second .status-charact').html('检测完成,已为'+count+'名学生去除姓名中的非汉字字符');
- $('.second').addClass('finish-status');
- $('.second').removeClass('now-status');
- checkRepeat();
- }else{
- $('.second .status-charact').html('检测失败');
- $('.second').addClass('error-status');
- $('.second').removeClass('now-status');
- }
- }
- });
- }
- //第三步
- function checkRepeat(){
- $('.fourth .status-charact').html('正在检测...');
- $('.fourth').addClass('now-status');
- $.ajax({
- url:'<?php echo $this->createUrl('zhiliao/matching')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- var html='';
- if(res.repeat>0){
- html+='<p>重名学生<span class="handle"><a href="<?php echo $this->createUrl('zhiliao/handle_repeat')?>">'+res.repeat+'组</a></span></p>';
- }else{
- html+='<p>重名学生<span class="handle">'+res.repeat+'组</span></p>';
- }
- if(res.noExistent>0){
- html+='<p>学生在系统中不存在<span class="handle"><a href="<?php echo $this->createUrl('zhiliao/handle_existent')?>">'+res.noExistent+'人</a></span></p>';
- }else{
- html+='<p>学生在系统中不存在<span class="handle">'+res.noExistent+'人</span></p>';
- }
- html+='<p>匹配成功<span class="handle">'+res.success+'人</span></p>';
- $('.third .status-charact').html(html);
- if(res.repeat==0 && res.success>0){
- $('.save_result').removeClass('hide');
- }
- $('.third').addClass('now-status');
- }else{
- $('.third .status-charact').html('检测失败,请稍后再试');
- $('.third').addClass('error-status');
- $('.third').removeClass('now-status');
- }
- }
- });
- }
- $('.give-up-check').click(function(){
- $('.anc-pop').show()
- })
- $('.npt-close,.confirm-pop-btn-cancel').click(function(){
- $('.anc-pop').hide()
- })
- $('.confirm-pop-btn-sure').click(function () {
- $.ajax({
- url:'<?php echo $this->createUrl('zhiliao/giveup')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- $('.anc-pop').hide();
- window.location.href='<?php echo $this->createUrl('zhiliao/index')?>';
- }else{
- $('.anc-pop').hide();
- }
- }
- });
- });
- })
- </script>
|