index.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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 #2977ff;
  9. text-align: center;
  10. line-height: 30px;
  11. }
  12. .active{
  13. color: #fff;
  14. background-color: #2977ff;
  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: #2977ff;
  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: #2977ff;
  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. .pdp-con .pop-opt-con{border-top: 1px solid #ddd;padding-top: 20px;}
  169. .tit-sub-intro span{font-size: 12px;}
  170. .notice-btn{background:#CC3300;color:#fff;font-size: 12px;font-weight: normal }
  171. </style>
  172. <script type="text/javascript">
  173. function in_array(search, array){
  174. for(var i in array){
  175. if(array[i]==search){
  176. return true;
  177. }
  178. }
  179. return false;
  180. }
  181. jQuery(document).ready(function(){
  182. // 根据年级筛选班级
  183. jQuery("#grade").change(function(){
  184. var grade = $(this).val();
  185. if (!grade) return false;
  186. jQuery.post(
  187. '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade},function(data){
  188. data = JSON.parse(data);
  189. if(data.success == 1){
  190. var classObj = $("#class");
  191. var html = "<option value=''>全部班级</option>";
  192. classObj.empty();
  193. $.each(data.message,function(i,n){
  194. html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
  195. });
  196. classObj.append(html);
  197. }
  198. }
  199. );
  200. });
  201. });
  202. </script>
  203. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  204. <div class="main-content-inner">
  205. <!-- 导航栏开始-->
  206. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  207. <!-- 导航栏结束-->
  208. <div class="page-content">
  209. <div class="row" style="margin:0px;">
  210. <div class="col-xs-12">
  211. <!-- PAGE CONTENT BEGINS -->
  212. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  213. <div class="row">
  214. <form method="get" id="form1" action="<?php echo $this->createUrl("correct/index");?>">
  215. <div class="col-xs-12">
  216. <div class="dataTables_length margin-zy clearfix">
  217. <select class="form-control" id="grade" name="grade">
  218. <option value="">年级</option>
  219. <option value="1" <?php if($grade == 1) echo "selected";?>>高一</option>
  220. <option value="2" <?php if($grade == 2) echo "selected";?>>高二</option>
  221. <option value="3" <?php if($grade == 3) echo "selected";?>>高三</option>
  222. </select>
  223. <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
  224. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  225. <span class="red">生成的纠错本仅保留7天,请及时下载/打印</span>
  226. <span class="fr ">
  227. <a href="/vue/index.html#/JiuCuoSet" class="btn-garder">生成纠错本</a>
  228. </span>
  229. </div>
  230. </div>
  231. </form>
  232. </div>
  233. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  234. <thead>
  235. <tr>
  236. <th class="center">
  237. <input type="checkbox" class="ace selectAll" />
  238. </th>
  239. <th>产品名称</th>
  240. <th>年级</th>
  241. <th>创建时间</th>
  242. <th>状态</th>
  243. <th>已下载/打印的班级数量</th>
  244. <th >操作</th>
  245. </tr>
  246. </thead>
  247. <tbody>
  248. <?php if(!empty($printList)):foreach($printList as $cl):?>
  249. <tr>
  250. <td>
  251. <input type="checkbox" class="ace myselect" value="<?php echo $cl['gp_group_id'];?>">
  252. </td>
  253. <td style="max-width:260px">
  254. <?php
  255. if($cl['isDown']==0 && $cl['reset_times']==0)
  256. { echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";};
  257. echo "<a href=".$this->createUrl("correct/resetclass",array("name"=>$cl['name'],"gp_group_id"=>$cl['gp_group_id'])).">{$cl['name']}</a>"
  258. ?>
  259. </td>
  260. <td style="max-width:100px"><?php echo Yii::app()->params['grade_config'][$cl['grade']]['grade_name'];?></td>
  261. <td><?php echo date('Y-m-d H:i:s',$cl['create_time']);?></td>
  262. <td>
  263. <?php
  264. if($cl['status']==5){
  265. echo '生成异常';
  266. }elseif($cl['isCreate']==0){
  267. echo '排队中';
  268. }elseif($cl['isAllCreate']==1){
  269. echo '已生成';
  270. }else{
  271. echo '生成中';
  272. }
  273. ?>
  274. </td>
  275. <td><?php echo $cl['isDown'].'/'.$cl['totalClass'];?></td>
  276. <td style="width:265px;">
  277. <a class="iconfont click-sc addbx" aria-hidden="true" title="查看班级" href="<?php echo $this->createUrl('correct/classlist',array('gpGroupId'=>$cl['gp_group_id']))?>">班</a>
  278. <?php
  279. if($cl['abnormal'] && $cl['status']==5){
  280. ?>
  281. <span class="iconfont notice-btn addbx viewAbnormal" aria-hidden="true" id="<?php echo $cl['gp_group_id']?>" examCount="<?php echo $cl['examGroupIdCount']?>" title="<?php echo $cl['abnormal'] ?>" >查看异常</span>
  282. <?php
  283. }
  284. ?>
  285. </td>
  286. </tr>
  287. <?php endforeach;else:?>
  288. <tr><td colspan="8">暂无数据!</td></tr>
  289. <?php endif;?>
  290. </tbody>
  291. </table>
  292. <?php if(!empty($page_total)):?>
  293. <div class="row">
  294. <div class="col-xs-6">
  295. &nbsp;
  296. </div>
  297. <div class="col-xs-6">
  298. <div class="dataTables_paginate paging_simple_numbers">
  299. <?php
  300. $this->widget('CLinkPager', array(
  301. 'header' => '',
  302. 'firstPageLabel'=> '首页',
  303. 'lastPageLabel' => '末页',
  304. 'prevPageLabel' => '上一页',
  305. 'nextPageLabel' => '下一页',
  306. 'pages' => $pages,
  307. 'maxButtonCount'=> 5,
  308. ));
  309. echo '共:'.$page_total.'条';
  310. ?>
  311. </div>
  312. </div>
  313. </div>
  314. <?php endif;?>
  315. </div>
  316. <!--上传模板弹窗-->
  317. <!--发送云印任务弹窗-->
  318. <div class="confirmbox-mask" id="classModal-1" style="display:none ;">
  319. <div class="class-modal-1">
  320. <i class="icon icon-close-1" style="color: white">X</i><div class="class-modal-head-1">异常提示</div>
  321. <div class="class-modal-body-1">
  322. <div>
  323. <span class="abnormal-txt">异常提示:所选班级内:高一1班、高一2班、高一3班 均未参加过所选的4场考试,无法生成产品<br>
  324. 选择【继续生成】将剔除异常班级生成<br>
  325. 选择【编辑设置】进入编辑页面,重新设置生成!<br></span>
  326. </div>
  327. <div class="btn_area" style="text-align: center;">
  328. <input type="hidden" name="gpGroupId" value="">
  329. <button class="cancel">编辑设置</button>
  330. <button id="proceedCreate" class="proceedCreate">继续生成</button>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. <!-- PAGE CONTENT ENDS -->
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. <?php include(Yii::app()->basePath.'/views/print/_print.php');?>
  341. <script src="/js/jquery.ajaxfileupload.js"></script>
  342. <script type="text/javascript">
  343. $(document).ready(function(){
  344. });
  345. // 搜索事件
  346. $("#search").click(function(){
  347. $("#form1").submit();
  348. });
  349. // 全选\反选
  350. $(".selectAll").click(function(){
  351. if ($(this).prop("checked")) {
  352. var s_obj = $(".myselect");
  353. var s_len = s_obj.length;
  354. for (var i=0;i<s_len;i++) {
  355. if (!s_obj[i].disabled) {
  356. s_obj[i].checked=true;
  357. }
  358. }
  359. } else {
  360. $(".myselect").prop("checked",false);
  361. }
  362. });
  363. $('.viewAbnormal').click(function () {
  364. txt=$(this).attr('title');
  365. number=$(this).attr('examCount');
  366. id=$(this).attr('id');
  367. html='异常提示:所选班级内:<span class="red">'+txt+'</span> 均未参加过所选的'+number+'场考试,无法生成产品<br>\n' +
  368. '选择【继续生成】将剔除异常班级生成<br>\n' +
  369. '选择【编辑设置】进入编辑页面,重新设置生成!<br>';
  370. $('.abnormal-txt').html(html);
  371. $('input[name=gpGroupId]').val(id);
  372. $('#classModal-1').show();
  373. });
  374. $('.confirmbox-mask .icon-close-1').click(function () {
  375. $('.confirmbox-mask').hide();
  376. });
  377. $('.confirmbox-mask .cancel').click(function () {
  378. id=$('input[name=gpGroupId]').val();
  379. url="/vue/index.html#/JiuCuoSet?EditId="+id;
  380. window.location.href=url;
  381. $('.confirmbox-mask').hide();
  382. });
  383. $('.proceedCreate').click(function () {
  384. id=$('input[name=gpGroupId]').val();
  385. $.ajax({
  386. url: "<?php echo $this->createUrl('correct/proceed');?>",
  387. type: "POST",
  388. dataType: "json",
  389. data: {"gpGroupId": id},
  390. beforeSend:function(){
  391. layer.msg("数据处理中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  392. },
  393. success: function (data){
  394. if(data.status==1){
  395. layer.msg('数据处理成功,进入生成队列',{time:2000},function () {
  396. window.location.reload();
  397. });
  398. $('.confirmbox-mask').hide();
  399. }else{
  400. if(data.msg!=undefined && data.msg!=''){
  401. layer.msg(data.msg);
  402. }else{
  403. layer.msg('数据处理失败');
  404. }
  405. }
  406. },
  407. });
  408. });
  409. </script>