1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807 |
- <link rel="stylesheet" href="/css/cylet.css" />
- <style>
- .sc-lis span{
- position: relative;
- }
- .sc-lis .points{
- top: 2px;
- right: -16px;
- }
- .label-primary-gray{background:#676767;}
- .loading-pop{position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 200;}
- .loading-pop-msg{color: #fff;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);font-size: 22px;letter-spacing: 4px;}
- .select_area{
- width:40%;
- height:85px;
- margin:0 30px;
- float: left;
- border:1px solid #ccc;
- text-align: center;
- line-height: 85px;
- border-radius:5px;
- }
- .active{color:#fff;background: #0e8e54}
- .online_word_btn{clear:both;text-align: center;margin-top:50px;}
- .online_word_btn button{}
- #classModal-1 .class-modal-1{
- min-height: auto;
- }
- #classModal-1 .class-modal-body-1:after{
- content: '';
- display: block;
- clear: both;
- }
- #classModal-1 .online_word_btn{
- padding: 10px 0;
- }
- #classModal-1 .online_word_btn button{
- width: 120px;
- height: 40px;
- text-align: center;
- line-height: 40px;
- border-radius: 5px;
- background: #0e8e54;
- border:1px solid #0e8e54;
- color: #fff;
- border:none;
- padding: 0;
- }
- #classModal-1 .online_word_btn button.cancel{
- color: #333;
- border:1px solid #333;
- background: #fff;
- }
- #classModal-1 .class-modal-1{
- min-height: auto;
- }
- #classModal-1 .class-modal-body-1:after{
- content: '';
- display: block;
- clear: both;
- }
- #classModal-1 .online_word_btn{
- padding: 10px 0;
- }
- #classModal-1 .online_word_btn button{
- width: 120px;
- height: 40px;
- text-align: center;
- line-height: 40px;
- border-radius: 5px;
- background: #0e8e54;
- border:1px solid #0e8e54;
- color: #fff;
- border:none;
- padding: 0;
- margin-left:10px;
- }
- #classModal-1 .online_word_btn button.cancel{
- color: #333;
- border:1px solid #333;
- background: #fff;
- }
- #classModal-1 .select_area{
- position: relative;
- }
- #classModal-1 .select_area.active:after{
- display: block;
- }
- #classModal-1 .select_area.active:before{
- display: block;
- }
- #classModal-1 .select_area:after{
- display: none;
- content: '';
- position: absolute;
- width: 30px;
- height: 30px;
- right: 10px;
- bottom: 10px;
- border-radius: 50%;
- background: #fff;
- }
- #classModal-1 .select_area:before{
- display: none;
- content: '';
- position: absolute;
- width: 15px;
- height: 8px;
- border-left: 2px solid #0e8e54;
- border-bottom: 2px solid #0e8e54;
- right: 16px;
- bottom: 22px;
- z-index: 10;
- transform: rotate(-35deg);
- -webkit-transform: rotate(-35deg);
- }
- .icon-close-1{background-image: url("/images/chose.png")}
- .table_area{margin-top:50px;}
- .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("print/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;">
- <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){?>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="updatePaperStatus" style="display: none">
- <i style="font-style: normal;" ></i>是否使用学校准考证
- </a>
- <?php }?>
- <a href="javascript:void(0);" class="btn label-primary-blue 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(!$isCustomTpl || $useAnswerCardOnlineQrcode){
- // if(!$isCustomTpl ){
- ?>
- <a href="javascript:void(0);" code="2" class="btn <?php echo $tempCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="createTempNew">
- <!-- <a href="javascript:void(0);" code="2" class="btn <?php echo $tempCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="createTemp">-->
- 批量生成
- </a>
- <a href="javascript:void(0);" code="1" class="btn label-primary-green btn-sm" id="selectPrintNew">
- <!-- <a href="javascript:void(0);" code="1" class="btn label-primary-green btn-sm" id="selectPrint">-->
- <i style="font-style: normal;" class="fa fa-print"></i>
- <?php if ($tplTwo == 1){echo '批量打印';}else{echo '批量打印';}?>
- </a>
- <a href="javascript:void(0);" code="3" class="btn <?php echo $printCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="printPaperNew">
- <!-- <a href="javascript:void(0);" code="3" class="btn <?php echo $printCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="printPaper">-->
- 批量下载
- </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>
- <th>原卷是否已上传</th>
- <th>成绩是否已生成</th>
- <?php if(!$isCustomTpl){?>
- <th>模板是否已生成</th>
- <?php }?>
- <?php if($useAnswerCardOnlineQrcode):?>
- <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" data="<?php echo $rt['id_number'];?>" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>" status="<?php echo $rt['temp_status'];?>" 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>
- <td><?php echo $rt['upload_answer_img'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
- <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(!$isCustomTpl){?>
- <td><span style='color:<?php if($rt['temp_status'] == 1) echo 'green';else if($rt['temp_status'] == 3 || $rt['temp_status'] == 2) echo 'red';?>'><?php echo $rt['temp_str'];?></span></td>
- <?php }?>
- <?php if($useAnswerCardOnlineQrcode):?>
- <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="7">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <input type="hidden" name="paperId" id="paperId" value="<?php echo $exam_group_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>
- <div class="loading-pop" style="display:none;">
- <div class="loading-pop-msg">正在打包,请稍候···</div>
- </div>
- <div class="loading-pop" style="display:none;">
- <div class="loading-pop-msg">正在打包,请稍候···</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">
- <?php
- $isWordShow=false;
- $isOnlineShow=false;
- if(!$isCustomTpl ){
- $isWordShow=true;
- }
- if($useAnswerCardOnlineQrcode){
- $isOnlineShow=true;
- }
- if($isWordShow && $isOnlineShow){
- ?>
- <div class="table_area select_area txt_1 active" type="0">
- 生成word答题卡
- </div>
- <div class="table_area select_area txt_2" type="1">
- 生成在线答题卡
- </div>
- <input type="hidden" name="type" value="0">
- <?php
- }elseif($isWordShow){
- ?>
- <div class="table_area select_area txt_1 active" type="0">
- 生成word答题卡
- </div>
- <div class="table_area select_area txt_2 disabled" type="1">
- 生成在线答题卡
- </div>
- <input type="hidden" name="type" value="0">
- <?php
- }elseif($isOnlineShow){
- ?>
- <div class="table_area select_area txt_1 disabled" type="0">
- 生成word答题卡
- </div>
- <div class="table_area select_area txt_2 active" type="1">
- 生成在线答题卡
- </div>
- <input type="hidden" name="type" value="1">
- <?php
- }
- ?>
- </div>
- <div class="clear"></div>
- <div class="class-modal-body-1">
- <div class="online_word_btn">
- <button class="submit_select">确定</button>
- <button class="cancel">取消</button>
- <input type="hidden" name="code" value="" />
- </div>
- </div>
- </div>
- </form>
- </div>
- <script type="text/javascript">
- var tempCheck = '<?php echo $tempCheck;?>';
- var qxkPaper='<?php echo $qxkPaperId?>';
- var isNewVersion=2;
- $(".add-class-list").hover(function(){
- $('.class-add-list').toggle();
- });
- //客户端发送打印弹窗(客户端调用)
- function sendToPrint(){
- $('#classModal-1').hide();
- $('input[name=code]').val(0);
- layer.msg('已成功发送至下载/打印列表');
- }
- $(document).ready(function(){
- /*var str = '<div class="points"></div>';
- $(".sc-lis").each(function(){
- if($(this).find(".points").length>0){
- $(".sel-opt").append(str);
- }
- });*/
- $('.select_area').click(function(){
- if($(this).hasClass('disabled')){
- return false;
- }
- $('.select_area').removeClass('active');
- $(this).addClass('active');
- $('input[name=type]').val($(this).attr('type'));
- });
- $('#printPaperNew').click(function(){
- var code=$(this).attr('code');
- if(qxkPaper>0){
- downloadOnline();
- return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- $('input[name=code]').val(code);
- $('.txt_1').html('下载word答题卡');
- $('.txt_2').html('下载在线答题卡');
- $('#classModal-1').show();
- });
- $('#selectPrintNew').click(function(){
- if(qxkPaper>0){
- printOnline();
- return false;
- }
- var code=$(this).attr('code');
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- $('input[name=code]').val(code);
- $('.txt_1').html('打印word答题卡');
- $('.txt_2').html('打印在线答题卡');
- $('#classModal-1').show();
- });
- $('#createTempNew').click(function(){
- var code=$(this).attr('code');
- if(qxkPaper>0){
- createOnline();
- return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- $('input[name=code]').val(code);
- $('.txt_1').html('生成word答题卡');
- $('.txt_2').html('生成在线答题卡');
- $('#classModal-1').show();
- });
- $('.icon-close-1,.cancel').click(function(){
- $('#classModal-1').hide();
- $('input[name=code]').val(0);
- // $('.select_area').removeClass('active');
- // $('.select_area').eq(0).addClass('active');
- });
- $('.submit_select').click(function(){
- var code=$('input[name=code]').val();
- var targetType=$('input[name=type]').val(); //word或在线答题卡
- if(code==1){
- //打印试卷
- if(targetType==0){
- printWord();
- }else if(targetType==1){
- printOnline();
- //downloadOnline();
- }
- }else if(code==2){
- //生成
- if(targetType==0){
- createWord();
- }else if(targetType==1){
- createOnline();
- }
- }else if(code==3){
- //下载
- if(targetType==0){
- downLoadWord();
- }else if(targetType==1){
- downloadOnline();
- }
- }
- return false;
- });
- //下载在线答题卡
- 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));
- // let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id;?>"],"studentIds":student_ids}}
- // console.log( $param)
- // evaluationClient.BulkPrintPDF(JSON.stringify($param))
- // }else if(isNewVersion==1){
-
- }else{
- $(".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 } );
- }
- }
- );
- }
- //下载word答题卡
- function downLoadWord(){
- var printCheck = '<?php echo $printCheck;?>';
- if(!printCheck) return false;
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- // $(".loading-pop").show();
- var student_ids = '';
- var finishCheck = 0;
- var failCheck = 0;
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if($(this).attr("status") == 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();
- $(".loading-pop").show();
- $.post("<?php echo Yii::app()->createUrl('print/ajaxPrintPaper')?>",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;
- }
- });
- }
- }
- );
- }
- //生成在线答题卡
- 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);
- }
- });
- }
- //生成word答题卡
- function createWord(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- $('#createTemp').removeClass('label-primary-green');
- $('#createTemp').addClass('label-primary-gray');
- if(tempCheck){
- tempCheck = 0;
- var data = {
- exam_id:"<?php echo $exam_id ?>"
- };
- $.post("<?php echo Yii::app()->createUrl('print/ajaxCreateTemplate')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- layer.alert("模板生成中", {icon: 6}, function(){
- location.replace(location.href);
- });
- }else
- {
- layer.msg(m.result);
- $('#createTemp').addClass('label-primary-green');
- $('#createTemp').removeClass('label-primary-gray');
- tempCheck = 1;
- }
- });
- }else{
- return false;
- }
- }
- //打印在线答题卡
- 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('打印失败');
- }
- }
- });
- }
- //打印word
- function printWord(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- layer.msg('您确定打印嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var result = [];
- var paperId = $("#paperId").val();
- var wpCode = $("#wpCode").val();
- var schoolId = $("#schoolId").val();
- var wpType = $("#wpType").val();
- var paperName = $("#paperName").val();
- var className = $("#className").val();
- var markType = <?php echo $markType;?>;
- if (!paperId || !wpCode || !schoolId || !wpType || !paperName || !className) {
- layer.msg('打印信息错误!');return false;
- }
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() && $(this).attr("stnm")) {
- var id_number=$(this).attr('data');
- result.push('{'+'"clazzName":"'+className+'","paperId":"'+paperId+'","paperName":"'+paperName+'","selectQTNub":'+document.paperData.object.topicsCount.singleChoice+',"completionNub":'+document.paperData.object.topicsCount.blankFilling+',"questionSNub":'+document.paperData.object.topicsCount.shortAnswer+',"schoolId":"'+schoolId+'","studentCode":"'+$(this).val()+'","studentName":"'+$(this).attr("stnm")+'","wpCode":"'+wpCode+'","wpType":"'+wpType+'","markType":"'+markType+'","idNumber":"'+id_number+'"}');
- }
- }
- });
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- evaluationClient.newprintPaper("["+result+"]");
- }
- });
- }
- $(".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();
- });
- })
- function ccc(){
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- return false;
- }
- });
- }
- $(function(){
- var school_card_status =<?php echo $examInfo->school_card_status;?>;
- // 全选\反选
- $(".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(){
- }
- });
- });
- $("#updatePaperStatus").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>当前考试准考证的长度</th><th><?php if($examInfo->school_card_length){echo $examInfo->school_card_length;}else{ if(Yii::app()->session['school_id']>999){echo 9;}else{ echo 8;}}?></th></tr><tr><th>状态</th><th><input type="radio" class="ace1" name="school_card_status" value="0" <?php if($examInfo->school_card_status==0){echo 'checked';}?>>系统准考证号<input type="radio" class="ace1" name="school_card_status" value="1" <?php if($examInfo->school_card_status==1){echo 'checked';}?>>学校准考证号</th></tr></thead><tbody>';
- html=html+html1;
- html=html+'</tbody></table>'+'<div class="row" style="margin:0px 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', '190px'],
- title: "是否使用学校准考证",
- content: html,
- success: function(index, layerObj){
- jQuery("#cancel").on("click", function(){
- layer.closeAll();
- });
- jQuery(".ace1").on("click", function(){
- school_card_status = jQuery(this).attr('value');
- });
- jQuery("#confirm").on("click", function(){
- var data={
- exam_id:"<?php echo $exam_id ?>",
- school_card_status:school_card_status
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/setExamStudentCard");?>",
- 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.newprintDAJX(JSON.stringify(obj.object));
- } else {
- layer.msg(obj.message);
- }
- }
- );
- }
- });
- });
- $("#selectPrint").click(function(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- layer.msg('您确定打印嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var result = [];
- var paperId = $("#paperId").val();
- var wpCode = $("#wpCode").val();
- var schoolId = $("#schoolId").val();
- var wpType = $("#wpType").val();
- var paperName = $("#paperName").val();
- var className = $("#className").val();
- var markType = <?php echo $markType;?>;
- if (!paperId || !wpCode || !schoolId || !wpType || !paperName || !className) {
- layer.msg('打印信息错误!');return false;
- }
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() && $(this).attr("stnm")) {
- var id_number=$(this).attr('data');
- result.push('{'+'"clazzName":"'+className+'","paperId":"'+paperId+'","paperName":"'+paperName+'","selectQTNub":'+document.paperData.object.topicsCount.singleChoice+',"completionNub":'+document.paperData.object.topicsCount.blankFilling+',"questionSNub":'+document.paperData.object.topicsCount.shortAnswer+',"schoolId":"'+schoolId+'","studentCode":"'+$(this).val()+'","studentName":"'+$(this).attr("stnm")+'","wpCode":"'+wpCode+'","wpType":"'+wpType+'","markType":"'+markType+'","idNumber":"'+id_number+'"}');
- }
- }
- });
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
- evaluationClient.newprintPaper("["+result+"]");
- }
- });
- });
- $("#selectPrintPack").click(function(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- $(".loading-pop").show();
- var student_ids = '';
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() && $(this).attr("stnm")) {
- student_ids = student_ids +$(this).val()+',';
- }
- }
- });
- var data = {
- exam_id:"<?php echo $exam_id ?>",
- student_id:student_ids
- };
- $.post("<?php echo Yii::app()->createUrl('print/print_pack')?>",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;
- }
- });
- });
- var tempCheck = '<?php echo $tempCheck;?>';
- $('#createTemp').on('click',function(){
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- $('#createTemp').removeClass('label-primary-green');
- $('#createTemp').addClass('label-primary-gray');
- if(tempCheck){
- tempCheck = 0;
- var data = {
- exam_id:"<?php echo $exam_id ?>"
- };
- $.post("<?php echo Yii::app()->createUrl('print/ajaxCreateTemplate')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- layer.alert("模板生成中", {icon: 6}, function(){
- location.replace(location.href);
- });
- }else
- {
- layer.msg(m.result);
- $('#createTemp').addClass('label-primary-green');
- $('#createTemp').removeClass('label-primary-gray');
- tempCheck = 1;
- }
- });
- }else{
- return false;
- }
- })
- $("#printPaper").click(function(){
- var printCheck = '<?php echo $printCheck;?>';
- if(!printCheck) return false;
- var tpl = "<?php echo $tpl;?>";
- var paperType = "<?php echo $paperType;?>";
- document.paperData = <?php echo $paperData;?>;
- if (tpl == "2") {
- layer.msg('请先上传试题模板!');return false;
- }
- var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
- if(paperType == 2 && answerCardUploaded == 0){
- layer.msg('请先上传答题卡模板!');return false;
- }
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('请至少选择一个学生!');return false;
- }
- // $(".loading-pop").show();
- var student_ids = '';
- var finishCheck = 0;
- var failCheck = 0;
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if($(this).attr("status") == 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();
- $(".loading-pop").show();
- $.post("<?php echo Yii::app()->createUrl('print/ajaxPrintPaper')?>",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;
- }
- });
- }
- }
- );
- });
- /*在线答题卡订单学生操作*/
- $('.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}}
- 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
- {
- 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>
|