123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- <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;
- }
- .btn-garder{
- margin-right: 10px;
- display: inline-block;
- width: 100px;
- border: none;
- text-align: center;
- line-height: 30px;
- color: #fff;
- background-color: #2977ff;
- }
- .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;}
- </style>
- <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">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy clearfix">
- <span class="fr ">
- <a id="batchPrint" href="javascript:void(0);" class="btn-garder">批量下载</a>
- <a id="batchPrintToolsXbJCB" href="javascript:void(0);" class="btn-garder">批量打印</a>
- </span>
- </div>
- </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">
- <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)):foreach($printList as $cl):?>
- <tr>
- <td>
- <input type="checkbox" class="ace myselect" value="<?php echo $cl['class_id'].'_'.$cl['gp_id'].'_'.$type; ?>">
- </td>
- <td style="max-width:260px">
- <?php ?>
- <a href=""><?php echo $cl['class_name'].$cl['name'];?></a>
- <?php ?>
- </td>
- <td style="max-width:100px"><?php echo $cl['class_name'];?></td>
- <td><?php echo $cl['create_count'].'/'.$cl['order_student_count'];?></td>
- <td><?php echo date('Y-m-d H:i:s',$cl['create_time']) ?></td>
- <td><?php if($cl['is_download']){echo '已下载/打印';}else{echo '未下载/打印';}?></td>
- <td><?php
- if($cl['is_download']){
- echo date('Y-m-d H:i:s',$cl['download_time']);
- }
- ?></td>
- <td style="width:265px;">
- <span cid="<?php echo $cl['class_id']?>" gpid="<?php echo $cl['gp_id']?>" type="66" class="iconfont click-sc addbx printToolsXbJCB" aria-hidden="true" title="打印纠错本" ></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" onclick="printBook('<?php echo $cl['class_id'];?>','<?php echo $cl['gp_id'];?>',<?php echo $type;?>)" title="下载纠错本" ><img src="/images/download.png" style="margin-bottom:-2px;"></span>
- <a class="iconfont click-sc addbx" aria-hidden="true" title="选择学生下载纠错本" href="<?php echo $this->createUrl('correct/stu',array('gp_id'=>$cl['gp_id']))?>" ></a>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="8">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <?php include(Yii::app()->basePath.'/views/print/_print.php');?>
- <script>
- // 全选\反选
- $(".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);
- }
- });
- //批量下载
- $("#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),
- beforeSend:function(){
- layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
- },
- success: function (data){
- layer.closeAll();
- if(data.success == 1) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
- icon: 1,
- yes: function () {
- layer.closeAll();
- }
- });
- }else {
- layer.msg(data.message);
- }
- },
- });
- }
- });
- });
- // 下载
- function printBook(cid,gpid,type){
- if (!cid || !gpid || !type) {
- layer.msg("打印参数有误");return;
- }
- var message = "您确定要下载该班级纠错本吗?";
- var divTitle = "下载纠错本";
- var improveName = "纠错本";
- 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},
- 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},
- 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});
- }
- },
- });
- }
- });
- }
- </script>
|