mytask.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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 class="active">素材切割任务</span>
  6. <span><a href="<?php echo $this->createUrl('assistTask/myScanTask'); ?>">扫描处理任务</a></span>
  7. </div>
  8. <div class="searchArea">
  9. <form class="task_search" action="<?php echo $this->createUrl('assistTask/myTask');?>" method="get" >
  10. <div class="searchLeft">
  11. <div class="conditionItem">
  12. <em>答题卡:</em>
  13. <select name="answer_sheet_task">
  14. <option value="0">全部</option>
  15. <option value="1" <?php if($condition['answer_sheet_task']==1) echo 'selected'?>>排队中</option>
  16. <option value="2" <?php if($condition['answer_sheet_task']==2) echo 'selected'?>>受理中</option>
  17. <option value="3" <?php if($condition['answer_sheet_task']==3) echo 'selected'?>>已完成 </option>
  18. </select>
  19. </div>
  20. <div class="conditionItem">
  21. <em>试卷:</em>
  22. <select name="paper_task">
  23. <option value="0">全部</option>
  24. <option value="1" <?php if($condition['paper_task']==1) echo 'selected'?>>排队中</option>
  25. <option value="2" <?php if($condition['paper_task']==2) echo 'selected'?>>受理中</option>
  26. <option value="3" <?php if($condition['paper_task']==3) echo 'selected'?>>已完成 </option>
  27. </select>
  28. </div>
  29. <div class="conditionItem">
  30. <em>答案解析:</em>
  31. <select name="parse_task">
  32. <option value="0">全部</option>
  33. <option value="1" <?php if($condition['parse_task']==1) echo 'selected'?>>排队中</option>
  34. <option value="2" <?php if($condition['parse_task']==2) echo 'selected'?>>受理中</option>
  35. <option value="3" <?php if($condition['parse_task']==3) echo 'selected'?>>已完成 </option>
  36. </select>
  37. </div>
  38. <div class="conditionItem">
  39. <input type="text" placeholder="请输入考试名称/学校名称/学管姓名的等关键字搜索" name="search_name" value="<?php echo $condition['search_name'] ?>">
  40. <div class="submit hbtn">搜索</div>
  41. <input type="hidden" name="subject_id" value="<?php echo $subjectId?>">
  42. </div>
  43. </div>
  44. </form>
  45. <div class="conditionItem last">
  46. <em>学科:</em>
  47. <select name="subject_id" id="selectId">
  48. <option value="0">全部</option>
  49. <?php
  50. if(isset($subjects)){
  51. foreach ($subjects as $key => $subject){
  52. if($key==$subjectId){
  53. echo '<option value="'.$key.'" selected>'.$subject.'</option>';
  54. }else{
  55. echo '<option value="'.$key.'">'.$subject.'</option>';
  56. }
  57. }
  58. }
  59. ?>
  60. </select>
  61. </div>
  62. </div>
  63. <div class="tableBox">
  64. <table class="hgc_table" border="1" cellspacing="0">
  65. <thead>
  66. <tr>
  67. <th>考试名称</th>
  68. <th>学科</th>
  69. <th>学校名称</th>
  70. <th>学校地址</th>
  71. <th>学管姓名</th>
  72. <th>学管手机号</th>
  73. <th>答题卡任务</th>
  74. <th>试卷任务</th>
  75. <th>答案解析任务</th>
  76. <th>任务更新时间</th>
  77. <th>操作</th>
  78. </tr>
  79. </thead>
  80. <tbody>
  81. <?php $i = 1; if ($dataList):foreach ($dataList as $loop): ?>
  82. <tr>
  83. <td><p class="examName" title="<?php echo $loop['exam_name'] ?>"><?php echo $loop['exam_name'] ?></p></td>
  84. <td><?php echo Yii::app()->params['subjectId'][$loop['subject_id']] ?></td>
  85. <td><?php echo $loop['school_name'] ?></td>
  86. <td><?php echo $loop['address'] ?></td>
  87. <td><?php echo $loop['coach_name'] ?></td>
  88. <td><?php echo $loop['coach_mobile'] ?></td>
  89. <?php
  90. switch ($loop['answer_sheet_task']){
  91. case 0:
  92. echo '<td> 无</td>';
  93. break;
  94. case 1:
  95. echo '<td class="warning">排队中</td>';
  96. break;
  97. case 2:
  98. echo '<td class="notice">受理中</td>';
  99. break;
  100. case 3:
  101. echo ' <td class="theme">已完成</td>';
  102. break;
  103. default:
  104. echo '<td> 无</td>';
  105. }
  106. ?>
  107. <?php
  108. switch ($loop['paper_task']){
  109. case 0:
  110. echo '<td> 无</td>';
  111. break;
  112. case 1:
  113. echo '<td class="warning">排队中</td>';
  114. break;
  115. case 2:
  116. echo '<td class="notice">受理中</td>';
  117. break;
  118. case 3:
  119. echo '<td class="theme">已完成</td>';
  120. break;
  121. default:
  122. echo '<td> 无</td>';
  123. }
  124. ?>
  125. <?php
  126. switch ($loop['parse_task']){
  127. case 0:
  128. echo '<td> 无</td>';
  129. break;
  130. case 1:
  131. echo '<td class="warning">排队中</td>';
  132. break;
  133. case 2:
  134. echo '<td class="notice">受理中</td>';
  135. break;
  136. case 3:
  137. echo '<td class="theme">已完成</td>';
  138. break;
  139. default:
  140. echo '<td> 无</td>';
  141. }
  142. ?>
  143. <td class=" open-tips" tipstext="<?php echo $loop['tips']?>"><?php echo date('Y-m-d H:i:s',$loop['update_time'])?></td>
  144. <td >
  145. <div class="operator">
  146. <a href="<?php echo $this->createUrl('assistTask/detail',array('exam_group_id'=>$loop['exam_group_id']))?>" class="theme artical">查看并处理</a>
  147. <a href="#" class="complete blue" eid="<?php echo $loop['exam_group_id']?>">完成并提交</a>
  148. </div>
  149. </td>
  150. </tr>
  151. <?php ++$i;endforeach;
  152. else:?>
  153. <tr><td colspan="12">
  154. <?php
  155. if(isset($isNoLimit)){
  156. echo '用户无权限';
  157. }else{
  158. echo '暂无任务数据';
  159. }
  160. ?>
  161. </td></tr>
  162. <?php
  163. endif;
  164. ?>
  165. </tbody>
  166. </table>
  167. <div class="dataTables_paginate paging_simple_numbers" >
  168. <?php
  169. if(isset($pages['totalPage']) && $pages['totalPage']>1){
  170. $StartPage=$pages['page']-5;
  171. $EndPage=$pages['page']+5;
  172. if($StartPage<1){
  173. $StartPage=1;
  174. }
  175. if($EndPage>$pages['totalPage']){
  176. $EndPage=$pages['totalPage'];
  177. }
  178. ?>
  179. <div class="row" style="padding-top:10px;margin:0 auto;">
  180. <div class="col-xs-5" style="font-size: 16px">
  181. <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
  182. <ul id="yw0" class="yiiPager">
  183. <?php
  184. if($pages['page']>1){
  185. echo '<li class="previous"><a href="'.$this->createUrl('assistTask/myTask')."?page=".($pages['page']-1).'&'.http_build_query($condition).'">上一页</a></li>';
  186. }
  187. for($i=$StartPage;$i<=$EndPage;$i++){
  188. $url=$this->createUrl('assistTask/myTask')."?page=".$i.'&'.http_build_query($condition);
  189. if($pages['page']==$i){
  190. echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
  191. }else{
  192. echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
  193. }
  194. }
  195. if($pages['page']<$pages['totalPage']){
  196. echo '<li class="previous"><a href="'.$this->createUrl('assistTask/myTask')."?page=".($pages['page']+1).'&'.http_build_query($condition).'">下一页</a></li>';
  197. }
  198. ?>
  199. </ul>
  200. 共:<?php echo $pages['total']?>条
  201. </div>
  202. </div>
  203. </div>
  204. <?php } ?>
  205. </div>
  206. </div>
  207. <div class="hgc_dialog" style="display: none">
  208. <div class="hgc_dialogContent">
  209. <h2>任务完成 <i class="close btn-colse">x</i></h2>
  210. <div class="content">
  211. <p class="warning">您将提交以下勾选中的任务对象,请确认!</p>
  212. <div class="conditionItem" id="taskYes">
  213. <p class="mgt">
  214. <div class="ch"><input type="checkbox" name="answer_card" value="1">答题卡<br><span class="answer_card_status">(已设置)</span></div>
  215. <div class="ch"><input type="checkbox" name="paper" value="1">试卷<br><span class="paper_status">(已设置)</span></div>
  216. <div class="ch"><input type="checkbox" name="parse" value="1">答案解析<br><span class="parse_status">(已设置)</span></div>
  217. </p>
  218. <input type="hidden" name="exam_group_id" value="0">
  219. </div>
  220. </div>
  221. <div class="btns">
  222. <input type="hidden" name="exam_id" value="0">
  223. <input type="hidden" name="file_type" value="">
  224. <div class="hbtn up-form disabled" id="btnSubmit">确定</div>
  225. <div class="hbtn btn-colse" id="btnClose">取消</div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <script type="text/javascript">
  231. $(document).ready(function () {
  232. //任务完成
  233. var $yesCheckInput = $('#taskYes input[type="checkbox"]')
  234. $yesCheckInput.off('click').click(function(e){
  235. if($(this).prop('checked')){
  236. $('#btnSubmit').removeClass('disabled')
  237. }else{
  238. var count = 0
  239. $yesCheckInput.each(function () {
  240. if($(this).prop('checked')){
  241. $('#btnSubmit').removeClass('disabled')
  242. return false;
  243. } else{
  244. count++;
  245. }
  246. })
  247. if(count === $yesCheckInput.length)$('#btnSubmit').addClass('disabled')
  248. }
  249. })
  250. //关闭弹窗
  251. $(".btn-colse").on("click", function () {
  252. //layer.closeAll();
  253. $('.hgc_dialog').hide();
  254. });
  255. $('.complete').click(function(){
  256. var examGroupId=$(this).attr('eid');
  257. if(examGroupId!=0){
  258. $.ajax({
  259. url:'<?php echo $this->createUrl('assistTask/getDetail')?>',
  260. type:'POST',
  261. dataType:'json',
  262. data:{exam_group_id:examGroupId},
  263. success:function(res){
  264. if(res.status==1){
  265. if(res.data['answer_card']==1){
  266. $('.answer_card_status').html('(已设置)');
  267. }else{
  268. $('.answer_card_status').html('(未设置)');
  269. }
  270. if(res.data['answer_card_input_status']==1){
  271. $('input[name=answer_card]').attr('disabled',false);
  272. }else{
  273. $('input[name=answer_card]').attr('checked',false);
  274. $('input[name=answer_card]').attr('disabled',true);
  275. }
  276. if(res.data['paper']==1){
  277. $('.paper_status').html('(已设置)');
  278. }else{
  279. $('.paper_status').html('(未设置)');
  280. }
  281. if(res.data['paper_input_status']==1){
  282. $('input[name=paper]').attr('disabled',false);
  283. }else{
  284. $('input[name=paper]').attr('checked',false);
  285. $('input[name=paper]').attr('disabled',true);
  286. }
  287. if(res.data['parse']==1){
  288. $('.parse_status').html('(已设置)');
  289. }else{
  290. $('.parse_status').html('(未设置)');
  291. }
  292. if(res.data['parse_input_status']==1){
  293. $('input[name=parse]').attr('disabled',false);
  294. }else{
  295. $('input[name=parse]').attr('checked',false);
  296. $('input[name=parse]').attr('disabled',true);
  297. }
  298. $('input[name=exam_group_id]').val(examGroupId);
  299. $('.hgc_dialog').show();
  300. // layer.open({
  301. // title: false,
  302. // closeBtn: 0,
  303. // type: 1,
  304. // area: ['300px', '220px'],
  305. // content: $("#classModal")
  306. // });
  307. }
  308. }
  309. });
  310. }
  311. });
  312. //完成提交
  313. $('.up-form').click(function(){
  314. var examGroupId=$('input[name=exam_group_id]').val();
  315. var answerCardStatus=0,
  316. paperStatus=0,
  317. parseStatus=0;
  318. var sendOk=false;
  319. if($('input[name=answer_card]').is(':checked')){
  320. answerCardStatus=1;
  321. sendOk=true;
  322. }
  323. if($('input[name=paper]').is(':checked')){
  324. paperStatus=1;
  325. sendOk=true;
  326. }
  327. if($('input[name=parse]').is(':checked')){
  328. parseStatus=1;
  329. sendOk=true;
  330. }
  331. if(examGroupId!=0 && sendOk){
  332. $.ajax({
  333. url:'<?php echo $this->createUrl('assistTask/complete')?>',
  334. type:'POST',
  335. dataType:'json',
  336. data:{exam_group_id:examGroupId,answer_card:answerCardStatus,paper:paperStatus,parse:parseStatus},
  337. success:function(res){
  338. if(res.status==1){
  339. layer.msg('提交成功');
  340. window.location.reload()
  341. }else{
  342. if(res.msg!=undefined){
  343. layer.msg(res.msg);
  344. }else{
  345. layer.msg('提交失败');
  346. }
  347. }
  348. }
  349. })
  350. }
  351. });
  352. $(".open-tips").on("mouseenter", function () {
  353. var tips_text = $(this).attr("tipstext");
  354. layer.tips(tips_text, this, {
  355. tips: [1, '#14AE68'] //还可配置颜色
  356. });
  357. });
  358. $('#selectId').change(function(){
  359. window.location.href='<?php echo $this->createUrl('assistTask/myTask')?>?subject_id='+$(this).val();
  360. });
  361. $('.submit').click(function(){
  362. $('.task_search').submit();
  363. });
  364. });
  365. </script>