123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <style>
- html {overflow-y: scroll;}
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="layout-gap">
- <section class="hrn-top flex">
- <div class="flex-one hrn-top-title fw"><?php if(isset($fieldName)){echo $fieldName;}else{echo '考号';} ?>重复</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>
- <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['check_field_value'];?></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>excel中重名学生:</p>
- </div>
- <span>处理办法:修改<?php if(isset($fieldName)){echo $fieldName;}else{echo '考号';} ?>号后</span>
- <div class="check-btn pointer save_student_id_old" data="">确认</div>
- </div>
- <div class="handle-detail-main-excel">
- </div>
- <div class="handle-detail-top flex">
- <div class="flex-one">
- <p>学校已存在重名学生:</p>
- </div>
- <span>处理办法:请为下方学生选择上方excel中对应的序号,确认即可</span>
- <div class="check-btn pointer save_student_id">确认关联</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="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());
- if(name_like==''){
- return false;
- }
- 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('record/handle_repeat')?>',
- 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]['check_field_value']+'</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('record/showrepeatstudent')?>',
- type:'POST',
- data:{'name':name},
- dataType:'json',
- success:function(res){
- if(res.status==1){
- $('.handle-detail-main').html(res.html);
- $('.handle-detail-main-excel').html(res.excel_html);
- now_name=name;
- now_menu_index=index;
- $('.save_student_id_old').attr('data',name);
- }
- $('.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();
- $('.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 (leftNum/(listLen-2)==-288) {
- alert('已经是最后第一条了')
- } else {
- $(this).prev('.countermark-datas').find('.countermark-list-detail').css('left',leftNum-288);
- }
- })
- $(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+288);
- } 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('click','.toggle-opt-btn',function(){
- if ($(this).text()=='展开') {
- $(this).text('收起')
- } else {
- $(this).text('展开')
- }
- $(this).closest('.term-card-list').find('.hide-list').toggle();
- })
- .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','.save_student_id_old',function(){//关联学生Id
- var check_value=$(this).attr('data');
- if(check_value==''){
- return false;
- }
- $.ajax({
- url:'<?php echo $this->createUrl('record/change_check')?>',
- type:'POST',
- dataType:'json',
- data:{'check_value':check_value},
- success:function(res){
- if(res.status==1){
- layer.msg('检查完成');
- window.location.reload()
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- layer.msg('数据还需要继续处理');
- }
- window.location.reload()
- }
- }
- });
- })
- .on('click','.save_student_id',function(){//关联学生Id
- select_obj=$('.nToId');
- console.log(select_obj.length);
- sidToTid=new Array();
- for(var i=0;i<select_obj.length;i++){
- student_id=select_obj.eq(i).closest('.term-card-list').attr('id');
- temp_id=select_obj.eq(i).val();
- if(temp_id>0){
- sidToTid.push(student_id+'///'+temp_id);
- }
- }
- if(sidToTid!=''){
- $.ajax({
- url:'<?php echo $this->createUrl('record/binding')?>',
- type:'POST',
- dataType:'json',
- data:{'str':sidToTid},
- success:function(res){
- if(res.status==1){
- layer.msg('操作成功');
- window.location.reload();
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- layer.msg('关联失败');
- }
- }
- }
- });
- }
- })
- $('.handle-detail-main-excel')
- .on('change','.change_card',function(){
- var new_card=$(this).val();
- var id=$(this).attr('id');
- var old_data=$(this).attr('data');
- changeValue(new_card,id,$(this));
- })
- function changeValue(value,id,obj){
- if(value=='' || value==undefined){
- return false;
- }
- if(id=='' || id==undefined){
- return false;
- }
- indexSend=layer.msg('正在修改,请稍候......',{time:0});
- $.ajax({
- url:'<?php echo $this->createUrl('record/change_value')?>',
- type:'POST',
- dataType:'json',
- data:{'id':id,'value':value},
- success:function(res){
- layer.close(indexSend);
- if(res.status==1){
- layer.msg('修改成功');
- obj.attr('data',value);
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- obj.val(obj.attr('data'));
- }else{
- layer.msg('修改失败');
- obj.val(obj.attr('data'));
- }
- }
- }
- });
- }
- })
- </script>
|