123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <style>
- html {overflow-y: scroll;}
- </style>
- <div class="main-content-inner">
- <ul class="clearfix main-content-inner-ul">
- <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学期管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php }?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" data-button="red">教师管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("classes/index");?>"' class="button button_normal button_group button_arrow" data-button="red">班级管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("studentinfo/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">学生管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- </ul>
- <div class="layout-gap">
- <section class="hrn-top flex">
- <div class="flex-one hrn-top-title fw">重名学生</div>
- <div class="green-font pointer" onclick="javascript:history.go(-1);">返回</div>
- </section>
- <section class="flex hrn-main-con">
- <article class="menu-list-con">
- <div class="menu-list-top">
- <span class="green-font pointer fw prev-menu-page vtm" rel="<?php echo $page;?>"><</span>
- <span class="vtm showpage">第<?php echo $page;?>页</span>
- <span class="green-font pointer fw next-menu-page vtm" rel="<?php echo $page;?>">></span>
- <span class="vtm totalpage">共<?php echo $total_page;?>页</span>
- <input type="hidden" name="total_page" value="<?php if(isset($total_page)) echo $total_page?>">
- </div>
- <div class="search-opt">
- <div class="search-inp vtm">
- <input type="text" name="name_like" placeholder="姓名关键字" class="search-key-value">
- <div class="clear-search-value pointer">×</div>
- </div>
- <img src="/images/search.png" alt="" class="search-btn-img pointer vtm">
- </div>
- <ul class="name-key-datas">
- <?php
- if(isset($name_group)){
- foreach ($name_group as $key=> $val){
- ?>
- <li class="name-key-list flex">
- <div class="flex-one"><?php echo $val['modify_name'];?></div>
- <div class="gray-font"><?php echo $val['count'];?></div>
- </li>
- <?php
- }
- }
- ?>
- </ul>
- </article>
- <article class="flex-one handle-detail-con">
- <div class="handle-detail-top flex">
- <div class="flex-one">
- <p>处理步骤:</p>
- <p class="gray-font">第1步、关联账号:若同一学生在不同学期创建了多个账号,请拖动之前学期学生的卡片到最近学期对应的学生卡片上,拖动结束则学生账号关联</p>
- <p class="gray-font">第2步、区分重名:当前学期学生若重名,请录入学生身份证号加以区分</p>
- <p class="gray-font">第3步、忽略:若是已经毕业的学生,可直接选择忽略本学期操作,不过下次检测还是会出现,但不影响其他功能使用(此功能只针对18年以前的开放)</p>
- </div>
- <div class="check-btn pointer">检查</div>
- </div>
- <div class="handle-detail-main">
- </div>
- </article>
- </section>
- </div>
- </div>
- <div class="history-pop">
- <div class="history-pop-con">
- <div class="need-pop-top clearfix">
- <div class="npt-title put-need fl">查看历史成绩</div>
- <div class="npt-close fr">×</div>
- </div>
- <table class="history-mark-table">
- <thead class="fw">
- <td>考试日期</td>
- <td>试卷名称</td>
- <td>我的得分</td>
- <td>班级平均分</td>
- <td>年级平均分</td>
- <td>班级排名</td>
- <td>年级排名</td>
- </thead>
- <tbody id="exam_list">
- </tbody>
- </table>
- </div>
- </div>
- <div class="countermark-pop">
- <div class="countermark-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="flex relative">
- <img src="/images/prev-arrow.png" alt="" class="prev-arrow-pop arrow-img pointer">
- <div class="countermark-datas flex-one">
- <ul class="clearfix countermark-list-detail">
- </ul>
- </div>
- <img src="/images/next-arrow.png" alt="" class="next-arrow-pop arrow-img pointer">
- </div>
- </div>
- </div>
- <div class="relate-sure-pop">
- <div class="relate-sure-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>
- </div>
- </div>
- <div class="pop-sec-time">处理成功!即将进入下一组</div>
- <script>
- $(function(){
- var data,idxStar,idxEnd,startCardId,endCardId;
- var now_name; //当前正在处理的哪一组
- var now_menu_index=0;
- //默认加载第一组
- next_name=$('.name-key-datas').find('li').eq(0).find('.flex-one').html();
- loadStudent(next_name,now_menu_index);
- //分页
- $('.prev-menu-page').click(function () {
- var page=$(this).attr('rel');
- var name_like=$.trim($('input[name=name_like]').val());
- if(page==1){
- return false;
- }
- loadmenu(page-1,name_like,'');
- });
- $('.next-menu-page').click(function(){
- var total_page=parseInt($('input[name=total_page]').val());
- var page=parseInt($(this).attr('rel'));
- var name_like=$.trim($('input[name=name_like]').val());
- if((page+1)>total_page){
- return false;
- }
- loadmenu(page+1,name_like,'');
- });
- $('.search-btn-img').click(function(){
- var name_like=$.trim($('.search-key-value').val());
- loadmenu(1,name_like,'');
- });
- $('.name-key-datas')
- .on('click','.flex-one',function(){
- var name=$(this).html();
- loadStudent(name,$(this).closest('.name-key-list').index());
- });
- function loadmenu(page,name_like,next_name){
- page=parseInt(page);
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/handledata')?>',
- type:'POST',
- data:{'page':page,'name':name_like},
- dataType:'json',
- success:function(res){
- if(res.status==1){
- var html='';
- for(var i=0;i<res.data.length;i++){
- html+='<li class="name-key-list flex">';
- html+='<div class="flex-one">'+res.data[i]['modify_name']+'</div>';
- html+='<div class="gray-font">'+res.data[i]['count']+'</div>';
- html+='</li>';
- }
- $('.name-key-datas').html(html);
- $('.prev-menu-page').attr('rel',page);
- $('.next-menu-page').attr('rel',page);
- $('.showpage').html('第'+(page)+'页');
- $('.totalpage').html('共'+res.total_page+'页');
- $('input[name=total_page]').val(res.total_page);
- if(next_name!=''){
- loadStudent(next_name,now_menu_index);
- }
- }
- }
- });
- }
- function loadStudent(name,index){
- if(name==''){
- return false;
- }
- $('.pop-sec-time').html('正在加载中。。。。。。');
- $('.pop-sec-time').show();
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/showrepeatstudent')?>',
- type:'POST',
- data:{'name':name},
- dataType:'json',
- success:function(res){
- if(res.status==1){
- $('.handle-detail-main').html(res.data);
- now_name=name;
- now_menu_index=index;
- }
- $('.pop-sec-time').hide();
- }
- });
- }
- function arrowImgShow() {
- $('.handel-term-list').each(function(){
- if ($(this).find('.term-card-list').length<4) {
- $(this).find('.arrow-img').hide();
- } else {
- $(this).find('.arrow-img').show();
- }
- })
- }
- arrowImgShow();
- $(document)
- .on('click','.toggle-opt-btn',function(){
- if ($(this).text()=='展开') {
- $(this).text('收起')
- } else {
- $(this).text('展开')
- }
- $(this).closest('.term-card-list').find('.hide-list').toggle();
- })
- .on('click','.prev-arrow',function(){
- var leftNum = $(this).next('.term-card-layout').find('.term-card-detail').position().left-40;
- var lisWidth = $(this).next('.term-card-layout').find('.term-card-detail li').width();
- if (leftNum==0) {
- alert('已经是第一条了')
- } else {
- $(this).next('.term-card-layout').find('.term-card-detail').css('left',leftNum+lisWidth);
- $('.hide-list').hide();
- $('.toggle-opt-btn').text('展开');
- }
- })
- .on('click','.next-arrow',function(){
- var listLen = $(this).prev('.term-card-layout').find('.term-card-detail li').length;
- var leftNum = $(this).prev('.term-card-layout').find('.term-card-detail').position().left-40;
- var lisWidth = $(this).prev('.term-card-layout').find('.term-card-detail li').width();
- if (listLen<3||listLen==3||leftNum/(listLen-3)==-lisWidth||leftNum/(listLen-3)<-lisWidth) {
- alert('已经是最后第一条了')
- } else {
- $(this).prev('.term-card-layout').find('.term-card-detail').css('left',leftNum-lisWidth);
- $('.hide-list').hide();
- $('.toggle-opt-btn').text('展开');
- }
- })
- .on('click','.edit-icon',function(){
- $(this).hide().next('.edit-self-no').show();
- })
- .on('blur','.edit-self-no',function(){
- var reg=/^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/;
- if (reg.test($(this).val())) {
- var student_id=$(this).attr('data');
- var id_number=$(this).val();
- var obj=$(this);
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/saveidnumber')?>',
- type:'POST',
- dataType:'json',
- data:{'student_id':student_id,'id_number':id_number},
- success:function(res){
- if(res.status==1){
- alert('保存成功!')
- }else{
- obj.val('');
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- layer.msg('保存失败');
- }
- }
- }
- });
- } else {
- alert('身份证号码有误!')
- }
- })
- .on('click','.browse-history',function(){
- var student_id=$(this).attr('rel');
- console.log(student_id);
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/gethistoryscore')?>',
- type:'POST',
- dataType:'json',
- data:{'student_id':student_id},
- success:function(res){
- if(res.status==1){
- var list=res.data,html='';
- for(var i=0;i<list.length;i++){
- html+='<tr>';
- html+='<td>'+list[i]['exam_date']+'</td>';
- html+='<td>'+list[i]['exam_name']+'</td>';
- html+='<td>'+list[i]['score']+'</td>';
- html+='<td>'+list[i]['class_avg']+'</td>';
- html+='<td>'+list[i]['grade_avg']+'</td>';
- html+='<td>'+list[i]['class_rank']+'</td>';
- html+='<td>'+list[i]['grade_rank']+'</td>';
- html+='</tr>';
- }
- $('#exam_list').html(html);
- $('.history-pop').show();
- }
- }
- });
- })
- .on('click','.fuhao-lock',function(){
- var student_id=$(this).attr('rel');
- var fuhao_number=parseInt($(this).html());
- if(fuhao_number>0){
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/getslaves')?>',
- type:'POST',
- dataType:'json',
- data:{'student_id':student_id},
- success:function(res){
- if(res.status==1){
- $('.countermark-list-detail').html(res.data);
- if ($('.countermark-list-detail li').length<3) {
- $('.countermark-pop-con').find('.arrow-img').hide()
- }
- $('.countermark-pop').show();
- }
- }
- });
- }
- })
- .on('click','.relieve-relate',function(){
- var student_id=$(this).attr('rel');
- var name=$(this).attr('data');
- if(student_id=='' || student_id==undefined){
- return false;
- }
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/cancelrelation')?>',
- dataType:'json',
- type:'POST',
- data:{'student_id':student_id},
- success:function(res){
- if(res.status==1){
- $('.countermark-pop').hide();
- loadStudent(name);
- }
- }
- });
- })
- .on('click','.term-name span',function(){
- //忽略功能
- var semester=$(this).attr('semester');
- var name=now_name;
- var obj=$(this);
- layer.msg('忽略后该学期姓名为:'+name+' 的学生将不再参与检测,确定吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/ignore')?>',
- dataType:'json',
- type:'POST',
- data:{'name':name,'semester':semester},
- success:function(res){
- if(res.status==1){
- obj.closest('.handel-term-list').remove();
- layer.msg('操作成功');
- }else{
- layer.msg('操作失败');
- }
- }
- });
- }
- });
- })
- $('.check-btn').click(function(){
- //开始检测
- $maxIndex=$('.name-key-datas').find('li').length-1;
- var next_name=$('.name-key-datas').find('li').eq(now_menu_index+1).find('.flex-one').html();
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/checkhandle')?>',
- data:{'name':now_name},
- type:'POST',
- dataType:'json',
- success:function(res){
- if(res.status==1){
- if(now_menu_index>=$maxIndex){
- $('.pop-sec-time').html('处理成功!');
- $('.pop-sec-time').show();
- window.location.href='<?php echo $this->createUrl('checkstudent/index')?>';
- }else{
- $('.pop-sec-time').html('处理成功!即将进入下一组');
- $('.pop-sec-time').show();
- page=$('.prev-menu-page').attr('rel');
- name_like=$.trim($('input[name=name_like]').val());
- loadmenu(page,name_like,next_name);
- }
- setTimeout(function(){
- $('.pop-sec-time').fadeOut();
- }, 2000);
- //进入下一组???
- }else if(res.status==2){
- $('.pop-sec-time').html('存在重名学生,请继续处理');
- $('.pop-sec-time').show();
- setTimeout(function(){
- $('.pop-sec-time').fadeOut();
- }, 2000);
- }
- }
- });
- })
- $('.npt-close').click(function(){
- $('.history-pop,.countermark-pop,.relate-sure-pop').hide();
- })
- $(document).on('click','.next-arrow-pop',function () {
- var listLen = $(this).prev('.countermark-datas').find('.countermark-list-detail li').length;
- var leftNum = $(this).prev('.countermark-datas').find('.countermark-list-detail').position().left-60;
- if (parseInt(leftNum/(listLen-2))==-282) {
- alert('已经是最后第一条了')
- } else {
- $(this).prev('.countermark-datas').find('.countermark-list-detail').css('left',leftNum-282);
- }
- })
- $(document).on('click','.prev-arrow-pop',function () {
- var leftNum = $(this).next('.countermark-datas').find('.countermark-list-detail').position().left-60;
- if (leftNum<0) {
- $(this).next('.countermark-datas').find('.countermark-list-detail').css('left',leftNum+282);
- } else {
- alert('已经是第一条了')
- }
- })
- $('.confirm-pop-btn-sure').click(function(){
- //合并操作
- $.ajax({
- url:'<?php echo $this->createUrl('checkstudent/relationhand')?>',
- type:'POST',
- dataType:'json',
- data:{'startCardId':startCardId,'endCardId':endCardId},
- success:function(res){
- if(res.status==1){
- $('#'+endCardId).find('.fuhao-lock').html(res.number);
- // 合并成功,删掉拖拽的元素
- $('.handel-term-list').eq(idxStar).find('#'+data).remove();
- if ($('.handel-term-list').eq(idxStar).find('li').length<4) {
- // 如果元素个数小于4,去掉左右箭头
- $('.handel-term-list').eq(idxStar).find('.arrow-img').hide();
- $('.handel-term-list').eq(idxStar).find('.term-card-detail').css('left',0)
- }
- }else{
- layer.msg(res.msg);
- }
- $('.relate-sure-pop').hide();
- }
- });
- })
- $('.search-key-value').keyup(function(){
- if ($('.search-key-value').val()!=="") {
- $('.clear-search-value').show()
- } else {
- $('.clear-search-value').hide()
- }
- })
- $('.clear-search-value').click(function(){
- $('.search-key-value').val('');
- $(this).hide()
- })
- var target_id;
- $(document).on('dragstart','.term-card-list',function(ev){
- // ev.dataTransfer.effectAllowed = "move";
- // ev.dataTransfer.setData("elId",ev.target.id);
- target_id = ev.target.id;
- $("#"+ev.target.id).addClass('moves');
- })
- $(document).on('drop','.term-card-layout',function(ev){
- var ev = ev? ev: window.ev
- var srcObj = ev.srcElement ? ev.srcElement : ev.target;
- ev.preventDefault();
- data=target_id;
- idxStar = $('.handel-term-list').index($('#'+data).closest('.handel-term-list'));
- idxEnd = $('.handel-term-list').index($(srcObj).closest('.handel-term-list'));
- $("#"+data).removeClass('moves');
- if (Math.abs(idxStar)>=Math.abs(idxEnd)) {
- // 如果是拖拽元素上面的学期的
- // 获取被拖拽到的地点卡片元素的id
- endCardId = $(srcObj).closest('.term-card-list').attr('id');
- startCardId=data;
- $('.relate-sure-pop').show();
- }
- });
- $(document).on('dragover','.term-card-layout',function(ev){
- ev.preventDefault();
- })
- })
- </script>
|