123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248 |
- <script type="text/javascript">
- function in_array(search, array){
- for(var i in array){
- if(array[i]==search){
- return true;
- }
- }
- return false;
- }
- testFlag = "<?php echo $this->testFlag;?>";
- customTplsIds = new Array();
- var i = 0;
- <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
- customTplsIds[i] = "<?php echo $tplId;?>";
- i++;
- <?php }?>
- jQuery(document).ready(function(){
- // 打印答案解析
- $(".answerAnalysis").click(function(){
- var element = this;
- var isEng = $(this).attr('isEng');
- layer.msg('您确定下载答案解析嘛?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var wpCode = jQuery(element).attr("examId");
- 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);*/
- if(isEng == 1){
- evaluationClient.PrintSubjectDAJX(JSON.stringify(obj.object));
- }else{
- evaluationClient.newprintDAJX(JSON.stringify(obj.object));
- }
- } else {
- layer.msg(obj.message);
- }
- }
- );
- }
- });
- });
- // 根据年级筛选班级
- });
- </script>
- <style>
- .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;}
- /*切换选择*/
- .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;
- }
- .h_list span {font-size: 14px;}
- </style>
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
- <link rel="stylesheet" href="/fonts/zip/iconfont.css" />
- <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">
- <form method="get" id="form1" action="<?php echo $this->createUrl("print/class_exam_united");?>">
- <div class="clearfix">
- <div class="dataTables_length margin-zy fl">
- <input type="text" class="form-control input-sm" placeholder="请输入班级名称" name="class_name" value="<?php echo $class_name;?>"> <input type="hidden" name="exam_group_id" value="<?php echo $exam_group_data->exam_group_id?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- </div>
- <div style="float: right;margin-right: 30px;margin-top:12px; padding-bottom: 10px;" class="h_list">
- <a class="click-sc addbx" aria-hidden="true" title="下载试卷" href="<?php if(isset($task_exam['paper_template_url'])) echo $task_exam['paper_template_url'] ?>">下载试卷</a>
- <span class=" click-sc addbx" aria-hidden="true" title="下载答题卡" onclick="createTemplate('<?php echo $exam_id; ?>',4)">下载答题卡</span>
- <span class=" click-sc addbx answerAnalysis" examId="<?php echo $exam_id;?>" aria-hidden="true" title="下载答案解析">下载答案解析</span>
- <span class=" click-sc addbx click-delete answerAnalysis" id="delPaperStudentAll" aria-hidden="true" title="删除全部未考试学生">删除全部未考试学生</span>
- </div>
- </div>
- </form>
- </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>名称</th>
- <th>班级</th>
- <th>是否打印</th>
- <th >答卷图片已上传/总数</th>
- <th >原卷已上传/总数</th>
- <th >操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($printList)):foreach($printList as $cl):?>
- <tr>
- <td style="max-width:260px"><?php
- $imgSrc = "";if($exam_group_data->mark_type > 0){$imgTitle="线上阅卷";$imgSrc.="/images/online/";}else{$imgTitle="线下阅卷";$imgSrc.="/images/offline/";}$imgSrc.="{$cl["paper_size"]}.png";$cursor = "pointer";echo "<img class='paperType' style='cursor:pointer;width:22px;height:22px;margin-right:5px;' title='{$imgTitle}' src='{$imgSrc}'/>";?>
- <?php echo $cl['print_name'];?>
- </td>
- <td style="max-width:100px"><?php if(isset($class_data[$cl['class_id']])){echo $class_data[$cl['class_id']];}?></td>
- <td><?php if(isset($exam_print[$cl['exam_id']]) && !empty($exam_print[$cl['exam_id']])){echo '已打印';}else{echo '未打印';}?></td>
- <td>
- <?php if(isset($exam_up_student[$cl['exam_id']])){echo count($exam_up_student[$cl['exam_id']]);}else{ echo 0;}?>/<?php if(isset($exam_student[$cl['exam_id']])){echo count($exam_student[$cl['exam_id']]);}else{ echo 0;}?>
- </td>
- <td>
- <?php if(isset($student_img_up_num[$cl['exam_id']])){echo count($student_img_up_num[$cl['exam_id']]);}else{ echo 0;}?>/<?php if(isset($exam_student[$cl['exam_id']])){echo count($exam_student[$cl['exam_id']]);}else{ echo 0;}?>
- </td>
- <td style="width:265px;">
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('print/change',array('cid'=>$cl['class_id'],'eid'=>$cl['exam_id'],'tid'=>$cl['type']));?>'"></span>
- <?php if(!$print['is_custom_tpl'] && $print['paper_tpl_type'] != 3){ ?><span class="iconfont click-sc addbx" aria-hidden="true" title="<?php if($print['paper_tpl_type'] == 2){echo '打印答题卡';}else{echo '打印试卷';}?>" onclick="<?php if($print["paper_tpl_type"] == 2 && !$print["answer_card_uploaded"]){?>layer.msg('请先上传答题卡模板');<?php }else{?>print('<?php echo $cl['class_id'];?>','<?php echo $cl['exam_id'];?>','0',<?php echo $print['is_tpl'];?>);<?php }?>"></span>
- <!-- <span class="iconfont icon-zip click-sc addbx print_pack" w_class_id="--><?php //echo $cl['class_id'];?><!--" w_exam_id="--><?php //echo $cl['exam_id']; ?><!--" title="打包打印" ></span>-->
- <?php }?>
- <?php
- if(in_array(Yii::app()->session['session_subject_id'],Yii::app()->params['mathSubjectId'])){
- if(isset($exam_student[$cl['exam_id']]) && isset($exam_up_student[$cl['exam_id']]) && count($exam_up_student[$cl['exam_id']]) == count($exam_student[$cl['exam_id']])){
- ?>
- <?php if($sub_id != 8):?>
- <span class="iconfont click-sc icon-yifasong addbx ruanyun" exam_id="<?php echo $cl['exam_id']; ?>" title="发送第三方,并生成提分方案"></span>
- <?php endif;?>
- <?php }}?>
- <?php if($exam_group_data->mark_type ==4 && $cl['status']==1 && $exam_group_data->import_score_type==0 )
- {
- ?>
- <span class="click-sc addbx" aria-hidden="true" title="恢复考试状态" onclick="renewExamStatClass('<?php echo $cl['exam_id']; ?>')">恢复考试状态</span>
- <?php
- }?>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="5">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- <?php if(!empty($page_total)):?>
- <div class="row">
- <div class="col-xs-6">
-
- </div>
- <div class="col-xs-6">
- <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>
- <div class="loading-pop" style="display:none;">
- <div class="loading-pop-msg">正在打包,请稍候···</div>
- </div>
- <!-- 弹窗 -->
- <div class="confirmbox-mask" style="display: none" id="fieldModal">
- <div class="class-modal">
- <i class="icon close_1 icon-close"></i>
- <div class="class-modal-head">添加考试班级</div>
- <form id="examSelect">
- <div class="class-modal-body">
- <p class="title">年级:高一 分科:文科</p>
- <div class="class_area">
- <div class="class_left">
- <p>A层班级</p>
- <input type="checkbox" class="checkAll">全选
- </div>
- <ul class="class_right area_1">
- </ul>
- <div class="clear"></div>
- <div class="class_left">
- <p>B层班级</p>
- <input type="checkbox" class="checkAll">全选
- </div>
- <ul class="class_right area_2">
- </ul>
- <div class="clear"></div>
- <div class="class_left">
- <p>C层班级</p>
- <input type="checkbox" class="checkAll">全选
- </div>
- <ul class="class_right area_3">
- </ul>
- </div>
- </div>
- <p class="class_btn">
- <input type="hidden" name="exam_gruop_id" value="0">
- <button type="button" class="setting_sumbit">确定</button>
- </p>
- </form>
- </div>
- </div>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(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();
- });
- $(".ruanyun").click(function(){
- var exam_id = $(this).attr('exam_id');
- layer.msg("确定发送吗?学生是否全部上传成绩", {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
- type: "POST",
- dataType: "json",
- data:{ examId: exam_id
- },
- success: function (data){
- if(data.status == 1){
- layer.msg('发送成功',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else if(data.status == 2){
- layer.msg('发送失败,未上传成绩',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('发送失败',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- });
- $(".print_pack").click(function(){
- $(".loading-pop").show();
- var data = {
- exam_id:$(this).attr("w_exam_id")
- };
- $.post("<?php echo Yii::app()->createUrl('print/print_pack')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==1)
- {
- 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;
- }
- setTimeout(function() {
- $(".loading-pop").hide();
- }, 2000);
- });
- });
- $("#delPaperStudentAll").click(function(){
- // 判断是否有选中
- var studentsIds;
- layer.msg('确定删除全部未考试的学生吗?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- var data={
- "exam_group_id":"<?php echo $exam_group_id ?>",
- };
- jQuery.post(
- "<?php echo $this->createUrl("print/delExamStudentAll?");?>",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);
- });
- }
- });
- }
- });
- });
- });
- function objToJson(obj){
- var json = "{ ";
- for(var item in obj){
- json += "'"+item+"':'"+obj[item]+"',";
- }
- json += " }";
- return json;
- }
- function ccc(){
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- return false;
- }
- });
- }
-
- function renewExamStat(exam_id) {
- if(!exam_id)
- {
- layer.msg('参数不正确!')
- }
- var msg = '您确定恢复本次考试状态吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('paper/recover');?>",
- type: "POST",
- dataType: "json",
- data: {
- exam_id: exam_id,
- },
- success: function (data){
- var m = data;
- if(m.status == 1){
- layer.msg('恢复成功,可以继续上传试卷',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('恢复失败,'+m.msg,{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- function renewExamStatClass(exam_id) {
- if(!exam_id)
- {
- layer.msg('参数不正确!')
- }
- var msg = '您确定恢复本次考试状态吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('paper/recover_one_class');?>",
- type: "POST",
- dataType: "json",
- data: {
- exam_id: exam_id,
- },
- success: function (data){
- var m = data;
- if(m.status == 1){
- layer.msg('恢复成功,可以继续上传试卷',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('恢复失败,'+m.msg,{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- function delExam(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- var enable = odj.getAttribute("w_enable");
- if(enable == 0){
- return false;
- }
- if (!classId || !examId) return false;
- var msg = '您确定要删除此班的考试吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/delexam');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data.status == 1){
- layer.msg('删除成功',{
- icon: 1
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }else{
- layer.msg('删除失败',{
- icon: 5
- }, function(){
- layer.closeAll();
- location.reload();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- // 确认上传成绩
- function uploadConfirm(classId, examId,className,is_uploaded_count,students_count) {
- //if (confirm('您确定已上传成绩了吗?')) {
- msg = "<div style='text-align:left;'>("+className+")已上传(<span style=' font-size:20px;color:#15ae68 ;font-weight: bold'>"+is_uploaded_count+"</span>)份试卷,还有(<span style='font-size:20px;color: red;font-weight: bold'>"+(students_count-is_uploaded_count)+"</span>)份试卷未上传!是否确认本班级试卷都已上传?<br/><br/><span style='color: red'>请注意!试卷上传确认后将不能再次上传本班的试卷!!!</span></div>";
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index, layerObj){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
- type: "POST",
- data: {
- classId: classId,
- examId: examId
- },
- beforeSend:function(){
- // 发送请求显示打印中
- layer.msg('确认中...', {time: 20000});
- },
- dataType: "JSON",
- success: function(data) {
- if (data.status == 1) {
- layer.msg('确认成功!');
- setTimeout(function(){location.reload();}, 1300);
- } else {
- layer.msg(data.error);
- }
- },
- complete:function(){
- },
- error:function(){
- }
- });
- }
- });
- //}
- }
- // 打印错题本
- function printBook(cid,eid,type){
- if (!cid || !eid || !type) {
- layer.msg("打印参数有误");return;
- }
- var message = '';
- var objUrl = '';
- if (type == 1) {
- message = "您确定要下载该班级纠错本吗?";
- objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
- divTitle = "下载错题本";
- improveName = "错题本";
- } else if (type == 2){
- message = "您确定要下载该班级个性化学习方案吗?";
- objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
- divTitle = "下载个性化学习方案";
- improveName = "个性化学习方案";
- }else if (type == 3){
- message = "您确定要下载该班级个性化学习宝吗?";
- objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
- divTitle = "下载个性化学习宝";
- improveName = "个性化学习宝";
- }
- else{
- layer.msg("打印参数有误");return;
- }
- html = ""+
- '<div style="padding:20px 30px 0px 30px">'+
- '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</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.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
- // 更试卷打印时间
- $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: cid, eid: eid,type:type } );
- /*if(type == 1)
- location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
- else
- location.href = objUrl+"/cid/"+cid+"/eid/"+eid+"/type/"+type;*/
- startTime = (new Date()).getTime();
- showTip = true;
- tipShowed = false;
- toPromptTime = 3000;
- window.interval = setInterval(function(){
- execTime = (new Date()).getTime() - startTime;
- if(execTime > toPromptTime && showTip && !tipShowed){
- // msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
- // tipShowed = true;
- }
- }, 1000);
- jQuery.get(
- "<?php echo $this->createUrl("print/getImproveFile");?>",
- {"examId": eid, "classId": cid, "type": type},
- function(data){
- data = JSON.parse(data);
- if(data.success == 1||data.success == 2){
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: divTitle,
- content: html,
- success: function(index, layerObj){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.limitinfo, {"time": 3000});
- clearInterval(window.interval);
- layer.close(msgIndex);
- jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></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(){
- }
- });
- }
- else if(data.success == 0){
- clearInterval(window.interval);
- msgIndex = layer.msg(data.message, {"time": 3000});
- }
- }
- );
- }
- });
- }
- // 上传试卷模板
- function uploadTemplate(eid,name, type){
- if (!eid) {
- layer.msg('考试信息不存在!');
- return false;
- }
- if(type == 1)
- forCheckUrl = "<?php echo $this->createUrl('print/verifyTpl');?>";
- else
- forCheckUrl = "<?php echo $this->createUrl('print/checkanswercard');?>";
- $.post(forCheckUrl,{eid:eid},function(data){
- var obj = JSON.parse(data);
- var html ='<div class="layer_notice" style="padding:5px;">';
- html +='<table class="table table-striped table-bordered table-hover ">';
- html +='<thead class="thin-border-bottom">';
- html +='<tr>';
- html +='<th>试卷名称</th>';
- html +='<th>是否上传</th>';
- html +='<th>操作</th>';
- html +='</tr>';
- html +='</thead>';
- html +='<tbody class="content_tbody">';
- if (obj.success == 1) {
- html +='<td>'+name+'</td><td><span style="color:red;">已上传</span></td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
- } else {
- html +='<td>'+name+'</td><td id="alreadUpload">未上传</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
- }
- html +='</tbody>';
- html +='</table>';
- html +='<span style="width:582px;display:inline-block;text-align:center;">';
- html +='<button class="btn btn-success btn-sm" onclick="uploadWord('+type+')"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
- html +='</span>';
- html +='<input type="hidden" id="mpEid" value="'+eid+'">';
- html +='</div>';
- layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ['600px', '300px'], //宽高
- content: html
- });
- });
- }
- function uploadWord(type) {
- var paramEid = $('#mpEid').val();
- if (!paramEid) {
- layer.msg('考试信息不存在!');
- return false;
- }
- var obj_file = $("#word_file").val();
- if (!obj_file) {
- layer.msg('请选择上传文件');
- return false;
- }
- var extStart = obj_file.lastIndexOf('.');
- var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
- if (extName != ".dotx" && extName != ".dotm") {
- layer.msg('模板格式有误,请上传dotx格式word!');
- return false;
- }
- $.ajaxFileUpload({
- url: "<?php echo $this->createUrl('print/uploadTpl');?>", //用于文件上传的服务器端请求地址
- secureuri: false, //是否需要安全协议,一般设置为false
- fileElementId: 'word_file', //文件上传域的ID
- dataType: 'text', //返回值类型 一般设置为json
- data:{"eid":paramEid, "type": type},
- success: function (data, status){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- layer.msg(obj.message,{
- icon: 1,
- }, function(){
- layer.closeAll();
- });
- $("#alreadUpload").html('<span style="color:red;">已上传</span>');
- location.reload();
- } else {
- layer.msg(obj.message,{
- icon: 5,
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5,
- }, function(){
- layer.closeAll();
- });
- }
- });
- return false;
- }
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
- function print(cid,eid,tid,fg){
- if (!cid || !eid) return false;
- var msg = '';
- if (fg == 1) {
- msg = '打印答题卡';
- } else {
- msg = '您确定要打印该试卷嘛?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- ajaxPrint(cid, eid, tid);
- }
- });
- }
- function ajaxPrint(cid, eid, tid) {
- $.ajax({
- url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
- type:"post",
- data:{cid:cid,eid:eid,tid:tid},
- dataType: "json",
- beforeSend:function(){
- // 发送请求显示打印中
- layer.msg('打印中', {icon: 16,time: 20000});
- },
- success:function(obj){
- var index = layer.msg();
- layer.close(index);
- if (obj.success == 1) {
- if (tid == 0) {//console.log(JSON.stringify(obj.message));
- evaluationClient.newprintPaper(JSON.stringify(obj.message));
- //alert('提交打印试卷成功!');
- } else if (tid == 1) {
- evaluationClient.printCTB(JSON.stringify(obj.message));
- //alert('提交打印错题本成功!');
- } else if (tid == 2) {
- evaluationClient.printTFFA(JSON.stringify(obj.message));
- //alert('提交打印提分册成功!');
- } else {
- layer.msg('操作错误!');
- }
- location.reload();
- } else {//alert(obj.message);
- layer.msg(obj.message);
- }
- },
- complete:function(){
- //layer.msg('打印失败!');
- //var index = layer.msg();
- //layer.close(index);
- },
- error:function(){
- //var index = layer.msg();
- //layer.close(index);
- }
- });
- }
- // 生成试卷模板
- function createTemplate (eid){
- if (!eid) {
- layer.msg('未找到考试信息');
- }
- var msg = '';
- msg = '您确定要下载答题卡嘛?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post('<?php echo $this->createUrl('print/create_united_tempelate');?>',{"eid":eid},function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- evaluationClient.CreateSchoolPaper(JSON.stringify(obj.object));
- } else {
- layer.msg(obj.message);
- }
- });
- }
- });
- }
- function wb_html(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要生成该班级的错题本吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('client/wbhtml');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data > 0){
- layer.msg('操作成功,重新生成错题本',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }else if(data==0){
- layer.msg('操作失败,此班无错题本',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- else{
- layer.msg('操作失败,重新生成错题本',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- function isp2_html(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要生成该班级的二步提分方案吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('client/isp2html');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data > 0){
- layer.msg('操作成功,重新生成提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }else if(data==0){
- layer.msg('操作失败,此班无提分方案',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- else{
- layer.msg('操作失败,重新生成提分方案',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- function isp3_html(odj){
- if (!odj) return false;
- var classId = odj.getAttribute("w_class_id");
- var examId = odj.getAttribute("w_exam_id");
- if (!classId || !examId) return false;
- var msg = '您确定要生成该班级的个性化学习宝吗?';
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('client/isp3html');?>",
- type: "POST",
- dataType: "json",
- data: {
- examId: examId,
- classId:classId
- },
- success: function (data){
- if(data > 0){
- layer.msg('操作成功,重新生成提分方案',{
- icon: 1
- }, function(){
- layer.closeAll();
- });
- }else if(data==0){
- layer.msg('操作失败,此班无提分方案',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- else{
- layer.msg('操作失败,重新生成提分方案',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- },
- error: function (data, status, e){ //服务器响应失败处理函数
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- });
- }
- });
- }
- // 隐藏试卷
- function oprateExam(examId,flag){
- if (examId) {
- layer.msg('未找到周周练id');
- }
- var msg = '您确定要隐藏该试卷吗?';
- if (flag == 0) {
- msg = '您确定要恢复该试卷吗?';
- }
- layer.msg(msg, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.post('<?php echo $this->createUrl("print/oprateexam");?>',{examId:examId,flag:flag},function(data){
- var obj = JSON.parse(data);
- if (obj.success == 1) {
- location.reload();
- } else {
- layer.msg(obj.message);
- }
- });
- }
- });
- }
- </script>
|