123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976 |
- <style>
- /*切换选择*/
- .tab-con{
- position: relative;
- height: 30px;
- width: 200px;
- background: #F2F2F2;
- border: 1px solid #01B677;
- border-radius: 15px;
- }
- .has-sel{
- background: #01B677;
- color: #fff;
- width: 50%;
- height: 30px;
- border-top-left-radius: 15px;
- border-bottom-left-radius: 15px;
- text-align: center;
- line-height: 30px;
- }
- .sel-opt{
- width: 50%;
- position: relative;
- color: #01B677;
- line-height: 30px;
- text-indent: 6px;
- cursor: pointer;
- }
- .sel-opt:after{
- content: '';
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-top: 8px solid #01B677;
- position: absolute;
- right: 12px;
- top: 12px;
- }
- // .sel-opt select{
- // width: 100%;
- // height: 30px;
- // background: #F2F2F2;
- // color: #01B677;
- // text-indent: 6px;
- // font-size: inherit;
- // border-top-right-radius: 15px;
- // border-bottom-right-radius: 15px;
- // cursor: pointer;
- // }
- // .sel-opt select option{
- // position: relative;
- // }
- .points{
- position: absolute;
- top: -2px;
- right: 0;
- width: 10px;
- height: 10px;
- background: #F01516;
- border-radius: 50%;
- }
- .sel-cons{
- border: 1px solid #01B677;
- width: 50%;
- position: absolute;
- right: 0;
- top: 30px;
- text-indent: 10px;
- display: none;
- }
- .sc-lis{
- line-height: 30px;
- cursor: pointer;
- }
- .sc-lis span{
- position: relative;
- }
- .sc-lis .points{
- top: 2px;
- right: -16px;
- }
- .add-class-list{position:relative}
- .class-add-list{
- position: absolute;
- background-color: #f9f9f9;
- min-width: 103px;
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
- padding: 0;
- left: -5px;
- top: 33px;
- display: none;
- color: rgb(51, 51, 51);
- z-index:1000;
- }
- .class-add-list a{
- display: flex;
- }
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_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="col-xs-4">
- <form method="get" id="form1" action="<?php echo $this->createUrl("third/change");?>">
- <div class="dataTables_length" style="margin: 6px 0px;">
- <div class="dataTables_length">
- <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
- <!--<button class="btn btn-minier btn-primary" id="search">搜索</button>-->
- <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
- </div>
- </div>
- <input type="hidden" name="cid" class="clid" value="<?php echo $class_id;?>" />
- <input type="hidden" name="eid" class="emid" value="<?php echo $exam_id;?>" />
- <input type="hidden" name="tid" value="<?php echo $type_id;?>" />
- </form>
- </div>
- <div class="col-xs-8">
- <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px;text-align: right;">
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="addPaperStudent">
- <i style="font-style: normal;" ></i>添加考试学生
- </a>
- <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudent">
- <i style="font-style: normal;" ></i>选择删除考试学生
- </a>
- <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudentAll">
- <i style="font-style: normal;" ></i>删除全部未考试学生
- </a>
- <?php
- if($use_answer_card_online_qrcode){
- // if(!$isCustomTpl ){
- ?>
- <a href="javascript:void(0);" code="2" class="btn label-primary-green btn-sm" id="createTempNew">
- 批量生成
- </a>
- <a href="javascript:void(0);" code="1" class="btn label-primary-green btn-sm" id="selectPrintNew">
- <i style="font-style: normal;" class="fa fa-print"></i>
- 批量打印
- </a>
- <a href="javascript:void(0);" code="3" class="btn label-primary-green btn-sm" id="printPaperNew">
- 批量下载
- </a>
- <!--
- <div href="javascript:void(0);" class="btn label-primary-green btn-sm add-class-list" >
- <i style="font-style: normal;" class="fa "></i>订单学生操作
- <div class="class-add-list">
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm createTempByOrder">订单学生生成</a>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm selectPrintByOrder">订单学生打印</a>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm printPaperByOrder">订单学生下载</a>
- </div>
- </div>
- -->
- <?php }?>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
- <?php echo $className;?> <?php echo $paperName;?>(使用<?php if($examInfo->school_card_status==0){if(Yii::app()->session['school_id']>999){echo '系统准考证号,长度为9位';}else{ echo '系统准考证号,长度为8位';}}else{echo '学校准考证号,长度为'.$examInfo->school_card_length.'位';}?>)
- </div>
- </div>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
- <thead>
- <tr>
- <th class="center">
- <!--<label class="pos-rel">
- <input type="checkbox" class="selectAll">
- <span class="lbl"></span>
- </label>-->
- <input type="checkbox" class="ace selectAll">
- </th>
- <th>学生名称</th>
- <th>学生编号</th>
- <th>系统准考证</th>
- <th>学校准考证</th>
- <th>身份证号</th>
- <th>答卷图片是否已上传</th>
- <?php if(!isset($under_line)):?>
- <th>原卷是否已上传</th>
- <?php endif;?>
- <th>成绩是否已生成</th>
- <?php if($use_answer_card_online_qrcode):?>
- <th>在线答题卡</th>
- <?php endif;?>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($result)):foreach($result as $rt):?>
- <tr>
- <td class="center">
- <!--<label class="pos-rel">
- <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
- <span class="lbl"></span>
- </label>-->
- <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>" online="<?php echo $rt['online_created']?>">
- </td>
- <td><?php echo $rt['studentName'];?></td>
- <td><?php echo $rt['studentCode'];?></td>
- <td><?php echo $rt['student_card'];?></td>
- <td><?php echo $rt['school_student_card'];?></td>
- <td><?php echo $rt['id_number'];?></td>
- <?php if(!isset($under_line)):?>
- <td><?php echo $rt['upload_answer_img'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- <?php endif;?>
- <td><?php echo $rt['student_img_paper'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- <td><?php echo $rt['is_complete'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- <?php if($use_answer_card_online_qrcode):?>
- <td><?php echo $rt['online_created'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- <?php endif;?>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="5">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <input type="hidden" name="paperId" id="paperId" value="<?php echo $paper_id;?>" />
- <input type="hidden" name="wpCode" id="wpCode" value="<?php echo $exam_id;?>" />
- <input type="hidden" name="schoolId" id="schoolId" value="<?php echo Yii::app()->session['school_id'];?>" />
- <input type="hidden" name="wpType" id="wpType" value="<?php echo $wp_type;?>" />
- <input type="hidden" name="className" id="className" value="<?php echo $className;?>" />
- <input type="hidden" name="paperName" id="paperName" value="<?php echo $paperName;?>" />
- <input type="hidden" name="isFeedback" id="isFeedback" value="<?php echo $isFeedback;?>" />
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- //客户端发送打印弹窗(客户端调用)
- function sendToPrint(){
- $('#classModal-1').hide();
- $('input[name=code]').val(0);
- layer.msg('已成功发送至下载/打印列表');
- }
- var isNewVersion=2;
- $(document).ready(function(){
- /*var str = '<div class="points"></div>';
- $(".sc-lis").each(function(){
- if($(this).find(".points").length>0){
- $(".sel-opt").append(str);
- }
- });*/
- $(".sel-opt,.sel-cons").mouseover(function(){
- $(".sel-cons").show();
- }).mouseout(function(){
- $(".sel-cons").hide();
- });
- $(".sc-lis").click(function(){
- var data = {
- subjectId : $(this).attr('val')
- };
- $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
- if(flags)
- {
- location.reload();
- }else
- {
- alert('网络异常');
- }
- });
- $('.has-sel').text($(this).text());
- $(".sel-cons").hide();
- });
- //批量生成
- $('#createTempNew').click(function(){
- var code=$(this).attr('code');
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- createOnline();
- });
- //批量打印
- $('#selectPrintNew').click(function(){
- var code=$(this).attr('code');
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- printOnline();
- });
- //批量下载
- $('#printPaperNew').click(function(){
- var code=$(this).attr('code');
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- downloadOnline();
- });
- //生成在线答题卡
- function createOnline(){
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- var student_ids = [];
- var class_name='<?php echo $className?>';
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- student_ids.push($(this).val()) ;
- }
- });
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- students:student_ids,
- class_name:class_name
- };
- var index=layer.msg('正在发送请求,请稍候',{time:0});
- $.post("<?php echo Yii::app()->createUrl('print/sendCreateOnlineStudents')?>",data,function(flags){
- //$.post("<?php echo Yii::app()->createUrl('print/sendCreateOnline')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- layer.close(index);
- layer.alert("模板生成中", {icon: 6}, function(){
- location.replace(location.href);
- });
- }else
- {
- layer.msg(m.msg);
- }
- });
- }
- //打印在线答题卡
- function printOnline(){
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- var student_ids = [];
- var class_name='<?php echo $className?>';
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- student_ids.push($(this).val()) ;
- }
- });
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- students:student_ids,
- };
- $.post("<?php echo Yii::app()->createUrl('print/printPdfOnline')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.success==1)
- {
- if(isNewVersion==1){
- params={
- exam_id:"<?php echo $exam_id ?>",
- student_id:student_ids,
- };
- evaluationClient.NewPrintPDF(JSON.stringify(params));
- }else if(isNewVersion==2){
- let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id;?>"],"studentIds":student_ids}}
- evaluationClient.BulkPrintPDF(JSON.stringify($param))
- }else{
- evaluationClient.PrintPDF(flags);
- }
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- }else
- {
- if(m.msg!=undefined){
- layer.msg(m.msg);
- }else{
- layer.msg('打印失败');
- }
- }
- });
- }
- //下载在线答题卡
- function downloadOnline(){
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- var student_ids = '';
- var finishCheck = 0;
- var failCheck = 0;
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if($(this).attr("online") == 1){
- finishCheck = 1;
- if ($(this).val() && $(this).attr("stnm")) {
- student_ids = student_ids +$(this).val()+',';
- }
- }else{
- failCheck = 1;
- }
- }
- });
- if(!finishCheck){
- layer.msg('当前选中的学生中,还未有已经生成的,请重新勾选~',{'btn':['确定'],time:0});
- return false;
- }
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- student_id:student_ids
- };
- var text = '';
- if(finishCheck && failCheck){
- text = '当前批量打印选中的学生有存在还未生成的,默认只会打印已经生成的,请知悉!';
- }
- if(finishCheck && !failCheck){
- text = '确定下载选中学生吗?';
- }
- layer.msg(text,
- {
- btn:['确定','取消'],
- time: 0,
- yes:function(){
- layer.closeAll();
- if(isNewVersion>=1){
-
- evaluationClient.NewDownLoadPDF(JSON.stringify(data));
- }else{
-
- console.log('old');
- $(".loading-pop").show();
- $.post("<?php echo Yii::app()->createUrl('print/downloadOnlineBatch')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- var html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
- '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
- '</div>'+
- '</div>'+
- "";
- //
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: '打印包',
- content: html,
- success: function(index, layerObj){
- $(".loading-pop").hide();
- jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.result+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
- jQuery("#confirm, #cancel").on("click", function(){
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function(){
- jQuery("#url").select();
- });
- },
- end: function(){
- }
- });
- return;
- }else {
- layer.msg(m.result);
- $(".loading-pop").hide();return;
- }
- $(".loading-pop").hide();
- return;
- });
- }
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- }
- }
- );
- }
- })
- function ccc(){
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- return false;
- }
- });
- }
- $(function(){
- // 全选\反选
- $(".selectAll").click(function(){
- if ($(this).prop("checked")) {
- $(".myselect").prop("checked",true);
- } else {
- $(".myselect").prop("checked",false);
- }
- });
- $("body").delegate("#stu_select_all","click",function(){
- $(this).closest("table").find("tbody .myselect").prop("checked",$(this).prop("checked"))
- });
- $("#addPaperStudent").click(function(){
- var studentsIds;
- var html1="";
- var html = ""+'<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px"><thead><tr><th><input type="checkbox" class="stu selectAll" id="stu_select_all"></th><th>学生名称</th><th>学生编号</th></tr></thead><tbody>';
- <?php if($no_paper_student){
- foreach($no_paper_student as $v)
- {
- ?>
- html1=html1+'<tr><td><input type="checkbox" class="stu myselect" value="<?php echo $v['student_id']?>"></td><td><?php echo $v['realname']?></td><td><?php echo $v['student_id']?></td></tr>'
- <?php } }else{?>
- html1='<tr><td colspan="3">没有新的学生</td></tr>';
- <?php }?>
- html=html+html1;
- html=html+'</tbody></table>'+'<div class="row" style="margin:15px auto; text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
- '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>';
- layer.open({
- type: 1,
- area: ['450px', '280px'],
- title: "为本次考试添加本班学生",
- content: html,
- success: function(index, layerObj){
- jQuery("#cancel").on("click", function(){
- layer.closeAll();
- });
- jQuery("#confirm").on("click", function(){
- if (!$("input[class='stu myselect']").is(':checked'))
- {
- layer.msg('请至少选择一个学生!');return false;
- }
- jQuery("input[class='stu myselect']").each(function()
- {
- if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
- {
- studentsIds += ","+jQuery(this).val();
- }
- });
- if(studentsIds)
- {
- studentsIds = studentsIds.replace("undefined,",'');
- }
- var data={
- "studentsIds":studentsIds,
- "exam_id":"<?php echo $exam_id ?>",
- "paper_id":"<?php echo $paper_id ?>",
- "class_id":"<?php echo $class_id?>"
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/addPaperStudent");?>",
- data,
- function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("添加成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==3){
- var icon = 5;
- layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("添加失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- }
- );
- layer.closeAll();
- });
- },
- end: function(){
- }
- });
- });
- $("#delPaperStudent").click(function(){
- // 判断是否有选中
- var studentsIds;
- if (!$("input[class='ace myselect']").is(':checked'))
- {
- layer.msg('请至少选择一个学生!');return false;
- }
- feedback=false;
- jQuery("input[class='ace myselect']").each(function()
- {
- if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
- {
- studentsIds += ","+jQuery(this).val();
- if($(this).closest('tr').find('td').eq(6).find('span').html()=='是'){
- feedback=true;
- }
- }
- });
- if(feedback){
- layer.msg('学生已上传成绩不能删除!');return false;
- }else{
- msg='确定删除选中的学生吗?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- if(studentsIds)
- {
- studentsIds = studentsIds.replace("undefined,",'');
- }
- var data={
- "studentsIds":studentsIds,
- "exam_id":"<?php echo $exam_id ?>",
- "paper_id":"<?php echo $paper_id ?>",
- "class_id":"<?php echo $class_id?>",
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/delPaperStudent?");?>",data,function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("删除成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("不能删除已上传成绩的学生", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("删除失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- });
- }
- });
- });
- $("#delPaperStudentAll").click(function(){
- // 判断是否有选中
- var studentsIds;
- if($('input[name=isFeedback]').val()==1){
- msg='所选考生中含有已上传答题卡的考生,删除后,上传总数量与阅卷任务量将会与考生数量不一致,请谨慎操作!';
- }else{
- msg='确定删除全部未考试的学生吗?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var data={
- "exam_id":"<?php echo $exam_id ?>",
- "paper_id":"<?php echo $paper_id ?>",
- "class_id":"<?php echo $class_id?>",
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/delPaperStudentAll?");?>",data,function(data){
- var m =JSON.parse(data);
- if(m.status==1)
- {
- var icon = 6;
- layer.alert("删除成功", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else if(m.status==2){
- var icon = 5;
- layer.alert("无未上传成绩的学生", {icon: icon}, function(){
- location.replace(location.href);
- });
- }else{
- var icon = 5;
- layer.alert("删除失败", {icon: icon}, function(){
- location.replace(location.href);
- });
- }
- });
- }
- });
- });
- // 打印答案解析
- $("#printAnswer").click(function(){
- layer.msg('您确定下载答案解析嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var wpCode = $("#wpCode").val();
- if (!wpCode) {
- layer.msg('周周练id有误!');return false;
- }
- jQuery.post(
- '<?php echo $this->createUrl('print/createtempelate');?>',
- {"eid":wpCode},
- function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- //alert(obj.message);
- //alert(obj);
- evaluationClient.printDAJX(JSON.stringify(obj.object));
- } else {
- layer.msg(obj.message);
- }
- }
- );
- }
- });
- });
- /*在线答题卡订单学生操作*/
- $(".add-class-list").hover(function(){
- $('.class-add-list').toggle();
- });
- $('.createTempByOrder').click(function(){
- createOnlineByOrder();
- });
- $('.selectPrintByOrder').click(function(){
- printOnlineByOrder();
- });
- $('.printPaperByOrder').click(function(){
- downloadOnlineByOrder();
- });
- //生成在线答题卡
- function createOnlineByOrder(){
- var class_name='<?php echo $className?>';
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- class_name:class_name,
- check_order:1
- };
- text = '确定生成本班所有订单学生的在线答题卡吗?';
- layer.msg(text,
- {
- btn:['确定','取消'],
- time: 0,
- yes:function(){
- var index=layer.msg('正在发送请求,请稍候',{time:0});
- $.post("<?php echo Yii::app()->createUrl('print/sendCreateOnlineStudents')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- layer.close(index);
- layer.alert("模板生成中", {icon: 6}, function(){
- location.replace(location.href);
- });
- }else
- {
- layer.msg(m.msg);
- }
- });
- }
- })
- }
- //打印在线答题卡
- function printOnlineByOrder(){
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- check_order:1
- };
- text = '确定打印本班所有订单学生的在线答题卡吗?';
- layer.msg(text,
- {
- btn:['确定','取消'],
- time: 0,
- yes:function(){
- $.post("<?php echo Yii::app()->createUrl('print/PrintPdfOnlineByOrder')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.success==1)
- {
- students=m.students;
- if(m.all_created==0){
- layer.msg('订单学生存在还未生成的,默认只会打印已经生成的,请知悉!',{
- btn:['确定','取消'],
- time: 0,
- yes:function(){
- params={
- exam_id:"<?php echo $exam_id ?>",
- student_id:students
- };
- let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id?>"],"studentIds":students}}
- if(isNewVersion==1){
- evaluationClient.NewPrintPDF(JSON.stringify(params));
- }else if(isNewVersion==2){
- evaluationClient.BulkPrintPDF(JSON.stringify($param))
- }
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- }
- })
- }else{
- params={
- exam_id:"<?php echo $exam_id ?>",
- student_id:students
- };
- let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id?>"],"studentIds":students}}
- // evaluationClient.BulkPrintPDF(JSON.stringify($param))
- if(isNewVersion==1){
- evaluationClient.NewPrintPDF(JSON.stringify(params));
- }else if(isNewVersion==2){
- evaluationClient.BulkPrintPDF(JSON.stringify($param))
- }
- // evaluationClient.NewPrintPDF(JSON.stringify(params));
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 });
- }
- }else
- {
- if(m.msg!=undefined){
- layer.msg(m.msg);
- }else{
- layer.msg('打印失败');
- }
- }
- });
- }
- })
- }
- //下载在线答题卡
- function downloadOnlineByOrder(){
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- };
- text = '确定下载本班所有订单学生的在线答题卡吗?';
- layer.msg(text,
- {
- btn:['确定','取消'],
- time: 0,
- yes:function(){
- //读取订单学生列表
- $.ajax({
- url:'<?php echo $this->createUrl('print/printPdfOnlineByOrder')?>',
- type:'POST',
- dataType:'json',
- data:data,
- success:function(res){
- if(res.success==1){
- students=res.students;
- if(res.all_created==0){
- layer.msg('订单学生存在还未生成的,默认只会下载已经生成的,请知悉!',{
- btn:['确定','取消'],
- time: 0,
- yes:function(){
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- student_id:students
- };
- evaluationClient.NewDownLoadPDF(JSON.stringify(data));
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- }
- })
- }else{
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- student_id:students
- };
- evaluationClient. NewDownLoadPDF(JSON.stringify(data));
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- }
- }else{
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- layer.msg('下载失败');
- }
- }
- }
- });
- }
- }
- );
- }
- })
- </script>
|