123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803 |
- <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>
- <script type="text/javascript">
- function in_array(search, array){
- for(var i in array){
- if(array[i]==search){
- return true;
- }
- }
- return false;
- }
- jQuery(document).ready(function(){
- // 根据年级筛选班级
- jQuery("#grade").change(function(){
- var grade = $(this).val();
- if (!grade) return false;
- jQuery.post(
- '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade},function(data){
- data = JSON.parse(data);
- if(data.success == 1){
- var classObj = $("#class");
- var html = "<option value=''>全部班级</option>";
- 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("htb/index");?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy clearfix">
- <select class="form-control" id="grade" name="grade">
- <option value="">年级</option>
- <option value="1" <?php if($grade == 1) echo "selected";?>>高一</option>
- <option value="2" <?php if($grade == 2) echo "selected";?>>高二</option>
- <option value="3" <?php if($grade == 3) echo "selected";?>>高三</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=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 class="fr ">
- <a href="<?php echo $this->createUrl("htb/setting");?>" class="btn-garder">选择内容生成</a>
- <a id="batchPrint" href="javascript:void(0);" class="btn-garder">批量下载</a>
- <a id="batchPrintToolsHtb" href="javascript:void(0);" class="btn-garder">批量打印</a>
- <a id="selectPrint" href="javascript:void(0);" class="btn-garder">发送云印任务</a>
- </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>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($printList)):foreach($printList as $cl):?>
- <tr>
- <td>
- <?php if(Yii::app()->cache->getValue("cloud_print_task_htb_".$cl['htb_id']) != 1){?>
- <input type="checkbox" class="ace myselect" value="<?php echo $cl['htb_id'];?>">
- <?php }?>
- </td>
- <td style="max-width:260px">
- <?php if($cl['is_new_version']){ ?>
- <a href="<?php echo $this->createUrl('htb/resetHtb',array('htbGroupId'=>(string)$cl['htb_group_id'])); ?>"><?php echo $cl['name'];?></a>
- <?php }else{?>
- <a href="javascript:" title="旧数据无重置功能"><?php echo $cl['name'];?></a>
- <?php }?>
- </td>
- <td style="max-width:100px"><?php echo $cl['class_name'];?></td>
- <td><?php echo $cl['pdfCount'].'/'.$cl['totalCount'];?></td>
- <td><?php if($cl['isDown']){echo '已下载/打印';}else{echo '未下载/打印';}?></td>
- <td><?php echo $cl['downTime'];?></td>
- <td style="width:265px;">
- <span class="iconfont click-sc addbx printToolsHtb" hid="<?php echo (string)$cl['htb_id'];?>" aria-hidden="true" title="打印好题本" ></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="下载好题本" onclick="printWeek('<?php echo (string)$cl['htb_id'];?>')"><img src="/images/download.png" style="margin-bottom:-2px;"></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生下载好题本" onclick="javascript:location.href='<?php echo $this->createUrl('htb/selectStu',array('htbId'=>(string)$cl['htb_id']));?>'"></span>
- <!-- 发送云印任务 -->
- <span class="iconfont click-sc addbx" <?php if(Yii::app()->cache->getValue("cloud_print_task_htb_".$cl['htb_id']) == 1) echo 'style="background-color:gray"';?> aria-hidden="true" title="<?php if(Yii::app()->cache->getValue("cloud_print_task_htb_".$cl['htb_id']) == 1){echo '24小时内不可重复发送';}else{echo '发送云印任务';}?>" onclick="sendCloudTask('<?php echo $cl['htb_id'];?>',<?php echo Yii::app()->cache->getValue("cloud_print_task_htb_".$cl['htb_id']) == 1 ? 1 :0;?>)">云</span>
- </td>
- </tr>
- <?php endforeach;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>
- </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(){
- });
- 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;
- }
- });
- }
- // 搜索事件
- $("#search").click(function(){
- $("#form1").submit();
- });
- function printWeek(mrId){
- if (!mrId) {
- layer.msg("打印参数有误");return;
- }
- var message = "您确定要下载该班级好题本吗?";
- var divTitle = '下载好题本';
- var objUrl = '';
- 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.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('productdownload/getHtbFile');?>",
- type: "GET",
- dataType: "json",
- title: divTitle,
- data: {"htbId": mrId},
- 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) {
- layer.closeAll();
- if(textStatus=="timeout"){
- $.ajax({
- type:'GET',
- url: "<?php echo $this->createUrl("productdownload/addHtbTask");?>",
- data: {"htbId": mrId},
- 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){
- 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){
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
- icon: 1,
- yes:function(){
- layer.closeAll();
- }
- });
- }
- else if(data.success == 0){
- layer.msg(data.message, {"time": 3000});
- }
- },
- });
- }
- });
- }
- //发送云印任务
- function sendCloudTask(htb_id,isDisable){
- if(isDisable === 1){
- return false;
- }
- //$('.confirmbox-mask').show();return false;
- if (!htb_id) {
- layer.msg("参数有误");return;
- }
- var saveDataAry=[];
- var data1={"htb_id": htb_id};
- saveDataAry.push(data1);
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("printCloud/generateHtb");?>",
- 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.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').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 saveDataAry=[];
- var data1 = [];
- for(i=0;i<result.length;i++)
- {
- var htb_id = result[i];
- data1 = {"htb_id": htb_id};
- saveDataAry.push(data1);
- }
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("printCloud/generateHtb");?>",
- 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.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').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(3)").children('i').html());
- var dowanload_count = parseInt($(this).children("td:eq(4)").html());
- $(this).children("td:eq(5)").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(6)").html('不可发送');
- }else{
- $(this).children("td:eq(6)").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(3)").children('i').html();
- $(this).children("td:eq(5)").html(enable_count);
- totalCount += parseInt(enable_count);
- if(enable_count==0){
- $(this).children("td:eq(6)").html('不可发送');
- }else{
- $(this).children("td:eq(6)").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/sendHtbTask");?>",
- data: {
- 'json_data' : json_data,
- 'is_filter' : is_filter,
- },
- 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);
- }
- }
- });
- });
- $('.confirmbox-mask .icon-close-1').click(function () {
- $('.confirmbox-mask').hide();
- });
- $('.confirmbox-mask .cancel').click(function () {
- $('.confirmbox-mask').hide();
- });
- //批量下载
- $("#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 saveDataAry=[];
- var data1 = [];
- for(i=0;i<result.length;i++)
- {
- var htbId = result[i];
- data1 = {"htbId": htbId};
- saveDataAry.push(data1);
- }
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl('productdownload/batchHtb');?>",
- 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);
- }
- },
- });
- }
- });
- });
- </script>
|