my_scan_task.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <link rel="stylesheet" href="/css/assist/taskPage.css">
  2. <script src="/js/assist/drag.js" type="text/javascript"></script>
  3. <div class="hgc_taskPage">
  4. <div class="hgc_totalHeader">
  5. <span><a href="<?php echo $this->createUrl('assistTask/myTask'); ?>">素材切割任务</a></span>
  6. <span class="active">扫描处理任务</span>
  7. </div>
  8. <div class="searchArea">
  9. <form class="task_search" action="<?php echo $this->createUrl('assistTask/myScanTask');?>" method="get" >
  10. <div class="searchLeft">
  11. <div class="conditionItem">
  12. <em>任务状态:</em>
  13. <select name="scan_task" id="scanTask">
  14. <option value="0">全部</option>
  15. <option value="1" <?php if($condition['scan_task']==1) echo 'selected'?>>排队中</option>
  16. <option value="2" <?php if($condition['scan_task']==2) echo 'selected'?>>受理中</option>
  17. <option value="3" <?php if($condition['scan_task']==3) echo 'selected'?>>已完成 </option>
  18. </select>
  19. </div>
  20. <div class="conditionItem">
  21. <input type="text" placeholder="请输入考试名称/学校名称/学管姓名的等关键字搜索" name="search_name" value="<?php echo $condition['search_name'] ?>">
  22. <div class="submit hbtn">搜索</div>
  23. <input type="hidden" name="subject_id" value="<?php echo $subjectId?>">
  24. </div>
  25. </div>
  26. </form>
  27. <div class="conditionItem last">
  28. <em>学科:</em>
  29. <select name="subject_id" id="selectId">
  30. <option value="0">全部</option>
  31. <?php
  32. if(isset($subjects)){
  33. foreach ($subjects as $key => $subject){
  34. if($key==$subjectId){
  35. echo '<option value="'.$key.'" selected>'.$subject.'</option>';
  36. }else{
  37. echo '<option value="'.$key.'">'.$subject.'</option>';
  38. }
  39. }
  40. }
  41. ?>
  42. </select>
  43. </div>
  44. </div>
  45. <div class="tableBox">
  46. <table class="hgc_table" border="1" cellspacing="0">
  47. <thead>
  48. <tr>
  49. <th>考试名称</th>
  50. <th>学科</th>
  51. <th>学校名称</th>
  52. <th>学管姓名</th>
  53. <th>学管手机号</th>
  54. <th>任务类别</th>
  55. <th>个人完成量</th>
  56. <th>剩余待处理</th>
  57. <th>任务状态</th>
  58. <th>任务更新时间</th>
  59. <th>操作</th>
  60. </tr>
  61. </thead>
  62. <tbody>
  63. <?php $i = 1; if ($dataList):foreach ($dataList as $loop): ?>
  64. <tr>
  65. <td><p class="examName" title="<?php echo $loop['exam_name'] ?>"><?php echo $loop['exam_name'] ?></p></td>
  66. <td><?php echo Yii::app()->params['subjectId'][$loop['subject_id']] ?></td>
  67. <td><?php echo $loop['school_name'] ?></td>
  68. <td><?php echo $loop['coach_name'] ?></td>
  69. <td><?php echo $loop['coach_mobile'] ?></td>
  70. <td>
  71. <?php
  72. if($loop['taskType']){
  73. echo implode(',',$loop['taskType']);
  74. }
  75. ?>
  76. </td>
  77. <td>
  78. <?php
  79. if($loop['taskCount']){
  80. echo $loop['taskCount']['processed'];
  81. }
  82. ?>
  83. </td>
  84. <td>
  85. <?php
  86. if($loop['taskCount']){
  87. echo $loop['taskCount']['surplus'];
  88. }
  89. ?>
  90. </td>
  91. <?php
  92. if($loop['scan_task']==2){
  93. echo '<td class="notice">受理中</td>';
  94. }elseif($loop['scan_task']==3){
  95. echo '<td class="theme">已完成</td>';
  96. }elseif($loop['scan_task']==4){
  97. echo '<td class="theme">已完成</td>';
  98. }else{
  99. echo '<td ></td>';
  100. }
  101. ?>
  102. <td><?php echo date('Y-m-d H:i:s',$loop['update_time'])?></td>
  103. <td>
  104. <div class="operator">
  105. <?php if($loop['scan_task']==3 || $loop['scan_task']==4){
  106. ?>
  107. <a href="<?php echo $this->createUrl('assistTask/scanTaskDetail',array('exam_group_id'=>$loop['exam_group_id']))?>" class="theme">查看详情</a>
  108. <?php
  109. }else{
  110. ?>
  111. <a href="<?php echo $this->createUrl('assistTask/scanTaskDetail',array('exam_group_id'=>$loop['exam_group_id']))?>" class="theme artical"> 查看并处理</a>
  112. <a href="#" class="complete blue" eid="<?php echo $loop['exam_group_id']?>">完成并提交</a>
  113. <?php
  114. }?>
  115. </div>
  116. </td>
  117. </tr>
  118. <?php ++$i;endforeach; else:?>
  119. <tr><td colspan="12">
  120. <?php
  121. if(isset($isNoLimit)){
  122. echo '用户无权限';
  123. }else{
  124. echo '暂无任务数据';
  125. }
  126. ?>
  127. </td></tr>
  128. <?php endif; ?>
  129. </tbody>
  130. </table>
  131. <div class="dataTables_paginate paging_simple_numbers" >
  132. <?php
  133. if(isset($pages['totalPage']) && $pages['totalPage']>1){
  134. $StartPage=$pages['page']-5;
  135. $EndPage=$pages['page']+5;
  136. if($StartPage<1){
  137. $StartPage=1;
  138. }
  139. if($EndPage>$pages['totalPage']){
  140. $EndPage=$pages['totalPage'];
  141. }
  142. ?>
  143. <div class="row" style="padding-top:10px;margin:0 auto;">
  144. <div class="col-xs-5" style="font-size: 16px">
  145. <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
  146. <ul id="yw0" class="yiiPager">
  147. <?php
  148. if($pages['page']>1){
  149. echo '<li class="previous"><a href="'.$this->createUrl('assistTask/myScanTask')."?page=".($pages['page']-1).'&'.http_build_query($condition).'">上一页</a></li>';
  150. }
  151. for($i=$StartPage;$i<=$EndPage;$i++){
  152. $url=$this->createUrl('assistTask/myScanTask')."?page=".$i.'&'.http_build_query($condition);
  153. if($pages['page']==$i){
  154. echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
  155. }else{
  156. echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
  157. }
  158. }
  159. if($pages['page']<$pages['totalPage']){
  160. echo '<li class="previous"><a href="'.$this->createUrl('assistTask/myScanTask')."?page=".($pages['page']+1).'&'.http_build_query($condition).'">下一页</a></li>';
  161. }
  162. ?>
  163. </ul>
  164. 共:<?php echo $pages['total']?>条
  165. </div>
  166. </div>
  167. </div>
  168. <?php } ?>
  169. </div>
  170. </div>
  171. <div class="hgc_dialog" style="display: none">
  172. <div class="hgc_dialogContent">
  173. <h2>任务完成 <i class="btn-colse">x</i></h2>
  174. <div class="content">
  175. <div class="conditionItem">
  176. <p class="mgt">
  177. 本次考试扫描异常您已处理<span class="complete_count"></span>份,剩余<span class="surplus"></span>份未处理,确认提交任务吗?
  178. </p>
  179. </div>
  180. <p class="notice" style="text-align: center;font-size: 16px;padding: 10px 0;">注:提交后将不可撤回</p>
  181. </div>
  182. <div class="btns">
  183. <input type="hidden" name="exam_group_id" value="0">
  184. <input type="hidden" name="file_type" value="">
  185. <div class="hbtn up-form" id="btnSubmit">确定</div>
  186. <div class="hbtn btn-colse" id="btnClose">取消</div>
  187. </div>
  188. </div>
  189. </div>
  190. <script type="text/javascript">
  191. $(document).ready(function () {
  192. //关闭弹窗
  193. $(".btn-colse").on("click", function () {
  194. $('.hgc_dialog').hide();
  195. });
  196. $('.complete').click(function(){
  197. var examGroupId=$(this).attr('eid');
  198. if(examGroupId!=0){
  199. $.ajax({
  200. url:'<?php echo $this->createUrl('assistTask/getScanDetail')?>',
  201. type:'POST',
  202. dataType:'json',
  203. data:{exam_group_id:examGroupId},
  204. success:function(res){
  205. if(res.status==1){
  206. $('.complete_count').html(res.data['count']['complete']);
  207. $('.surplus').html(res.data['count']['surplus']);
  208. $('input[name=exam_group_id]').val(examGroupId);
  209. $('.hgc_dialog').show();
  210. }
  211. }
  212. });
  213. }
  214. });
  215. //完成提交
  216. $('.up-form').click(function(){
  217. var examGroupId=$('input[name=exam_group_id]').val();
  218. if(examGroupId!=0){
  219. $.ajax({
  220. url:'<?php echo $this->createUrl('assistTask/scanTaskComplete')?>',
  221. type:'POST',
  222. dataType:'json',
  223. data:{exam_group_id:examGroupId},
  224. success:function(res){
  225. if(res.status==1){
  226. layer.msg('提交成功');
  227. window.location.reload()
  228. }else{
  229. if(res.msg!=undefined){
  230. layer.msg(res.msg);
  231. }else{
  232. layer.msg('提交失败');
  233. }
  234. }
  235. }
  236. })
  237. }
  238. });
  239. $(".open-tips").on("mouseenter", function () {
  240. var tips_text = $(this).attr("tipstext");
  241. layer.tips(tips_text, this, {
  242. tips: [1, '#14AE68'] //还可配置颜色
  243. });
  244. });
  245. $('#selectId').change(function(){
  246. window.location.href='<?php echo $this->createUrl('assistTask/myScanTask')?>?subject_id='+$(this).val();
  247. });
  248. $('#scanTask').change(function(){
  249. var subject=$('input[name=subject_id]').val();
  250. window.location.href='<?php echo $this->createUrl('assistTask/myScanTask')?>?subject_id='+subject+'&scan_task='+$(this).val();
  251. });
  252. $('.submit').click(function(){
  253. $('.task_search').submit();
  254. });
  255. });
  256. </script>