_print.php 106 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840
  1. <style>
  2. /*打印产品弹框*/
  3. .modal1_multi_print{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;background: rgba(0,0,0,.4)}
  4. .modal1_multi_print .model-score-m{width:80%;margin:5px auto;height: 20px;}
  5. .modal1_multi_print .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
  6. .modal1_multi_print .select_area{
  7. width: 140px;
  8. height: 30px;
  9. background: #2977ff;
  10. float: left;
  11. text-align: center;
  12. line-height: 30px;
  13. color:#fff;
  14. margin-top: 10px;
  15. }
  16. .print_select{ margin:20px auto;width:300px}
  17. .print_select .txt_1,.english_txt_1,.teacher_txt_1{margin-right: 20px}
  18. /*打印产品弹框*/
  19. .modal1_multi_print_card{font-size:14px;display: none;}
  20. .modal1_multi_print_card .model-score-m{width:80%;margin:5px auto;height: 20px;}
  21. .modal1_multi_print_card .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
  22. .modal1_multi_print_card .select_area{
  23. width: 140px;
  24. height: 30px;
  25. background: #2977ff;
  26. float: left;
  27. text-align: center;
  28. line-height: 30px;
  29. color:#fff;
  30. margin-top: 10px;
  31. }
  32. .modal1_multi_print .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  33. .modal1_multi_print .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #2977ff;color:#fff;}
  34. .modal1_multi_print .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  35. .modal1_multi_print .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  36. .modal1_multi_print .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #2977ff;color: #fff;}
  37. .modal1_multi_print .modal1_multi .model-score-m{width:80%;margin:5px auto;height: 20px;}
  38. .modal1_multi_print .txt_3{display: none;}
  39. .modal1_multi .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
  40. .modal1_multi_print_card .modal-content{height:150px;}
  41. /*教师产品打印弹框*/
  42. .modal1_multi_print_teacher{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display: none;background: rgba(0,0,0,.4)}
  43. .modal1_multi_print_teacher .model-score-m{width:80%;margin:5px auto;height: 20px;}
  44. .modal1_multi_print_teacher .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
  45. .modal1_multi_print_teacher .select_area{
  46. width: 140px;
  47. height: 30px;
  48. background: #2977ff;
  49. float: left;
  50. text-align: center;
  51. line-height: 30px;
  52. color:#fff;
  53. margin-top: 10px;
  54. }
  55. .modal1_multi_print_teacher .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
  56. .modal1_multi_print_teacher .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #2977ff;color:#fff;}
  57. .modal1_multi_print_teacher .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
  58. .modal1_multi_print_teacher .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
  59. .modal1_multi_print_teacher .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #009965;color: #fff;}
  60. .modal1_multi_print_teacher .modal1_multi .model-score-m{width:80%;margin:5px auto;height: 20px;}
  61. /*打印产品弹框*/
  62. .modal1_multi_print_card1{font-size:14px;display: none;}
  63. .modal1_multi_print_card1 .model-score-m{width:80%;margin:5px auto;height: 20px;}
  64. .modal1_multi_print_card1 .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
  65. .modal1_multi_print_card1 .select_area{
  66. width: 150px;
  67. height: 30px;
  68. background: #2977ff;
  69. float: left;
  70. text-align: center;
  71. line-height: 30px;
  72. color:#fff;
  73. margin-top: 10px;
  74. }
  75. .modal1_multi_print_card1 .modal-content{height:150px;}
  76. .modal1_multi_print_card1 .print_select{ margin:20px auto;width:520px}
  77. .modal1_multi_print_card1 .english_txt_1,.english_txt_3{margin-right: 20px}
  78. </style>
  79. <div class="modal1_multi_print">
  80. <div class="modal-shadow"></div>
  81. <div class="modal-content">
  82. <div class="modal-title clearfix">
  83. 请选择操作<em class="fr close_product">×</em>
  84. </div>
  85. <div class="print_select">
  86. <div class="table_area select_area txt_1 " type="0">
  87. 打印产品内容
  88. </div>
  89. <div class="table_area select_area txt_2" type="1">
  90. 打印答案
  91. </div>
  92. <div class="table_area select_area txt_3" type="2">
  93. 打印检测卡
  94. </div>
  95. </div>
  96. <div class="model-score-m" style="clear: both">
  97. </div>
  98. </div>
  99. </div>
  100. <div class="modal1_multi_print_card">
  101. <div class="modal-shadow"></div>
  102. <div class="">
  103. <div class="print_select">
  104. <div class="table_area select_area english_txt_1 " type="0">
  105. 下载批改后答题卡
  106. </div>
  107. <div class="table_area select_area english_txt_2" type="1">
  108. 打印批改后答题卡
  109. </div>
  110. <input type="hidden" name="english_chb_id" value="0">
  111. <input type="hidden" name="english_xzb_id" value="0">
  112. <input type="hidden" name="english_product_print_type" value="0">
  113. </div>
  114. <div class="model-score-m" style="clear: both">
  115. </div>
  116. </div>
  117. </div>
  118. <div class="modal1_multi_print_card1">
  119. <div class="modal-shadow"></div>
  120. <div class="">
  121. <div class="print_select">
  122. <div class="table_area select_area english_txt_1 " type="0">
  123. 下载批改后答题卡
  124. </div>
  125. <div class="table_area select_area english_txt_3" type="1">
  126. 打印批改后答题卡试题
  127. </div>
  128. <div class="table_area select_area english_txt_4" type="2">
  129. 打印批改后答题卡答案
  130. </div>
  131. <input type="hidden" name="english_chb_id" value="0">
  132. <input type="hidden" name="english_xzb_id" value="0">
  133. <input type="hidden" name="english_product_print_type" value="0">
  134. </div>
  135. <div class="model-score-m" style="clear: both">
  136. </div>
  137. </div>
  138. </div>
  139. <div class="modal1_multi_print_teacher">
  140. <div class="modal-shadow"></div>
  141. <div class="modal-content">
  142. <div class="modal-title clearfix">
  143. 请选择操作<em class="fr close_product">×</em>
  144. </div>
  145. <br>
  146. <p align="center">请选择下一步操作!</p>
  147. <div class="print_select">
  148. <div class="table_area select_area teacher_txt_1 " type="0">
  149. 打印
  150. </div>
  151. <div class="table_area select_area teacher_txt_2" type="1">
  152. 下载
  153. </div>
  154. </div>
  155. <input type="hidden" name="downloadUrl" value="">
  156. <input type="hidden" name="examId" value="">
  157. <input type="hidden" name="teacherPrintType" value="">
  158. <div class="model-score-m" style="clear: both">
  159. </div>
  160. </div>
  161. </div>
  162. <script>
  163. printToolsVersion='';
  164. <?php
  165. $printVersion=str_replace('.','',Yii::app()->session['coachInfo']['use_version']);
  166. echo "printToolsVersion='".$printVersion."';";
  167. ?>
  168. printJson={};
  169. if(printToolsVersion<249){
  170. $('.printBookTools').hide();
  171. $('#batchPrintTools').hide();
  172. $('#selectPrintTools').hide();
  173. $('.printToolsJieDuan').hide();
  174. $('#batchPrintToolsJieDuan').hide();
  175. $('#selectPrintToolsJieDuan').hide();
  176. $('.printToolsErLun').hide();
  177. $('#batchPrintToolsErLun').hide();
  178. $('#selectPrintToolsErLun').hide();
  179. $('.printToolsHtb').hide();
  180. $('#batchPrintToolsHtb').hide();
  181. $('#selectPrintToolsHtb').hide();
  182. $('.printToolsJqbg').hide();
  183. $('#batchPrintToolsJqbg').hide();
  184. $('#selectPrintToolsJqbg').hide();
  185. $('.printToolsFfb').hide();
  186. $('#batchPrintToolsFfb').hide();
  187. $('#selectPrintToolsFfb').hide();
  188. $('.printToolsZtb').hide();
  189. $('#batchPrintToolsZtb').hide();
  190. $('#selectPrintToolsZtb').hide();
  191. $('.printToolsJqzy').hide();
  192. $('#batchPrintToolsJqzy').hide();
  193. $('#selectPrintToolsJqzy').hide();
  194. $('.printToolsWkb').hide();
  195. $('#batchPrintToolsWkb').hide();
  196. $('#selectPrintToolsWkb').hide();
  197. $('.printToolsChb').hide();
  198. $('#batchPrintToolsChb').hide();
  199. $('#selectPrintToolsChb').hide();
  200. $('.printToolsXzb').hide();
  201. $('#batchPrintToolsXzb').hide();
  202. $('#selectPrintToolsXzb').hide();
  203. $('.english_txt_2').hide();
  204. }
  205. //班级下载
  206. $('.printBookTools').click(function(){
  207. cid=$(this).attr('class_id');
  208. eid=$(this).attr('exam_id');
  209. type=$(this).attr('ptype');
  210. printType=$(this).attr('printType');
  211. sub_id='<?php echo Yii::app()->session['session_subject_id'];?>';
  212. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  213. $.ajax({
  214. url: "<?php echo $this->createUrl('printTools/getImproveFile');?>",
  215. type: "GET",
  216. dataType: "json",
  217. data: {
  218. "examId": eid,
  219. "classId": cid,
  220. "type": type,
  221. "absent_filter": absent_filter,
  222. "printType": printType
  223. },
  224. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  225. beforeSend: function () {
  226. layer.msg("请稍后...", {"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  227. },
  228. success: function (rs){
  229. layer.closeAll();
  230. if(rs.success == 1){
  231. if(rs.data.separate==1){
  232. printJson=rs.data;
  233. showPrintMulti(rs.data.separate);
  234. }else{
  235. if (type == 1) {
  236. message = "您确定要打印该班级纠错本吗?";
  237. } else if (type == 2){
  238. if(sub_id == 8){
  239. message = "您确定要打印该班级个性化学习宝吗?";
  240. }else{
  241. message = "您确定要打印该班级个性化学习方案吗?";
  242. }
  243. }else if (type == 3){
  244. message = "您确定要打印该班级个性化学习宝吗?";
  245. }
  246. layer.msg(message, {
  247. time: 0,
  248. btn: ['确定', '取消'],
  249. yes: function (index) {
  250. layer.close(index);
  251. console.log(JSON.stringify(rs.data));
  252. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  253. }
  254. })
  255. }
  256. }else{
  257. if(rs.message){
  258. layer.msg(rs.message)
  259. }else{
  260. layer.msg('获取学生数据失败');
  261. }
  262. }
  263. }
  264. })
  265. });
  266. $('.txt_1').click(function(){
  267. printJson.separate=1;
  268. evaluationClient.BulkPrintPDF(JSON.stringify(printJson));
  269. console.log(printJson)
  270. });
  271. $('.txt_2').click(function(){
  272. printJson.separate=2;
  273. evaluationClient.BulkPrintPDF(JSON.stringify(printJson));
  274. });
  275. $('.txt_3').click(function(){
  276. printJson.separate=3;
  277. evaluationClient.BulkPrintPDF(JSON.stringify(printJson));
  278. });
  279. //批量下载
  280. $("#batchPrintTools").click(function(){
  281. printType=$(this).attr('printType');
  282. sub_id='<?php echo Yii::app()->session['session_subject_id'];?>';
  283. var message = "您确定要批量打印该产品吗?";
  284. // 判断是否有选中
  285. if (!$("input[class='ace myselect']").is(':checked')) {
  286. layer.msg('至少选择一个目标!');
  287. return false;
  288. }
  289. var result = [];
  290. $(".myselect").each(function(m,n){
  291. if ($(this).prop('checked')) {
  292. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  293. result.push($(this).val());
  294. }
  295. }
  296. })
  297. var sp = [];
  298. var cid = 0;
  299. var eid = 0;
  300. var type = 0;
  301. var saveDataAry=[];
  302. var data1 = [];
  303. for(i=0;i<result.length;i++)
  304. {
  305. sp = result[i].split('_');
  306. cid = sp[0];
  307. eid = sp[1];
  308. type = sp[2];
  309. if(!cid || !eid || !type) continue;
  310. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  311. data1 = {"examId": eid, "classId": cid, "type": type,"absent_filter":absent_filter,"printType":printType};
  312. saveDataAry.push(data1);
  313. }
  314. $.ajax({
  315. type: "POST",
  316. url: "<?php echo $this->createUrl('printTools/batchIsp');?>",
  317. dataType: "json",
  318. contentType: "application/json",
  319. data: JSON.stringify(saveDataAry),
  320. success: function (rs){
  321. layer.closeAll();
  322. if(rs.success == 1) {
  323. if(rs.data.separate==1){
  324. printJson=rs.data;
  325. showPrintMulti(rs.data.separate);
  326. }else{
  327. if (type == 1) {
  328. message = "您确定要打印该班级纠错本吗?";
  329. } else if (type == 2){
  330. if(sub_id == 8){
  331. message = "您确定要打印该班级个性化学习宝吗?";
  332. }else{
  333. message = "您确定要打印该班级个性化学习方案吗?";
  334. }
  335. }else if (type == 3){
  336. message = "您确定要打印该班级个性化学习宝吗?";
  337. }
  338. layer.msg(message, {
  339. time: 0,
  340. btn: ['确定', '取消'],
  341. yes: function (index) {
  342. layer.close(index);
  343. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  344. }
  345. })
  346. }
  347. }else {
  348. layer.msg(rs.message);
  349. }
  350. },
  351. });
  352. })
  353. //错题本(1,2,3)选择学生打印
  354. $("#selectPrintTools").click(function(){
  355. printType=$(this).attr('printType');
  356. sub_id='<?php echo Yii::app()->session['session_subject_id'];?>';
  357. // 判断是否有选中
  358. if (!$("input[class='ace myselect']").is(':checked')) {
  359. layer.msg('请至少选择一个学生!');return false;
  360. }
  361. var classId = $("#classId").val();
  362. var examId = $("#examId").val();
  363. if (!classId || !examId) {
  364. layer.msg('参数错误!');return false;
  365. }
  366. var result = [];
  367. $(".myselect").each(function(m,n){
  368. if ($(this).prop('checked')) {
  369. if ($(this).val() && $(this).attr("stnm")) {
  370. result.push($(this).val());
  371. }
  372. }
  373. })
  374. if (result.length < 1) {
  375. layer.msg('未找到要打印的学生!');return false;
  376. }
  377. if(printType=='isp'){
  378. type=2;
  379. }else if(printType=='studytrend'){
  380. type=3;
  381. }else if(printType=='third_isp'){
  382. type=3;
  383. }else if(printType=='wtp'){
  384. type=1;
  385. }
  386. $.ajax({
  387. url: "<?php echo $this->createUrl('printTools/getImproveFile');?>",
  388. type: "GET",
  389. dataType: "json",
  390. data: {"examId": examId, "classId": classId,"studentsIds":result, "type": type,"printType":printType},
  391. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  392. beforeSend:function(){
  393. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  394. },
  395. success: function (rs){
  396. layer.closeAll();
  397. if(rs.success == 1) {
  398. if(rs.data.separate==1){
  399. printJson=rs.data;
  400. showPrintMulti(rs.data.separate);
  401. }else{
  402. if (type == 1) {
  403. message = "您确定要打印该班级纠错本吗?";
  404. } else if (type == 2){
  405. if(sub_id == 8){
  406. message = "您确定要打印该班级个性化学习宝吗?";
  407. }else{
  408. message = "您确定要打印该班级个性化学习方案吗?";
  409. }
  410. }else if (type == 3){
  411. message = "您确定要打印该班级个性化学习宝吗?";
  412. }
  413. layer.msg(message, {
  414. time: 0,
  415. btn: ['确定', '取消'],
  416. yes: function (index) {
  417. layer.close(index);
  418. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  419. }
  420. })
  421. }
  422. }else{
  423. layer.msg(rs.message);
  424. }
  425. },
  426. });
  427. });
  428. //打印阶段复习学习宝
  429. $('.printToolsJieDuan').click(function(){
  430. cid=$(this).attr('cid');
  431. type=$(this).attr('trun-type');
  432. var message = '';
  433. if (type == 1) {
  434. message = "您确定要打印该班级期中阶段复习学习宝吗?";
  435. } else if (type == 2){
  436. message = "您确定要打印该班级期末阶段复习学习宝吗?";
  437. }else if (type == 3){
  438. message = "您确定要打印该班级总复习学习宝吗?";
  439. }else{
  440. layer.msg("打印参数有误");return;
  441. }
  442. layer.msg(message, {
  443. time: 0,
  444. btn: ['确定', '取消'],
  445. yes: function(index){
  446. layer.close(index);
  447. $.ajax({
  448. url: "<?php echo $this->createUrl('printTools/downloadStudentProduct');?>",
  449. type: "GET",
  450. dataType: "json",
  451. data: { "classId": cid, "type": type},
  452. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  453. beforeSend:function(){
  454. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  455. },
  456. success: function (rs){
  457. layer.closeAll();
  458. if(rs.success == 1){
  459. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  460. }else if(rs.success == 0){
  461. layer.msg(rs.message, {"time": 3000});
  462. }
  463. },
  464. });
  465. }
  466. });
  467. });
  468. //批量打印阶段复习
  469. $("#batchPrintToolsJieDuan").click(function(){
  470. var message = "您确定要批量打印该产品吗?";
  471. // 判断是否有选中
  472. if (!$("input[class='ace myselect']").is(':checked')) {
  473. layer.msg('至少选择一个目标!');
  474. return false;
  475. }
  476. var result = [];
  477. $(".myselect").each(function(m,n){
  478. if ($(this).prop('checked')) {
  479. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  480. result.push($(this).val());
  481. }
  482. }
  483. })
  484. var sp = [];
  485. var cid = 0;
  486. var type = 0;
  487. var saveDataAry=[];
  488. var data1 = [];
  489. for(i=0;i<result.length;i++)
  490. {
  491. sp = result[i].split('_');
  492. cid = sp[0];
  493. type = sp[1];
  494. if(!cid || !type) continue;
  495. data1 = {"classId": cid, "type": type};
  496. saveDataAry.push(data1);
  497. }
  498. layer.msg(message, {
  499. time: 0,
  500. btn: ['确定', '取消'],
  501. yes: function(index){
  502. layer.close(index);
  503. $.ajax({
  504. type: "POST",
  505. url: "<?php echo $this->createUrl('printTools/batchSp');?>",
  506. dataType: "json",
  507. contentType: "application/json",
  508. data: JSON.stringify(saveDataAry),
  509. success: function (rs){
  510. layer.closeAll();
  511. if(rs.success == 1) {
  512. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  513. }else {
  514. layer.msg(rs.message);
  515. }
  516. },
  517. });
  518. }
  519. });
  520. });
  521. $("#selectPrintToolsJieDuan").click(function(){
  522. // 判断是否有选中
  523. if (!$("input[class='ace myselect']").is(':checked')) {
  524. layer.msg('请至少选择一个学生!');return false;
  525. }
  526. layer.msg("您确定打印阶段复习学习宝吗?", {
  527. time: 0,
  528. btn: ['确定', '取消'],
  529. yes: function(index){
  530. layer.close(index);
  531. var classId = $("#classId").val();
  532. var type = $("#type").val();
  533. if (!classId || !type) {
  534. layer.msg('参数错误!');return false;
  535. }
  536. var result = [];
  537. $(".myselect").each(function(m,n){
  538. if ($(this).prop('checked')) {
  539. if ($(this).val() && $(this).attr("stnm")) {
  540. result.push($(this).val());
  541. }
  542. }
  543. })
  544. if (result.length < 1) {
  545. layer.msg('未找到要打印的学生!');return false;
  546. }
  547. if(type>3){
  548. type=(type-3);
  549. }
  550. $.ajax({
  551. url: "<?php echo $this->createUrl('printTools/downloadStudentProduct');?>",
  552. type: "GET",
  553. dataType: "json",
  554. data: { "classId": classId, "type": type, "studentsIds":result},
  555. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  556. beforeSend:function(){
  557. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  558. },
  559. success: function (rs){
  560. layer.closeAll();
  561. if(rs.success == 1){
  562. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  563. }else if(rs.success == 0){
  564. layer.msg(rs.message, {"time": 3000});
  565. }
  566. },
  567. });
  568. }
  569. });
  570. });
  571. //二轮学习指导手册
  572. $('.printToolsErLun').click(function(){
  573. mrId=$(this).attr('mrid');
  574. cid=$(this).attr('cid');
  575. if (!mrId) {
  576. layer.msg("打印参数有误");return;
  577. }
  578. var message = "您确定要打印该班级二轮学习指导手册吗?";
  579. layer.msg(message, {
  580. time: 0,
  581. btn: ['确定', '取消'],
  582. yes: function(index){
  583. layer.close(index);
  584. $.ajax({
  585. url: "<?php echo $this->createUrl('printTools/getMathReviewFile');?>",
  586. type: "GET",
  587. dataType: "json",
  588. data: {"mrId": mrId,"cid":cid},
  589. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  590. beforeSend:function(){
  591. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  592. },
  593. success: function (rs){
  594. layer.closeAll();
  595. if(rs.success == 1){
  596. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  597. }else if(rs.success == 0){
  598. layer.msg(rs.message, {"time": 3000});
  599. }
  600. },
  601. });
  602. }
  603. });
  604. });
  605. //二轮学习指导手册批量下载
  606. $('#batchPrintToolsErLun').click(function(){
  607. var message = "您确定要批量打印该产品吗?";
  608. // 判断是否有选中
  609. if (!$("input[class='ace myselect']").is(':checked')) {
  610. layer.msg('至少选择一个目标!');
  611. return false;
  612. }
  613. var result = [];
  614. $(".myselect").each(function(m,n){
  615. if ($(this).prop('checked')) {
  616. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  617. result.push($(this).val());
  618. }
  619. }
  620. });
  621. var saveDataAry=[];
  622. var data1 = [];
  623. for(i=0;i<result.length;i++)
  624. {
  625. var mr_id = result[i];
  626. data1 = {"mrId": mr_id};
  627. saveDataAry.push(data1);
  628. }
  629. layer.msg(message, {
  630. time: 0,
  631. btn: ['确定', '取消'],
  632. yes: function(index){
  633. layer.close(index);
  634. $.ajax({
  635. type: "POST",
  636. url: "<?php echo $this->createUrl('printTools/batchMathReview');?>",
  637. dataType: "json",
  638. contentType: "application/json",
  639. data: JSON.stringify(saveDataAry),
  640. success: function (rs){
  641. layer.closeAll();
  642. if(rs.success == 1) {
  643. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  644. }else {
  645. layer.msg(rs.message);
  646. }
  647. },
  648. });
  649. }
  650. });
  651. });
  652. //二轮指导学生打印
  653. $("#selectPrintToolsErLun").click(function(){
  654. var mrId = $("#mrId").val();
  655. // 判断是否有选中
  656. if (!$("input[class='ace myselect']").is(':checked')) {
  657. layer.msg('请至少选择一个学生!');return false;
  658. }
  659. layer.msg("您确定要打印二轮提分指导手册吗?", {
  660. time: 0,
  661. btn: ['确定', '取消'],
  662. yes: function(index){
  663. layer.close(index);
  664. var result = [];
  665. $(".myselect").each(function(m,n){
  666. if ($(this).prop('checked')) {
  667. if ($(this).val() && $(this).attr("stnm")) {
  668. result.push($(this).val());
  669. }
  670. }
  671. })
  672. if (result.length < 1) {
  673. layer.msg('未找到要打印的学生!');return false;
  674. }
  675. $.ajax({
  676. url: "<?php echo $this->createUrl('printTools/getMathReviewFile');?>",
  677. type: "GET",
  678. dataType: "json",
  679. data: {"mrId": mrId, "studentsIds":result},
  680. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  681. beforeSend:function(){
  682. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  683. },
  684. success: function (rs){
  685. layer.closeAll();
  686. if(rs.success == 1){
  687. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  688. }else if(rs.success == 0){
  689. layer.msg(rs.message, {"time": 3000});
  690. }
  691. },
  692. });
  693. }
  694. });
  695. });
  696. //打印好题本
  697. $('.printToolsHtb').click(function(){
  698. hid=$(this).attr('hid');
  699. if (!hid) {
  700. layer.msg("打印参数有误");return;
  701. }
  702. var message = "您确定要打印该班级好题本吗?";
  703. var divTitle = '打印好题本';
  704. layer.msg(message, {
  705. time: 0,
  706. btn: ['确定', '取消'],
  707. yes: function(index){
  708. layer.close(index);
  709. $.ajax({
  710. url: "<?php echo $this->createUrl('printTools/getHtbFile');?>",
  711. type: "GET",
  712. dataType: "json",
  713. title: divTitle,
  714. data: {"htbId": hid},
  715. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  716. beforeSend:function(){
  717. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  718. },
  719. success: function (rs){
  720. layer.closeAll();
  721. if(rs.success == 1){
  722. if(rs.data.separate==1){
  723. printJson=rs.data;
  724. showPrintMulti(rs.data.separate);
  725. }else{
  726. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  727. }
  728. } else if(rs.success == 0){
  729. layer.msg(rs.message, {"time": 3000});
  730. }
  731. },
  732. });
  733. }
  734. });
  735. });
  736. //批量打印好题本
  737. $('#batchPrintToolsHtb').click(function(){
  738. var message = "您确定要批量打印该产品吗?";
  739. // 判断是否有选中
  740. if (!$("input[class='ace myselect']").is(':checked')) {
  741. layer.msg('至少选择一个目标!');
  742. return false;
  743. }
  744. var result = [];
  745. $(".myselect").each(function(m,n){
  746. if ($(this).prop('checked')) {
  747. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  748. result.push($(this).val());
  749. }
  750. }
  751. });
  752. var saveDataAry=[];
  753. var data1 = [];
  754. for(i=0;i<result.length;i++)
  755. {
  756. var htbId = result[i];
  757. data1 = {"htbId": htbId};
  758. saveDataAry.push(data1);
  759. }
  760. layer.msg(message, {
  761. time: 0,
  762. btn: ['确定', '取消'],
  763. yes: function(index){
  764. layer.close(index);
  765. $.ajax({
  766. type: "POST",
  767. url: "<?php echo $this->createUrl('printTools/batchHtb');?>",
  768. dataType: "json",
  769. contentType: "application/json",
  770. data: JSON.stringify(saveDataAry),
  771. success: function (rs){
  772. layer.closeAll();
  773. if(rs.success == 1) {
  774. if(rs.data.separate==1){
  775. printJson=rs.data;
  776. showPrintMulti(rs.data.separate);
  777. }else{
  778. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  779. }
  780. }else {
  781. layer.msg(rs.message);
  782. }
  783. },
  784. });
  785. }
  786. });
  787. });
  788. $("#selectPrintToolsHtb").click(function(){
  789. var htbId = $("#htbId").val();
  790. // 判断是否有选中
  791. if (!$("input[class='ace myselect']").is(':checked')) {
  792. layer.msg('请至少选择一个学生!');return false;
  793. }
  794. layer.msg("您确定要打印好题本吗?", {
  795. time: 0,
  796. btn: ['确定', '取消'],
  797. yes: function(index){
  798. layer.close(index);
  799. var result = [];
  800. $(".myselect").each(function(m,n){
  801. if ($(this).prop('checked')) {
  802. if ($(this).val() && $(this).attr("stnm")) {
  803. result.push($(this).val());
  804. }
  805. }
  806. })
  807. if (result.length < 1) {
  808. layer.msg('未找到要打印的学生!');return false;
  809. }
  810. $.ajax({
  811. url: "<?php echo $this->createUrl('printTools/getHtbFile');?>",
  812. type: "GET",
  813. dataType: "json",
  814. data: {"htbId": htbId, "studentsIds":result},
  815. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  816. beforeSend:function(){
  817. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  818. },
  819. success: function (rs){
  820. layer.closeAll();
  821. if(rs.success == 1){
  822. if(rs.data.separate==1){
  823. printJson=rs.data;
  824. showPrintMulti(rs.data.separate);
  825. }else{
  826. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  827. }
  828. }else if(rs.success == 0){
  829. layer.msg(rs.message, {"time": 3000});
  830. }
  831. },
  832. });
  833. }
  834. });
  835. });
  836. //打印假期报告
  837. $('.printToolsJqbg').click(function(){
  838. reportId=$(this).attr('rid');
  839. if (!reportId) {
  840. layer.msg("打印参数有误");return;
  841. }
  842. var message = "您确定要打印该班级假期报告吗?";
  843. var divTitle = '打印假期报告';
  844. layer.msg(message, {
  845. time: 0,
  846. btn: ['确定', '取消'],
  847. yes: function(index){
  848. layer.close(index);
  849. $.ajax({
  850. url: "<?php echo $this->createUrl('printTools/getHolidayReportFile');?>",
  851. type: "GET",
  852. dataType: "json",
  853. title: divTitle,
  854. data: {"reportId": reportId},
  855. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  856. beforeSend:function(){
  857. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  858. },
  859. success: function (rs){
  860. layer.closeAll();
  861. if(rs.success == 1){
  862. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  863. }else if(rs.success == 0){
  864. layer.msg(rs.message, {"time": 3000});
  865. }
  866. },
  867. });
  868. }
  869. });
  870. });
  871. //假期报告
  872. $('#batchPrintToolsJqbg').click(function(){
  873. var message = "您确定要批量打印该班级假期报告吗?";
  874. // 判断是否有选中
  875. if (!$("input[class='ace myselect']").is(':checked')) {
  876. layer.msg('至少选择一个目标!');
  877. return false;
  878. }
  879. var result = [];
  880. $(".myselect").each(function(m,n){
  881. if ($(this).prop('checked')) {
  882. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  883. result.push($(this).val());
  884. }
  885. }
  886. });
  887. var saveDataAry=[];
  888. var data1 = [];
  889. for(i=0;i<result.length;i++)
  890. {
  891. var reportId = result[i];
  892. data1 = {"reportId": reportId};
  893. saveDataAry.push(data1);
  894. }
  895. layer.msg(message, {
  896. time: 0,
  897. btn: ['确定', '取消'],
  898. yes: function(index){
  899. layer.close(index);
  900. $.ajax({
  901. type: "POST",
  902. url: "<?php echo $this->createUrl('printTools/batchHoliday');?>",
  903. dataType: "json",
  904. contentType: "application/json",
  905. data: JSON.stringify(saveDataAry),
  906. success: function (rs){
  907. layer.closeAll();
  908. if(rs.success == 1) {
  909. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  910. }else {
  911. layer.msg(rs.message);
  912. }
  913. },
  914. });
  915. }
  916. });
  917. });
  918. //假期报告选择学生
  919. $('#selectPrintToolsJqbg').click(function(){
  920. var reportId = $("#reportId").val();
  921. // 判断是否有选中
  922. if (!$("input[class='ace myselect']").is(':checked')) {
  923. layer.msg('请至少选择一个学生!');return false;
  924. }
  925. layer.msg("您确定打印假期报告吗?", {
  926. time: 0,
  927. btn: ['确定', '取消'],
  928. yes: function(index){
  929. layer.close(index);
  930. var result = [];
  931. $(".myselect").each(function(m,n){
  932. if ($(this).prop('checked')) {
  933. if ($(this).val() && $(this).attr("stnm")) {
  934. result.push($(this).val());
  935. }
  936. }
  937. })
  938. if (result.length < 1) {
  939. layer.msg('未找到要打印的学生!');return false;
  940. }
  941. $.ajax({
  942. url: "<?php echo $this->createUrl('printTools/getHolidayReportFile');?>",
  943. type: "GET",
  944. dataType: "json",
  945. data: {"reportId": reportId, "studentsIds":result},
  946. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  947. beforeSend:function(){
  948. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  949. },
  950. success: function (rs){
  951. layer.closeAll();
  952. if(rs.success == 1){
  953. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  954. }else if(rs.success == 0){
  955. layer.msg(rs.message, {"time": 3000});
  956. }
  957. },
  958. });
  959. }
  960. });
  961. });
  962. //打印方法宝
  963. $('.printToolsFfb').click(function(){
  964. cid=$(this).attr('cid');
  965. eid=$(this).attr('eid');
  966. type=$(this).attr('type');
  967. if (!cid || !eid || !type) {
  968. layer.msg("打印参数有误");return;
  969. }
  970. var message = "您确定要打印该班方法宝吗?";
  971. layer.msg(message, {
  972. time: 0,
  973. btn: ['确定', '取消'],
  974. yes: function(index){
  975. layer.close(index);
  976. $.ajax({
  977. url: "<?php echo $this->createUrl('printTools/getFfb');?>",
  978. type: "GET",
  979. dataType: "json",
  980. data: {"examId": eid, "classId": cid, "type": type},
  981. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  982. beforeSend:function(){
  983. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  984. },
  985. success: function (rs){
  986. layer.closeAll();
  987. if(rs.success == 1){
  988. if(rs.data.separate==1){
  989. printJson=rs.data;
  990. showPrintMulti(rs.data.separate);
  991. }else{
  992. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  993. }
  994. }else if(rs.success == 0){
  995. layer.msg(rs.message, {"time": 3000});
  996. }
  997. },
  998. });
  999. }
  1000. });
  1001. });
  1002. //批量打印方法宝
  1003. $('#batchPrintToolsFfb').click(function(){
  1004. var message = "您确定要批量打印该产品吗?";
  1005. // 判断是否有选中
  1006. if (!$("input[class='ace myselect']").is(':checked')) {
  1007. layer.msg('至少选择一个目标!');
  1008. return false;
  1009. }
  1010. var result = [];
  1011. $(".myselect").each(function(m,n){
  1012. if ($(this).prop('checked')) {
  1013. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1014. result.push($(this).val());
  1015. }
  1016. }
  1017. })
  1018. var sp = [];
  1019. var cid = 0;
  1020. var eid = 0;
  1021. var type = 0;
  1022. var saveDataAry=[];
  1023. var data1 = [];
  1024. for(i=0;i<result.length;i++)
  1025. {
  1026. sp = result[i].split('_');
  1027. cid = sp[0];
  1028. eid = sp[1];
  1029. type = sp[2];
  1030. if(!cid || !eid || !type) continue;
  1031. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  1032. data1 = {"examId": eid, "classId": cid, "type": type,"absent_filter":absent_filter,"printType":"<?php echo $printType;?>"};
  1033. saveDataAry.push(data1);
  1034. }
  1035. layer.msg(message, {
  1036. time: 0,
  1037. btn: ['确定', '取消'],
  1038. yes: function(index){
  1039. layer.close(index);
  1040. $.ajax({
  1041. type: "POST",
  1042. url: "<?php echo $this->createUrl('printTools/batch');?>",
  1043. dataType: "json",
  1044. contentType: "application/json",
  1045. data: JSON.stringify(saveDataAry),
  1046. success: function (rs){
  1047. layer.closeAll();
  1048. if(rs.success == 1) {
  1049. if(rs.data.separate==1){
  1050. printJson=rs.data;
  1051. showPrintMulti(rs.data.separate);
  1052. }else{
  1053. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1054. }
  1055. }else {
  1056. layer.msg(rs.message);
  1057. }
  1058. },
  1059. });
  1060. }
  1061. });
  1062. });
  1063. //方法宝选择学生下载
  1064. $('#selectPrintToolsFfb').click(function(){
  1065. type=$(this).attr('type');
  1066. var examId = $("#examId").val();
  1067. var classId = $("#classId").val();
  1068. // 判断是否有选中
  1069. if (!$("input[class='ace myselect']").is(':checked')) {
  1070. layer.msg('请至少选择一个学生!');return false;
  1071. }
  1072. layer.msg("您确定打印产品吗?", {
  1073. time: 0,
  1074. btn: ['确定', '取消'],
  1075. yes: function(index){
  1076. layer.close(index);
  1077. var result = [];
  1078. $(".myselect").each(function(m,n){
  1079. if ($(this).prop('checked')) {
  1080. if ($(this).val() && $(this).attr("stnm")) {
  1081. result.push($(this).val());
  1082. }
  1083. }
  1084. })
  1085. if (result.length < 1) {
  1086. layer.msg('未找到要打印的学生!');return false;
  1087. }
  1088. $.ajax({
  1089. url: "<?php echo $this->createUrl('printTools/getFfb');?>",
  1090. type: "GET",
  1091. dataType: "json",
  1092. data: {"examId": examId,"classId":classId, "studentsIds":result, "type":type},
  1093. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1094. beforeSend:function(){
  1095. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1096. },
  1097. success: function (rs){
  1098. layer.closeAll();
  1099. if(rs.success == 1){
  1100. if(rs.data.separate==1){
  1101. printJson=rs.data;
  1102. showPrintMulti(rs.data.separate);
  1103. }else{
  1104. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1105. }
  1106. }else if(rs.success == 0){
  1107. layer.msg(rs.message, {"time": 3000});
  1108. }
  1109. },
  1110. });
  1111. }
  1112. });
  1113. });
  1114. $('.printToolsZtb').click(function(){
  1115. cid=$(this).attr('cid');
  1116. gpid=$(this).attr('gpid');
  1117. type=$(this).attr('type');
  1118. if (!cid || !gpid || !type) {
  1119. layer.msg("打印参数有误");return;
  1120. }
  1121. var message = "您确定要打印该班级专题宝吗?";
  1122. layer.msg(message, {
  1123. time: 0,
  1124. btn: ['确定', '取消'],
  1125. yes: function(index){
  1126. layer.close(index);
  1127. $.ajax({
  1128. url: "<?php echo $this->createUrl('printTools/getUrlZtb');?>",
  1129. type: "GET",
  1130. dataType: "json",
  1131. data: {"gpId": gpid, "classId": cid, "type": type},
  1132. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1133. beforeSend:function(){
  1134. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1135. },
  1136. success: function (rs){
  1137. layer.closeAll();
  1138. if(rs.success == 1){
  1139. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1140. }else if(rs.success == 0){
  1141. layer.msg(rs.message, {"time": 3000});
  1142. }
  1143. },
  1144. });
  1145. }
  1146. });
  1147. });
  1148. $('#batchPrintToolsZtb').click(function(){
  1149. var message = "您确定要批量打印该产品吗?";
  1150. // 判断是否有选中
  1151. if (!$("input[class='ace myselect']").is(':checked')) {
  1152. layer.msg('至少选择一个目标!');
  1153. return false;
  1154. }
  1155. var result = [];
  1156. $(".myselect").each(function(m,n){
  1157. if ($(this).prop('checked')) {
  1158. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1159. result.push($(this).val());
  1160. }
  1161. }
  1162. })
  1163. var sp = [];
  1164. var cid = 0;
  1165. var eid = 0;
  1166. var type = 0;
  1167. var saveDataAry=[];
  1168. var data1 = [];
  1169. for(i=0;i<result.length;i++)
  1170. {
  1171. sp = result[i].split('_');
  1172. cid = sp[0];
  1173. eid = sp[1];
  1174. type = sp[2];
  1175. if(!cid || !eid || !type) continue;
  1176. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  1177. data1 = {"gpId": eid, "classId": cid, "type": type,"absent_filter":absent_filter};
  1178. saveDataAry.push(data1);
  1179. }
  1180. layer.msg(message, {
  1181. time: 0,
  1182. btn: ['确定', '取消'],
  1183. yes: function(index){
  1184. layer.close(index);
  1185. $.ajax({
  1186. type: "POST",
  1187. url: "<?php echo $this->createUrl('printTools/batchZtb');?>",
  1188. dataType: "json",
  1189. contentType: "application/json",
  1190. data: JSON.stringify(saveDataAry),
  1191. success: function (rs){
  1192. layer.closeAll();
  1193. if(rs.success == 1) {
  1194. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1195. }else {
  1196. layer.msg(rs.message);
  1197. }
  1198. }
  1199. });
  1200. }
  1201. });
  1202. });
  1203. //专题宝选择学生
  1204. $('#selectPrintToolsZtb').click(function(){
  1205. var weekId = $("#weekId").val();
  1206. var classId = $("#classId").val();
  1207. var type = $("#type").val();
  1208. // 判断是否有选中
  1209. if (!$("input[class='ace myselect']").is(':checked')) {
  1210. layer.msg('请至少选择一个学生!');return false;
  1211. }
  1212. layer.msg("您确定打印专题宝吗?", {
  1213. time: 0,
  1214. btn: ['确定', '取消'],
  1215. yes: function(index){
  1216. layer.close(index);
  1217. var result = [];
  1218. $(".myselect").each(function(m,n){
  1219. if ($(this).prop('checked')) {
  1220. if ($(this).val() && $(this).attr("stnm")) {
  1221. result.push($(this).val());
  1222. }
  1223. }
  1224. })
  1225. if (result.length < 1) {
  1226. layer.msg('未找到要打印的学生!');return false;
  1227. }
  1228. $.ajax({
  1229. url: "<?php echo $this->createUrl('printTools/getUrlZtb');?>",
  1230. type: "GET",
  1231. dataType: "json",
  1232. data: {"gpId": weekId,"classId":classId,"type":type,"studentsIds":result},
  1233. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1234. beforeSend:function(){
  1235. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1236. },
  1237. success: function (rs){
  1238. layer.closeAll();
  1239. if(rs.success == 1){
  1240. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1241. }else if(rs.success == 0){
  1242. layer.msg(rs.message, {"time": 3000});
  1243. }
  1244. },
  1245. });
  1246. }
  1247. });
  1248. });
  1249. //打印假期作业
  1250. $('.printToolsJqzy').click(function(){
  1251. cid=$(this).attr('cid');
  1252. gpid=$(this).attr('gpid');
  1253. type=$(this).attr('ptype');
  1254. if (!cid || !gpid || !type) {
  1255. layer.msg("打印参数有误");return;
  1256. }
  1257. var message = "您确定要打印该班级产品吗?";
  1258. layer.msg(message, {
  1259. time: 0,
  1260. btn: ['确定', '取消'],
  1261. yes: function(index){
  1262. layer.close(index);
  1263. $.ajax({
  1264. url: "<?php echo $this->createUrl('printTools/getUrlJqzy');?>",
  1265. type: "GET",
  1266. dataType: "json",
  1267. data: {"gpId": gpid, "classId": cid, "type": type},
  1268. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1269. beforeSend:function(){
  1270. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1271. },
  1272. success: function (rs){
  1273. layer.closeAll();
  1274. if(rs.success == 1){
  1275. if(rs.data.separate==1){
  1276. printJson=rs.data;
  1277. showPrintMulti(rs.data.separate);
  1278. }else{
  1279. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1280. }
  1281. }else if(rs.success == 0){
  1282. layer.msg(rs.message, {"time": 3000});
  1283. }
  1284. },
  1285. });
  1286. }
  1287. });
  1288. });
  1289. //批量打印假期作业
  1290. $('#batchPrintToolsJqzy').click(function(){
  1291. var message = "您确定要批量打印该产品吗?";
  1292. // 判断是否有选中
  1293. if (!$("input[class='ace myselect']").is(':checked')) {
  1294. layer.msg('至少选择一个目标!');
  1295. return false;
  1296. }
  1297. var result = [];
  1298. $(".myselect").each(function(m,n){
  1299. if ($(this).prop('checked')) {
  1300. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1301. result.push($(this).val());
  1302. }
  1303. }
  1304. })
  1305. var sp = [];
  1306. var cid = 0;
  1307. var eid = 0;
  1308. var type = 0;
  1309. var saveDataAry=[];
  1310. var data1 = [];
  1311. for(i=0;i<result.length;i++)
  1312. {
  1313. sp = result[i].split('_');
  1314. cid = sp[0];
  1315. eid = sp[1];
  1316. type = sp[2];
  1317. if(!cid || !eid || !type) continue;
  1318. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  1319. data1 = {"gpId": eid, "classId": cid, "type": type,"absent_filter":absent_filter};
  1320. saveDataAry.push(data1);
  1321. }
  1322. layer.msg(message, {
  1323. time: 0,
  1324. btn: ['确定', '取消'],
  1325. yes: function(index){
  1326. layer.close(index);
  1327. $.ajax({
  1328. type: "POST",
  1329. url: "<?php echo $this->createUrl('printTools/batchJqzy');?>",
  1330. dataType: "json",
  1331. contentType: "application/json",
  1332. data: JSON.stringify(saveDataAry),
  1333. success: function (rs){
  1334. layer.closeAll();
  1335. if(rs.success == 1) {
  1336. if(rs.data.separate==1){
  1337. printJson=rs.data;
  1338. showPrintMulti(rs.data.separate);
  1339. }else{
  1340. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1341. }
  1342. }else {
  1343. layer.msg(rs.message);
  1344. }
  1345. },
  1346. });
  1347. }
  1348. });
  1349. });
  1350. //选择学生打印假期作业
  1351. $('#selectPrintToolsJqzy').click(function(){
  1352. var weekId = $("#weekId").val();
  1353. var classId = $("#classId").val();
  1354. var type = $("#type").val();
  1355. // 判断是否有选中
  1356. if (!$("input[class='ace myselect']").is(':checked')) {
  1357. layer.msg('请至少选择一个学生!');return false;
  1358. }
  1359. layer.msg("您确定打印该产品吗?", {
  1360. time: 0,
  1361. btn: ['确定', '取消'],
  1362. yes: function(index){
  1363. layer.close(index);
  1364. var result = [];
  1365. $(".myselect").each(function(m,n){
  1366. if ($(this).prop('checked')) {
  1367. if ($(this).val() && $(this).attr("stnm")) {
  1368. result.push($(this).val());
  1369. }
  1370. }
  1371. })
  1372. if (result.length < 1) {
  1373. layer.msg('未找到要下载的学生!');return false;
  1374. }
  1375. $.ajax({
  1376. url: "<?php echo $this->createUrl('printTools/getUrlJqzy');?>",
  1377. type: "GET",
  1378. dataType: "json",
  1379. data: {"gpId": weekId,"classId":classId,"type":type,"studentsIds":result},
  1380. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1381. beforeSend:function(){
  1382. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1383. },
  1384. success: function (rs){
  1385. layer.closeAll();
  1386. if(rs.success == 1){
  1387. if(rs.data.separate==1){
  1388. printJson=rs.data;
  1389. showPrintMulti(rs.data.separate);
  1390. }else{
  1391. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1392. }
  1393. }else if(rs.success == 0){
  1394. layer.msg(rs.message, {"time": 3000});
  1395. }
  1396. },
  1397. });
  1398. }
  1399. });
  1400. });
  1401. //英语晨读词汇
  1402. $('.printToolsEnglishCdch').click(function(){
  1403. weekId=$(this).attr('weekid');
  1404. if (!weekId) {
  1405. layer.msg("打印参数有误");return;
  1406. }
  1407. var message = "您确定要打印该班级晨读词汇吗?";
  1408. var divTitle = '打印晨读词汇';
  1409. layer.msg(message, {
  1410. time: 0,
  1411. btn: ['确定', '取消'],
  1412. yes: function(index){
  1413. layer.close(index);
  1414. $.ajax({
  1415. url: "<?php echo $this->createUrl('printTools/getEnglishFile');?>",
  1416. type: "GET",
  1417. dataType: "json",
  1418. title: divTitle,
  1419. data: {"weekId": weekId},
  1420. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1421. beforeSend:function(){
  1422. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1423. },
  1424. success: function (rs){
  1425. layer.closeAll();
  1426. if(rs.success == 1){
  1427. if(rs.data.separate==1){
  1428. printJson=rs.data;
  1429. showPrintMulti(rs.data.separate);
  1430. }else{
  1431. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1432. }
  1433. }else if(rs.success == 0){
  1434. layer.msg(rs.message, {"time": 3000});
  1435. }
  1436. },
  1437. });
  1438. }
  1439. });
  1440. });
  1441. $('#batchPrintToolsCdch').click(function () {
  1442. var message = "您确定要批量打印该产品吗?";
  1443. // 判断是否有选中
  1444. if (!$("input[class='ace myselect']").is(':checked')) {
  1445. layer.msg('至少选择一个目标!');
  1446. return false;
  1447. }
  1448. var result = [];
  1449. $(".myselect").each(function(m,n){
  1450. if ($(this).prop('checked')) {
  1451. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1452. result.push($(this).val());
  1453. }
  1454. }
  1455. });
  1456. var saveDataAry=[];
  1457. var data1 = [];
  1458. for(i=0;i<result.length;i++)
  1459. {
  1460. var weekId = result[i];
  1461. data1 = {"weekId": weekId};
  1462. saveDataAry.push(data1);
  1463. }
  1464. layer.msg(message, {
  1465. time: 0,
  1466. btn: ['确定', '取消'],
  1467. yes: function(index){
  1468. layer.close(index);
  1469. $.ajax({
  1470. type: "POST",
  1471. url: "<?php echo $this->createUrl('printTools/batchEnMrv');?>",
  1472. dataType: "json",
  1473. contentType: "application/json",
  1474. data: JSON.stringify(saveDataAry),
  1475. success: function (rs){
  1476. layer.closeAll();
  1477. if(rs.success == 1) {
  1478. if(rs.data.separate==1){
  1479. printJson=rs.data;
  1480. showPrintMulti(rs.data.separate);
  1481. }else{
  1482. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1483. }
  1484. }else {
  1485. layer.msg(rs.message);
  1486. }
  1487. },
  1488. });
  1489. }
  1490. });
  1491. });
  1492. //选择学生打印晨读词汇
  1493. $('#selectPrintToolsCdch').click(function(){
  1494. var weekId = $("#weekId").val();
  1495. // 判断是否有选中
  1496. if (!$("input[class='ace myselect']").is(':checked')) {
  1497. layer.msg('请至少选择一个学生!');return false;
  1498. }
  1499. layer.msg("您确定打印晨读词汇吗?", {
  1500. time: 0,
  1501. btn: ['确定', '取消'],
  1502. yes: function(index){
  1503. layer.close(index);
  1504. var result = [];
  1505. $(".myselect").each(function(m,n){
  1506. if ($(this).prop('checked')) {
  1507. if ($(this).val() && $(this).attr("stnm")) {
  1508. result.push($(this).val());
  1509. }
  1510. }
  1511. })
  1512. if (result.length < 1) {
  1513. layer.msg('未找到要打印的学生!');return false;
  1514. }
  1515. $.ajax({
  1516. url: "<?php echo $this->createUrl('printTools/getEnglishFile');?>",
  1517. type: "GET",
  1518. dataType: "json",
  1519. data: {"weekId": weekId, "studentsIds":result},
  1520. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1521. beforeSend:function(){
  1522. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1523. },
  1524. success: function (rs){
  1525. layer.closeAll();
  1526. if(rs.success == 1){
  1527. if(rs.data.separate==1){
  1528. printJson=rs.data;
  1529. showPrintMulti(rs.data.separate);
  1530. }else{
  1531. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1532. }
  1533. }else if(rs.success == 0){
  1534. layer.msg(rs.message, {"time": 3000});
  1535. }
  1536. },
  1537. });
  1538. }
  1539. });
  1540. });
  1541. //打印外刊宝
  1542. $('.printToolsWkb').click(function(){
  1543. weekId=$(this).attr('weekid');
  1544. if (!weekId) {
  1545. layer.msg("打印参数有误");
  1546. return;
  1547. }
  1548. var message = "您确定要打印该班级该产品吗?";
  1549. var divTitle = '打印产品';
  1550. layer.msg(message, {
  1551. time: 0,
  1552. btn: ['确定', '取消'],
  1553. yes: function (index) {
  1554. layer.close(index);
  1555. $.ajax({
  1556. url: "<?php echo $this->createUrl('printTools/getEnglishReadingFile');?>",
  1557. type: "GET",
  1558. dataType: "json",
  1559. title: divTitle,
  1560. data: {"weekId": weekId},
  1561. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1562. beforeSend: function () {
  1563. layer.msg("请稍后...", {"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1564. },
  1565. success: function (rs) {
  1566. layer.closeAll();
  1567. if (rs.success == 1) {
  1568. if(rs.data.separate==1){
  1569. printJson=rs.data;
  1570. showPrintMulti(rs.data.separate);
  1571. }else{
  1572. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1573. }
  1574. }else if (rs.success == 0) {
  1575. layer.msg(rs.message, {"time": 3000});
  1576. }
  1577. },
  1578. });
  1579. }
  1580. });
  1581. });
  1582. //批量打印外刊宝
  1583. $('#batchPrintToolsWkb').click(function(){
  1584. var message = "您确定要批量打印该产品吗?";
  1585. // 判断是否有选中
  1586. if (!$("input[class='ace myselect']").is(':checked')) {
  1587. layer.msg('至少选择一个目标!');
  1588. return false;
  1589. }
  1590. var result = [];
  1591. $(".myselect").each(function (m, n) {
  1592. if ($(this).prop('checked')) {
  1593. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1594. result.push($(this).val());
  1595. }
  1596. }
  1597. });
  1598. var saveDataAry = [];
  1599. var data1 = [];
  1600. for (i = 0; i < result.length; i++) {
  1601. var weekId = result[i];
  1602. data1 = {"weekId": weekId};
  1603. saveDataAry.push(data1);
  1604. }
  1605. layer.msg(message, {
  1606. time: 0,
  1607. btn: ['确定', '取消'],
  1608. yes: function (index) {
  1609. layer.close(index);
  1610. $.ajax({
  1611. type: "POST",
  1612. url: "<?php echo $this->createUrl('printTools/batchEnReading');?>",
  1613. dataType: "json",
  1614. contentType: "application/json",
  1615. data: JSON.stringify(saveDataAry),
  1616. success: function (rs) {
  1617. layer.closeAll();
  1618. if (rs.success == 1) {
  1619. if(rs.data.separate==1){
  1620. printJson=rs.data;
  1621. showPrintMulti(rs.data.separate);
  1622. }else{
  1623. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1624. }
  1625. } else {
  1626. layer.msg(rs.message);
  1627. }
  1628. },
  1629. });
  1630. }
  1631. });
  1632. });
  1633. //选择学生打印外刊宝
  1634. $('#selectPrintToolsWkb').click(function(){
  1635. var weekId = $("#weekId").val();
  1636. // 判断是否有选中
  1637. if (!$("input[class='ace myselect']").is(':checked')) {
  1638. layer.msg('请至少选择一个学生!');return false;
  1639. }
  1640. layer.msg("您确定打印该产品吗?", {
  1641. time: 0,
  1642. btn: ['确定', '取消'],
  1643. yes: function(index){
  1644. layer.close(index);
  1645. var result = [];
  1646. $(".myselect").each(function(m,n){
  1647. if ($(this).prop('checked')) {
  1648. if ($(this).val() && $(this).attr("stnm")) {
  1649. result.push($(this).val());
  1650. }
  1651. }
  1652. })
  1653. if (result.length < 1) {
  1654. layer.msg('未找到要打印的学生!');return false;
  1655. }
  1656. $.ajax({
  1657. url: "<?php echo $this->createUrl('printTools/getEnglishReadingFile');?>",
  1658. type: "GET",
  1659. dataType: "json",
  1660. data: {"weekId": weekId, "studentsIds":result},
  1661. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1662. beforeSend:function(){
  1663. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1664. },
  1665. success: function (rs){
  1666. layer.closeAll();
  1667. if(rs.success == 1){
  1668. if(rs.data.separate==1){
  1669. printJson=rs.data;
  1670. showPrintMulti(rs.data.separate);
  1671. }else{
  1672. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1673. }
  1674. }else if(rs.success == 0){
  1675. layer.msg(rs.message, {"time": 3000});
  1676. }
  1677. },
  1678. });
  1679. }
  1680. });
  1681. });
  1682. //打印词汇宝
  1683. $('.printToolsChb').click(function () {
  1684. weekId=$(this).attr('mwid');
  1685. if (!weekId) {
  1686. layer.msg("打印参数有误");
  1687. return;
  1688. }
  1689. var message = "您确定要打印该班级词汇宝吗?";
  1690. var divTitle = '打印词汇宝';
  1691. layer.msg(message, {
  1692. time: 0,
  1693. btn: ['确定', '取消'],
  1694. yes: function (index) {
  1695. layer.close(index);
  1696. $.ajax({
  1697. url: "<?php echo $this->createUrl('printTools/getMagicWordFile');?>",
  1698. type: "GET",
  1699. dataType: "json",
  1700. title: divTitle,
  1701. data: {"mw_id": weekId},
  1702. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1703. beforeSend: function () {
  1704. layer.msg("请稍后...", {"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1705. },
  1706. success: function (rs) {
  1707. layer.closeAll();
  1708. if (rs.success == 1) {
  1709. if(rs.data.separate>1){
  1710. printJson=rs.data;
  1711. showPrintMulti(rs.data.separate-2,1);
  1712. }else{
  1713. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1714. }
  1715. }else if (rs.success == 0) {
  1716. layer.msg(rs.message, {"time": 3000});
  1717. }
  1718. },
  1719. });
  1720. }
  1721. });
  1722. });
  1723. //批量打印词汇宝
  1724. $('#batchPrintToolsChb').click(function () {
  1725. var message = "您确定要批量打印该产品吗?";
  1726. // 判断是否有选中
  1727. if (!$("input[class='ace myselect']").is(':checked')) {
  1728. layer.msg('至少选择一个目标!');
  1729. return false;
  1730. }
  1731. var result = [];
  1732. $(".myselect").each(function (m, n) {
  1733. if ($(this).prop('checked')) {
  1734. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1735. result.push($(this).val());
  1736. }
  1737. }
  1738. });
  1739. var saveDataAry = [];
  1740. var data1 = [];
  1741. for (i = 0; i < result.length; i++) {
  1742. var weekId = result[i];
  1743. data1 = {"mw_id": weekId};
  1744. saveDataAry.push(data1);
  1745. }
  1746. layer.msg(message, {
  1747. time: 0,
  1748. btn: ['确定', '取消'],
  1749. yes: function (index) {
  1750. layer.close(index);
  1751. $.ajax({
  1752. type: "POST",
  1753. url: "<?php echo $this->createUrl('printTools/batchMagicWord');?>",
  1754. dataType: "json",
  1755. contentType: "application/json",
  1756. data: JSON.stringify(saveDataAry),
  1757. success: function (rs) {
  1758. layer.closeAll();
  1759. if (rs.success == 1) {
  1760. if(rs.data.separate==1){
  1761. printJson=rs.data;
  1762. showPrintMulti(rs.data.separate-2,1);
  1763. }else{
  1764. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1765. }
  1766. } else {
  1767. layer.msg(rs.message);
  1768. }
  1769. },
  1770. });
  1771. }
  1772. });
  1773. });
  1774. //选择学生打印词汇宝
  1775. $('#selectPrintToolsChb').click(function(){
  1776. var weekId = $("#weekId").val();
  1777. // 判断是否有选中
  1778. if (!$("input[class='ace myselect']").is(':checked')) {
  1779. layer.msg('请至少选择一个学生!');return false;
  1780. }
  1781. layer.msg("您确定打印词汇宝吗?", {
  1782. time: 0,
  1783. btn: ['确定', '取消'],
  1784. yes: function(index){
  1785. layer.close(index);
  1786. var result = [];
  1787. $(".myselect").each(function(m,n){
  1788. if ($(this).prop('checked')) {
  1789. if ($(this).val() && $(this).attr("stnm")) {
  1790. result.push($(this).val());
  1791. }
  1792. }
  1793. })
  1794. if (result.length < 1) {
  1795. layer.msg('未找到要打印的学生!');return false;
  1796. }
  1797. $.ajax({
  1798. url: "<?php echo $this->createUrl('printTools/getMagicWordFile');?>",
  1799. type: "GET",
  1800. dataType: "json",
  1801. data: {"mw_id": weekId, "studentsIds":result},
  1802. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1803. beforeSend:function(){
  1804. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1805. },
  1806. success: function (rs){
  1807. layer.closeAll();
  1808. if(rs.success == 1){
  1809. if(rs.data.separate>0){
  1810. printJson=rs.data;
  1811. showPrintMulti(rs.data.separate-2,1);
  1812. }else{
  1813. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1814. }
  1815. }else if(rs.success == 0){
  1816. layer.msg(rs.message, {"time": 3000});
  1817. }
  1818. },
  1819. });
  1820. }
  1821. });
  1822. });
  1823. //打印写作宝
  1824. $('.printToolsXzb').click(function(){
  1825. weekId=$(this).attr('ewid')
  1826. if (!weekId) {
  1827. layer.msg("打印参数有误");
  1828. return;
  1829. }
  1830. var message = "您确定要打印该班级写作宝吗?";
  1831. var divTitle = '打印写作宝';
  1832. layer.msg(message, {
  1833. time: 0,
  1834. btn: ['确定', '取消'],
  1835. yes: function (index) {
  1836. layer.close(index);
  1837. $.ajax({
  1838. url: "<?php echo $this->createUrl('printTools/getWritingFile');?>",
  1839. type: "GET",
  1840. dataType: "json",
  1841. title: divTitle,
  1842. data: {"ew_id": weekId},
  1843. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1844. beforeSend: function () {
  1845. layer.msg("请稍后...", {"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1846. },
  1847. success: function (rs) {
  1848. layer.closeAll();
  1849. if (rs.success == 1) {
  1850. if(rs.data.separate==1){
  1851. printJson=rs.data;
  1852. showPrintMulti(rs.data.separate,1);
  1853. }else{
  1854. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1855. }
  1856. }else if (rs.success == 0) {
  1857. layer.msg(rs.message, {"time": 3000});
  1858. }
  1859. },
  1860. });
  1861. }
  1862. });
  1863. });
  1864. $('#batchPrintToolsXzb').click(function(){
  1865. var message = "您确定要批量打印该产品吗?";
  1866. // 判断是否有选中
  1867. if (!$("input[class='ace myselect']").is(':checked')) {
  1868. layer.msg('至少选择一个目标!');
  1869. return false;
  1870. }
  1871. var result = [];
  1872. $(".myselect").each(function (m, n) {
  1873. if ($(this).prop('checked')) {
  1874. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1875. result.push($(this).val());
  1876. }
  1877. }
  1878. });
  1879. var saveDataAry = [];
  1880. var data1 = [];
  1881. for (i = 0; i < result.length; i++) {
  1882. var weekId = result[i];
  1883. data1 = {"ew_id": weekId};
  1884. saveDataAry.push(data1);
  1885. }
  1886. layer.msg(message, {
  1887. time: 0,
  1888. btn: ['确定', '取消'],
  1889. yes: function (index) {
  1890. layer.close(index);
  1891. $.ajax({
  1892. type: "POST",
  1893. url: "<?php echo $this->createUrl('printTools/batchWriting');?>",
  1894. dataType: "json",
  1895. contentType: "application/json",
  1896. data: JSON.stringify(saveDataAry),
  1897. success: function (rs) {
  1898. layer.closeAll();
  1899. if (rs.success == 1) {
  1900. if(rs.data.separate==1){
  1901. printJson=rs.data;
  1902. showPrintMulti(rs.data.separate,1);
  1903. }else{
  1904. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1905. }
  1906. } else {
  1907. layer.msg(rs.message);
  1908. }
  1909. },
  1910. });
  1911. }
  1912. });
  1913. });
  1914. //选择学生打印写作宝
  1915. $('#selectPrintToolsXzb').click(function(){
  1916. var weekId = $("#weekId").val();
  1917. // 判断是否有选中
  1918. if (!$("input[class='ace myselect']").is(':checked')) {
  1919. layer.msg('请至少选择一个学生!');return false;
  1920. }
  1921. layer.msg("您确定打印写作宝吗?", {
  1922. time: 0,
  1923. btn: ['确定', '取消'],
  1924. yes: function(index){
  1925. layer.close(index);
  1926. var result = [];
  1927. $(".myselect").each(function(m,n){
  1928. if ($(this).prop('checked')) {
  1929. if ($(this).val() && $(this).attr("stnm")) {
  1930. result.push($(this).val());
  1931. }
  1932. }
  1933. })
  1934. if (result.length < 1) {
  1935. layer.msg('未找到要打印的学生!');return false;
  1936. }
  1937. $.ajax({
  1938. url: "<?php echo $this->createUrl('printTools/getWritingFile');?>",
  1939. type: "GET",
  1940. dataType: "json",
  1941. data: {"ew_id": weekId, "studentsIds":result},
  1942. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1943. beforeSend:function(){
  1944. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1945. },
  1946. success: function (rs){
  1947. layer.closeAll();
  1948. if(rs.success == 1){
  1949. if(rs.data.separate==1){
  1950. printJson=rs.data;
  1951. showPrintMulti(rs.data.separate,1);
  1952. }else{
  1953. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  1954. }
  1955. }else if(rs.success == 0){
  1956. layer.msg(rs.message, {"time": 3000});
  1957. }
  1958. },
  1959. });
  1960. }
  1961. });
  1962. });
  1963. //打印批改后答题卡
  1964. $('.printToolsCorrect').click(function(){
  1965. mwid=$(this).attr('mwid');
  1966. $('input[name=english_chb_id]').val(mwid);
  1967. $('input[name=english_product_print_type]').val(1);
  1968. layer.open({
  1969. type: 1,
  1970. title: '请选择操作',
  1971. area: ['440px', '150px'], //宽高
  1972. btnAlign: 'c',
  1973. content: $('.modal1_multi_print_card'),
  1974. });
  1975. });
  1976. //打印批改后答题卡写作宝
  1977. $('.printToolsCorrectXzb').click(function(){
  1978. ewid=$(this).attr('ewid');
  1979. $('input[name=english_xzb_id]').val(ewid);
  1980. $('input[name=english_product_print_type]').val(2);
  1981. //判断是否答案分离
  1982. $.ajax({
  1983. url: "<?php echo $this->createUrl('printTools/getWritingCardAnswer');?>",
  1984. type: "GET",
  1985. dataType: "json",
  1986. data: {"ew_id": ewid},
  1987. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1988. success: function (rs){
  1989. layer.closeAll();
  1990. if(rs.success == 1){
  1991. if(rs.data==1){
  1992. layer.open({
  1993. type: 1,
  1994. title: '请选择操作',
  1995. area: ['740px', '150px'], //宽高
  1996. btnAlign: 'c',
  1997. content: $('.modal1_multi_print_card1'),
  1998. });
  1999. }else{
  2000. layer.open({
  2001. type: 1,
  2002. title: '请选择操作',
  2003. area: ['440px', '150px'], //宽高
  2004. btnAlign: 'c',
  2005. content: $('.modal1_multi_print_card'),
  2006. });
  2007. }
  2008. }else if(rs.success == 0){
  2009. layer.msg(rs.message, {"time": 3000});
  2010. }
  2011. }
  2012. });
  2013. });
  2014. $('.english_txt_1').click(function(){
  2015. printType=$('input[name=english_product_print_type]').val();
  2016. if(printType==1){
  2017. mwid=$('input[name=english_chb_id]').val();
  2018. downloadCardChb(mwid)
  2019. }else if(printType==2){
  2020. ewid=$('input[name=english_xzb_id]').val();
  2021. downloadCardXzb(ewid);
  2022. }
  2023. });
  2024. $('.english_txt_2').click(function(){
  2025. printType=$('input[name=english_product_print_type]').val();
  2026. if(printType==1){
  2027. mwid=$('input[name=english_chb_id]').val();
  2028. if (!mwid) {
  2029. layer.msg("打印参数有误");
  2030. return;
  2031. }
  2032. printCardChb(mwid);
  2033. }else if(printType==2){
  2034. ewid=$('input[name=english_xzb_id]').val();
  2035. if (!ewid) {
  2036. layer.msg("打印参数有误");
  2037. return;
  2038. }
  2039. printCardXzb(ewid,0);
  2040. }
  2041. });
  2042. $('.english_txt_3').click(function(){
  2043. ewid=$('input[name=english_xzb_id]').val();
  2044. if (!ewid) {
  2045. layer.msg("打印参数有误");
  2046. return;
  2047. }
  2048. printCardXzb(ewid,1);
  2049. });
  2050. $('.english_txt_4').click(function(){
  2051. ewid=$('input[name=english_xzb_id]').val();
  2052. if (!ewid) {
  2053. layer.msg("打印参数有误");
  2054. return;
  2055. }
  2056. printCardXzb(ewid,2);
  2057. });
  2058. function printCardChb(mwId){
  2059. if (!mwId) {
  2060. layer.msg("打印参数有误");
  2061. return;
  2062. }
  2063. var message = "您确定要打印批改后答题卡吗?";
  2064. layer.msg(message, {
  2065. time: 0,
  2066. btn: ['确定', '取消'],
  2067. yes: function (index) {
  2068. layer.close(index);
  2069. msgIndex = layer.msg("请稍后...", {"time": 3600000});
  2070. jQuery.get(
  2071. "<?php echo $this->createUrl("printTools/getMagicWordCard");?>",
  2072. {"mw_id": mwId},
  2073. function (data) {
  2074. rs = JSON.parse(data);
  2075. layer.close(msgIndex);
  2076. if (rs.success == 1) {
  2077. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  2078. }
  2079. else if (rs.success == 0) {
  2080. msgIndex = layer.msg(rs.message, {"time": 3000});
  2081. }
  2082. }
  2083. );
  2084. }
  2085. });
  2086. }
  2087. function printCardXzb(ewId,separate){
  2088. if (!ewId) {
  2089. layer.msg("打印参数有误");
  2090. return;
  2091. }
  2092. var message = "您确定要打印批改后答题卡吗?";
  2093. layer.msg(message, {
  2094. time: 0,
  2095. btn: ['确定', '取消'],
  2096. yes: function (index) {
  2097. layer.close(index);
  2098. msgIndex = layer.msg("请稍后...", {"time": 3600000});
  2099. jQuery.get(
  2100. "<?php echo $this->createUrl("printTools/getWritingCard");?>",
  2101. {"ew_id": ewId},
  2102. function (data) {
  2103. rs = JSON.parse(data);
  2104. layer.close(msgIndex);
  2105. if (rs.success == 1) {
  2106. rs.data.separate=separate;
  2107. console.log(rs.data);
  2108. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  2109. }
  2110. else if (rs.success == 0) {
  2111. msgIndex = layer.msg(rs.message, {"time": 3000});
  2112. }
  2113. }
  2114. );
  2115. }
  2116. });
  2117. }
  2118. function downloadCardChb(mwId) {
  2119. if (!mwId) {
  2120. layer.msg("打印参数有误");
  2121. return;
  2122. }
  2123. var message = "您确定要下载该班级检测卡吗?";
  2124. html = "" +
  2125. '<div style="padding:20px 30px 0px 30px">' +
  2126. '<div style="padding:8px 0;">请复制下方链接下载词汇宝检测卡。</div>' +
  2127. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>' +
  2128. '<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>' +
  2129. '</div>' +
  2130. '</div>' +
  2131. "";
  2132. layer.msg(message, {
  2133. time: 0,
  2134. btn: ['确定', '取消'],
  2135. yes: function (index) {
  2136. layer.close(index);
  2137. msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
  2138. startTime = (new Date()).getTime();
  2139. showTip = true;
  2140. tipShowed = false;
  2141. toPromptTime = 3000;
  2142. window.interval = setInterval(function () {
  2143. execTime = (new Date()).getTime() - startTime;
  2144. if (execTime > toPromptTime && showTip && !tipShowed) {
  2145. msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
  2146. tipShowed = true;
  2147. }
  2148. }, 1000);
  2149. jQuery.get(
  2150. "<?php echo $this->createUrl("productdownload/getMagicWordCard");?>",
  2151. {"mw_id": mwId},
  2152. function (data) {
  2153. data = JSON.parse(data);
  2154. if (data.success == 1 || data.success == 2) {
  2155. layer.open({
  2156. type: 1,
  2157. area: ['550px', '220px'],
  2158. title: "下载检测卡",
  2159. content: html,
  2160. success: function (index, layerObj) {
  2161. clearInterval(window.interval);
  2162. msgIndex = layer.msg(data.limitinfo, {"time": 3000});
  2163. clearInterval(window.interval);
  2164. layer.close(msgIndex);
  2165. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="' + data.downloadPath + '" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  2166. jQuery("#confirm, #cancel").on("click", function () {
  2167. layer.close(layerObj);
  2168. });
  2169. jQuery("#copy").on("click", function () {
  2170. jQuery("#url").select();
  2171. });
  2172. },
  2173. end: function () {
  2174. }
  2175. });
  2176. }
  2177. else if (data.success == 0) {
  2178. clearInterval(window.interval);
  2179. msgIndex = layer.msg(data.message, {"time": 3000});
  2180. }
  2181. }
  2182. );
  2183. }
  2184. });
  2185. }
  2186. function downloadCardXzb(mwId) {
  2187. if (!mwId) {
  2188. layer.msg("打印参数有误");
  2189. return;
  2190. }
  2191. var message = "您确定要下载该班级写作卡吗?";
  2192. html = "" +
  2193. '<div style="padding:20px 30px 0px 30px">' +
  2194. '<div style="padding:8px 0;">请复制下方链接下载写作卡。</div>' +
  2195. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>' +
  2196. '<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>' +
  2197. '</div>' +
  2198. '</div>' +
  2199. "";
  2200. layer.msg(message, {
  2201. time: 0,
  2202. btn: ['确定', '取消'],
  2203. yes: function (index) {
  2204. layer.close(index);
  2205. msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
  2206. startTime = (new Date()).getTime();
  2207. showTip = true;
  2208. tipShowed = false;
  2209. toPromptTime = 3000;
  2210. window.interval = setInterval(function () {
  2211. execTime = (new Date()).getTime() - startTime;
  2212. if (execTime > toPromptTime && showTip && !tipShowed) {
  2213. msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
  2214. tipShowed = true;
  2215. }
  2216. }, 1000);
  2217. jQuery.get(
  2218. "<?php echo $this->createUrl("productdownload/getWritingCard");?>",
  2219. {"ew_id": mwId},
  2220. function (data) {
  2221. data = JSON.parse(data);
  2222. if (data.success == 1 || data.success == 2) {
  2223. layer.open({
  2224. type: 1,
  2225. area: ['550px', '220px'],
  2226. title: "下载写作卡",
  2227. content: html,
  2228. success: function (index, layerObj) {
  2229. clearInterval(window.interval);
  2230. msgIndex = layer.msg(data.limitinfo, {"time": 3000});
  2231. clearInterval(window.interval);
  2232. layer.close(msgIndex);
  2233. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="' + data.downloadPath + '" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  2234. jQuery("#confirm, #cancel").on("click", function () {
  2235. layer.close(layerObj);
  2236. });
  2237. jQuery("#copy").on("click", function () {
  2238. jQuery("#url").select();
  2239. });
  2240. },
  2241. end: function () {
  2242. }
  2243. });
  2244. }
  2245. else if (data.success == 0) {
  2246. clearInterval(window.interval);
  2247. msgIndex = layer.msg(data.message, {"time": 3000});
  2248. }
  2249. }
  2250. );
  2251. }
  2252. });
  2253. }
  2254. $('.close_product').click(function(){
  2255. $('.modal1_multi_print,.modal1_multi_print_teacher').hide();
  2256. });
  2257. function showPrintMulti(option,jck=0) {
  2258. if(option==0){
  2259. $('.txt_2').hide();
  2260. }else{
  2261. $('.txt_2').show();
  2262. }
  2263. if(jck==1){
  2264. $('.txt_3').show();
  2265. }else{
  2266. $('.txt_3').hide();
  2267. }
  2268. $('.modal1_multi_print').show()
  2269. }
  2270. //教师产品下载打印 个性化学习宝教学宝
  2271. function downpdfPrint(examId, classId,isLabelled) {
  2272. layer.msg('生成中,请稍后...', { time: 0, shade: 0.4 })
  2273. var subjectId = "<?php echo Yii::app()->session['session_subject_id'];?>";
  2274. var url = '';
  2275. //是否是多学科
  2276. var isDuoSub = "<?php echo in_array(Yii::app()->session['session_subject_id'],array(8,9,12,13,14,15,16,17,18,19))?1:0;?>";
  2277. var teachingRoute = '';
  2278. if (isDuoSub && isLabelled == 0) {
  2279. teachingRoute = "<?php echo $this->createUrl('teaching/index');?>";
  2280. }else if(subjectId == 12 && isLabelled == 1){//物理新版
  2281. teachingRoute = "<?php echo $this->createUrl('teaching/physics');?>";
  2282. }else{
  2283. teachingRoute = "<?php echo $this->createUrl('export/academicr');?>";
  2284. }
  2285. $.get(teachingRoute, {examId: examId, classId: classId}, function(data) {
  2286. console.log(data);
  2287. var m = JSON.parse(data);
  2288. layer.closeAll();
  2289. if (m.status == 0)
  2290. {
  2291. //if (m.is_create == 1) {
  2292. // $('input[name=downloadUrl]').val("<?php //echo $this->createUrl("export/down_load")?>//?examId="+examId);
  2293. // $('input[name=examId]').val(examId);
  2294. // $('input[name=teacherPrintType]').val(1);
  2295. // $('.modal1_multi_print_teacher').show();
  2296. // return false;
  2297. //} else {
  2298. // layer.closeAll()
  2299. //}
  2300. $('input[name=downloadUrl]').val("<?php echo $this->createUrl("export/down_load")?>?examId="+examId);
  2301. $('input[name=examId]').val(examId);
  2302. $('input[name=teacherPrintType]').val(1);
  2303. $('.modal1_multi_print_teacher').show();
  2304. return false;
  2305. //location.href="<?php echo $this->createUrl("export/down_load")?>?examId="+examId;
  2306. } else
  2307. {
  2308. setTimeout(function() {
  2309. layer.closeAll()
  2310. }, 500);
  2311. layer.msg(m.error)
  2312. // alert(m.error);
  2313. }
  2314. });
  2315. }
  2316. //下载方法宝教学宝
  2317. function downMethodPdfPrint(examId){
  2318. $('input[name=examId]').val(examId);
  2319. $('input[name=teacherPrintType]').val(2);
  2320. $('.modal1_multi_print_teacher').show();
  2321. }
  2322. //下载错题前十
  2323. function downCTQSPrint(examId){
  2324. $('input[name=examId]').val(examId);
  2325. $('input[name=teacherPrintType]').val(3);
  2326. $('.modal1_multi_print_teacher').show();
  2327. return false;
  2328. }
  2329. $('.teacher_txt_1').click(function(){
  2330. msgIndex = layer.msg("请稍后...", {"time": 3600000});
  2331. teacherPrintType=$('input[name=teacherPrintType]').val();
  2332. examId=$('input[name=examId]').val();
  2333. if(teacherPrintType==1){
  2334. url="<?php echo $this->createUrl("printTools/getTeacherPdf");?>";
  2335. data={"examId": examId};
  2336. }else if(teacherPrintType==2){
  2337. url="<?php echo $this->createUrl("printTools/getMethodPdfPrint");?>";
  2338. data={"examId": examId};
  2339. }else if(teacherPrintType==3){
  2340. url="<?php echo $this->createUrl("printTools/GetCTQSPrint");?>";
  2341. data={"exam_id": examId};
  2342. }else if(teacherPrintType==4){
  2343. url="<?php echo $this->createUrl("printTools/CDCHTeacherPrint");?>";
  2344. data={"weekId":examId};
  2345. }else if(teacherPrintType==5){
  2346. url="<?php echo $this->createUrl("printTools/downPdfWKBTeacherPrint");?>";
  2347. data={"weekId":examId};
  2348. }else if(teacherPrintType==6){
  2349. //url="<?php echo $this->createUrl("printTools/downPdfCHBTeacherPrint");?>";
  2350. url="<?php echo $this->createUrl("magic/teacherWeek")?>";
  2351. data={"mwId":examId,"isPrint":1};
  2352. }else if(teacherPrintType==7) {
  2353. // url = "<?php echo $this->createUrl("printTools/downPdfXZBTeacherPrint");?>";
  2354. url = "<?php echo $this->createUrl("writing/teacherWeek")?>";
  2355. data = {"mwId": examId,"isPrint":1};
  2356. }
  2357. jQuery.get(
  2358. url,
  2359. data,
  2360. function (data) {
  2361. rs = JSON.parse(data);
  2362. layer.close(msgIndex);
  2363. if (rs.success == 1) {
  2364. evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  2365. }
  2366. else if (rs.success == 0) {
  2367. msgIndex = layer.msg(rs.message, {"time": 3000});
  2368. }
  2369. }
  2370. );
  2371. });
  2372. $('.teacher_txt_2').click(function(){
  2373. teacherPrintType=$('input[name=teacherPrintType]').val();
  2374. if(teacherPrintType==1){
  2375. url=$('input[name=downloadUrl]').val();
  2376. location.href=url;
  2377. }else if(teacherPrintType==2){
  2378. layer.msg('请稍后...', { time: 0, shade: 0.4 });
  2379. examId=$('input[name=examId]').val();
  2380. var url = "<?php echo $this->createUrl("productexam/method_pdf");?>?examId="+examId+"&productType=31";
  2381. window.location.href = url;
  2382. layer.closeAll();
  2383. }else if(teacherPrintType==3){
  2384. layer.msg('请稍后...', { time: 0, shade: 0.4 });
  2385. examId=$('input[name=examId]').val();
  2386. var url = "<?php echo Yii::app()->createUrl('export/download'); ?>?exam_id="+examId;
  2387. window.location.href = url;
  2388. layer.closeAll();
  2389. }else if(teacherPrintType==4){
  2390. layer.msg('请稍后...', { time: 0, shade: 0.4 });
  2391. weekId=$('input[name=examId]').val();
  2392. location.href="<?php echo $this->createUrl("print/teacherWeek")?>?weekId="+weekId;
  2393. layer.closeAll();
  2394. }else if(teacherPrintType==5){
  2395. layer.msg('请稍后...', { time: 0, shade: 0.4 });
  2396. weekId=$('input[name=examId]').val();
  2397. location.href = "<?php echo $this->createUrl("print/down_load")?>?weekId=" + weekId;
  2398. layer.closeAll();
  2399. }else if(teacherPrintType==6){
  2400. layer.msg('请稍后...', { time: 0, shade: 0.4 });
  2401. weekId=$('input[name=examId]').val();
  2402. location.href = "<?php echo $this->createUrl("magic/teacherWeek")?>?mwId=" + weekId;
  2403. layer.closeAll();
  2404. }else if(teacherPrintType==7){
  2405. layer.msg('生成中,请稍后...', {time: 0, shade: 0.4})
  2406. mwId=$('input[name=examId]').val();
  2407. location.href = "<?php echo $this->createUrl("writing/teacherWeek")?>?mwId=" + mwId;
  2408. layer.closeAll();
  2409. }
  2410. });
  2411. //晨读词汇周推教师版
  2412. function downPdfCDCHTeacherPrint(weekId){
  2413. $('input[name=examId]').val(weekId);
  2414. $('input[name=teacherPrintType]').val(4);
  2415. $('.modal1_multi_print_teacher').show();
  2416. return false;
  2417. }
  2418. //外刊宝教师版
  2419. function downPdfWKBTeacherPrint(weekId){
  2420. $('input[name=examId]').val(weekId);
  2421. $('input[name=teacherPrintType]').val(5);
  2422. $('.modal1_multi_print_teacher').show();
  2423. return false;
  2424. }
  2425. //词汇宝教师版
  2426. function downPdfCHBTeacherPrint(weekId){
  2427. $('input[name=examId]').val(weekId);
  2428. $('input[name=teacherPrintType]').val(6);
  2429. $('.modal1_multi_print_teacher').show();
  2430. return false;
  2431. }
  2432. //写作宝教师版
  2433. function downPdfXZBTeacherPrint(mwId){
  2434. $('input[name=examId]').val(mwId);
  2435. $('input[name=teacherPrintType]').val(7);
  2436. $('.modal1_multi_print_teacher').show();
  2437. return false;
  2438. }
  2439. //打印试卷
  2440. function PaperPrintTools(){
  2441. data=$('#downloadPaperForm').serialize();
  2442. data+='&isPrint=1';
  2443. layer.msg('请稍后...', { time: 0, shade: 0.4 });
  2444. $.ajax({
  2445. url:'<?php echo $this->createUrl('print/downloadPaper')?>',
  2446. type:'POST',
  2447. data:data,
  2448. dataType:'json',
  2449. success:function(res){
  2450. layer.closeAll();
  2451. if(res.status==1){
  2452. console.log(res.data)
  2453. evaluationClient.BulkPrintPDF(JSON.stringify(res.data));
  2454. }
  2455. }
  2456. });
  2457. }
  2458. //班级打印校本纠错本
  2459. $('.printToolsXbJCB').click(function(){
  2460. cid=$(this).attr('cid');
  2461. gpid=$(this).attr('gpid');
  2462. type=$(this).attr('type');
  2463. if (!cid || !gpid || !type) {
  2464. layer.msg("打印参数有误");return;
  2465. }
  2466. var message = "您确定要打印该班级纠错本吗?";
  2467. layer.msg(message, {
  2468. time: 0,
  2469. btn: ['确定', '取消'],
  2470. yes: function(index){
  2471. layer.close(index);
  2472. $.ajax({
  2473. url: "<?php echo $this->createUrl('printTools/getUrlZtb');?>",
  2474. type: "GET",
  2475. dataType: "json",
  2476. data: {"gpId": gpid, "classId": cid, "type": type},
  2477. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  2478. beforeSend:function(){
  2479. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  2480. },
  2481. success: function (rs){
  2482. layer.closeAll();
  2483. if(rs.success == 1){
  2484. printJson=rs.data;
  2485. showPrintMulti(rs.data.separate,0);
  2486. //evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  2487. }else if(rs.success == 0){
  2488. layer.msg(rs.message, {"time": 3000});
  2489. }
  2490. },
  2491. });
  2492. }
  2493. });
  2494. });
  2495. //批量打印校本纠错本
  2496. $('#batchPrintToolsXbJCB').click(function(){
  2497. var message = "您确定要批量打印纠错本吗?";
  2498. // 判断是否有选中
  2499. if (!$("input[class='ace myselect']").is(':checked')) {
  2500. layer.msg('至少选择一个目标!');
  2501. return false;
  2502. }
  2503. var result = [];
  2504. $(".myselect").each(function(m,n){
  2505. if ($(this).prop('checked')) {
  2506. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  2507. result.push($(this).val());
  2508. }
  2509. }
  2510. })
  2511. var sp = [];
  2512. var cid = 0;
  2513. var eid = 0;
  2514. var type = 0;
  2515. var saveDataAry=[];
  2516. var data1 = [];
  2517. for(i=0;i<result.length;i++)
  2518. {
  2519. sp = result[i].split('_');
  2520. cid = sp[0];
  2521. eid = sp[1];
  2522. type = sp[2];
  2523. if(!cid || !eid || !type) continue;
  2524. var absent_filter = $("input[name='absent-filter']").is(':checked') ? 1 : 0;
  2525. data1 = {"gpId": eid, "classId": cid, "type": type,"absent_filter":absent_filter};
  2526. saveDataAry.push(data1);
  2527. }
  2528. layer.msg(message, {
  2529. time: 0,
  2530. btn: ['确定', '取消'],
  2531. yes: function(index){
  2532. layer.close(index);
  2533. $.ajax({
  2534. type: "POST",
  2535. url: "<?php echo $this->createUrl('printTools/batchZtb');?>",
  2536. dataType: "json",
  2537. contentType: "application/json",
  2538. data: JSON.stringify(saveDataAry),
  2539. success: function (rs){
  2540. layer.closeAll();
  2541. if(rs.success == 1) {
  2542. printJson=rs.data;
  2543. showPrintMulti(rs.data.separate,0);
  2544. //evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  2545. }else {
  2546. layer.msg(rs.message);
  2547. }
  2548. }
  2549. });
  2550. }
  2551. });
  2552. });
  2553. //打印校本纠错本选择学生
  2554. $('#selectPrintToolsXbJCB').click(function(){
  2555. var weekId = $("#gpId").val();
  2556. var classId = $("#classId").val();
  2557. var type = $("#type").val();
  2558. // 判断是否有选中
  2559. if (!$("input[class='ace myselect']").is(':checked')) {
  2560. layer.msg('请至少选择一个学生!');return false;
  2561. }
  2562. layer.msg("您确定打印纠错本吗?", {
  2563. time: 0,
  2564. btn: ['确定', '取消'],
  2565. yes: function(index){
  2566. layer.close(index);
  2567. var result = [];
  2568. $(".myselect").each(function(m,n){
  2569. if ($(this).prop('checked')) {
  2570. if ($(this).val() && $(this).attr("stnm")) {
  2571. result.push($(this).val());
  2572. }
  2573. }
  2574. })
  2575. if (result.length < 1) {
  2576. layer.msg('未找到要打印的学生!');return false;
  2577. }
  2578. $.ajax({
  2579. url: "<?php echo $this->createUrl('printTools/getUrlZtb');?>",
  2580. type: "GET",
  2581. dataType: "json",
  2582. data: {"gpId": weekId,"classId":classId,"type":type,"studentsIds":result},
  2583. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  2584. beforeSend:function(){
  2585. layer.msg("请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  2586. },
  2587. success: function (rs){
  2588. layer.closeAll();
  2589. if(rs.success == 1){
  2590. printJson=rs.data;
  2591. showPrintMulti(rs.data.separate,0);
  2592. //evaluationClient.BulkPrintPDF(JSON.stringify(rs.data));
  2593. }else if(rs.success == 0){
  2594. layer.msg(rs.message, {"time": 3000});
  2595. }
  2596. },
  2597. });
  2598. }
  2599. });
  2600. });
  2601. </script>