123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897 |
- <link rel="stylesheet" href="/css/cylet.css" />
- <style>
- .tab-con-btn{
- height: 25px;
- width: 60px;
- background: #666;
- border: 0;
- border-radius: 15px;
- display: inline-block;
- text-align: center;
- margin-bottom: -7px;
- }
- .tab_btn{
- display: inline-block;
- width:30px;
- height:25px;
- padding: 0;
- border: 0;
- outline:none;
- margin:0;
- background: #F2F2F2;
- border-radius: 15px;
- float: left;
- }
- .has-sel-2{
- background: #F2F2F2;
- }
- .has-sel-1{
- background: #666;
- }
- .class-modal-body-1{
- height: 650px;
- overflow: auto;
- position: relative;
- }
- .stu-btn-area{
- margin-left:10px!important;
- }
- </style>
- <script>
- function getClassByGrade(gradeId,$classId){
- $.ajax({
- type:'post',
- url:'<?php echo $this->createUrl("cylet/getclassbygrade");?>',
- async: true,
- dataType: 'json',
- data:{'grade':gradeId},
- success: function (result) {
- if(result.status==1){
- $('#class').html('<option value="0">全部班级</option>');
- for(var i=0;i<result.data.length;i++){
- if($.trim($classId)==$.trim(result.data[i]['class_id'])){
- html='<option value="'+result.data[i]['class_id']+'" selected>'+result.data[i]['class_name']+'</option>';
- }else{
- html='<option value="'+result.data[i]['class_id']+'" >'+result.data[i]['class_name']+'</option>';
- }
- $('#class').append(html);
- }
- }
- },
- error: function () {
- return;
- }
- });
- }
- function changeDisplay(cid,display){
- var showAll=$('#display').is(':checked');
- if(parseInt(cid)==0){
- return false;
- }
- $.ajax({
- type:'post',
- url:'<?php echo $this->createUrl("cylet/changestatus");?>',
- async: true,
- dataType: 'json',
- data:{'cid':cid,'display':display},
- success: function (result) {
- if(result.status==1){
- if(display==1){
- if(showAll){
- $('#'+cid).find('.icon').eq(2).removeClass('icon-eye-close').addClass('icon-xunhuan');
- }else{
- $('#'+cid).hide();
- }
- }else{
- $('#'+cid).find('.icon').eq(2).removeClass('icon-xunhuan').addClass('icon-eye-close');
- $('#'+cid).hide();
- }
- }
- },
- error: function () {
- return;
- }
- });
- }
- </script>
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="filter">
- <?php
- $gradeSelect=array(
- 0=>'',
- 1=>'',
- 2=>'',
- 3=>''
- );
- $arts_scienceSelect=array(
- 0=>'',
- 1=>'',
- 2=>'',
- );
- $cylet_typeSelect=array(
- 0=>'',
- 1=>'',
- 2=>'',
- );
- if(isset($arts_science)){
- $arts_scienceSelect[$arts_science]='selected';
- }
- if(isset($cylet_type)){
- $cylet_typeSelect[$cylet_type]='selected';
- }
- if(isset($grade)){
- $gradeSelect[$grade]='selected';
- if($class){
- $class=(string)$class;
- echo "<script>getClassByGrade(".$grade.",'".$class."');</script>";
- }else{
- echo "<script>getClassByGrade(".$grade.",0);</script>";
- }
- }
- ?>
- <form action="" method="get" name="cylet" id="cyletForm">
- <label for="checkbox"><input type="checkbox" name="display" <?php if($display) echo 'checked'?> id="display" value="1"/>显示隐藏试卷</label>
- <select name="grade" id="grade">
- <option value="0">年级</option>
- <?php
- if(Yii::app()->params['grade_config']){
- foreach (Yii::app()->params['grade_config'] as $id=> $val){
- if($grade==$id){
- echo '<option value="'.$id.'" selected >'.$val['grade_name'].'</option>';
- }else{
- echo '<option value="'.$id.'" >'.$val['grade_name'].'</option>';
- }
- }
- }
- ?>
- </select>
- <select name="classId" id="class">
- <option value="0">全部班级</option>
- </select>
- <?php if(Yii::app()->params['section']==1):?>
- <select name="arts_science" >
- <option value="0">全部</option>
- <option value="1" <?php echo $arts_scienceSelect[1] ?>>文科</option>
- <option value="2" <?php echo $arts_scienceSelect[2] ?>>理科</option>
- </select>
- <?php endif;?>
- <select name="cylet_type" >
- <option value="0">全部统考</option>
- <option value="1" <?php echo $cylet_typeSelect[1] ?>>非年级统考</option>
- <option value="2" <?php echo $cylet_typeSelect[2] ?>>年级统考</option>
- </select>
- <button type="button" name="search_btn">搜索</button>
- <button type="button" class="fr add_exam" style="margin-right:10px;">
- <i class="icon icon-add"></i>
- <span style="display: inline-block;vertical-align: middle">添加统考</span>
- </button>
- </form>
- </div>
- <div class="list">
- <table cellspacing="0" cellpadding="0" >
- <thead>
- <tr>
- <th >序号</th>
- <th >年级</th>
- <th >统考日期</th>
- <th >模式</th>
- <?php if(Yii::app()->params['section']==1):?>
- <th >科目</th>
- <?php endif;?>
- <th width="12%">名称</th>
- <th >学科</th>
- <th>统考类型</th>
- <th >已生成班级</th>
- <th width="12%">操作</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($dataList) && !empty($dataList)):
- $i=0;
- foreach ($dataList as $val):
- $i++;
- ?>
- <tr id="<?php echo $val['cylet_id']; ?>">
- <td><?php echo $i;?></td>
- <td class="tl"><?php echo isset(Yii::app()->params['grade_list'][$val['grade']])?Yii::app()->params['grade_list'][$val['grade']]['grade_name']:''?></td>
- <td><?php echo date('Y-m-d',$val['create_time'])?></td>
- <td><?php
- if($val['exam_mode']==1){
- echo '新高考3+3';
- }elseif($val['exam_mode']==2){
- echo ' 新高考3+1+2';
- }else{
- echo '普通模式';
- }
- ?></td>
- <?php if(Yii::app()->params['section']==1):?>
- <td class="tl"><?php echo $val['arts_science']==1?'文科':($val['arts_science']==2?'理科':'不分科')?></td>
- <?php endif;?>
- <td class="tl"><?php echo $val['title']?></td>
- <td>
- <div class="tl subjects">
- <?php
- if($val['SubjectName']):
- foreach ($val['SubjectName'] as $v):
- ?>
- <span><?php echo $v?></span>
- <?php endforeach;endif;?>
- </div>
- </td>
- <td class="tl"><?php echo $val['cylet_type']==1?'非年级统考':'<span class="red">年级统考</span>'?></td>
- <td class="showClassInfo">
- <?php
- if($val['classComplete']==$val['classCount']){
- echo '<span style="color:green">'.$val['classComplete'].'</span>';
- }else{
- echo '<span style="color:red">'.$val['classComplete'].'</span>';
- }
- ?>/<?php echo $val['classCount']?>
- </td>
- <td>
- <i class="icon icon-edit" title="编辑"></i>
- <?php if(!$display){?>
- <i class="icon icon-download-setting" download="<?php echo $val['downloadBtn']?>" title="报表下载设置"></i>
- <?php
- }
- ?>
- <?php
- if($val['report_url']){
- $report=json_decode($val['report_url'],true);
- if(isset($report['errCode']) && $report['errCode']=='00'){
- echo '<a href="'.$report['data'].'" ><i class="icon icon-download-file" title="下载"></i></a>';
- }else{
- echo '<a href="#" ><i class="icon icon-no-download-file" title="'.$report['errMsg'].'"></i></a>';
- }
- }else{
- echo '<i class="icon icon-no-download-file" title="下载"></i>';
- }
- if($val['is_display']){
- echo '<i class="icon icon-xunhuan" title="显示"></i>';
- }else{
- echo '<i class="icon icon-eye-close" title="隐藏"></i>';
- }
- ?>
- </td>
- </tr>
- <?php endforeach;endif;?>
- <tr>
- <td colspan="10" class="page">
- <?php
- if(isset($pageTotal) && $pageTotal>1){
- $StartPage=$page-5;
- $EndPage=$page+5;
- if($StartPage<1){
- $StartPage=1;
- }
- if($EndPage>$pageTotal){
- $EndPage=$pageTotal;
- }
- ?>
- <div class="row" style="padding-top:10px;">
- <div class="col-xs-7">
-
- </div>
- <div class="col-xs-5" style="font-size: 16px">
- <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
- <ul id="yw0" class="yiiPager">
- <?php
- if($page>1){
- echo '<li class="previous"><a href="'.$this->createUrl('cylet/index').'?page='.($page-1).'&grade='.$grade.'&classId='.$class.'&arts_science='.$arts_science.'&cylet_type='.$cylet_type.'">上一页</a></li>';
- }
- for($i=$StartPage;$i<=$EndPage;$i++){
- $url=$this->createUrl('cylet/index')."?page=".$i."&grade=".$grade."&classId=".$class.'&arts_science='.$arts_science.'&cylet_type='.$cylet_type;
- if($page==$i){
- echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
- }else{
- echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
- }
- }
- if($page<$pageTotal){
- echo '<li class="next"><a href="'.$this->createUrl('cylet/index').'?page='.($page+1).'&grade='.$grade.'&classId='.$class.'&arts_science='.$arts_science.'&cylet_type='.$cylet_type.'">下一页</a></li>';
- }
- }
- ?>
- </td>
- </tr>
- </tbody>
- </table>
- <div class="confirmbox-mask" style="display: none" id="classModal">
- <div class="class-modal">
- </div>
- </div>
- <div class="confirmbox-mask" style="display: none" id="classModal-1">
- <form name="table_set">
- <div class="class-modal-1">
- <i class="icon icon-close-1"></i><div class="class-modal-head-1">下载报表</div>
- <div class="class-modal-body-1">
- <h2>选择下载的报表 <input name="isNative" id="isNative" type="checkbox" checked="checked" value="1" /><span class="red"> 只显示在籍学生</span></h2>
- <div class="table_area">
- <label><input class="table_1" name="table[]" type="checkbox" checked="checked" value="8" />学科分析表</label>
- <label><input class="table_2" name="table[]" type="checkbox" checked="checked" value="9" />总分段人数分析表<span class="c-red-1"></span></label>
- <label><input class="table_3" name="table[]" type="checkbox" checked="checked" value="10" />排名段人数分析表<span class="c-red-1"></span></label>
- <label><input class="table_4" name="table[]" type="checkbox" checked="checked" value="11" />班级对比分析表</label>
- <label><input class="table_5" name="table[]" type="checkbox" checked="checked" value="5" />年级成绩分析表</label>
- <label><input class="table_6" name="table[]" type="checkbox" checked="checked" value="7" />班级成绩分析表</label>
- <label><input class="table_7" name="table[]" type="checkbox" value="13" />赋分规则表</label>
- </div>
- <label class="checkAll"><input class="select_all" type="checkbox" checked="checked" />全选</label>
- <div class="class_area">
- </div>
- <h2>报表下载设置</h2>
- <h3 class="tit-sub-intro">总分段人数分析表(请按分数进行分段):<span class="fr">注:分段包含右边界值</span></h3>
- <div class="clearfix">
- <div class="fl">
- <div class="dib vtm table_set_1">
- <input type="hidden" name="max_score" value="">
- <span class="score-inp-list"><input type="text" class="subsection" name="score_0" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_1" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_2" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_3" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_4" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_5" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_6" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_7" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_8" srcvalue="" value="">-</span>
- <span class="score-inp-list"><input type="text" class="subsection" name="score_9" srcvalue="" value="">-</span>
- </div>
- 0<input type="hidden" name="score_10" value="0">
- </div>
- <div class="fr">
- <span class="dib pointer vtm reduce-btn">-</span>
- <span class="dib pointer vtm add-btn">+</span>
- <img src="/images/del-icon.png" alt="" class="del-icon pointer vtm">
- </div>
- </div>
- <h3 class="table_set_2">排名段人数分析表(请按名次进行分段):<span class="fr">注:分段包含右边界值</span></h3>
- <div class="table_set_2">
- 1-
- <input type="hidden" name="count_10" value="1">
- <input type="text" class="subsection" name="count_9" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_8" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_7" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_6" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_5" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_4" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_3" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_2" srcvalue="" value="">-
- <input type="text" class="subsection" name="count_1" srcvalue="" value="">-
- <input type="hidden" name="count_0" srcvalue="" value="0">
- <span class="max_count"></span>
- </div>
- <div class="btn_area">
- 过滤0分考生
- <input type="radio" name="removeZeroStudent" value="1">是
- <input type="radio" name="removeZeroStudent" value="0" checked>否
- </div>
- <div class="btn_area">
- 班级分析模式
- <input type="radio" name="clazzAnalysisMode" value="1" checked>行政班
- <?php if( Yii::app()->params['section']==1):?>
- <input type="radio" name="clazzAnalysisMode" value="2" >教学班
- <?php endif;?>
- </div>
- <div class="waiyu_data">
- </div>
- <div class="btn_area">
- <p>学生信息显示:</p>
- <input type="checkbox" name='hasStudentNo' class='stu-btn-area'value='0'>学号
- <input type="checkbox" name='hasStudentSystemCard' class='stu-btn-area' value='0'>系统准考证号
- <input type="checkbox" name='hasStudentSchoolCard' class='stu-btn-area' value='0'>学校准考证号
- <input type="checkbox" name='hasIdNumber' class='stu-btn-area' value='0'>身份证号码
- </div>
- <div class="btn_area">
- <p>*下载表格较多时,可能会受到网络影响导致下载较慢,请耐心等待</p>
- <button class="cancel">取消</button>
- <button class="download">发送设置</button>
- <input type="hidden" name="cylet_id" value="">
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- <script>
- $(function(){
- if ($('.table_set_1').find('.subsection').length==10) {
- // 如果输入框是10个,添加按钮禁用
- $('.add-btn').addClass('forbidden');
- }
- // 减少按钮
- $('.reduce-btn').click(function(){
- var inpLength = $('.table_set_1').find('.score-inp-list').length;
- if (inpLength==2) {
- return;
- }
- $('.table_set_1').find('.score-inp-list').eq(inpLength-1).remove();
- $('.add-btn').removeClass('forbidden');
- if ($('.table_set_1').find('.score-inp-list').length==2) {
- $(this).addClass('forbidden');
- }
- })
- // 添加按钮
- $('.add-btn').click(function(){
- var inpLength = $('.table_set_1').find('.score-inp-list').length,pendStr = '<span class="score-inp-list"><input type="text" class="subsection" name="score_'+inpLength+'" value="">-</span>';
- if (inpLength==10) {
- return;
- }
- $('.table_set_1').append(pendStr);
- $('.reduce-btn').removeClass('forbidden');
- if ($('.table_set_1').find('.score-inp-list').length==10) {
- $(this).addClass('forbidden');
- }
- })
- // 删除按钮
- $('.del-icon').click(function(){
- $('.table_set_1').find('input').val('')
- })
- $('select[name="grade"]').change(function(){
- var grade=$(this).val();
- getClassByGrade(grade,0);
- });
- $('button[name="search_btn"]').click(function(){
- var grade_id=$('#grade').val(),
- class_id=$('#class').val();
- /*
- if(grade_id==0){
- layer.msg('请选择年级!', {
- icon: 2,
- time: 2000 //2秒关闭(如果不配置,默认是3秒)
- });
- return false;
- }
- */
- $('#cyletForm').submit();
- });
- $('.list').on('click','.icon-xunhuan',function (){
- var cylet_id=$(this).closest('tr').attr('id');
- layer.msg('您确定恢复这次统考吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- changeDisplay(cylet_id,0);
- }
- });
- }).on('click','.icon-eye-close',function(){
- var cylet_id=$(this).closest('tr').attr('id');
- layer.msg('您确定隐藏这次统考吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- changeDisplay(cylet_id,1);
- }
- });
- }).on('click','.showClassInfo',function(){
- var cylet_id=$(this).closest('tr').attr('id');
- $.ajax({
- url:'<?php echo $this->createUrl('cylet/getclassinfo')?>',
- type:'POST',
- dataType:'json',
- data:{'cid':cylet_id},
- success:function(res){
- if(res.status==1){
- $('.class-modal').html(res.html);
- classModal.style.display = 'block';
- }
- }
- });
- }).on('click','.icon-close',function(){
- classModal.style.display = 'none';
- });
- $('.icon-edit').click(function () {
- var id=$(this).closest('tr').attr('id');
- window.location.href="<?php echo $this->createUrl('cylet/edit')?>?cid="+id;
- });
- $('.add_exam').click(function(){
- window.location.href="<?php echo $this->createUrl('cylet/edit')?>";
- });
- $('.icon-close-1,.cancel').click(function(){
- resetTable();
- $('.table_2').parent().removeClass('disabled');
- $('.table_2').parent().find('span').html('');
- $('.table_2').attr('disabled',false);
- $('.table_2').prop('checked',true);
- $('.table_set_1').removeClass('disabled');
- $('.table_set_1 input').attr('readonly',false);
- $('.table_set_1 input').val('');
- $('.table_3').parent().removeClass('disabled');
- $('.table_3').prop('checked',true);
- $('.table_3').parent().find('span').html('');
- $('.table_3').attr('disabled',false);
- $('.table_set_2').removeClass('disabled');
- $('.table_set_2 input').attr('readonly',false);
- $('.table_set_2 input').val('');
- $('#classModal-1').hide();
- return false;
- });
- $('.select_all').click(function(){
- if($(this).is(':checked')) {
- $(".classlist").prop("checked", true);
- $('.table_6').prop('checked',true);
- }else {
- $(".classlist").prop("checked", false);
- $('.table_6').prop('checked',false);
- }
- });
- $('.icon-download-setting').click(function(){
- var cylet_id=$(this).closest('tr').attr('id');
- var compete=$(this).closest('tr').find('.showClassInfo span').eq(0).html();
- var download=$(this).attr('download');
- if(download==0){
- layer.msg('暂时还没有可以生成报告的班级');
- return false;
- }
- var ii=layer.msg('正在加载统考数据,请稍候......',{time:0});
- $.ajax({
- url:'<?php echo $this->createUrl('cylet/loadcyletinfo')?>',
- type:'POST',
- dataType:'json',
- data:{'cylet_id':cylet_id},
- success:function(res){
- layer.close(ii);
- $('.select_all').prop('checked',true);
- $('#classModal-1').show();
- $('#classModal-1').find('.total_score').html(res.score);
- $('input[name=score_0]').val(res.score);
- $('input[name=score_0]').attr('srcvalue',res.score);
- $('input[name=max_score]').val(res.score);
- $('#classModal-1').find('.max_count').html(res.student_count);
- $('input[name=count_0]').val(res.student_count);
- $('input[name=score_10]').val(0);
- $('input[name=count_10]').val(1);
- for(var i=0;i<res.score_section.length;i++){
- $('input[name=score_'+(i+1)+']').val(res.score_section[i]);
- $('input[name=score_'+(i+1)+']').attr('srcvalue',res.score_section[i]);
- }
- for(var i=0;i<res.count_section.length;i++){
- $('input[name=count_'+(i+1)+']').val(res.count_section[i]);
- $('input[name=count_'+(i+1)+']').attr('srcvalue',res.count_section[i]);
- }
- class_area_html='';
- for(var i=0;i<res.class.length;i++){
- class_area_html+='<label><input class="classlist" name="classlist[]" type="checkbox" checked="checked" value="'+res.class[i]['class_id']+'" />'+res.class[i]['class_name']+'</label>';
- }
- $('.class_area').html(class_area_html);
- if(res.score_section.length==0){
- //$('.table_2').click();
- $('.table_2').attr('checked',false);
- $('.table_2').parent().addClass('disabled');
- $('.table_2').parent().find('span').html('分数太小,不可分段');
- $('.table_2').attr('disabled',true);
- $('.table_set_1').addClass('disabled');
- $('.table_set_1 input').attr('readonly',true);
- }
- if(res.count_section.length==0){
- // $('.table_3').click();
- $('.table_3').attr('checked',false);
- $('.table_3').parent().addClass('disabled');
- $('.table_3').parent().find('span').html('名次太少,不可分段');
- $('.table_3').attr('disabled',true);
- $('.table_set_2').addClass('disabled');
- $('.table_set_2 input').attr('readonly',true);
- }
- if(res.is_has_english==1){
- $('.english_ratio').show();
- }else{
- $('.english_ratio').hide();
- $('input[name=ratio_switch]').val(0);
- }
- if(res.score_report==1){
- $('.table_7').parent().show();
- }else{
- $('.table_7').parent().hide();
- }
- $('input[name=cylet_id]').val(cylet_id);
- //展示外语学科
- if(res.waiData){
- var wai_html='';
- $.each(res.waiData,function(k,v){
- wai_html += '<div class="btn_area english_ratio">';
- wai_html += v.subject_name+'系数';
- wai_html += ' <div class="tab-con-btn">';
- wai_html += ' <div class="tab_btn has-sel-2" ></div>';
- wai_html += ' <div class="tab_btn has-sel-1" ></div>';
- wai_html += ' </div>';
- wai_html += ' <input type="text" value="1.25" name="ratio[]" disabled style="width: 40px">';
- wai_html =wai_html+ ' <input type="radio" value="1" class="decimal" checked name="decimal'+v.subject_id+'" disabled >保留小数';
- wai_html =wai_html+ ' <input type="radio" value="0" class="decimal" name="decimal'+v.subject_id+'" disabled >保留整数';
- wai_html += ' <input type="hidden" name="ratio_switch[]" value="0">';
- wai_html += ' <input type="hidden" name="subject_id[]" disabled value="'+v.subject_id+'">';
- wai_html += '</div>';
- });
- wai_html+='<div class="btn_area"> 启用系数后,外语学科会另外提供换算后的总分成绩(原始分×系数)</div>';
- $(".waiyu_data").html(wai_html);
- }
- }
- });
- });
- $('.download').click(function(){
- var selectTableNum=0,selectClassNum=0;
- //var table=$('form[name=table_set]').serializeArray();
- for(var i=0;i<$('.table_area input').length;i++){
- if($('.table_area input').eq(i).is(':Checked')==true){
- selectTableNum++;
- }
- }
- if(selectTableNum==0){
- layer.msg('请选择下载的报表类型');
- return false;
- }
- if($('.table_6').is(':checked')){
- for(var i=0;i<$('.classlist').length;i++){
- if($('.classlist').eq(i).is(':Checked')==true){
- selectClassNum++;
- }
- }
- if(selectClassNum==0){
- layer.msg('请选择班级成绩分析表对应的班级');
- return false;
- }
- }
- //验证分数段
- var inpLength = $('.table_set_1').find('.score-inp-list').length;
- for(var i=0;i<inpLength;i++){
- if($('.table_set_1').find('.score-inp-list').eq(i).find('input').val()==''){
- layer.msg('分数段设置不正确');
- return false;
- }
- }
- //校验系数
- var ratio_switch=$('input[name=ratio_switch]').val();
- if(ratio_switch==1){
- var ratio=parseFloat($('input[name=ratio]').val());
- if(ratio<=0){
- layer.msg('英语系数值不正确');
- return false;
- }
- }
- var ii=layer.msg('报告设置保存中,请稍候。。。。。',{time:0});
- $.ajax({
- url:'<?php echo $this->createUrl('cylet/downloadtable')?>',
- type:'POST',
- dataType:'json',
- data:$('form[name=table_set]').serializeArray(),
- success:function(res){
- if(res.status==1){
- $('.icon-close-1,.cancel').click();
- layer.close(ii)
- layer.msg("报告已转入后台生成,请稍后刷新页面下载",{time:3000})
- }else{
- layer.msg(res.result);
- }
- }
- });
- return false;
- });
- $('.table_2').click(function(){
- if($(this).is(':Checked')==false){
- $('.table_set_1').addClass('disabled');
- $('.table_set_1 input').attr('readonly',true);
- }else{
- $('.table_set_1').removeClass('disabled');
- $('.table_set_1 input').attr('readonly',false);
- }
- });
- $('.table_3').click(function(){
- if($(this).is(':Checked')==false){
- $('.table_set_2').addClass('disabled');
- $('.table_set_2 input').attr('readonly',true);
- }else{
- $('.table_set_2').removeClass('disabled');
- $('.table_set_2 input').attr('readonly',false);
- }
- });
- $('.table_6').click(function(){
- if($(this).is(':Checked')==false){
- $('.class_area').addClass('disabled');
- $('.class_area input').attr('disabled',true);
- $('.checkAll').addClass('disabled');
- $('.checkAll input').attr('disabled',true);
- }else{
- $('.class_area').removeClass('disabled');
- $('.class_area input').attr('disabled',false);
- $('.checkAll').removeClass('disabled');
- $('.checkAll input').attr('disabled',false);
- }
- });
- $('.class_area').on('click','.classlist',function(){
- var selectNum=0,noSelectNum=0;
- for(var i=0;i<$('.classlist').length;i++){
- if($('.classlist').eq(i).is(':Checked')==true){
- selectNum++;
- }else{
- noSelectNum++;
- }
- }
- if(selectNum>0){
- $('.table_6').prop('checked',true);
- }
- if(selectNum==$('.classlist').length){
- $('.select_all').prop('checked',true);
- }
- if(noSelectNum==$('.classlist').length){
- $('.select_all').prop('checked',false);
- }
- });
- $('.table_area').on('click','input',function(){
- var selectNum=0,noSelectNum=0;
- for(var i=0;i<$('.table_area input').length;i++){
- if($('.table_area input').eq(i).is(':Checked')==true){
- selectNum++;
- }else{
- noSelectNum++;
- }
- }
- if(noSelectNum==$('.table_area input').length){
- $('.download').prop('disabled',true);
- $('.download').addClass('disabled');
- }else{
- $('.download').prop('disabled',false);
- $('.download').removeClass('disabled');
- }
- });
- $(document).on('change','.table_set_1 input',function() {
- var prev_value=parseInt($(this).closest('span').prev('span').find('input').val()),this_value=parseInt($(this).val());
- var next_value=parseInt($(this).closest('span').next('span').find('input').val());
- var max_score=parseInt($('input[name=max_score]').val());
- if(this_value=='' || this_value==0 || isNaN(this_value)){
- layer.msg('分段数值设置不正确,请重新输入');
- $(this).val($(this).attr('srcvalue'));
- $(this).focus();
- return false;
- }
- if((!isNaN(prev_value) && this_value>=prev_value) || this_value>max_score){
- layer.msg('分段数值设置不正确,请重新输入');
- $(this).val($(this).attr('srcvalue'));
- $(this).focus();
- }else if(this_value<=next_value){
- layer.msg('分段数值设置不正确,请重新输入');
- $(this).val($(this).attr('srcvalue'));
- $(this).focus();
- }else{
- $(this).attr('srcvalue',this_value);
- }
- });
- //获取下一组数值
- function getNextValue(obj){
- var index=$('.score-inp-list').index(obj.closest('.score-inp-list'));
- var length=$('.score-inp-list').length;
- while (index<length){
- index++;
- value=$('.score-inp-list').eq(index).find('input').val();
- if(value!=''){
- return value;
- }
- }
- return 0;
- }
- //获取前一组数值
- function getPrevValue(obj){
- var index=$('.score-inp-list').index(obj.closest('.score-inp-list'));
- while (index>0){
- index--;
- value=$('.score-inp-list').eq(index).find('input').val();
- if(value!=''){
- return value;
- }
- }
- return 0;
- }
- $('.table_set_2').find('input').change(function(){
- var prev_value=parseInt($(this).prev('input').val()),this_value=parseInt($(this).val());
- var next_value=parseInt($(this).next('input').val());
- if(this_value<=prev_value || $(this).val()==''){
- layer.msg('排名段数值设置不正确,请重新输入');
- $(this).val($(this).attr('srcvalue'));
- $(this).focus();
- }else if(this_value>=next_value){
- layer.msg('排名数值设置不正确,请重新输入');
- $(this).val($(this).attr('srcvalue'));
- $(this).focus();
- }else{
- $(this).attr('srcvalue',this_value);
- }
- });
- function resetTable(){
- $('.table_area').find('input').prop('checked',true);
- $('.class_area').html('');
- $('.class_area').removeClass('disabled');
- $('.checkAll').removeClass('disabled');
- $('.checkAll input').attr('disabled',false);
- $('.download').removeClass('disabled');
- $('.download').prop('disabled',false);
- $('.has-sel-2').click();
- $('input[name=ratio]').val(1.25);
- }
- $("body").on("click",".has-sel-1",function(){
- // $('.has-sel-1').click(function(){ //开 #01B677
- $(this).parent().find('.has-sel-2').css('background','#01B677');
- $(this).parent().css('background','#01B677');
- $(this).css('background','#F2F2F2');
- $(this).parent().parent().find('input[name="ratio[]"]').attr('disabled',false);
- $(this).parent().parent().find('input[name="ratio_switch[]"]').val(1);
- $(this).parent().parent().find('input[name="subject_id[]"]').attr('disabled',false);
- $(this).closest('.english_ratio').find('.decimal').attr('disabled',false);
- });
- $("body").on("click",".has-sel-2",function(){
- // $('.has-sel-2').click(function(){ //关
- $(this).parent().find('.has-sel-1').css('background','#666');
- $(this).parent().css('background','#666');
- $(this).css('background','#F2F2F2');
- $(this).parent().parent().find('input[name="ratio[]"]').attr('disabled',true);
- $(this).parent().parent().find('input[name="ratio_switch[]"]').val(0);
- $(this).parent().parent().find('input[name="subject_id[]"]').attr('disabled',true);
- $(this).closest('.english_ratio').find('.decimal').attr('disabled',true);
- });
- $("body").on("click",".stu-btn-area",function(){
- if($(this).is(":checked")){
- $(this).val(1);
- }else{
- $(this).val(0);
- }
- });
-
- });
- </script>
|