123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <style>
- .handle{float: right}
- .font-center th{text-align: center!important;}
- .green-font{font-size: 12px;}
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="layout-gap">
- <section class="anc-top flex status_1 ">
- <div class="flex-one flex">
- <p class="anc-title">导入班级 <span class="blue green-font">小贴士:新增了批量导入班级的功能,请按模板要求在excel表格内填写班级信息进行上传,班级执教老师需通过教师批量导入进行班级匹配。</span></p>
- </div>
- </section>
- <section class="anc-main-con">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-1 no-padding-right">模板示例<span class="errorMessage">*</span>:</label>
- <div class="col-sm-11">
- <table id="template" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable font-center">
- <tr>
- <th><span class="red">*</span>班级名称</th>
- <th><span class="red">*</span>年级</th>
- <th><span class="red">*</span>层级</th>
- <?php if(Yii::app()->params['section']==1):?>
- <th><span class="red">*</span>文理科</th>
- <?php endif;?>
- <th><span class="red">*</span>班主任</th>
- <th><span class="red">*</span>班主任电话</th>
- <th><span class="red">*</span>学科</th>
- <th><span class="red">*</span>老师</th>
- <th><span class="red">*</span>教师电话</th>
- </tr>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- <?php if(Yii::app()->params['section']==1):?>
- <th></th>
- <?php endif;?>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
-
- </tr>
- </table>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-1 no-padding-right">填写须知<span class="errorMessage">*</span>:</label>
- <div class="col-sm-11">
- <?php if(Yii::app()->params['section']==1):?>
- <div>1、Excel中带“*”为必填字段</div>
- <div>2、表格以及系统内班级名称不能重复</div>
- <div>3、年级只能填写“1”、“2”、“3”,分别代表“高一”、“高二”、高三</div>
- <div>4、层级只能填写“A”、“B”、“C”</div>
- <div>5、文理科只能填写“不分科”、“文科”、“理科”</div>
- <div>6、班主任与班主任电话要与系统内相匹配</div>
- <div>7、学科、老师和老师电话要与系统内相匹配(注意:上传学科老师时,每一行添加一位学科老师,当一个班级添加多学科老师时,班级名称、年级等需合并单元格)</div>
- <?php elseif(Yii::app()->params['section']==3):?>
- <div>1、Excel中带“*”为必填字段</div>
- <div>2、表格以及系统内班级名称不能重复</div>
- <div>3、年级只能填写“10”、“11”、“12”,分别代表“高一”、“高二”、高三</div>
- <div>4、层级只能填写“A”、“B”、“C”</div>
- <div>5、班主任与班主任电话要与系统内相匹配</div>
- <div>6、学科、老师和老师电话要与系统内相匹配(注意:上传学科老师时,每一行添加一位学科老师,当一个班级添加多学科老师时,班级名称、年级等需合并单元格)</div>
- <?php else:?>
- <div>1、Excel中带“*”为必填字段</div>
- <div>2、表格以及系统内班级名称不能重复</div>
- <div>3、年级只能填写阿拉伯数字,例如:“7”、“8”、“9”,分别代表“七年级”、“八年级”、“九年级”</div>
- <div>4、层级只能填写“A”、“B”、“C”</div>
- <div>5、班主任与班主任电话要与系统内相匹配</div>
- <div>7、学科、老师和老师电话要与系统内相匹配(注意:上传学科老师时,每一行添加一位学科老师,当一个班级添加多学科老师时,班级名称、年级等需合并单元格)</div>
- <?php endif;?>
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-1">
- <?php if(Yii::app()->params['section']==1):?>
- <a class="btn label-primary-green btn-sm" href="/assets/data/bulk_import_class.xls">
- 下载excel模板
- </a>
- <?php else:?>
- <a class="btn label-primary-green btn-sm" href="/assets/data/bulk_import_class_section0.xls">
- 下载excel模板
- </a>
- <?php endif;?>
- <div class="btn label-primary-green btn-sm select_file" >上传excel</div>
- <form id="form1" action="<?php echo $this->createUrl('classes/classImport')?>" method="post" enctype="multipart/form-data">
- <input type="file" name="file" id="uploadFile" style="display: none">
- </form>
- </div>
- </div>
- <div class="clearfix form-actions">
- </div>
- </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('record/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('record/importscore')?>";
- });
- }else{
- layer.msg('导入失败');
- }
- }
- });
- });
- //第一步,检测数据
- // function checkFirst(){
- // var count=0;
- // $.ajax({
- // url:'<?php //echo $this->createUrl('record/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('record/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('record/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('record/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('record/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('record/giveup')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- $('.anc-pop').hide();
- window.location.href='<?php echo $this->createUrl('record/importscore')?>';
- }else{
- $('.anc-pop').hide();
- }
- }
- });
- });
- $('#uploadFile').val('');
- $('.select_file').click(function(){
- $('#uploadFile').click();
- });
- $('#uploadFile').change(function(){
- if($('#uploadFile').val()!=''){
- $('#form1').submit();
- }
- });
- })
- </script>
|