123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600 |
- <script src="/js/xsgl.js" xmlns="http://www.w3.org/1999/html"></script>
- <style>
- .diy_select_list li{padding-left:0px;}
- .layer-zd{
- padding: 15px 40px;
- }
- #report-class-bulid{
- width: 75px;
- line-height: 25px;
- border-radius: 3px;
- float: right;
- color: #fff;
- background-color: #12985b !important;
- border: none;
- outline: none;
- }
- .table-zd{
- margin-top:15px;
- width: 100%;
- line-height: 30px;
- text-align: center;
- }
- .page-zd{
- margin: 15px;
- text-align: center;
- }
- .layui-layer-title{
- font-size: 18px;
- color: #fff;
- background-color: #12985b !important;
- }
- </style>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery(".delClass").click(function(){
- document.classId = jQuery(this).attr("classId");
- document.semesterId = "<?php echo $semesterId;?>";
- var msg = <?php echo Yii::app()->session["role"] ? Yii::app()->session["role"] : 1;?> == 2 ? "删除班级会将班级下学生一并删除,确定删除?" : "确定删除?";
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- jQuery.post(
- "<?php echo $this->createUrl("classes/delclassact");?>",
- {"classId": document.classId, "semesterId":document.semesterId},
- function(data){
- data = eval("("+data+")");
- if(data.code == "0"){
- msg = data.msg;
- icon = 6;
- }
- else{
- msg = "因为以下原因操作失败:<br/>"+data.msg;
- icon = 5;
- }
- layer.alert(msg, {icon: icon}, function(){
- location.href = "<?php echo $this->createUrl("classes/index?semesterId={$semesterId}");?>";
- });
- }
- );
- }
- });
- });
- jQuery("#search").click(function(){
- //var semesterId = jQuery(this).val();
- var grade_id = jQuery(".diy_select1 input[name=grade_id]").val();
- var realname = jQuery("input[name=realname]").val();
- var smid = jQuery("input[name=semesters]").val();
- var arts_science=$("input[name=arts_science]").val();
- location.href = "<?php echo $this->createUrl("parent/index?grade_id=");?>"+grade_id+"&realname="+realname+"&semesterId="+smid+'&arts_science='+arts_science;
- });
- });
- </script>
- <link rel="stylesheet" href="/fonts/zhuanzhang/iconfont.css" />
- <link rel="stylesheet" href="/css/toTransferPop.css" />
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row">
- <div class="dataTables_length margin-zy">
- <div class="col-xs-9" style="margin-bottom: 10px;">
- <div style="float: left;margin-top: 4px;">
- 按学期筛选:
- </div>
- <div class='diy_select' style="width:215px;">
- <input type='hidden' class='diy_select_input' name="semesters" id="semesters" value="<?php echo $semesterId;?>"/>
- <div class='diy_select_txt' style="width:182px;">
- <?php
- echo empty($thisSemester['semester_name']) ? '--请选择--':$thisSemester['semester_name'];
- if($this->schoolManager->isCurrentSemester($semesterId)){echo "(当前学期)";}
- else if($this->schoolManager->isFutureSemester($semesterId)){echo "(未开始学期)";}
- else{echo "(已完成学期)";}
- ?>
- </div>
- <div class='diy_select_btn'></div>
- <ul class='diy_select_list'>
- <?php foreach($semesters as $semester){?>
- <li val="<?php echo $semester->semester_id;?>">
- <?php echo $semester->semester_name;
- if($this->schoolManager->isCurrentSemester($semester->semester_id)){echo "(当前学期)";}
- else if($this->schoolManager->isFutureSemester($semester->semester_id)){echo "(未开始学期)";}
- else{echo "(已完成学期)";}
- ?>
- </li>
- <?php }?>
- </ul>
- </div>
- <div style="float: left;margin-top: 4px; padding-left: 5px;">
- 年级:
- </div>
- <div class='diy_select1' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
- <input type='hidden' id="grade_id" name="grade_id" class='diy_select_input1' value="<?php if(empty($grade_id)){echo 0;}else{echo $grade_id;}?>"/>
- <div class='diy_select_txt1'> <?php if(empty($grade_id)){echo '请选择年级';}else{echo Yii::app()->params['grade_list'][$grade_id]['grade_name'];}?></div>
- <div class='diy_select_btn1'></div>
- <ul class='diy_select_list1'>
- <li val="0" >请选择年级</li>
- <?php
- if(Yii::app()->params['grade_config']){
- foreach (Yii::app()->params['grade_config'] as $val){
- echo '<li val="'.$val['id'].'" >'.$val['grade_name'].'</li>';
- }
- }
- ?>
- </ul>
- </div>
- <?php if(Yii::app()->params['section']!=0):?>
- <div style="float: left;margin-top: 4px; padding-left: 5px;">
- 文理科:
- </div>
- <div class='diy_select2' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
- <input type='hidden' id="arts_science" name="arts_science" class='diy_select_input2' value="<?php if(empty($arts_science)){echo 0;}else{echo $arts_science;}?>"/>
- <div class='diy_select_txt2'><?php if(empty($arts_science)){echo '不限';}else{ switch($arts_science){
- case 1:echo '文科';break;
- case 2:echo '理科';break;
- }}?></div>
- <div class='diy_select_btn2'></div>
- <ul class='diy_select_list2'>
- <li val="0" >不限</li>
- <li val="1">文科</li>
- <li val="2">理科</li>
- </ul>
- </div>
- <?php else:?>
- <input type='hidden' id="arts_science" name="arts_science" class='diy_select_input2' value="0"/>
- <?php endif;?>
- <input type="text" class="form-control input-sm" placeholder="请输入教师姓名!" name="realname" value="<?php if(!empty($realname)){echo $realname;}?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- </div>
- </div>
- <div id="download-excel" class="dataTables_filter" style="margin-right: 10px;">
- <a class="btn label-primary-green btn-sm" style="float:right;" href="<?php echo $this->createUrl('parent/excelinfo');?>">
- <i class="fa fa-plus" style="font-style: normal;"></i>批量上传教师
- </a>
- </div>
- </div>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <th>班级</th>
- <th>学期</th>
- <th>年级</th>
- <th>班主任</th>
- <th>学科教师人数</th>
- <th>学生人数</th>
- <th>学生绑定数量</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($yearsList)){foreach($yearsList as $cl){?>
- <tr>
- <td><?php echo $cl['class_name'];?></td>
- <td><?php echo $cl['name'];?></td>
- <td><?php echo Yii::app()->params['grade_list'][$cl['grade']]['grade_name'];?></td>
- <td><?php echo $cl['teachers_bzr']?></td>
- <td><?php echo $cl['teachers_count'];?></td>
- <td><?php echo $cl['student_count'];?></td>
- <td><?php echo $cl['student_bind_count'];?></td>
- <td><a href="<?php echo $this->createUrl("parent/view?cid=".$cl['class_id']);?>">详情</a></td>
- </tr>
- <?php }}else{?>
- <tr><td colspan="10">暂无数据!</td></tr>
- <?php }?>
- </tbody>
- </table>
- <?php if(!empty($page_total)):?>
- <div class="row">
- <div class="col-xs-7">
-
- </div>
- <div class="col-xs-5">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- 'firstPageLabel'=> '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $pages,
- 'maxButtonCount'=> 5,
- ));
- echo '共:'.$page_total.'条';
- ?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script src="/js/layer/layer.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- var _one_select_class = [];
- var _two_select_class = [];
- var _three_select_class = [];
- $("#zhuanban").click(function(){
- $("#pop-zhuan").removeClass("dn");
- });
- //班级排序
- $("#change-class-sort").click(function(){
- $.ajax({
- type:'post',
- url: "<?php echo $this->createUrl('classes/getClassWithSort');?>",
- dataType: 'json',
- success: function (res) {
- var html = ''
- if (res.status){
- for (var i=0; i<res.data.length; i++) {
- var item = res.data[i];
- html += '<li class="tsd-lis clearfix" classId="'+item.class_id+'">';
- html += '<span class="rev-class prev-class-title ellipsis">'+item.class_name+'</span>';
- html += '<span class="fr current-class">';
- html += '<input type="number" style="width: 50px;height: 30px;text-align: center" name="sort" value="'+item.sort+'">';
- html += '</span></li>';
- }
- $('.class-list').html(html);
- $("#pop-sortClass").removeClass("dn");
- }else {
- layer.msg("暂无班级");
-
- }
- }
- })
- })
-
- $(".one_class").each(function(){
- var _this = $(this);
- _this.data("last",_this.val()).change(function(){
- var oldVal = _this.data("last");
- var newVal = _this.val();
- var temp = 0;
- for(var i=0;i<$(".one_class").length;i++){
- if($(".one_class").eq(i).val() == newVal){
- if(newVal!=0){
- temp++;
- if(temp>1){
- _this.val(oldVal);
- _this.data("last",oldVal);
- alert("不能重复选择班级")
- break;
- }
- }
- }else{
- _this.data("last",_this.val());
- }
- }
- })
- })
- $(".aline_one_class").each(function(){
- var _this = $(this);
- _this.data("alast",_this.val()).change(function(){
- var oldVal = _this.data("alast");
- var newVal = _this.val();
- var temp = 0;
- for(var i=0;i<$(".aline_one_class").length;i++){
- if($(".aline_one_class").eq(i).val() == newVal){
- if(newVal!=0){
- temp++;
- if(temp>1){
- _this.val(oldVal);
- _this.data("alast",oldVal);
- alert("不能重复选择班级")
- break;
- }
- }
- }else{
- _this.data("alast",_this.val());
- }
- }
- })
- })
- // 点击单选
- $("#pop-zhuan .ttf-radio-con li").click(function(){
- $(this).find(".sel-btn").addClass("select");
- $(this).siblings().find(".sel-btn").removeClass("select");
- $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").hide().removeClass('hide');
- $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").eq($(this).index()).show();
- });
- $("#pop-zhuan .ttf-radio-con.alone li").click(function(){
- $(this).find(".sel-btn.alone").addClass("select");
- $(this).siblings().find(".sel-btn.alone").removeClass("select");
- $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").hide().removeClass('hide');
- $(this).closest(".ttf-tab-right").find(".ttf-sel-datas").eq($(this).index()).show();
- });
- // 内容切换
- $("#pop-zhuan .ttf-tog-menu").click(function(){
- // console.log($(this).index());
- $(this).addClass("active").siblings().removeClass("active");
- $(".ttf-tab-con").hide();
- $(".ttf-tab-con").eq($(this).index()).show().removeClass("hide");
- });
- // 点击关闭
- $(".ttf-close-btn").click(function(){
- $("select").val(0);
- $(".ttf-pop").addClass('dn');
- });
- });
- function cancelPay(cid){//alert(uid);return;
- if (!cid) return;
- layer.open({
- type: 2,
- skin: 'layui-layer-lan',
- title: '设置用户缴费',
- fix: false,
- shadeClose: true,
- maxmin: true,
- area: ['1000px', '500px'],
- content: "<?php echo $this->createUrl('classes/import');?>/cid/"+cid,
- });
- }
-
- function saveClassSort() {
- var classSort = [];
- $('input[name="sort"]').each(function () {
- var str = $(this).parent().parent().attr('classId')+'_'+$(this).val();
- classSort.push(str);
- });
- if(classSort.length==0){
- layer.msg("排序参数错误");
- return false;
- }
- $.ajax({
- type:'post',
- url: "<?php echo $this->createUrl('classes/saveClassSort');?>",
- data: {'classSort': classSort},
- dataType: 'json',
- success: function (res) {
- var html = ''
- if (res.status){
- $(".ttf-pop").addClass('dn');
- layer.alert('修改成功',{icon:1,closeBtn:0},function () {
- location.reload();
- })
- }else {
- layer.msg("修改失败");
- }
- }
- })
- }
-
- function classesMesByGradeAndPage(grade,page){
- if(!grade){
- grade = 1;
- }
- if(!page){
- page = 1;
- }
- $.ajax({
- type:'get',
- url: "<?php echo $this->createUrl('classes/ajaxGetClassesByGrade');?>",
- data:{grade:grade,page:page},
- dataType: 'json',
- success: function (res) {
- var html = ''
- if (res.status == 1){
- console.log(res.data);
- html += "<table border=1 class='table-zd'>";
- html += " <tr>";
- html += " <td><input type='checkbox' class='select-class-all'></td>";
- html += " <td>班级</td>";
- html += " <td>人数</td>";
- html += " <td>状态</td>";
- html += " <td>生成进度</td>";
- html += " </tr>";
- for(var i = 0;i<res.data.rs.length;i++){
- html += " <tr>";
- if(res.data.rs[i]['report_status'] == 0){
- if(res.data.rs[i]['stu_count'] > 0 ){
- html += " <td><input type='checkbox' class='select-class' classId='"+res.data.rs[i]['class_id']+"'></td>";
- }else{
- html += " <td><input type='checkbox' class='select-class' classId='"+res.data.rs[i]['class_id']+"' disabled='disabled'></td>";
- }
-
- }else{
- html += " <td><input type='checkbox' class='select-class' classId='"+res.data.rs[i]['class_id']+"' disabled='disabled'></td>";
- }
-
- html += " <td>"+res.data.rs[i]['class_name']+"</td>";
- html += " <td>"+res.data.rs[i]['stu_count']+"</td>";
- if(res.data.rs[i]['report_status'] == 0){
- html += " <td>未生成</td>";
- html += " <td>0/"+res.data.rs[i]['stu_count']+"</td>";
- }else if(res.data.rs[i]['report_status'] == 1){
- html += " <td>正在生成</td>";
- html += " <td>0/"+res.data.rs[i]['stu_count']+"</td>";
- }else if(res.data.rs[i]['report_status'] == 2){
- html += " <td>已生成</td>";
- html += " <td>"+res.data.rs[i]['stu_count']+"/"+res.data.rs[i]['stu_count']+"</td>";
- }
-
-
- html += " </tr>";
- }
- html += "</table>";
- html += '<div class="page-zd">';
- html += ' <div class="dataTables_paginate paging_simple_numbers">';
- html += res.data.pages_index;
- html +='共:'+res.data.page.rowsCount+'条';
- html += "</div>";
- html += "</div>";
- $(".class-data").html(html);
- }else {
- console.log(11);
- }
- }
- })
- }
- $("#year-report").click(function () {
- //通过年级页码获取班级信息
- var html = "";
- html += "<div class='layer-zd'>";
- html += "<select class='report-grade'>";
- html += "<option value='1'>高一</option>";
- html += "<option value='2'>高二</option>";
- html += "<option value='3'>高三</option>";
- html += "</select>";
- html += "<button id='report-class-bulid'>生成</button>";
- html += "<div class='class-data'></div>";
- html += "<div>";
- html += "<div class='notice-report-1'>注:</div>";
- html += "<div class='notice-report-2'>1、确认哪些班级需要使用学生年度账单,然后再勾选进行生成!</div>";
- html += "<div class='notice-report-3'>2、点击生成后,稍后再确认是否为“已生成”状态,只有已生成的班级才可以在班级列表中下载学生年度账单</div>";
- html += "</div>";
- html += "</div>";
- layer.open({
- type: 1,
- title: '生成年度账单',
- btn: [],
- area: ['640px', '500px'], //宽高
- btnAlign: 'c',
- content: html,
- btn2: function (index, layero) {
- }
- });
- classesMesByGradeAndPage(1,1);
-
- // alert(1);
- });
- $("body").delegate(".report-grade","change",function(){
- var grade = $(this).val();
- if(grade){
- classesMesByGradeAndPage(grade,1);
- }
- })
- $("body").delegate(".select-class-all","click",function(){
- if($(this).prop("checked")){
- $('.select-class').each(function(i){
- if(!$(this).prop("disabled")){
- $(this).prop("checked",true);
- }
- });
- }else{
- $('.select-class').prop("checked",false);
- }
- })
-
- $("body").delegate("#report-class-bulid","click",function(){
- var classIds = [];
- $(".select-class:checked").each(function(){
- classIds.push($(this).attr('classId'));
- });
- if(classIds.length>0){
- var url = "<?php echo $this->createUrl("classes/yearReport") ?>";
- $.post(url, {classId: classIds}, function(data) {
- var m = JSON.parse(data);
- console.log(m);
- if (m.status == 0)
- {
-
- } else
- {
- setTimeout(function() {
- $(".loading-pop").hide();
- }, 500);
- layer.msg(m.error)
- }
- });
- $(".select-class:checked").each(function(){
- $(this).prop("disabled",true);
- $(this).parent().parent().find("td:eq(3)").html("正在生成");
- });
- }
- })
- $("body").delegate(".page-zd ul li a","click",function(){
- var page = $(this).html();
- var grade = $(".report-grade").val();
- if(isNaN(page)){
- var current_page = parseInt($(".page-zd ul .selected").text());
- if(page == '下一页'){
- classesMesByGradeAndPage(grade,(current_page + 1));
- }else if(page == '上一页'){
- classesMesByGradeAndPage(grade,(current_page-1));
- }
-
- }else{
- classesMesByGradeAndPage(grade,page);
- }
-
- })
- function downfile(classId,status) {
- $(".loading-pop").show();
- if(status == 2){
- var msg = '是否确定下载该班级学生的年度使用报告吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- location.href="<?php echo $this->createUrl("classes/down_load_yearreport")?>"+"?classId="+classId;
- }
- });
- }else{
- layer.msg('账单未生成');
- }
- var url = "<?php echo $this->createUrl("classes/yearReport") ?>";
-
-
-
- }
- $(function(){
- $('#uploadFile').val('');
- $('.select_file').click(function(){
- $('#uploadFile').click();
- });
- $('#uploadFile').change(function(){
- if($('#uploadFile').val()!=''){
- $('#form1').submit();
- }
- });
- })
- </script>
|