change2.php 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807
  1. <link rel="stylesheet" href="/css/cylet.css" />
  2. <style>
  3. .sc-lis span{
  4. position: relative;
  5. }
  6. .sc-lis .points{
  7. top: 2px;
  8. right: -16px;
  9. }
  10. .label-primary-gray{background:#676767;}
  11. .loading-pop{position: fixed;left: 0;top: 0;bottom: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 200;}
  12. .loading-pop-msg{color: #fff;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);font-size: 22px;letter-spacing: 4px;}
  13. .select_area{
  14. width:40%;
  15. height:85px;
  16. margin:0 30px;
  17. float: left;
  18. border:1px solid #ccc;
  19. text-align: center;
  20. line-height: 85px;
  21. border-radius:5px;
  22. }
  23. .active{color:#fff;background: #0e8e54}
  24. .online_word_btn{clear:both;text-align: center;margin-top:50px;}
  25. .online_word_btn button{}
  26. #classModal-1 .class-modal-1{
  27. min-height: auto;
  28. }
  29. #classModal-1 .class-modal-body-1:after{
  30. content: '';
  31. display: block;
  32. clear: both;
  33. }
  34. #classModal-1 .online_word_btn{
  35. padding: 10px 0;
  36. }
  37. #classModal-1 .online_word_btn button{
  38. width: 120px;
  39. height: 40px;
  40. text-align: center;
  41. line-height: 40px;
  42. border-radius: 5px;
  43. background: #0e8e54;
  44. border:1px solid #0e8e54;
  45. color: #fff;
  46. border:none;
  47. padding: 0;
  48. }
  49. #classModal-1 .online_word_btn button.cancel{
  50. color: #333;
  51. border:1px solid #333;
  52. background: #fff;
  53. }
  54. #classModal-1 .class-modal-1{
  55. min-height: auto;
  56. }
  57. #classModal-1 .class-modal-body-1:after{
  58. content: '';
  59. display: block;
  60. clear: both;
  61. }
  62. #classModal-1 .online_word_btn{
  63. padding: 10px 0;
  64. }
  65. #classModal-1 .online_word_btn button{
  66. width: 120px;
  67. height: 40px;
  68. text-align: center;
  69. line-height: 40px;
  70. border-radius: 5px;
  71. background: #0e8e54;
  72. border:1px solid #0e8e54;
  73. color: #fff;
  74. border:none;
  75. padding: 0;
  76. margin-left:10px;
  77. }
  78. #classModal-1 .online_word_btn button.cancel{
  79. color: #333;
  80. border:1px solid #333;
  81. background: #fff;
  82. }
  83. #classModal-1 .select_area{
  84. position: relative;
  85. }
  86. #classModal-1 .select_area.active:after{
  87. display: block;
  88. }
  89. #classModal-1 .select_area.active:before{
  90. display: block;
  91. }
  92. #classModal-1 .select_area:after{
  93. display: none;
  94. content: '';
  95. position: absolute;
  96. width: 30px;
  97. height: 30px;
  98. right: 10px;
  99. bottom: 10px;
  100. border-radius: 50%;
  101. background: #fff;
  102. }
  103. #classModal-1 .select_area:before{
  104. display: none;
  105. content: '';
  106. position: absolute;
  107. width: 15px;
  108. height: 8px;
  109. border-left: 2px solid #0e8e54;
  110. border-bottom: 2px solid #0e8e54;
  111. right: 16px;
  112. bottom: 22px;
  113. z-index: 10;
  114. transform: rotate(-35deg);
  115. -webkit-transform: rotate(-35deg);
  116. }
  117. .icon-close-1{background-image: url("/images/chose.png")}
  118. .table_area{margin-top:50px;}
  119. .add-class-list{position:relative}
  120. .class-add-list{
  121. position: absolute;
  122. background-color: #f9f9f9;
  123. min-width: 103px;
  124. box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  125. padding: 0;
  126. left: -5px;
  127. top: 33px;
  128. display: none;
  129. color: rgb(51, 51, 51);
  130. z-index:1000;
  131. }
  132. .class-add-list a{
  133. display: flex;
  134. }
  135. </style>
  136. <div class="main-content-inner">
  137. <!-- 导航栏开始-->
  138. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  139. <!-- 导航栏结束-->
  140. <div class="page-content">
  141. <div class="row" style="margin:0px">
  142. <div class="col-xs-12">
  143. <!-- PAGE CONTENT BEGINS -->
  144. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  145. <div class="row">
  146. <div class="col-xs-4">
  147. <form method="get" id="form1" action="<?php echo $this->createUrl("print/change");?>">
  148. <div class="dataTables_length" style="margin: 6px 0px;">
  149. <div class="dataTables_length">
  150. <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
  151. <!--<button class="btn btn-minier btn-primary" id="search">搜索</button>-->
  152. <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
  153. </div>
  154. </div>
  155. <input type="hidden" name="cid" class="clid" value="<?php echo $class_id;?>" />
  156. <input type="hidden" name="eid" class="emid" value="<?php echo $exam_id;?>" />
  157. <input type="hidden" name="tid" value="<?php echo $type_id;?>" />
  158. </form>
  159. </div>
  160. <div class="col-xs-8">
  161. <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px;text-align: right;">
  162. <?php if(isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)){?>
  163. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="updatePaperStatus" style="display: none">
  164. <i style="font-style: normal;" ></i>是否使用学校准考证
  165. </a>
  166. <?php }?>
  167. <a href="javascript:void(0);" class="btn label-primary-blue btn-sm" id="addPaperStudent">
  168. <i style="font-style: normal;" ></i>添加考试学生
  169. </a>
  170. <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudent">
  171. <i style="font-style: normal;" ></i>选择删除考试学生
  172. </a>
  173. <a href="javascript:void(0);" class="btn click-delete btn-sm" id="delPaperStudentAll">
  174. <i style="font-style: normal;" ></i>删除全部未考试学生
  175. </a>
  176. <?php
  177. if(!$isCustomTpl || $useAnswerCardOnlineQrcode){
  178. // if(!$isCustomTpl ){
  179. ?>
  180. <a href="javascript:void(0);" code="2" class="btn <?php echo $tempCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="createTempNew">
  181. <!-- <a href="javascript:void(0);" code="2" class="btn <?php echo $tempCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="createTemp">-->
  182. 批量生成
  183. </a>
  184. <a href="javascript:void(0);" code="1" class="btn label-primary-green btn-sm" id="selectPrintNew">
  185. <!-- <a href="javascript:void(0);" code="1" class="btn label-primary-green btn-sm" id="selectPrint">-->
  186. <i style="font-style: normal;" class="fa fa-print"></i>
  187. <?php if ($tplTwo == 1){echo '批量打印';}else{echo '批量打印';}?>
  188. </a>
  189. <a href="javascript:void(0);" code="3" class="btn <?php echo $printCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="printPaperNew">
  190. <!-- <a href="javascript:void(0);" code="3" class="btn <?php echo $printCheck ? 'label-primary-green' : 'label-primary-gray'; ?> btn-sm" id="printPaper">-->
  191. 批量下载
  192. </a>
  193. <!--
  194. <div href="javascript:void(0);" class="btn label-primary-green btn-sm add-class-list" >
  195. <i style="font-style: normal;" class="fa "></i>订单学生操作
  196. <div class="class-add-list">
  197. <a href="javascript:void(0);" class="btn label-primary-green btn-sm createTempByOrder">订单学生生成</a>
  198. <a href="javascript:void(0);" class="btn label-primary-green btn-sm selectPrintByOrder">订单学生打印</a>
  199. <a href="javascript:void(0);" class="btn label-primary-green btn-sm printPaperByOrder">订单学生下载</a>
  200. </div>
  201. </div>
  202. -->
  203. <?php }?>
  204. </div>
  205. </div>
  206. </div>
  207. <div class="row">
  208. <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
  209. <?php echo $className;?> <?php echo $paperName;?>(使用<?php if($examInfo->school_card_status==0){if(Yii::app()->session['school_id']>999){echo '系统准考证号,长度为9位';}else{ echo '系统准考证号,长度为8位';}}else{echo '学校准考证号,长度为'.$examInfo->school_card_length.'位';}?>)
  210. </div>
  211. </div>
  212. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  213. <thead>
  214. <tr>
  215. <th class="center">
  216. <!--<label class="pos-rel">
  217. <input type="checkbox" class="selectAll">
  218. <span class="lbl"></span>
  219. </label>-->
  220. <input type="checkbox" class="ace selectAll">
  221. </th>
  222. <th>学生名称</th>
  223. <th>学生编号</th>
  224. <th>系统准考证号</th>
  225. <th>学校准考证号</th>
  226. <th>身份证号</th>
  227. <th>答卷图片是否已上传</th>
  228. <th>原卷是否已上传</th>
  229. <th>成绩是否已生成</th>
  230. <?php if(!$isCustomTpl){?>
  231. <th>模板是否已生成</th>
  232. <?php }?>
  233. <?php if($useAnswerCardOnlineQrcode):?>
  234. <th>在线答题卡</th>
  235. <?php endif;?>
  236. </tr>
  237. </thead>
  238. <tbody>
  239. <?php if(!empty($result)):foreach($result as $rt):?>
  240. <tr>
  241. <td class="center">
  242. <!--<label class="pos-rel">
  243. <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
  244. <span class="lbl"></span>
  245. </label>-->
  246. <input type="checkbox" class="ace myselect" data="<?php echo $rt['id_number'];?>" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>" status="<?php echo $rt['temp_status'];?>" online="<?php echo $rt['online_created']?>">
  247. </td>
  248. <td><?php echo $rt['studentName'];?></td>
  249. <td><?php echo $rt['studentCode'];?></td>
  250. <td><?php echo $rt['student_card'];?></td>
  251. <td><?php echo $rt['school_student_card'];?></td>
  252. <td><?php echo $rt['id_number'];?></td>
  253. <td><?php echo $rt['upload_answer_img'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
  254. <td><?php echo $rt['student_img_paper'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
  255. <td><?php echo $rt['is_complete'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
  256. <?php if(!$isCustomTpl){?>
  257. <td><span style='color:<?php if($rt['temp_status'] == 1) echo 'green';else if($rt['temp_status'] == 3 || $rt['temp_status'] == 2) echo 'red';?>'><?php echo $rt['temp_str'];?></span></td>
  258. <?php }?>
  259. <?php if($useAnswerCardOnlineQrcode):?>
  260. <td><?php echo $rt['online_created'] ? "<span style='color:green'>是</span>" : "<span style='color:red'>否</span>";?></td>
  261. <?php endif;?>
  262. </tr>
  263. <?php endforeach;else:?>
  264. <tr><td colspan="7">暂无数据!</td></tr>
  265. <?php endif;?>
  266. </tbody>
  267. </table>
  268. <input type="hidden" name="paperId" id="paperId" value="<?php echo $exam_group_id;?>" />
  269. <input type="hidden" name="wpCode" id="wpCode" value="<?php echo $exam_id;?>" />
  270. <input type="hidden" name="schoolId" id="schoolId" value="<?php echo Yii::app()->session['school_id'];?>" />
  271. <input type="hidden" name="wpType" id="wpType" value="<?php echo $wp_type;?>" />
  272. <input type="hidden" name="className" id="className" value="<?php echo $className;?>" />
  273. <input type="hidden" name="paperName" id="paperName" value="<?php echo $paperName;?>" />
  274. <input type="hidden" name="isFeedback" id="isFeedback" value="<?php echo $isFeedback;?>" />
  275. </div>
  276. <!-- PAGE CONTENT ENDS -->
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. <div class="loading-pop" style="display:none;">
  282. <div class="loading-pop-msg">正在打包,请稍候···</div>
  283. </div>
  284. <div class="loading-pop" style="display:none;">
  285. <div class="loading-pop-msg">正在打包,请稍候···</div>
  286. </div>
  287. <div class="confirmbox-mask" style="display:none " id="classModal-1">
  288. <form name="table_set">
  289. <div class="class-modal-1">
  290. <i class="icon icon-close-1"></i><div class="class-modal-head-1">选择提示</div>
  291. <div class="class-modal-body-1">
  292. <?php
  293. $isWordShow=false;
  294. $isOnlineShow=false;
  295. if(!$isCustomTpl ){
  296. $isWordShow=true;
  297. }
  298. if($useAnswerCardOnlineQrcode){
  299. $isOnlineShow=true;
  300. }
  301. if($isWordShow && $isOnlineShow){
  302. ?>
  303. <div class="table_area select_area txt_1 active" type="0">
  304. 生成word答题卡
  305. </div>
  306. <div class="table_area select_area txt_2" type="1">
  307. 生成在线答题卡
  308. </div>
  309. <input type="hidden" name="type" value="0">
  310. <?php
  311. }elseif($isWordShow){
  312. ?>
  313. <div class="table_area select_area txt_1 active" type="0">
  314. 生成word答题卡
  315. </div>
  316. <div class="table_area select_area txt_2 disabled" type="1">
  317. 生成在线答题卡
  318. </div>
  319. <input type="hidden" name="type" value="0">
  320. <?php
  321. }elseif($isOnlineShow){
  322. ?>
  323. <div class="table_area select_area txt_1 disabled" type="0">
  324. 生成word答题卡
  325. </div>
  326. <div class="table_area select_area txt_2 active" type="1">
  327. 生成在线答题卡
  328. </div>
  329. <input type="hidden" name="type" value="1">
  330. <?php
  331. }
  332. ?>
  333. </div>
  334. <div class="clear"></div>
  335. <div class="class-modal-body-1">
  336. <div class="online_word_btn">
  337. <button class="submit_select">确定</button>
  338. <button class="cancel">取消</button>
  339. <input type="hidden" name="code" value="" />
  340. </div>
  341. </div>
  342. </div>
  343. </form>
  344. </div>
  345. <script type="text/javascript">
  346. var tempCheck = '<?php echo $tempCheck;?>';
  347. var qxkPaper='<?php echo $qxkPaperId?>';
  348. var isNewVersion=2;
  349. $(".add-class-list").hover(function(){
  350. $('.class-add-list').toggle();
  351. });
  352. //客户端发送打印弹窗(客户端调用)
  353. function sendToPrint(){
  354. $('#classModal-1').hide();
  355. $('input[name=code]').val(0);
  356. layer.msg('已成功发送至下载/打印列表');
  357. }
  358. $(document).ready(function(){
  359. /*var str = '<div class="points"></div>';
  360. $(".sc-lis").each(function(){
  361. if($(this).find(".points").length>0){
  362. $(".sel-opt").append(str);
  363. }
  364. });*/
  365. $('.select_area').click(function(){
  366. if($(this).hasClass('disabled')){
  367. return false;
  368. }
  369. $('.select_area').removeClass('active');
  370. $(this).addClass('active');
  371. $('input[name=type]').val($(this).attr('type'));
  372. });
  373. $('#printPaperNew').click(function(){
  374. var code=$(this).attr('code');
  375. if(qxkPaper>0){
  376. downloadOnline();
  377. return false;
  378. }
  379. // 判断是否有选中
  380. if (!$("input[class='ace myselect']").is(':checked')) {
  381. layer.msg('请至少选择一个学生!');return false;
  382. }
  383. $('input[name=code]').val(code);
  384. $('.txt_1').html('下载word答题卡');
  385. $('.txt_2').html('下载在线答题卡');
  386. $('#classModal-1').show();
  387. });
  388. $('#selectPrintNew').click(function(){
  389. if(qxkPaper>0){
  390. printOnline();
  391. return false;
  392. }
  393. var code=$(this).attr('code');
  394. // 判断是否有选中
  395. if (!$("input[class='ace myselect']").is(':checked')) {
  396. layer.msg('请至少选择一个学生!');return false;
  397. }
  398. $('input[name=code]').val(code);
  399. $('.txt_1').html('打印word答题卡');
  400. $('.txt_2').html('打印在线答题卡');
  401. $('#classModal-1').show();
  402. });
  403. $('#createTempNew').click(function(){
  404. var code=$(this).attr('code');
  405. if(qxkPaper>0){
  406. createOnline();
  407. return false;
  408. }
  409. // 判断是否有选中
  410. if (!$("input[class='ace myselect']").is(':checked')) {
  411. layer.msg('请至少选择一个学生!');return false;
  412. }
  413. $('input[name=code]').val(code);
  414. $('.txt_1').html('生成word答题卡');
  415. $('.txt_2').html('生成在线答题卡');
  416. $('#classModal-1').show();
  417. });
  418. $('.icon-close-1,.cancel').click(function(){
  419. $('#classModal-1').hide();
  420. $('input[name=code]').val(0);
  421. // $('.select_area').removeClass('active');
  422. // $('.select_area').eq(0).addClass('active');
  423. });
  424. $('.submit_select').click(function(){
  425. var code=$('input[name=code]').val();
  426. var targetType=$('input[name=type]').val(); //word或在线答题卡
  427. if(code==1){
  428. //打印试卷
  429. if(targetType==0){
  430. printWord();
  431. }else if(targetType==1){
  432. printOnline();
  433. //downloadOnline();
  434. }
  435. }else if(code==2){
  436. //生成
  437. if(targetType==0){
  438. createWord();
  439. }else if(targetType==1){
  440. createOnline();
  441. }
  442. }else if(code==3){
  443. //下载
  444. if(targetType==0){
  445. downLoadWord();
  446. }else if(targetType==1){
  447. downloadOnline();
  448. }
  449. }
  450. return false;
  451. });
  452. //下载在线答题卡
  453. function downloadOnline(){
  454. // 判断是否有选中
  455. if (!$("input[class='ace myselect']").is(':checked')) {
  456. layer.msg('请至少选择一个学生!');return false;
  457. }
  458. var student_ids = '';
  459. var finishCheck = 0;
  460. var failCheck = 0;
  461. $(".myselect").each(function(m,n){
  462. if ($(this).prop('checked')) {
  463. if($(this).attr("online") == 1){
  464. finishCheck = 1;
  465. if ($(this).val() && $(this).attr("stnm")) {
  466. student_ids = student_ids +$(this).val()+',';
  467. }
  468. }else{
  469. failCheck = 1;
  470. }
  471. }
  472. });
  473. if(!finishCheck){
  474. layer.msg('当前选中的学生中,还未有已经生成的,请重新勾选~',{'btn':['确定'],time:0});
  475. return false;
  476. }
  477. var data = {
  478. exam_id:"<?php echo $exam_id ?>",
  479. student_id:student_ids
  480. };
  481. var text = '';
  482. if(finishCheck && failCheck){
  483. text = '当前批量打印选中的学生有存在还未生成的,默认只会打印已经生成的,请知悉!';
  484. }
  485. if(finishCheck && !failCheck){
  486. text = '确定下载选中学生吗?';
  487. }
  488. layer.msg(text,
  489. {
  490. btn:['确定','取消'],
  491. time: 0,
  492. yes:function(){
  493. layer.closeAll();
  494. if (isNewVersion>=1) {
  495. evaluationClient.NewDownLoadPDF(JSON.stringify(data));
  496. // let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id;?>"],"studentIds":student_ids}}
  497. // console.log( $param)
  498. // evaluationClient.BulkPrintPDF(JSON.stringify($param))
  499. // }else if(isNewVersion==1){
  500. }else{
  501. $(".loading-pop").show();
  502. $.post("<?php echo Yii::app()->createUrl('print/downloadOnlineBatch')?>",data,function(flags){
  503. var m = JSON.parse(flags);
  504. if(m.status==1)
  505. {
  506. var html = ""+
  507. '<div style="padding:20px 30px 0px 30px">'+
  508. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  509. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  510. '<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>'+
  511. '</div>'+
  512. '</div>'+
  513. "";
  514. //
  515. layer.open({
  516. type: 1,
  517. area: ['550px', '220px'],
  518. title: '打印包',
  519. content: html,
  520. success: function(index, layerObj){
  521. $(".loading-pop").hide();
  522. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.result+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  523. jQuery("#confirm, #cancel").on("click", function(){
  524. layer.close(layerObj);
  525. });
  526. jQuery("#copy").on("click", function(){
  527. jQuery("#url").select();
  528. });
  529. },
  530. end: function(){
  531. }
  532. });
  533. return;
  534. }else {
  535. layer.msg(m.result);
  536. $(".loading-pop").hide();return;
  537. }
  538. $(".loading-pop").hide();
  539. return;
  540. });
  541. }
  542. // 更试卷打印时间
  543. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  544. }
  545. }
  546. );
  547. }
  548. //下载word答题卡
  549. function downLoadWord(){
  550. var printCheck = '<?php echo $printCheck;?>';
  551. if(!printCheck) return false;
  552. var tpl = "<?php echo $tpl;?>";
  553. var paperType = "<?php echo $paperType;?>";
  554. document.paperData = <?php echo $paperData;?>;
  555. if (tpl == "2") {
  556. layer.msg('请先上传试题模板!');return false;
  557. }
  558. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  559. if(paperType == 2 && answerCardUploaded == 0){
  560. layer.msg('请先上传答题卡模板!');return false;
  561. }
  562. // 判断是否有选中
  563. if (!$("input[class='ace myselect']").is(':checked')) {
  564. layer.msg('请至少选择一个学生!');return false;
  565. }
  566. // $(".loading-pop").show();
  567. var student_ids = '';
  568. var finishCheck = 0;
  569. var failCheck = 0;
  570. $(".myselect").each(function(m,n){
  571. if ($(this).prop('checked')) {
  572. if($(this).attr("status") == 1){
  573. finishCheck = 1;
  574. if ($(this).val() && $(this).attr("stnm")) {
  575. student_ids = student_ids +$(this).val()+',';
  576. }
  577. }else{
  578. failCheck = 1;
  579. }
  580. }
  581. });
  582. if(!finishCheck){
  583. layer.msg('当前选中的学生中,还未有已经生成的,请重新勾选~',{'btn':['确定'],time:0});
  584. return false;
  585. }
  586. var data = {
  587. exam_id:"<?php echo $exam_id ?>",
  588. student_id:student_ids
  589. };
  590. var text = '';
  591. if(finishCheck && failCheck){
  592. text = '当前批量打印选中的学生有存在还未生成的,默认只会打印已经生成的,请知悉!';
  593. }
  594. if(finishCheck && !failCheck){
  595. text = '确定打印选中学生吗?';
  596. }
  597. layer.msg(text,
  598. {
  599. btn:['确定','取消'],
  600. time: 0,
  601. yes:function(){
  602. layer.closeAll();
  603. $(".loading-pop").show();
  604. $.post("<?php echo Yii::app()->createUrl('print/ajaxPrintPaper')?>",data,function(flags){
  605. var m = JSON.parse(flags);
  606. if(m.status==1)
  607. {
  608. var html = ""+
  609. '<div style="padding:20px 30px 0px 30px">'+
  610. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  611. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  612. '<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>'+
  613. '</div>'+
  614. '</div>'+
  615. "";
  616. //
  617. layer.open({
  618. type: 1,
  619. area: ['550px', '220px'],
  620. title: '打印包',
  621. content: html,
  622. success: function(index, layerObj){
  623. $(".loading-pop").hide();
  624. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.result+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  625. jQuery("#confirm, #cancel").on("click", function(){
  626. layer.close(layerObj);
  627. });
  628. jQuery("#copy").on("click", function(){
  629. jQuery("#url").select();
  630. });
  631. },
  632. end: function(){
  633. }
  634. });
  635. return;
  636. }else {
  637. layer.msg(m.result);
  638. $(".loading-pop").hide();return;
  639. }
  640. });
  641. }
  642. }
  643. );
  644. }
  645. //生成在线答题卡
  646. function createOnline(){
  647. // 判断是否有选中
  648. if (!$("input[class='ace myselect']").is(':checked')) {
  649. layer.msg('请至少选择一个学生!');return false;
  650. }
  651. var student_ids = [];
  652. var class_name='<?php echo $className?>';
  653. $(".myselect").each(function(m,n){
  654. if ($(this).prop('checked')) {
  655. student_ids.push($(this).val()) ;
  656. }
  657. });
  658. var data = {
  659. exam_id:"<?php echo $exam_id ?>",
  660. students:student_ids,
  661. class_name:class_name
  662. };
  663. var index=layer.msg('正在发送请求,请稍候',{time:0});
  664. $.post("<?php echo Yii::app()->createUrl('print/sendCreateOnlineStudents')?>",data,function(flags){
  665. //$.post("<?php echo Yii::app()->createUrl('print/sendCreateOnline')?>",data,function(flags){
  666. var m = JSON.parse(flags);
  667. if(m.status==1)
  668. {
  669. layer.close(index);
  670. layer.alert("模板生成中", {icon: 6}, function(){
  671. location.replace(location.href);
  672. });
  673. }else
  674. {
  675. layer.msg(m.msg);
  676. }
  677. });
  678. }
  679. //生成word答题卡
  680. function createWord(){
  681. var tpl = "<?php echo $tpl;?>";
  682. var paperType = "<?php echo $paperType;?>";
  683. document.paperData = <?php echo $paperData;?>;
  684. if (tpl == "2") {
  685. layer.msg('请先上传试题模板!');return false;
  686. }
  687. if (tpl == "2") {
  688. layer.msg('请先上传试题模板!');return false;
  689. }
  690. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  691. if(paperType == 2 && answerCardUploaded == 0){
  692. layer.msg('请先上传答题卡模板!');return false;
  693. }
  694. $('#createTemp').removeClass('label-primary-green');
  695. $('#createTemp').addClass('label-primary-gray');
  696. if(tempCheck){
  697. tempCheck = 0;
  698. var data = {
  699. exam_id:"<?php echo $exam_id ?>"
  700. };
  701. $.post("<?php echo Yii::app()->createUrl('print/ajaxCreateTemplate')?>",data,function(flags){
  702. var m = JSON.parse(flags);
  703. if(m.status==1)
  704. {
  705. layer.alert("模板生成中", {icon: 6}, function(){
  706. location.replace(location.href);
  707. });
  708. }else
  709. {
  710. layer.msg(m.result);
  711. $('#createTemp').addClass('label-primary-green');
  712. $('#createTemp').removeClass('label-primary-gray');
  713. tempCheck = 1;
  714. }
  715. });
  716. }else{
  717. return false;
  718. }
  719. }
  720. //打印在线答题卡
  721. function printOnline(){
  722. // 判断是否有选中
  723. if (!$("input[class='ace myselect']").is(':checked')) {
  724. layer.msg('请至少选择一个学生!');return false;
  725. }
  726. var student_ids = [];
  727. var class_name='<?php echo $className?>';
  728. $(".myselect").each(function(m,n){
  729. if ($(this).prop('checked')) {
  730. student_ids.push($(this).val()) ;
  731. }
  732. });
  733. var data = {
  734. exam_id:"<?php echo $exam_id ?>",
  735. students:student_ids,
  736. };
  737. $.post("<?php echo Yii::app()->createUrl('print/printPdfOnline')?>",data,function(flags){
  738. var m = JSON.parse(flags);
  739. if(m.success==1)
  740. {
  741. if(isNewVersion==1){
  742. params={
  743. exam_id:"<?php echo $exam_id ?>",
  744. student_id:student_ids,
  745. };
  746. evaluationClient.NewPrintPDF(JSON.stringify(params));
  747. }else if(isNewVersion==2){
  748. let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id;?>"],"studentIds":student_ids}}
  749. evaluationClient.BulkPrintPDF(JSON.stringify($param))
  750. }else{
  751. evaluationClient.PrintPDF(flags);
  752. }
  753. // 更试卷打印时间
  754. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  755. }else
  756. {
  757. if(m.msg!=undefined){
  758. layer.msg(m.msg);
  759. }else{
  760. layer.msg('打印失败');
  761. }
  762. }
  763. });
  764. }
  765. //打印word
  766. function printWord(){
  767. var tpl = "<?php echo $tpl;?>";
  768. var paperType = "<?php echo $paperType;?>";
  769. document.paperData = <?php echo $paperData;?>;
  770. if (tpl == "2") {
  771. layer.msg('请先上传试题模板!');return false;
  772. }
  773. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  774. if(paperType == 2 && answerCardUploaded == 0){
  775. layer.msg('请先上传答题卡模板!');return false;
  776. }
  777. // 判断是否有选中
  778. if (!$("input[class='ace myselect']").is(':checked')) {
  779. layer.msg('请至少选择一个学生!');return false;
  780. }
  781. layer.msg('您确定打印嘛?', {
  782. time: 0,
  783. btn: ['确定', '取消'],
  784. yes: function(index){
  785. layer.close(index);
  786. var result = [];
  787. var paperId = $("#paperId").val();
  788. var wpCode = $("#wpCode").val();
  789. var schoolId = $("#schoolId").val();
  790. var wpType = $("#wpType").val();
  791. var paperName = $("#paperName").val();
  792. var className = $("#className").val();
  793. var markType = <?php echo $markType;?>;
  794. if (!paperId || !wpCode || !schoolId || !wpType || !paperName || !className) {
  795. layer.msg('打印信息错误!');return false;
  796. }
  797. $(".myselect").each(function(m,n){
  798. if ($(this).prop('checked')) {
  799. if ($(this).val() && $(this).attr("stnm")) {
  800. var id_number=$(this).attr('data');
  801. result.push('{'+'"clazzName":"'+className+'","paperId":"'+paperId+'","paperName":"'+paperName+'","selectQTNub":'+document.paperData.object.topicsCount.singleChoice+',"completionNub":'+document.paperData.object.topicsCount.blankFilling+',"questionSNub":'+document.paperData.object.topicsCount.shortAnswer+',"schoolId":"'+schoolId+'","studentCode":"'+$(this).val()+'","studentName":"'+$(this).attr("stnm")+'","wpCode":"'+wpCode+'","wpType":"'+wpType+'","markType":"'+markType+'","idNumber":"'+id_number+'"}');
  802. }
  803. }
  804. });
  805. // 更试卷打印时间
  806. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  807. evaluationClient.newprintPaper("["+result+"]");
  808. }
  809. });
  810. }
  811. $(".sel-opt,.sel-cons").mouseover(function(){
  812. $(".sel-cons").show();
  813. }).mouseout(function(){
  814. $(".sel-cons").hide();
  815. });
  816. $(".sc-lis").click(function(){
  817. var data = {
  818. subjectId : $(this).attr('val')
  819. };
  820. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
  821. if(flags)
  822. {
  823. location.reload();
  824. }else
  825. {
  826. alert('网络异常');
  827. }
  828. });
  829. $('.has-sel').text($(this).text());
  830. $(".sel-cons").hide();
  831. });
  832. })
  833. function ccc(){
  834. layer.msg('敬请期待!', {
  835. time: 0,
  836. btn: ['确定', '取消'],
  837. yes: function(index){
  838. layer.close(index);
  839. return false;
  840. }
  841. });
  842. }
  843. $(function(){
  844. var school_card_status =<?php echo $examInfo->school_card_status;?>;
  845. // 全选\反选
  846. $(".selectAll").click(function(){
  847. if ($(this).prop("checked")) {
  848. $(".myselect").prop("checked",true);
  849. } else {
  850. $(".myselect").prop("checked",false);
  851. }
  852. });
  853. $("body").delegate("#stu_select_all","click",function(){
  854. $(this).closest("table").find("tbody .myselect").prop("checked",$(this).prop("checked"))
  855. })
  856. $("#addPaperStudent").click(function(){
  857. var studentsIds;
  858. var html1="";
  859. var html = ""+'<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px"><thead><tr><th><input type="checkbox" class="stu selectAll" id="stu_select_all"></th><th>学生名称</th><th>学生编号</th></tr></thead><tbody>';
  860. <?php if($no_paper_student){
  861. foreach($no_paper_student as $v)
  862. {
  863. ?>
  864. html1=html1+'<tr><td><input type="checkbox" class="stu myselect" value="<?php echo $v['student_id']?>"></td><td><?php echo $v['realname']?></td><td><?php echo $v['student_id']?></td></tr>'
  865. <?php } }else{?>
  866. html1='<tr><td colspan="3">没有新的学生</td></tr>';
  867. <?php }?>
  868. html=html+html1;
  869. html=html+'</tbody></table>'+'<div class="row" style="margin:15px auto; text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
  870. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>';
  871. layer.open({
  872. type: 1,
  873. area: ['450px', '280px'],
  874. title: "为本次考试添加本班学生",
  875. content: html,
  876. success: function(index, layerObj){
  877. jQuery("#cancel").on("click", function(){
  878. layer.closeAll();
  879. });
  880. jQuery("#confirm").on("click", function(){
  881. if (!$("input[class='stu myselect']").is(':checked'))
  882. {
  883. layer.msg('请至少选择一个学生!');return false;
  884. }
  885. jQuery("input[class='stu myselect']").each(function()
  886. {
  887. if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
  888. {
  889. studentsIds += ","+jQuery(this).val();
  890. }
  891. });
  892. if(studentsIds)
  893. {
  894. studentsIds = studentsIds.replace("undefined,",'');
  895. }
  896. var data={
  897. "studentsIds":studentsIds,
  898. "exam_id":"<?php echo $exam_id ?>",
  899. "paper_id":"<?php echo $paper_id ?>",
  900. "class_id":"<?php echo $class_id?>",
  901. };
  902. jQuery.post(
  903. "<?php echo $this->createUrl("print/addPaperStudent");?>",
  904. data,
  905. function(data){
  906. var m =JSON.parse(data);
  907. if(m.status==1)
  908. {
  909. var icon = 6;
  910. layer.alert("添加成功", {icon: icon}, function(){
  911. location.replace(location.href);
  912. });
  913. }else if(m.status==2){
  914. var icon = 5;
  915. layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
  916. location.replace(location.href);
  917. });
  918. }else if(m.status==3){
  919. var icon = 5;
  920. layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
  921. location.replace(location.href);
  922. });
  923. }else{
  924. var icon = 5;
  925. layer.alert("添加失败", {icon: icon}, function(){
  926. location.replace(location.href);
  927. });
  928. }
  929. }
  930. );
  931. layer.closeAll();
  932. });
  933. },
  934. end: function(){
  935. }
  936. });
  937. });
  938. $("#updatePaperStatus").click(function(){
  939. var studentsIds;
  940. var html1="";
  941. var html = ""+'<table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px"><thead><tr><th>当前考试准考证的长度</th><th><?php if($examInfo->school_card_length){echo $examInfo->school_card_length;}else{ if(Yii::app()->session['school_id']>999){echo 9;}else{ echo 8;}}?></th></tr><tr><th>状态</th><th><input type="radio" class="ace1" name="school_card_status" value="0" <?php if($examInfo->school_card_status==0){echo 'checked';}?>>系统准考证号<input type="radio" class="ace1" name="school_card_status" value="1" <?php if($examInfo->school_card_status==1){echo 'checked';}?>>学校准考证号</th></tr></thead><tbody>';
  942. html=html+html1;
  943. html=html+'</tbody></table>'+'<div class="row" style="margin:0px auto; text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
  944. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>';
  945. layer.open({
  946. type: 1,
  947. area: ['450px', '190px'],
  948. title: "是否使用学校准考证",
  949. content: html,
  950. success: function(index, layerObj){
  951. jQuery("#cancel").on("click", function(){
  952. layer.closeAll();
  953. });
  954. jQuery(".ace1").on("click", function(){
  955. school_card_status = jQuery(this).attr('value');
  956. });
  957. jQuery("#confirm").on("click", function(){
  958. var data={
  959. exam_id:"<?php echo $exam_id ?>",
  960. school_card_status:school_card_status
  961. };
  962. jQuery.post(
  963. "<?php echo $this->createUrl("print/setExamStudentCard");?>",
  964. data,
  965. function(data){
  966. var m =JSON.parse(data);
  967. if(m.status==1)
  968. {
  969. var icon = 6;
  970. layer.alert("添加成功", {icon: icon}, function(){
  971. location.replace(location.href);
  972. });
  973. }else if(m.status==2){
  974. var icon = 5;
  975. layer.alert("添加失败,学生已在本次考试中", {icon: icon}, function(){
  976. location.replace(location.href);
  977. });
  978. }else if(m.status==3){
  979. var icon = 5;
  980. layer.alert("添加失败,学生:"+m.result+"已参加其它考试", {icon: icon}, function(){
  981. location.replace(location.href);
  982. });
  983. }else{
  984. var icon = 5;
  985. layer.alert("添加失败", {icon: icon}, function(){
  986. location.replace(location.href);
  987. });
  988. }
  989. }
  990. );
  991. layer.closeAll();
  992. });
  993. },
  994. end: function(){
  995. }
  996. });
  997. });
  998. $("#delPaperStudent").click(function(){
  999. // 判断是否有选中
  1000. var studentsIds;
  1001. if (!$("input[class='ace myselect']").is(':checked'))
  1002. {
  1003. layer.msg('请至少选择一个学生!');return false;
  1004. }
  1005. feedback=false;
  1006. jQuery("input[class='ace myselect']").each(function()
  1007. {
  1008. if(jQuery(this).is(":checked") && typeof(jQuery(this).val())!= "undefined")
  1009. {
  1010. studentsIds += ","+jQuery(this).val();
  1011. if($(this).closest('tr').find('td').eq(6).find('span').html()=='是'){
  1012. feedback=true;
  1013. }
  1014. }
  1015. });
  1016. if(feedback){
  1017. layer.msg('学生已上传成绩不能删除!');return false;
  1018. }else{
  1019. msg='确定删除选中的学生吗?';
  1020. }
  1021. layer.msg(msg, {
  1022. time: 0,
  1023. btn: ['确定', '取消'],
  1024. yes: function(index){
  1025. layer.close(index);
  1026. if(studentsIds)
  1027. {
  1028. studentsIds = studentsIds.replace("undefined,",'');
  1029. }
  1030. var data={
  1031. "studentsIds":studentsIds,
  1032. "exam_id":"<?php echo $exam_id ?>",
  1033. "paper_id":"<?php echo $paper_id ?>",
  1034. "class_id":"<?php echo $class_id?>",
  1035. };
  1036. jQuery.post(
  1037. "<?php echo $this->createUrl("print/delPaperStudent?");?>",data,function(data){
  1038. var m =JSON.parse(data);
  1039. if(m.status==1)
  1040. {
  1041. var icon = 6;
  1042. layer.alert("删除成功", {icon: icon}, function(){
  1043. location.replace(location.href);
  1044. });
  1045. }else if(m.status==2){
  1046. var icon = 5;
  1047. layer.alert("不能删除已上传成绩的学生", {icon: icon}, function(){
  1048. location.replace(location.href);
  1049. });
  1050. }else{
  1051. var icon = 5;
  1052. layer.alert("删除失败", {icon: icon}, function(){
  1053. location.replace(location.href);
  1054. });
  1055. }
  1056. });
  1057. }
  1058. });
  1059. });
  1060. $("#delPaperStudentAll").click(function(){
  1061. // 判断是否有选中
  1062. var studentsIds;
  1063. if($('input[name=isFeedback]').val()==1){
  1064. msg='所选考生中含有已上传答题卡的考生,删除后,上传总数量与阅卷任务量将会与考生数量不一致,请谨慎操作!';
  1065. }else{
  1066. msg='确定删除全部未考试的学生吗?';
  1067. }
  1068. layer.msg(msg, {
  1069. time: 0,
  1070. btn: ['确定', '取消'],
  1071. yes: function(index){
  1072. layer.close(index);
  1073. var data={
  1074. "exam_id":"<?php echo $exam_id ?>",
  1075. "paper_id":"<?php echo $paper_id ?>",
  1076. "class_id":"<?php echo $class_id?>",
  1077. };
  1078. jQuery.post(
  1079. "<?php echo $this->createUrl("print/delPaperStudentAll?");?>",data,function(data){
  1080. var m =JSON.parse(data);
  1081. if(m.status==1)
  1082. {
  1083. var icon = 6;
  1084. layer.alert("删除成功", {icon: icon}, function(){
  1085. location.replace(location.href);
  1086. });
  1087. }else if(m.status==2){
  1088. var icon = 5;
  1089. layer.alert("无未上传成绩的学生", {icon: icon}, function(){
  1090. location.replace(location.href);
  1091. });
  1092. }else{
  1093. var icon = 5;
  1094. layer.alert("删除失败", {icon: icon}, function(){
  1095. location.replace(location.href);
  1096. });
  1097. }
  1098. });
  1099. }
  1100. });
  1101. });
  1102. // 打印答案解析
  1103. $("#printAnswer").click(function(){
  1104. layer.msg('您确定下载答案解析嘛?', {
  1105. time: 0,
  1106. btn: ['确定', '取消'],
  1107. yes: function(index){
  1108. layer.close(index);
  1109. var wpCode = $("#wpCode").val();
  1110. if (!wpCode) {
  1111. layer.msg('周周练id有误!');return false;
  1112. }
  1113. jQuery.post(
  1114. '<?php echo $this->createUrl('print/createtempelate');?>',
  1115. {"eid":wpCode},
  1116. function(data){
  1117. var obj = JSON.parse(data);
  1118. if (obj.success == 1) {
  1119. //alert(obj.message);
  1120. //alert(obj);
  1121. evaluationClient.newprintDAJX(JSON.stringify(obj.object));
  1122. } else {
  1123. layer.msg(obj.message);
  1124. }
  1125. }
  1126. );
  1127. }
  1128. });
  1129. });
  1130. $("#selectPrint").click(function(){
  1131. var tpl = "<?php echo $tpl;?>";
  1132. var paperType = "<?php echo $paperType;?>";
  1133. document.paperData = <?php echo $paperData;?>;
  1134. if (tpl == "2") {
  1135. layer.msg('请先上传试题模板!');return false;
  1136. }
  1137. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  1138. if(paperType == 2 && answerCardUploaded == 0){
  1139. layer.msg('请先上传答题卡模板!');return false;
  1140. }
  1141. // 判断是否有选中
  1142. if (!$("input[class='ace myselect']").is(':checked')) {
  1143. layer.msg('请至少选择一个学生!');return false;
  1144. }
  1145. layer.msg('您确定打印嘛?', {
  1146. time: 0,
  1147. btn: ['确定', '取消'],
  1148. yes: function(index){
  1149. layer.close(index);
  1150. var result = [];
  1151. var paperId = $("#paperId").val();
  1152. var wpCode = $("#wpCode").val();
  1153. var schoolId = $("#schoolId").val();
  1154. var wpType = $("#wpType").val();
  1155. var paperName = $("#paperName").val();
  1156. var className = $("#className").val();
  1157. var markType = <?php echo $markType;?>;
  1158. if (!paperId || !wpCode || !schoolId || !wpType || !paperName || !className) {
  1159. layer.msg('打印信息错误!');return false;
  1160. }
  1161. $(".myselect").each(function(m,n){
  1162. if ($(this).prop('checked')) {
  1163. if ($(this).val() && $(this).attr("stnm")) {
  1164. var id_number=$(this).attr('data');
  1165. result.push('{'+'"clazzName":"'+className+'","paperId":"'+paperId+'","paperName":"'+paperName+'","selectQTNub":'+document.paperData.object.topicsCount.singleChoice+',"completionNub":'+document.paperData.object.topicsCount.blankFilling+',"questionSNub":'+document.paperData.object.topicsCount.shortAnswer+',"schoolId":"'+schoolId+'","studentCode":"'+$(this).val()+'","studentName":"'+$(this).attr("stnm")+'","wpCode":"'+wpCode+'","wpType":"'+wpType+'","markType":"'+markType+'","idNumber":"'+id_number+'"}');
  1166. }
  1167. }
  1168. });
  1169. // 更试卷打印时间
  1170. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  1171. evaluationClient.newprintPaper("["+result+"]");
  1172. }
  1173. });
  1174. });
  1175. $("#selectPrintPack").click(function(){
  1176. var tpl = "<?php echo $tpl;?>";
  1177. var paperType = "<?php echo $paperType;?>";
  1178. document.paperData = <?php echo $paperData;?>;
  1179. if (tpl == "2") {
  1180. layer.msg('请先上传试题模板!');return false;
  1181. }
  1182. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  1183. if(paperType == 2 && answerCardUploaded == 0){
  1184. layer.msg('请先上传答题卡模板!');return false;
  1185. }
  1186. // 判断是否有选中
  1187. if (!$("input[class='ace myselect']").is(':checked')) {
  1188. layer.msg('请至少选择一个学生!');return false;
  1189. }
  1190. $(".loading-pop").show();
  1191. var student_ids = '';
  1192. $(".myselect").each(function(m,n){
  1193. if ($(this).prop('checked')) {
  1194. if ($(this).val() && $(this).attr("stnm")) {
  1195. student_ids = student_ids +$(this).val()+',';
  1196. }
  1197. }
  1198. });
  1199. var data = {
  1200. exam_id:"<?php echo $exam_id ?>",
  1201. student_id:student_ids
  1202. };
  1203. $.post("<?php echo Yii::app()->createUrl('print/print_pack')?>",data,function(flags){
  1204. var m = JSON.parse(flags);
  1205. if(m.status==1)
  1206. {
  1207. var html = ""+
  1208. '<div style="padding:20px 30px 0px 30px">'+
  1209. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  1210. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1211. '<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>'+
  1212. '</div>'+
  1213. '</div>'+
  1214. "";
  1215. layer.open({
  1216. type: 1,
  1217. area: ['550px', '220px'],
  1218. title: '打印包',
  1219. content: html,
  1220. success: function(index, layerObj){
  1221. $(".loading-pop").hide();
  1222. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.result+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  1223. jQuery("#confirm, #cancel").on("click", function(){
  1224. layer.close(layerObj);
  1225. });
  1226. jQuery("#copy").on("click", function(){
  1227. jQuery("#url").select();
  1228. });
  1229. },
  1230. end: function(){
  1231. }
  1232. });
  1233. return;
  1234. }else
  1235. {
  1236. layer.msg(m.result);
  1237. $(".loading-pop").hide();return;
  1238. }
  1239. });
  1240. });
  1241. var tempCheck = '<?php echo $tempCheck;?>';
  1242. $('#createTemp').on('click',function(){
  1243. var tpl = "<?php echo $tpl;?>";
  1244. var paperType = "<?php echo $paperType;?>";
  1245. document.paperData = <?php echo $paperData;?>;
  1246. if (tpl == "2") {
  1247. layer.msg('请先上传试题模板!');return false;
  1248. }
  1249. if (tpl == "2") {
  1250. layer.msg('请先上传试题模板!');return false;
  1251. }
  1252. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  1253. if(paperType == 2 && answerCardUploaded == 0){
  1254. layer.msg('请先上传答题卡模板!');return false;
  1255. }
  1256. $('#createTemp').removeClass('label-primary-green');
  1257. $('#createTemp').addClass('label-primary-gray');
  1258. if(tempCheck){
  1259. tempCheck = 0;
  1260. var data = {
  1261. exam_id:"<?php echo $exam_id ?>"
  1262. };
  1263. $.post("<?php echo Yii::app()->createUrl('print/ajaxCreateTemplate')?>",data,function(flags){
  1264. var m = JSON.parse(flags);
  1265. if(m.status==1)
  1266. {
  1267. layer.alert("模板生成中", {icon: 6}, function(){
  1268. location.replace(location.href);
  1269. });
  1270. }else
  1271. {
  1272. layer.msg(m.result);
  1273. $('#createTemp').addClass('label-primary-green');
  1274. $('#createTemp').removeClass('label-primary-gray');
  1275. tempCheck = 1;
  1276. }
  1277. });
  1278. }else{
  1279. return false;
  1280. }
  1281. })
  1282. $("#printPaper").click(function(){
  1283. var printCheck = '<?php echo $printCheck;?>';
  1284. if(!printCheck) return false;
  1285. var tpl = "<?php echo $tpl;?>";
  1286. var paperType = "<?php echo $paperType;?>";
  1287. document.paperData = <?php echo $paperData;?>;
  1288. if (tpl == "2") {
  1289. layer.msg('请先上传试题模板!');return false;
  1290. }
  1291. var answerCardUploaded = "<?php echo $answerCardUploaded ? 1 : 0;?>";
  1292. if(paperType == 2 && answerCardUploaded == 0){
  1293. layer.msg('请先上传答题卡模板!');return false;
  1294. }
  1295. // 判断是否有选中
  1296. if (!$("input[class='ace myselect']").is(':checked')) {
  1297. layer.msg('请至少选择一个学生!');return false;
  1298. }
  1299. // $(".loading-pop").show();
  1300. var student_ids = '';
  1301. var finishCheck = 0;
  1302. var failCheck = 0;
  1303. $(".myselect").each(function(m,n){
  1304. if ($(this).prop('checked')) {
  1305. if($(this).attr("status") == 1){
  1306. finishCheck = 1;
  1307. if ($(this).val() && $(this).attr("stnm")) {
  1308. student_ids = student_ids +$(this).val()+',';
  1309. }
  1310. }else{
  1311. failCheck = 1;
  1312. }
  1313. }
  1314. });
  1315. if(!finishCheck){
  1316. layer.msg('当前选中的学生中,还未有已经生成的,请重新勾选~',{'btn':['确定'],time:0});
  1317. return false;
  1318. }
  1319. var data = {
  1320. exam_id:"<?php echo $exam_id ?>",
  1321. student_id:student_ids
  1322. };
  1323. var text = '';
  1324. if(finishCheck && failCheck){
  1325. text = '当前批量打印选中的学生有存在还未生成的,默认只会打印已经生成的,请知悉!';
  1326. }
  1327. if(finishCheck && !failCheck){
  1328. text = '确定打印选中学生吗?';
  1329. }
  1330. layer.msg(text,
  1331. {
  1332. btn:['确定','取消'],
  1333. time: 0,
  1334. yes:function(){
  1335. layer.closeAll();
  1336. $(".loading-pop").show();
  1337. $.post("<?php echo Yii::app()->createUrl('print/ajaxPrintPaper')?>",data,function(flags){
  1338. var m = JSON.parse(flags);
  1339. if(m.status==1)
  1340. {
  1341. var html = ""+
  1342. '<div style="padding:20px 30px 0px 30px">'+
  1343. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  1344. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1345. '<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>'+
  1346. '</div>'+
  1347. '</div>'+
  1348. "";
  1349. //
  1350. layer.open({
  1351. type: 1,
  1352. area: ['550px', '220px'],
  1353. title: '打印包',
  1354. content: html,
  1355. success: function(index, layerObj){
  1356. $(".loading-pop").hide();
  1357. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.result+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  1358. jQuery("#confirm, #cancel").on("click", function(){
  1359. layer.close(layerObj);
  1360. });
  1361. jQuery("#copy").on("click", function(){
  1362. jQuery("#url").select();
  1363. });
  1364. },
  1365. end: function(){
  1366. }
  1367. });
  1368. return;
  1369. }else {
  1370. layer.msg(m.result);
  1371. $(".loading-pop").hide();return;
  1372. }
  1373. });
  1374. }
  1375. }
  1376. );
  1377. });
  1378. /*在线答题卡订单学生操作*/
  1379. $('.createTempByOrder').click(function(){
  1380. createOnlineByOrder();
  1381. });
  1382. $('.selectPrintByOrder').click(function(){
  1383. printOnlineByOrder();
  1384. });
  1385. $('.printPaperByOrder').click(function(){
  1386. downloadOnlineByOrder();
  1387. });
  1388. //生成在线答题卡
  1389. function createOnlineByOrder(){
  1390. var class_name='<?php echo $className?>';
  1391. var data = {
  1392. exam_id:"<?php echo $exam_id ?>",
  1393. class_name:class_name,
  1394. check_order:1
  1395. };
  1396. text = '确定生成本班所有订单学生的在线答题卡吗?';
  1397. layer.msg(text,
  1398. {
  1399. btn:['确定','取消'],
  1400. time: 0,
  1401. yes:function(){
  1402. var index=layer.msg('正在发送请求,请稍候',{time:0});
  1403. $.post("<?php echo Yii::app()->createUrl('print/sendCreateOnlineStudents')?>",data,function(flags){
  1404. var m = JSON.parse(flags);
  1405. if(m.status==1)
  1406. {
  1407. layer.close(index);
  1408. layer.alert("模板生成中", {icon: 6}, function(){
  1409. location.replace(location.href);
  1410. });
  1411. }else
  1412. {
  1413. layer.msg(m.msg);
  1414. }
  1415. });
  1416. }
  1417. })
  1418. }
  1419. //打印在线答题卡
  1420. function printOnlineByOrder(){
  1421. var data = {
  1422. exam_id:"<?php echo $exam_id ?>",
  1423. check_order:1
  1424. };
  1425. text = '确定打印本班所有订单学生的在线答题卡吗?';
  1426. layer.msg(text,
  1427. {
  1428. btn:['确定','取消'],
  1429. time: 0,
  1430. yes:function(){
  1431. $.post("<?php echo Yii::app()->createUrl('print/PrintPdfOnlineByOrder')?>",data,function(flags){
  1432. var m = JSON.parse(flags);
  1433. if(m.success==1)
  1434. {
  1435. students=m.students;
  1436. if(m.all_created==0){
  1437. layer.msg('订单学生存在还未生成的,默认只会打印已经生成的,请知悉!',{
  1438. btn:['确定','取消'],
  1439. time: 0,
  1440. yes:function(){
  1441. params={
  1442. exam_id:"<?php echo $exam_id ?>",
  1443. student_id:students
  1444. };
  1445. let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id?>"],"studentIds":students}}
  1446. if(isNewVersion==1){
  1447. evaluationClient.NewPrintPDF(JSON.stringify(params));
  1448. }else if(isNewVersion==2){
  1449. evaluationClient.BulkPrintPDF(JSON.stringify($param))
  1450. }
  1451. // 更试卷打印时间
  1452. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  1453. }
  1454. })
  1455. }else{
  1456. params={
  1457. exam_id:"<?php echo $exam_id ?>",
  1458. student_id:students
  1459. };
  1460. let $param={"typeId":14,"params":{"examIds":["<?php echo $exam_id ?>"],"classIds":["<?php echo $class_id?>"],"studentIds":students}}
  1461. if(isNewVersion==1){
  1462. evaluationClient.NewPrintPDF(JSON.stringify(params));
  1463. }else if(isNewVersion==2){
  1464. evaluationClient.BulkPrintPDF(JSON.stringify($param))
  1465. }
  1466. // 更试卷打印时间
  1467. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 });
  1468. }
  1469. }else
  1470. {
  1471. if(m.msg!=undefined){
  1472. layer.msg(m.msg);
  1473. }else{
  1474. layer.msg('打印失败');
  1475. }
  1476. }
  1477. });
  1478. }
  1479. })
  1480. }
  1481. //下载在线答题卡
  1482. function downloadOnlineByOrder(){
  1483. var data = {
  1484. exam_id:"<?php echo $exam_id ?>",
  1485. };
  1486. text = '确定下载本班所有订单学生的在线答题卡吗?';
  1487. layer.msg(text,
  1488. {
  1489. btn:['确定','取消'],
  1490. time: 0,
  1491. yes:function(){
  1492. //读取订单学生列表
  1493. $.ajax({
  1494. url:'<?php echo $this->createUrl('print/printPdfOnlineByOrder')?>',
  1495. type:'POST',
  1496. dataType:'json',
  1497. data:data,
  1498. success:function(res){
  1499. if(res.success==1){
  1500. students=res.students;
  1501. if(res.all_created==0){
  1502. layer.msg('订单学生存在还未生成的,默认只会下载已经生成的,请知悉!',{
  1503. btn:['确定','取消'],
  1504. time: 0,
  1505. yes:function(){
  1506. var data = {
  1507. exam_id:"<?php echo $exam_id ?>",
  1508. student_id:students
  1509. };
  1510. evaluationClient. NewDownLoadPDF(JSON.stringify(data));
  1511. // 更试卷打印时间
  1512. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  1513. }
  1514. })
  1515. }else{
  1516. var data = {
  1517. exam_id:"<?php echo $exam_id ?>",
  1518. student_id:students
  1519. };
  1520. evaluationClient. NewDownLoadPDF(JSON.stringify(data));
  1521. // 更试卷打印时间
  1522. $.post("<?php echo $this->createUrl('print/updateOnlinePaperPrintTime');?>", {cid: $(".clid").val(), eid: $(".emid").val(),type:0 } );
  1523. }
  1524. }else{
  1525. if(res.msg!=undefined){
  1526. layer.msg(res.msg);
  1527. }else{
  1528. layer.msg('下载失败');
  1529. }
  1530. }
  1531. }
  1532. });
  1533. }
  1534. }
  1535. );
  1536. }
  1537. })
  1538. </script>