class_list.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <style>
  2. .nav-btns{
  3. margin: 10px 20px;
  4. }
  5. .nav-btns>a{
  6. display: inline-block;
  7. width: 120px;
  8. border: 1px solid #40c180;
  9. text-align: center;
  10. line-height: 30px;
  11. }
  12. .active{
  13. color: #fff;
  14. background-color: #40c180;
  15. }
  16. .btn-garder{
  17. margin-right: 10px;
  18. display: inline-block;
  19. width: 100px;
  20. border: none;
  21. text-align: center;
  22. line-height: 30px;
  23. color: #fff;
  24. background-color: #2977ff;
  25. }
  26. .confirmbox {
  27. background: #fff;
  28. border: 1px solid #cccccc;
  29. border-radius: 3px;
  30. padding: 40px 40px 30px;
  31. text-align: center;
  32. position: fixed;
  33. left: 50%;
  34. top: 50%;
  35. transform: translate(-50%, -50%);
  36. z-index: 99;
  37. }
  38. .confirmbox-mask {
  39. background: rgba(0, 0, 0, .7);
  40. left: 0;
  41. right: 0;
  42. top: 0;
  43. bottom: 0;
  44. z-index: 99;
  45. position: fixed;
  46. }
  47. .btn_area button {
  48. border: none;
  49. background: #009965;
  50. width: 111px;
  51. height: 36px;
  52. border-radius: 3px;
  53. font-size: 14px;
  54. color: #fff;
  55. outline: none;
  56. cursor: pointer;
  57. }
  58. .btn_area button.save {
  59. display: block;
  60. margin: 40px auto;
  61. }
  62. .confirmbox .confirmbox-btns {
  63. margin-top: 40px;
  64. }
  65. .class-modal-body .classes {
  66. margin-bottom: 10px;
  67. }
  68. .class-modal-body .classes > div {
  69. display: inline-block;
  70. max-width: 640px;
  71. vertical-align: top;
  72. }
  73. .class-modal-body .classes a {
  74. text-decoration: none;
  75. display: inline-block;
  76. margin: 0 5px 5px;
  77. color: #136bfb;
  78. font-size: 14px;
  79. }
  80. .class-modal-body .classes a.active {
  81. color: #fc091b
  82. }
  83. .class-modal .icon-close{
  84. position: absolute;
  85. right: 20px;
  86. top: 20px;
  87. }
  88. .class-modal-1 {
  89. width: auto;
  90. background: #fff;
  91. border-radius: 5px;
  92. position: absolute;
  93. top: 50%;
  94. left: 50%;
  95. transform: translate(-50%, -50%);
  96. }
  97. .class-modal-head-1 {
  98. font-size: 14px;
  99. text-align: left;
  100. color:#fff;
  101. line-height:30px;
  102. background: #2977ff;
  103. padding-left:15px;
  104. }
  105. .class-modal-body-1{
  106. padding:15px;
  107. }
  108. .class-modal-body-1 h2,.class-modal-body-1 h3{
  109. font-size:14px;
  110. font-weight:normal;
  111. margin-top:10px;
  112. }
  113. .class-modal-body-1 h3 span{
  114. font-size:10px;
  115. color:#ccc;
  116. }
  117. .class-modal-body-1 label{
  118. display: inline-block;
  119. font-weight: normal;
  120. margin-right: 15px;
  121. height:30px;
  122. position: relative;
  123. }
  124. .class-modal-1 .icon-close-1{
  125. position: absolute;
  126. right: 10px;
  127. top:5px;
  128. }
  129. .class-modal-1 .class_area{
  130. height:115px;
  131. border:1px solid #ccc;
  132. padding:5px;
  133. overflow-y: auto;
  134. margin-bottom:15px;
  135. }
  136. .class-modal-1 .checkAll{
  137. position:absolute;
  138. right:5px;
  139. top:115px;
  140. }
  141. .class-modal-1 .subsection{
  142. }
  143. .class-modal-1 .btn p{color:#000;}
  144. .class-modal-1 .btn_area{
  145. padding: 10px;
  146. border-top: 1px solid #aab6aa;
  147. margin-top:10px;
  148. }
  149. .class-modal-1 .btn_area p{
  150. display: inline-block;
  151. }
  152. .class-modal-1 .btn_area button{
  153. margin-left:5px;
  154. }
  155. .class-modal-1 .btn_area .cancel{
  156. background: #fff;
  157. color:#000;
  158. border:1px solid #666;
  159. }
  160. .c-red-1 {
  161. color: #CC3300;
  162. font-size:10px;
  163. display: inline-block;
  164. position:absolute;
  165. left:15px;
  166. top:18px;
  167. }
  168. .vtm{vertical-align: middle;}
  169. .pointer{cursor: pointer;}
  170. .dib{display: inline-block;}
  171. .pdp-con .pop-opt-con{border-top: 1px solid #ddd;padding-top: 20px;}
  172. .tit-sub-intro{color: #666;}
  173. .tit-sub-intro span{font-size: 12px;}
  174. .subsection{width: 44px;height: 24px;border: 1px solid #ddd;text-align: center;font-size: 12px;}
  175. .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;}
  176. .reduce-btn.forbidden,.add-btn.forbidden{color: #bbb;border: 1px solid #bbb;cursor: no-drop;}
  177. </style>
  178. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  179. <div class="main-content-inner">
  180. <!-- 导航栏开始-->
  181. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  182. <!-- 导航栏结束-->
  183. <div class="page-content">
  184. <div class="row" style="margin:0px;">
  185. <div class="col-xs-12">
  186. <!-- PAGE CONTENT BEGINS -->
  187. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  188. <div class="row">
  189. <div class="col-xs-12">
  190. <div class="dataTables_length margin-zy clearfix">
  191. <span class="fr ">
  192. <a id="batchPrint" href="javascript:void(0);" class="btn-garder">批量下载</a>
  193. <a id="batchPrintToolsXbJCB" href="javascript:void(0);" class="btn-garder">批量打印</a>
  194. </span>
  195. </div>
  196. </div>
  197. </div>
  198. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  199. <thead>
  200. <tr>
  201. <th class="center">
  202. <input type="checkbox" class="ace selectAll" />
  203. </th>
  204. <th>产品名称</th>
  205. <th>班级</th>
  206. <th>已生成/总数</th>
  207. <th>创建时间</th>
  208. <th>是否下载/打印</th>
  209. <th>下载/打印时间</th>
  210. <th >操作</th>
  211. </tr>
  212. </thead>
  213. <tbody>
  214. <?php if(!empty($printList)):foreach($printList as $cl):?>
  215. <tr>
  216. <td>
  217. <input type="checkbox" class="ace myselect" value="<?php echo $cl['class_id'].'_'.$cl['gp_id'].'_'.$type; ?>">
  218. </td>
  219. <td style="max-width:260px">
  220. <?php ?>
  221. <a href=""><?php echo $cl['class_name'].$cl['name'];?></a>
  222. <?php ?>
  223. </td>
  224. <td style="max-width:100px"><?php echo $cl['class_name'];?></td>
  225. <td><?php echo $cl['create_count'].'/'.$cl['order_student_count'];?></td>
  226. <td><?php echo date('Y-m-d H:i:s',$cl['create_time']) ?></td>
  227. <td><?php if($cl['is_download']){echo '已下载/打印';}else{echo '未下载/打印';}?></td>
  228. <td><?php
  229. if($cl['is_download']){
  230. echo date('Y-m-d H:i:s',$cl['download_time']);
  231. }
  232. ?></td>
  233. <td style="width:265px;">
  234. <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="打印纠错本" >&#xe6bb;</span>
  235. <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>
  236. <a class="iconfont click-sc addbx" aria-hidden="true" title="选择学生下载纠错本" href="<?php echo $this->createUrl('correct/stu',array('gp_id'=>$cl['gp_id']))?>" >&#xe668;</a>
  237. </td>
  238. </tr>
  239. <?php endforeach;else:?>
  240. <tr><td colspan="8">暂无数据!</td></tr>
  241. <?php endif;?>
  242. </tbody>
  243. </table>
  244. </div>
  245. <!-- PAGE CONTENT ENDS -->
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. <?php include(Yii::app()->basePath.'/views/print/_print.php');?>
  251. <script>
  252. // 全选\反选
  253. $(".selectAll").click(function(){
  254. if ($(this).prop("checked")) {
  255. var s_obj = $(".myselect");
  256. var s_len = s_obj.length;
  257. for (var i=0;i<s_len;i++) {
  258. if (!s_obj[i].disabled) {
  259. s_obj[i].checked=true;
  260. }
  261. }
  262. } else {
  263. $(".myselect").prop("checked",false);
  264. }
  265. });
  266. //批量下载
  267. $("#batchPrint").click(function(){
  268. var message = "您确定要批量下载该产品吗?";
  269. // 判断是否有选中
  270. if (!$("input[class='ace myselect']").is(':checked')) {
  271. layer.msg('至少选择一个目标!');
  272. return false;
  273. }
  274. var result = [];
  275. $(".myselect").each(function(m,n){
  276. if ($(this).prop('checked')) {
  277. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  278. result.push($(this).val());
  279. }
  280. }
  281. })
  282. var sp = [];
  283. var cid = 0;
  284. var eid = 0;
  285. var type = 0;
  286. var saveDataAry=[];
  287. var data1 = [];
  288. for(i=0;i<result.length;i++)
  289. {
  290. sp = result[i].split('_');
  291. cid = sp[0];
  292. eid = sp[1];
  293. type = sp[2];
  294. if(!cid || !eid || !type) continue;
  295. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  296. data1 = {"gpId": eid, "classId": cid, "type": type,"absent_filter":absent_filter,"printType":"<?php echo $printType;?>"};
  297. saveDataAry.push(data1);
  298. }
  299. layer.msg(message, {
  300. time: 0,
  301. btn: ['确定', '取消'],
  302. yes: function(index){
  303. layer.close(index);
  304. $.ajax({
  305. type: "POST",
  306. url: "<?php echo $this->createUrl('productdowngeneral/batch');?>",
  307. dataType: "json",
  308. contentType: "application/json",
  309. data: JSON.stringify(saveDataAry),
  310. beforeSend:function(){
  311. layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  312. },
  313. success: function (data){
  314. layer.closeAll();
  315. if(data.success == 1) {
  316. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
  317. icon: 1,
  318. yes: function () {
  319. layer.closeAll();
  320. }
  321. });
  322. }else {
  323. layer.msg(data.message);
  324. }
  325. },
  326. });
  327. }
  328. });
  329. });
  330. // 下载
  331. function printBook(cid,gpid,type){
  332. if (!cid || !gpid || !type) {
  333. layer.msg("打印参数有误");return;
  334. }
  335. var message = "您确定要下载该班级纠错本吗?";
  336. var divTitle = "下载纠错本";
  337. var improveName = "纠错本";
  338. html = ""+
  339. '<div style="padding:20px 30px 0px 30px">'+
  340. '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
  341. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  342. '<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>'+
  343. '</div>'+
  344. '</div>'+
  345. "";
  346. layer.msg(message, {
  347. time: 0,
  348. btn: ['确定', '取消'],
  349. yes: function(index){
  350. layer.close(index);
  351. $.ajax({
  352. url: "<?php echo $this->createUrl('productdowngeneral/getUrl');?>",
  353. type: "GET",
  354. dataType: "json",
  355. data: {"gpId": gpid, "classId": cid, "type": type},
  356. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  357. beforeSend:function(){
  358. layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  359. },
  360. error: function (jqXHR, textStatus, errorThrown) {
  361. if(textStatus=="timeout"){
  362. $.ajax({
  363. type:'GET',
  364. url: "<?php echo $this->createUrl("productdowngeneral/addTask");?>",
  365. data: {"gpId": gpid, "classId": cid, "type": type},
  366. dataType: "json",
  367. success:function (data) {
  368. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
  369. icon: 1,
  370. yes:function(){
  371. layer.closeAll();
  372. }
  373. });
  374. }
  375. })
  376. }else {
  377. layer.msg('返回失败!',{
  378. icon: 5
  379. }, function(){
  380. layer.closeAll();
  381. });
  382. }
  383. },
  384. success: function (data){
  385. layer.closeAll();
  386. if(data.success == 1||data.success == 2){
  387. layer.open({
  388. type: 1,
  389. area: ['550px', '220px'],
  390. title: divTitle,
  391. content: html,
  392. success: function(index, layerObj){
  393. // 更试卷打印时间
  394. //$.post("<?php //echo $this->createUrl('print/updatepaperprinttime');?>//", {cid: cid, eid: eid,type:type } );
  395. 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>');
  396. jQuery("#confirm, #cancel").on("click", function(){
  397. layer.close(layerObj);
  398. });
  399. jQuery("#copy").on("click", function(){
  400. jQuery("#url").select();
  401. });
  402. },
  403. end: function(){
  404. }
  405. });
  406. }else if(data.success == 3){
  407. // 更试卷打印时间
  408. //$.post("<?php //echo $this->createUrl('print/updatepaperprinttime');?>//", {cid: cid, eid: eid,type:type } );
  409. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
  410. icon: 1,
  411. yes:function(){
  412. layer.closeAll();
  413. }
  414. });
  415. }
  416. else if(data.success == 0){
  417. layer.msg(data.message, {"time": 3000});
  418. }
  419. },
  420. });
  421. }
  422. });
  423. }
  424. </script>