123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- <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">小贴士:1、新增了批量导入执教班级的功能,相同登录手机号的教师会根据表格内容更新信息;</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 width="1"></th>
- <th>A</th>
- <th>B</th>
- <th>C</th>
- <th>D</th>
- <th>E</th>
- <th>F</th>
- <th>G</th>
- <th>H</th>
- <th>I</th>
- <th class="hide custom_field_no">J</th>
- </tr>
- <tr>
- <th>1</th>
- <th><span class="red-font">*</span>教师姓名</th>
- <th><span class="red-font">*</span>登录手机号</th>
- <th><span class="red-font">*</span>学科</th>
- <th><span class="red-font">*</span>岗位</th>
- <th>职称</th>
- <th>执教班级</th>
- <th>教龄</th>
- <th>性别</th>
- <th>年级</th>
- <th class="hide custom_field"></th>
- </tr>
- <tr>
- <th>2</th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th class="hide custom_field_value"></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">
- <div>1、Excel中带“*”为必填字段,其他选填</div>
- <div>2、教师姓名:只能填写汉字、字母(支持“·”符号)</div>
- <div>3、手机号:作为教师登陆账号,必须唯一,由11位数字组成,帐号相同需进行手动修改【帐号初始密码:123456】</div>
- <div>4、学科:只能填写“数学”、“语文”、“英语”、“物理”、“化学”、“生物”、“政治”、“历史”、“地理”、“其它”或学校添加的自定义科目名称</div>
- <div>5、岗位:只能填写“校长”、“任课教师”、“年级主任”、“教研组长”、“班主任”</div>
- <div>6、职称:只能填写“三级教师”、“二级教师”、“一级教师”、“高级教师”</div>
- <div>7、执教班级:必须填写系统内有效的班级名称(注意:多个班级间需要用中文分号隔开,班级名称需要与系统内完全一致)</div>
- <div>8、教龄:只能填写数字</div>
- <div>9、性别:只能填写“男”或“女”,不填或填错默认为“男”</div>
- <?php if( Yii::app()->params['section']==0):?>
- <div>10、年级:岗位若填写年级主任,年级则必须填写,且只能填写阿拉伯数字,例如:“7”、“8”、“9”,分别代表“七年级”、“八年级”、“九年级”</div>
- <?php else:?>
- <div>10、年级:岗位若填写年级主任,年级则必须填写,且只能填写“1”、“2”、“3”,分别代表“高一”、“高二”、“高三”</div>
- <?php endif;?>
-
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-1">
- <a class="btn label-primary-green btn-sm" href="/assets/data/批量导入教师.xlsx">
- 下载excel模板
- </a>
- <div class="btn label-primary-green btn-sm select_file" >上传excel</div>
- <form id="form1" action="<?php echo $this->createUrl('teacher/import')?>" 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>
|