123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029 |
- <style>
- .nav-btns{
- margin: 10px 20px;
- }
- .nav-btns>a{
- display: inline-block;
- width: 120px;
- border: 1px solid #40c180;
- text-align: center;
- line-height: 30px;
- }
- .active{
- color: #fff;
- background-color: #40c180;
- }
- .fr{
- float: right;
- }
- .filter * {
- font-size: 14px;
- }
- .filter label {
- font-weight: bold;
- }
- .filter select {
- height: 36px;
- font-size: 14px;
- margin-left: 10px;
- }
- .filter select:nth-child(2) {
- width: 82px;
- }
- .filter select:nth-child(3) {
- width: 110px;
- }
- .filter button {
- border: none;
- background: #009965;
- width: 111px;
- height: 36px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- margin-left: 10px;
- }
- .showClassInfo{
- cursor: pointer;
- }
- .list table {
- width: 96%;
- margin-top: 20px;
- text-align: center;
- border-right: 1px solid #ccc;
- margin:20px auto 0 auto;
- }
- .list table th {
- background: #f2f2f2;
- border: 1px solid #ccc;
- border-right: none;
- padding: 12px 15px;
- }
- .list table td {
- border: 1px solid #ccc;
- border-right: none;
- border-top: none;
- padding: 12px 15px;
- font-weight: bold;
- }
- .list table tr:nth-child(even) {
- background: #f2f2f2;
- }
- .list .tl {
- text-align: left;
- }
- .list .red {
- color: #cc3400;
- }
- .list .green {
- color: #079b67;
- }
- .icon {
- display: inline-block;
- background: center/contain no-repeat;
- width: 25px;
- height: 25px;
- cursor: pointer;
- vertical-align: middle;
- }
- .list .subjects {
- line-height: 22px;
- font-size: 0;
- }
- .list .icon{
- margin: 0 4px;
- }
- .list .subjects span {
- display: inline-block;
- font-size: 16px;
- word-break: keep-all;
- margin: 0 4px;
- }
- .confirmbox {
- background: #fff;
- border: 1px solid #cccccc;
- border-radius: 3px;
- padding: 40px 40px 30px;
- text-align: center;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- }
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- .btn_area button {
- border: none;
- background: #009965;
- width: 111px;
- height: 36px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- .btn_area button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal-body .classes {
- margin-bottom: 10px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b
- }
- .class-modal .icon-close{
- position: absolute;
- right: 20px;
- top: 20px;
- }
- .class-modal-1 {
- width: auto;
- background: #fff;
- border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .class-modal-head-1 {
- font-size: 14px;
- text-align: left;
- color:#fff;
- line-height:30px;
- background: #2977ff;
- padding-left:15px;
- }
- .class-modal-body-1{
- padding:15px;
- }
- .class-modal-body-1 h2,.class-modal-body-1 h3{
- font-size:14px;
- font-weight:normal;
- margin-top:10px;
- }
- .class-modal-body-1 h3 span{
- font-size:10px;
- color:#ccc;
- }
- .class-modal-body-1 label{
- display: inline-block;
- font-weight: normal;
- margin-right: 15px;
- height:30px;
- position: relative;
- }
- .class-modal-1 .icon-close-1{
- position: absolute;
- right: 10px;
- top:5px;
- }
- .class-modal-1 .class_area{
- height:115px;
- border:1px solid #ccc;
- padding:5px;
- overflow-y: auto;
- margin-bottom:15px;
- }
- .class-modal-1 .checkAll{
- position:absolute;
- right:5px;
- top:115px;
- }
- .class-modal-1 .subsection{
- }
- .class-modal-1 .btn p{color:#000;}
- .class-modal-1 .btn_area{
- padding: 10px;
- border-top: 1px solid #aab6aa;
- margin-top:10px;
- }
- .class-modal-1 .btn_area p{
- display: inline-block;
- }
- .class-modal-1 .btn_area button{
- margin-left:5px;
- }
- .class-modal-1 .btn_area .cancel{
- background: #fff;
- color:#000;
- border:1px solid #666;
- }
- .c-red-1 {
- color: #CC3300;
- font-size:10px;
- display: inline-block;
- position:absolute;
- left:15px;
- top:18px;
- }
- .vtm{vertical-align: middle;}
- .pointer{cursor: pointer;}
- .dib{display: inline-block;}
- .pdp-con .pop-opt-con{border-top: 1px solid #ddd;padding-top: 20px;}
- .tit-sub-intro{color: #666;}
- .tit-sub-intro span{font-size: 12px;}
- .subsection{width: 44px;height: 24px;border: 1px solid #ddd;text-align: center;font-size: 12px;}
- .reduce-btn,.add-btn{width: 16px;height: 16px;line-height: 16px;text-align: center;color: #16AE68;border: 1px solid #16AE68;border-radius: 3px;font-size: 16px;font-weight: bold;margin-right: 6px;}
- .reduce-btn.forbidden,.add-btn.forbidden{color: #bbb;border: 1px solid #bbb;cursor: no-drop;}
- /*打印历史产品弹框*/
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #009965;color:#fff;}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #009965;color: #fff;}
- .modal-btn .close3{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #fff;color: #000;border:1px solid #555;border-radius: 3px;}
- .modal1_multi{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display:none ;background: rgba(0,0,0,.4)}
- .modal1_multi .model-score-m{width:80%;margin:5px auto;height: 20px;}
- .model-rule{width:80%;margin:8px auto;text-align: left;font-size:12px;}
- .modal1_multi .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
- .magic-tips{
- padding: 5px;
- position: absolute;
- z-index: 100;
- right: 450px;
- background:#15ae68;
- color: white;
- display: none;
- }
- .magic-tips li{
- list-style: none;
- }
- .tip-icon{
- cursor: pointer;
- }
- </style>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- // 根据年级筛选班级
- jQuery("#grade").change(function(){
- var grade = $(this).val();
- var subjectId='<?php echo $subjectId?>';
- if (!grade) return false;
- jQuery.post(
- '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade,"subjectId":subjectId},function(data){
- data = JSON.parse(data);
- var html = "<option value=''>全部班级</option>";
- if(data.success == 1){
- var classObj = $("#class");
- classObj.empty();
- $.each(data.message,function(i,n){
- html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
- });
- }
- classObj.append(html);
- }
- );
- });
- });
- </script>
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/view_production_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("generalproduct/index",array('productType'=>$productType));?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy">
- <select class="form-control" id="grade" name="grade">
- <option value="0">年级</option>
- <?php
- if(Yii::app()->params['grade_config']){
- foreach (Yii::app()->params['grade_config'] as $id=> $val){
- if($grade==$id){
- echo '<option value="'.$id.'" selected >'.$val['grade_name'].'</option>';
- }else{
- echo '<option value="'.$id.'" >'.$val['grade_name'].'</option>';
- }
- }
- }
- ?>
- </select>
- <select class="form-control" id="class" name="classId">
- <option value="">全部班级</option>
- <?php foreach($classes as $class){?>
- <option <?php if((string)$classId == (string)$class["class_id"]) echo "selected";?> value="<?php echo $class["class_id"];?>"><?php echo $class["class_name"];?></option>
- <?php }?>
- </select>
- <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- <span style="font-size:13px;padding-left:2px;color:red;display: none;">
- 提示:生成的<?php echo $productName; ?>仅保留7天
- </span>
- <div class="dataTables_filter" id="dynamic-table_filter" style="float: right;">
- <a href="<?php echo $this->createUrl("generalproduct/setting",array("productType"=>$productType)); ?>" <?php echo $isSetting ? "": "disabled" ; ?> class="btn label-primary-green btn-sm">生成<?php echo $productName; ?></a>
- <a id="batchPrint" href="javascript:void(0);" class="btn label-primary-green btn-sm">批量下载</a>
- <a id="batchPrintToolsJqzy" href="javascript:void(0);" class="btn label-primary-green btn-sm">批量打印</a>
- <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrint">
- <i style="font-style: normal;" class="fa fa-print"></i> 发送云印任务
- </a>
- </div>
- <span class="fr">
- <span class="magic-tips">
- <?php if($productType == ProductDownload::PRODUCT_TYPE_WRONG_REFINE):?>
- <li>* 错题精练每学期仅能生成3次</li>
- <li>* 如无法生成请联系技术支持</li>
- <?php else:?>
- <li>* 假期作业,仅在寒假(11月1日-次年1月31日)、暑假(每年4月1日-7月31日)可生成;</li>
- <li>* 如想在非假期中生成假期作业,请联系技术支持。</li>
- <?php endif;?>
- </span>
- <span class="tip-icon"><img width="35" height="35" src="/images/tongzhi.png"></span>
- <span class="tip-icon" style="font-size:13px;padding-left:2px;color:red;margin-right: 10px;">温馨提示</span>
- </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 class="center">
- <input type="checkbox" class="ace selectAll" />
- </th>
- <th>产品名称</th>
- <th>班级</th>
- <th >创建时间</th>
- <th >已生成/总数</th>
- <th>是否下载/打印</th>
- <th>下载/打印时间</th>
- <th >操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($printList)):?>
- <?php foreach($printList as $cl):?>
- <tr>
- <td>
- <?php if(!$cl['is_cloud_print']){?>
- <input type="checkbox" class="ace myselect" value="<?php echo $cl['class_id'].'_'.$cl['gp_id'].'_'.$productType; ?>">
- <?php }?>
- </td>
- <td style="max-width:260px">
- <?php if($cl['isDown']==0 && $cl['reset_times']==0) { echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";};
- echo "<a href=".$this->createUrl("generalproduct/classes",array("name"=>$cl['name'],"gp_group_id"=>$cl['gp_group_id'],"productType"=>$productType)).">{$cl['name']}</a>"
- ?>
- <?php if($cl['status'] == 5):?>
- <a style="color: red;text-decoration: underline;margin-left: 10px;" href="javascript:void(0);" onclick='showRepair(<?php echo $cl['repair_info'];?>)'>待补题</a>
- <?php endif;?>
- </td>
- <td style="max-width:100px"><?php echo $cl['class_name'];?></td>
- <td style="max-width:100px"><?php echo date('Y-m-d H:i:s',$cl['create_time']);?></td>
- <td><span style="color: green;"><?php echo $cl['pdfCount'];?></span>/<span><?php echo $cl['totalCount'];?></span></td>
- <td><?php echo $cl["isDown"] ? '已下载//打印' : '未下载//打印';?></td>
- <td><?php echo $cl['downTime'];?></td>
- <td style="width:265px;">
- <span class="iconfont click-sc addbx printToolsJqzy" cid="<?php echo $cl['class_id'];?>" gpid="<?php echo $cl['gp_id'];?>" ptype="<?php echo $productType;?>" aria-hidden="true" title="打印<?php echo $productName;?>" ></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="下载<?php echo $productName;?>" onclick="printBook('<?php echo $cl['class_id'];?>','<?php echo $cl['gp_id'];?>',<?php echo $productType;?>)"><img src="/images/download.png" style="margin-bottom:-2px;"></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生下载<?php echo $productName;?>" onclick="javascript:location.href='<?php echo $this->createUrl('generalproduct/stu',array('type'=>$productType,'cid'=>$cl['class_id'],'gp_id'=>$cl['gp_id']));?>'"></span>
- <!-- 发送云印任务 -->
- <span class="iconfont click-sc addbx" <?php if($cl['is_cloud_print'] == 1) echo 'style="background-color:gray"';?> aria-hidden="true" title="<?php if($cl['is_cloud_print'] == 1){echo ' 24小时内不可重复发送';}else{echo '发送云印任务';}?>" onclick="sendCloudTask('<?php echo $cl['class_id'];?>','<?php echo $cl['gp_id'];?>',<?php echo $productType;?>,<?php echo $cl['is_cloud_print'] == 1 ? 1 :0;?>)">云</span>
- </td>
- </tr>
- <?php endforeach;?>
- <?php else:?>
- <tr><td colspan="8">暂无数据</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>
- <!--发送云印任务弹窗-->
- <div class="confirmbox-mask" id="classModal-1" style="display: none;">
- <div class="class-modal-1">
- <i class="icon icon-close-1" style="color: white">X</i><div class="class-modal-head-1">发送云印任务</div>
- <div class="class-modal-body-1">
- <div>
- <span>亲爱的学管:您正在发起云印任务,请核对以下云印任务数据!</span>
- <span style="float: right;">共<i id="task_count">0</i>条任务,<i id="total_print_num">0</i>份云印任务</span>
- </div>
- <table style="margin-top: 15px;" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <th>序号</th>
- <th>任务名称</th>
- <th>班级</th>
- <th>完成日期</th>
- <th>已生成/已开通/可下载</th>
- <th>已下载</th>
- <th>云印份数</th>
- <th>备注</th>
- </tr>
- </thead>
- <tbody id="taskList">
- </tbody>
- </table>
- <div style="margin-top: 40px;">
- <span><img width="20px" height="20px" src="/images/icon-tip.svg">发送后,请至学管端【IMS-云印任务】模块查看任务进程,请等待云印中心打印后,寄回给学校!</span>
- <span style="margin-left:15px;float: right;"><input id="filter-uploaded" checked="checked" type="checkbox">过滤【已下载】的学生</span>
- </div>
- <div class="btn_area" style="text-align: center;">
- <input type="hidden" id="sendJson" name="sendJson" value="">
- <button id="sendCloudPrint" class="download">发送</button>
- <button class="cancel">取消</button>
- </div>
- </div>
- </div>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <?php include(Yii::app()->basePath.'/views/print/_print.php');?>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- $(".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();
- });
- });
- //产品名称
- var productName="<?php echo $productName; ?>";
- // 打印产品
- function printBook(cid,gpid,type){
- if (!cid || !gpid || !type) {
- layer.msg("打印参数有误");return;
- }
- var message = "您确定要下载该班级"+productName+"吗?";
- var divTitle = "下载"+productName;
- var improveName = productName;
- 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);
- $.ajax({
- url: "<?php echo $this->createUrl('productdowngeneral/getUrl');?>",
- type: "GET",
- dataType: "json",
- data: {"gpId": gpid, "classId": cid, "type": type,"printType":"<?php echo $printType;?>"},
- timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
- beforeSend:function(){
- layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
- },
- error: function (jqXHR, textStatus, errorThrown) {
- if(textStatus=="timeout"){
- $.ajax({
- type:'GET',
- url: "<?php echo $this->createUrl("productdowngeneral/addTask");?>",
- data: {"gpId": gpid, "classId": cid, "type": type,"printType":"<?php echo $printType;?>"},
- dataType: "json",
- success:function (data) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
- icon: 1,
- yes:function(){
- layer.closeAll();
- }
- });
- }
- })
- }else {
- layer.msg('返回失败!',{
- icon: 5
- }, function(){
- layer.closeAll();
- });
- }
- },
- success: function (data){
- layer.closeAll();
- if(data.success == 1||data.success == 2){
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: divTitle,
- content: html,
- success: function(index, layerObj){
- // 更试卷打印时间
- //$.post("<?php //echo $this->createUrl('print/updatepaperprinttime');?>//", {cid: cid, eid: eid,type:type } );
- 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 == 3){
- // 更试卷打印时间
- //$.post("<?php //echo $this->createUrl('print/updatepaperprinttime');?>//", {cid: cid, eid: eid,type:type } );
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
- icon: 1,
- yes:function(){
- layer.closeAll();
- }
- });
- }
- else if(data.success == 0){
- layer.msg(data.message, {"time": 3000});
- }
- },
- });
- }
- });
- }
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
- $('.confirmbox-mask .icon-close-1').click(function () {
- $('.confirmbox-mask').hide();
- })
- $('.confirmbox-mask .cancel').click(function () {
- $('.confirmbox-mask').hide();
- })
- //发送云印任务
- function sendCloudTask(cid,gpid,type,isDisable){
- if(isDisable === 1){
- return false;
- }
- //$('.confirmbox-mask').show();return false;
- if (!cid || !gpid || !type) {
- layer.msg("参数有误");return;
- }
- // 更试卷打印时间
- var saveDataAry=[];
- var data1={"gpId": gpid, "classId": cid, "type": type,"printType":"<?php echo $printType;?>"};
- saveDataAry.push(data1);
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("printCloud/generateGeneralProduct");?>",
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify(saveDataAry),
- beforeSend:function(){
- layer.load(1, {
- shade: [0.1,'#fff'] //0.1透明度的白色背景
- });
- },
- success:function(data) {
- var index = layer.load();
- layer.close(index);
- if (data.status == 1) {
- $('#sendJson').attr('value', JSON.stringify(data));
- var con = '';
- var task_count = 0;
- var totalCount = 0;
- $.each(data.data, function(index, item) {
- var one_count = item.enable_download_count - item.download_count;
- totalCount += (one_count>0?one_count:0);
- if((item.enable_download_count - item.download_count)>0) {
- task_count += 1;
- }
- con += '<tr><td>' + (index + 1) + '</td><td>' + item.taskName + '</td><td>' + item.clazzName + '</td><td>' + item.complete_time + '</td><td>'
- + item.generate_count + '/' + item.dredge_count + '/' + '<i style="color: green">' + item.enable_download_count + '</i><input type="hidden" name="drege_count" value="'+ item.enable_download_count +'"></td><td>'
- + item.download_count + '</td><td>' + (one_count>0?one_count:0) + '</td><td>' + (one_count>0?'可发送':'不可发送')
- + '</td></tr>'
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount);
- $('#taskList').html(con);
- $('#filter-uploaded').attr({'cid':cid, 'eid':gpid, 'typeId':type, 'printType':"<?php echo $printType;?>"});
- $('#filter-uploaded').prop("checked", true)
- $('.confirmbox-mask').show();
- } else if (data.status == 0) {
- layer.msg(data.message);
- }
- }
- }
- );
- }
- //批量发送云印任务
- $("#selectPrint").click(function() {
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('至少选择一个目标!');
- return false;
- }
- var result = [];
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() /*&& $(this).attr("stnm")*/) {
- result.push($(this).val());
- }
- }
- })
- var sp = [];
- var cid = 0;
- var eid = 0;
- var type = 0;
- var isDisable = 0;
- var saveDataAry=[];
- var data1 = [];
- for(i=0;i<result.length;i++)
- {
- sp = result[i].split('_');
- cid = sp[0];
- eid = sp[1];
- type = sp[2];
- isDisable = sp[3];
- if(isDisable == 1 || !cid || !eid || !type) continue;
- // 更试卷打印时间
- //$.post("<?php //echo $this->createUrl('print/updatepaperprinttime');?>//", {cid: cid, eid: eid,type:type } );
- //alert(cid);alert(eid);alert(type);alert(printType);
- data1 = {"gpId": eid, "classId": cid, "type": type,"printType":"<?php echo $printType;?>"};
- saveDataAry.push(data1);
- }
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("printCloud/generateGeneralProduct");?>",
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify(saveDataAry),
- beforeSend:function(){
- layer.load(1, {
- shade: [0.1,'#fff'] //0.1透明度的白色背景
- });
- },
- success:function(data) {
- var index = layer.load();
- layer.close(index);
- if (data.status == 1) {
- $('#sendJson').attr('value', JSON.stringify(data));
- var con = '';
- var task_count = 0;
- var totalCount = 0;
- $.each(data.data, function(index, item) {
- var one_count = item.enable_download_count - item.download_count;
- totalCount += (one_count>0?one_count:0);
- if((item.enable_download_count - item.download_count)>0) {
- task_count += 1;
- }
- con += '<tr><td>' + (index + 1) + '</td><td>' + item.taskName + '</td><td>' + item.clazzName + '</td><td>' + item.complete_time + '</td><td>'
- + item.generate_count + '/' + item.dredge_count + '/' + '<i style="color: green">' + item.enable_download_count + '</i><input type="hidden" name="drege_count" value="'+ item.enable_download_count +'"></td><td>'
- + item.download_count + '</td><td>' + (one_count>0?one_count:0) + '</td><td>' + (one_count>0?'可发送':'不可发送')
- + '</td></tr>'
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount);
- $('#taskList').html(con);
- $('#filter-uploaded').attr({'cid':cid, 'eid':eid, 'typeId':type, 'printType':"<?php echo $printType;?>"});
- $('#filter-uploaded').prop("checked", true);
- $('.confirmbox-mask').show();
- } else if (data.status == 0) {
- layer.msg(data.message);
- }
- }
- }
- );
- });
- // 全选\反选
- $(".selectAll").click(function(){
- if ($(this).prop("checked")) {
- var s_obj = $(".myselect");
- var s_len = s_obj.length;
- for (var i=0;i<s_len;i++) {
- if (!s_obj[i].disabled) {
- s_obj[i].checked=true;
- }
- }
- } else {
- $(".myselect").prop("checked",false);
- }
- });
- //过滤已下载学生
- $('#filter-uploaded').click(function () {
- if($(this).is(':checked')){
- var totalCount = 0;
- var task_count = 0;
- $('#taskList tr').each(function () {
- var enable_count = parseInt($(this).children("td:eq(4)").children('i').html());
- var dowanload_count = parseInt($(this).children("td:eq(5)").html());
- $(this).children("td:eq(6)").html((enable_count-dowanload_count)>0?(enable_count-dowanload_count):0);
- totalCount += ((enable_count-dowanload_count)>0?(enable_count-dowanload_count):0);
- if((enable_count-dowanload_count)==0){
- $(this).children("td:eq(7)").html('不可发送');
- }else{
- $(this).children("td:eq(7)").html('可发送');
- task_count += 1;
- }
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount)
- }else {
- var totalCount = 0;
- var task_count = 0;
- $('#taskList tr').each(function () {
- var enable_count = $(this).children("td:eq(4)").children('i').html();
- $(this).children("td:eq(6)").html(enable_count);
- totalCount += parseInt(enable_count);
- if(enable_count==0){
- $(this).children("td:eq(7)").html('不可发送');
- }else{
- $(this).children("td:eq(7)").html('可发送');
- task_count += 1;
- }
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount);
- $('#filter-uploaded').attr('isFilter',0)
- }
- });
- //发送云印任务(真正发送)
- $('#sendCloudPrint').click(function (){
- var task_count = parseInt($('#task_count').html());
- if(task_count === 0){
- layer.msg('没有可发送的任务');
- return false;
- }
- var json_data = $('#sendJson').val();
- var is_filter = $('#filter-uploaded').is(':checked') ? 1 : 0;
- $.post({
- url: "<?php echo $this->createUrl("printCloud/sendGeneralProductTask");?>",
- data: {
- 'json_data' : json_data,
- 'is_filter' : is_filter,
- 'printType':"<?php echo $printType;?>"
- },
- dataType: "json",
- beforeSend:function(){
- layer.load(1, {
- shade: [0.1,'#fff'] //0.1透明度的白色背景
- });
- },
- success:function(data) {
- var index = layer.load();
- layer.close(index);
- if (data.status == 1) {
- layer.msg('操作成功,请耐心等待后台打包');
- $('.confirmbox-mask').hide();
- location.reload();
- } else if (data.status == 0) {
- layer.msg(data.message);
- }
- }
- });
- })
- //批量下载
- $("#batchPrint").click(function(){
- var message = "您确定要批量下载该产品吗?";
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('至少选择一个目标!');
- return false;
- }
- var result = [];
- $(".myselect").each(function(m,n){
- if ($(this).prop('checked')) {
- if ($(this).val() /*&& $(this).attr("stnm")*/) {
- result.push($(this).val());
- }
- }
- })
- var sp = [];
- var cid = 0;
- var eid = 0;
- var type = 0;
- var saveDataAry=[];
- var data1 = [];
- for(i=0;i<result.length;i++)
- {
- sp = result[i].split('_');
- cid = sp[0];
- eid = sp[1];
- type = sp[2];
- if(!cid || !eid || !type) continue;
- var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
- data1 = {"gpId": eid, "classId": cid, "type": type,"absent_filter":absent_filter,"printType":"<?php echo $printType;?>"};
- saveDataAry.push(data1);
- }
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl('productdowngeneral/batch');?>",
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify(saveDataAry),
- success: function (data){
- layer.closeAll();
- if(data.success == 1) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
- icon: 1,
- yes: function () {
- layer.closeAll();
- }
- });
- }else {
- layer.msg(data.message);
- }
- },
- });
- }
- });
- });
- function downpdf(gpId) {
- layer.msg('生成中,请稍后...', { time: 0, shade: 0.4 })
- var _url = "<?php echo $this->createUrl("special/teaching")?>";
- $.get(_url, {gpId: gpId}, function(data) {
- var m = JSON.parse(data);
- if (m.status == 1)
- {
- location.href = m.url;
- }else{
- setTimeout(function() {
- layer.closeAll()
- }, 500);
- layer.msg(m.message)
- // alert(m.error);
- }
- });
- }
- function showRepair(info) {
- var jsonArray = eval(info);
- var msg = '';
- for (key in jsonArray) {
- msg += jsonArray[key] + "<br>";
- }
- layer.alert("待补题方法:<br>" + msg);
- }
- $('.tip-icon').mouseover(function () {
- $('.magic-tips').show()
- })
- $('.tip-icon').mouseleave(function () {
- $('.magic-tips').hide()
- })
- </script>
|