123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960 |
- <style>
- .fr{
- float: right;
- }
- .filter {
- font-size: 0;
- margin-top:10px;
- width: 96%;
- margin:10px auto 0 auto;
- }
- .filter * {
- font-size: 14px;
- }
- .filter label {
- font-weight: bold;
- }
- .filter select {
- height: 36px;
- font-size: 14px;
- margin-left: 10px;
- }
- .filter select:nth-child(2) {
- width: 82px;
- }
- .filter select:nth-child(3) {
- width: 110px;
- }
- .filter button {
- border: none;
- background: #2977ff;
- width: 111px;
- height: 36px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- margin-left: 10px;
- }
- .showClassInfo{
- cursor: pointer;
- }
- .list table {
- width: 96%;
- margin-top: 20px;
- text-align: center;
- border-right: 1px solid #ccc;
- margin:20px auto 0 auto;
- }
- .list table th {
- background: #f2f2f2;
- border: 1px solid #ccc;
- border-right: none;
- padding: 12px 15px;
- }
- .list table td {
- border: 1px solid #ccc;
- border-right: none;
- border-top: none;
- padding: 12px 15px;
- font-weight: bold;
- }
- .list table tr:nth-child(even) {
- background: #f2f2f2;
- }
- .list .tl {
- text-align: left;
- }
- .list .red {
- color: #cc3400;
- }
- .list .green {
- color: #079b67;
- }
- .icon {
- display: inline-block;
- background: center/contain no-repeat;
- width: 25px;
- height: 25px;
- cursor: pointer;
- vertical-align: middle;
- }
- .icon-edit {
- background-image: url("/images/edit.png")
- }
- .icon-eye-close {
- background-image: url("/images/eye_close.png")
- }
- .icon-download {
- background-image: url("/images/download_cylet.png")
- }
- .icon-xunhuan {
- background-image: url("/images/xunhuan.png")
- }
- .icon-add {
- background-image: url("/images/add.png");
- width: 20px;
- height: 20px;
- }
- .list .subjects {
- line-height: 22px;
- font-size: 0;
- }
- .list .icon{
- margin: 0 4px;
- }
- .list .subjects span {
- display: inline-block;
- font-size: 16px;
- word-break: keep-all;
- margin: 0 4px;
- }
- .confirmbox {
- background: #fff;
- border: 1px solid #cccccc;
- border-radius: 3px;
- padding: 40px 40px 30px;
- text-align: center;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- }
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- button {
- border: none;
- background: #009965;
- width: 111px;
- height: 36px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .icon-close{
- background-image: url("/images/close.png")
- }
- .icon-close-1{
- background-image: url("/images/close.png");
- background-size: 15px,15px;
- }
- .class-modal {
- width: 700px;
- min-height: 400px;
- background: #fff;
- border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- padding: 20px;
- }
- .class-modal-head {
- font-size: 20px;
- font-weight: bold;
- text-align: center;
- }
- .class-modal-body {
- margin-top: 20px;
- max-height: 300px;
- overflow: auto;
- }
- .class-modal-body .classes {
- margin-bottom: 10px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b
- }
- .class-modal .icon-close{
- position: absolute;
- right: 20px;
- top: 20px;
- }
- .class-modal-1 {
- width: 700px;
- min-height: 400px;
- background: #fff;
- border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .class-modal-head-1 {
- font-size: 14px;
- text-align: left;
- color:#fff;
- line-height:30px;
- background: #2977ff;
- padding-left:15px;
- }
- .class-modal-body-1{
- padding:15px;
- }
- .class-modal-body-1 h2,.class-modal-body-1 h3{
- font-size:14px;
- font-weight:normal;
- margin-top:10px;
- }
- .class-modal-body-1 h3 span{
- font-size:10px;
- color:#ccc;
- }
- .class-modal-body-1 label{
- display: inline-block;
- font-weight: normal;
- margin-right: 15px;
- height:30px;
- position: relative;
- }
- .class-modal-1 .icon-close-1{
- position: absolute;
- right: 10px;
- top:5px;
- }
- .class-modal-1 .class_area{
- height:115px;
- border:1px solid #ccc;
- padding:5px;
- overflow-y: auto;
- margin-bottom:15px;
- }
- .class-modal-1 .checkAll{
- position:absolute;
- right:5px;
- top:115px;
- }
- .class-modal-1 .subsection{
- width:50px;
- padding:0 5px;
- margin:0 5px;
- }
- .class-modal-1 .btn p{color:#000;}
- .class-modal-1 .btn_area{
- margin-top:20px;
- }
- .class-modal-1 .btn_area p{
- display: inline-block;
- }
- .class-modal-1 .btn_area button{
- width:80px;
- height:25px;
- float: right;
- margin-left:5px;
- }
- .class-modal-1 .btn_area .cancel{
- background: #fff;
- color:#000;
- border:1px solid #666;
- }
- .c-red-1 {
- color: #CC3300;
- font-size:10px;
- display: inline-block;
- position:absolute;
- left:15px;
- top:18px;
- }
- .subject-name {
- display: inline-block;
- padding: 3px 8px;
- background: #ff9900;
- border-radius: 3px;
- color: #ffffff;
- font-size: 12px;
- }
- .disabled{
- color:#ccc;
- }
- div.table_set_2 ,div.table_set_1{
- margin-bottom:20px;
- }
- </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("zhiliao/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();
- }
- window.location.reload()
- }
- },
- error: function () {
- return;
- }
- });
- }
- </script>
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="filter">
- <?php
- $gradeSelect=array(
- 0=>'',
- 1=>'',
- 2=>'',
- 3=>''
- );
- 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>
- <option value="1" <?php echo $gradeSelect[1] ?>>高一</option>
- <option value="2" <?php echo $gradeSelect[2]?>>高二</option>
- <option value="3" <?php echo $gradeSelect[3]?>>高三</option>
- </select>
- <select name="classId" id="class">
- <option value="0">全部班级</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>
- <button type="button" class="fr blackListSet" style="margin-right:10px;width:150px;">
- <i class="icon icon-add"></i>
- <span style="display: inline-block;vertical-align: middle">家校成绩设置</span>
- </button>
- <button type="button" class="fr unpaidSet" style="margin-right:10px;width:180px;">
- <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 width="12%">名称</th>
- <th >考试日期</th>
- <th >科目</th>
- <th >考试班级数</th>
- <th>上传进度</th>
- <th >状态</th>
- <th width="12%">操作</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($dataList) && !empty($dataList)):
- $i=0;
- $gradeArr=array(
- 1=>'高一',
- 2=>'高二',
- 3=>'高三'
- );
- foreach ($dataList as $val):
- $i++;
- ?>
- <tr id="<?php echo $val['zl_exam_group_id']?>">
- <td><?php echo $i;?></td>
- <td class="tl"><?php echo isset($gradeArr[$val['zl_grade']])?$gradeArr[$val['zl_grade']]:''?></td>
- <td><?php echo $val['zl_exam_name']?></td>
- <td class="tl"><?php echo date('Y-m-d',$val['zl_exam_date']) ?></td>
- <td class="tl"><?php echo implode(',',$val['subjects'])?></td>
- <td class="tl"><?php echo $val['classCount']?></td>
- <td class="tl"><?php echo $val['progress']?></td>
- <td>
- <?php echo $val['status']==1?'已上传成绩':'未上传成绩'?>
- </td>
- <td>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('zhiliao/exam_list',array('exam_group_id'=>$val['zl_exam_group_id']));?>'"></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="上传成绩" onclick="javascript:location.href='<?php echo $this->createUrl('zhiliao/upload',array('exam_group_id'=>$val['zl_exam_group_id']));?>'"></span>
- <?php if($val['status']==0):?>
- <i class="icon icon-edit" title="编辑"></i>
- <?php endif;?>
- <?php
- if($val['zl_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="9" 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('zhiliao/index').'?page='.($page-1).'&grade='.$grade.'&classId='.$class.'&display='.$display.'">上一页</a></li>';
- }
- for($i=$StartPage;$i<=$EndPage;$i++){
- $url=$this->createUrl('zhiliao/index')."?page=".$i."&grade=".$grade."&classId=".$class.'&display='.$display;
- 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('zhiliao/index').'?page='.($page+1).'&grade='.$grade.'&classId='.$class.'&display='.$display.'">下一页</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>
- </div>
- <label class="checkAll"><input class="select_all" type="checkbox" checked="checked" />全选</label>
- <div class="class_area">
- </div>
- <h2>报表下载设置</h2>
- <h3 class="table_set_1">总分段人数分析表(请按分数进行分段):<span class="fr">注:分段包含右边界值</span></h3>
- <div class="table_set_1">
- <span class="total_score"></span>-
- <input type="hidden" name="score_0" value="0">
- <input type="text" class="subsection" name="score_1" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_2" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_3" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_4" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_5" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_6" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_7" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_8" srcvalue="" value="">-
- <input type="text" class="subsection" name="score_9" srcvalue="" value="">-0
- <input type="hidden" name="score_10" value="0">
- </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">
- <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(){
-
- $('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('zhiliao/edit')?>?exam_group_id="+id;
- });
- $('.add_exam').click(function(){
- window.location.href="<?php echo $this->createUrl('zhiliao/edit')?>";
- });
- $('.blackListSet').click(function(){
- window.location.href="<?php echo $this->createUrl('zhiliao/blackList')?>";
- });
- $('.unpaidSet').click(function(){
- window.location.href="<?php echo $this->createUrl('zhiliao/unpaidUserSetting')?>";
- });
- $('.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').click(function(){
- var cylet_id=$(this).closest('tr').attr('id');
- var compete=$(this).closest('tr').find('.showClassInfo span').eq(0).html();
- if(compete==0){
- layer.msg('暂时还没有可以生成报告的班级');
- return false;
- }
- $.ajax({
- url:'<?php echo $this->createUrl('cylet/loadcyletinfo')?>',
- type:'POST',
- dataType:'json',
- data:{'cylet_id':cylet_id},
- success:function(res){
- $('.select_all').prop('checked',true);
- $('#classModal-1').show();
- $('#classModal-1').find('.total_score').html(res.score);
- $('input[name=score_0]').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);
- }
- $('input[name=cylet_id]').val(cylet_id);
- }
- });
- /*
- $.ajax({
- url:'',
- type:'POST',
- dataType:'json',
- data:{'cylet_id':cylet_id},
- success:function(res){
- if(res.status==1){
- location.href = res.result;
- }else{
- layer.msg(res.result);
- }
- }
- });
- */
- });
- $('.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 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){
- layer.close(ii)
- if(res.status==1){
- location.href = res.result;
- }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');
- }
- });
- $('.table_set_1').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);
- }
- });
- $('.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);
- }
- });
- </script>
|