sheet.php 83 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031
  1. <style>
  2. .confirmbox {
  3. background: #fff;
  4. border: 1px solid #cccccc;
  5. border-radius: 3px;
  6. padding: 40px 40px 30px;
  7. text-align: center;
  8. position: fixed;
  9. left: 50%;
  10. top: 50%;
  11. transform: translate(-50%, -50%);
  12. z-index: 99;
  13. }
  14. .confirmbox-mask {
  15. background: rgba(0, 0, 0, .7);
  16. left: 0;
  17. right: 0;
  18. top: 0;
  19. bottom: 0;
  20. z-index: 99;
  21. position: fixed;
  22. }
  23. .btn_area button {
  24. border: none;
  25. background: #009965;
  26. width: 111px;
  27. height: 36px;
  28. border-radius: 3px;
  29. font-size: 14px;
  30. color: #fff;
  31. outline: none;
  32. cursor: pointer;
  33. }
  34. .btn_area button.save {
  35. display: block;
  36. margin: 40px auto;
  37. }
  38. .confirmbox .confirmbox-btns {
  39. margin-top: 40px;
  40. }
  41. .class-modal-body .classes {
  42. margin-bottom: 10px;
  43. }
  44. .class-modal-body .classes > div {
  45. display: inline-block;
  46. max-width: 640px;
  47. vertical-align: top;
  48. }
  49. .class-modal-body .classes a {
  50. text-decoration: none;
  51. display: inline-block;
  52. margin: 0 5px 5px;
  53. color: #136bfb;
  54. font-size: 14px;
  55. }
  56. .class-modal-body .classes a.active {
  57. color: #fc091b
  58. }
  59. .class-modal .icon-close{
  60. position: absolute;
  61. right: 20px;
  62. top: 20px;
  63. }
  64. .class-modal-1 {
  65. width: auto;
  66. background: #fff;
  67. border-radius: 5px;
  68. position: absolute;
  69. top: 50%;
  70. left: 50%;
  71. transform: translate(-50%, -50%);
  72. }
  73. .class-modal-head-1 {
  74. font-size: 14px;
  75. text-align: left;
  76. color:#fff;
  77. line-height:30px;
  78. background: #2977ff;
  79. padding-left:15px;
  80. }
  81. .class-modal-body-1{
  82. padding:15px;
  83. }
  84. .class-modal-body-1 h2,.class-modal-body-1 h3{
  85. font-size:14px;
  86. font-weight:normal;
  87. margin-top:10px;
  88. }
  89. .class-modal-body-1 h3 span{
  90. font-size:10px;
  91. color:#ccc;
  92. }
  93. .class-modal-body-1 label{
  94. display: inline-block;
  95. font-weight: normal;
  96. margin-right: 15px;
  97. height:30px;
  98. position: relative;
  99. }
  100. .class-modal-1 .icon-close-1{
  101. position: absolute;
  102. right: 10px;
  103. top:5px;
  104. }
  105. .class-modal-1 .class_area{
  106. height:115px;
  107. border:1px solid #ccc;
  108. padding:5px;
  109. overflow-y: auto;
  110. margin-bottom:15px;
  111. }
  112. .class-modal-1 .checkAll{
  113. position:absolute;
  114. right:5px;
  115. top:115px;
  116. }
  117. .class-modal-1 .subsection{
  118. }
  119. .class-modal-1 .btn p{color:#000;}
  120. .class-modal-1 .btn_area{
  121. padding: 10px;
  122. border-top: 1px solid #aab6aa;
  123. margin-top:10px;
  124. }
  125. .class-modal-1 .btn_area p{
  126. display: inline-block;
  127. }
  128. .class-modal-1 .btn_area button{
  129. margin-left:5px;
  130. }
  131. .class-modal-1 .btn_area .cancel{
  132. background: #fff;
  133. color:#000;
  134. border:1px solid #666;
  135. }
  136. .c-red-1 {
  137. color: #CC3300;
  138. font-size:10px;
  139. display: inline-block;
  140. position:absolute;
  141. left:15px;
  142. top:18px;
  143. }
  144. .vtm{vertical-align: middle;}
  145. .pointer{cursor: pointer;}
  146. .dib{display: inline-block;}
  147. .pdp-con .pop-opt-con{border-top: 1px solid #ddd;padding-top: 20px;}
  148. .tit-sub-intro{color: #666;}
  149. .tit-sub-intro span{font-size: 12px;}
  150. .subsection{width: 44px;height: 24px;border: 1px solid #ddd;text-align: center;font-size: 12px;}
  151. .reduce-btn,.add-btn{width: 16px;height: 16px;line-height: 16px;text-align: center;color: #16AE68;border: 1px solid #16AE68;border-radius: 3px;font-size: 16px;font-weight: bold;margin-right: 6px;}
  152. .reduce-btn.forbidden,.add-btn.forbidden{color: #bbb;border: 1px solid #bbb;cursor: no-drop;}
  153. </style>
  154. <script type="text/javascript">
  155. function in_array(search, array){
  156. for(var i in array){
  157. if(array[i]==search){
  158. return true;
  159. }
  160. }
  161. return false;
  162. }
  163. testFlag = "<?php echo $this->testFlag;?>";
  164. customTplsIds = new Array();
  165. var i = 0;
  166. <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
  167. customTplsIds[i] = "<?php echo $tplId;?>";
  168. i++;
  169. <?php }?>
  170. jQuery(document).ready(function(){
  171. // 打印答案解析
  172. $(".answerAnalysis").click(function(){
  173. var element = this;
  174. layer.msg('您确定下载答案解析嘛?', {
  175. time: 0,
  176. btn: ['确定', '取消'],
  177. yes: function(index){
  178. layer.close(index);
  179. var wpCode = jQuery(element).attr("examId");
  180. if (!wpCode) {
  181. layer.msg('周周练id有误!');return false;
  182. }
  183. jQuery.post(
  184. '<?php echo $this->createUrl('print/createtempelate');?>',
  185. {"eid":wpCode},
  186. function(data){
  187. var obj = JSON.parse(data);
  188. if (obj.success == 1) {
  189. /*alert(obj.message);
  190. alert(obj);*/
  191. evaluationClient.printDAJX(JSON.stringify(obj.object));
  192. } else {
  193. layer.msg(obj.message);
  194. }
  195. }
  196. );
  197. }
  198. });
  199. });
  200. jQuery(".needToSendLabelTask").click(function(){
  201. layer.msg("请先发送标注任务");
  202. });
  203. jQuery(".sendLabelTask").click(function(){
  204. var examId = jQuery(this).attr("examId");
  205. var examName = jQuery(this).attr("examName");
  206. var subjectId = jQuery(this).attr("subjectId");
  207. var createTime = jQuery(this).attr("createTime");
  208. layer.msg('您确定发送试题标注任务吗?', {
  209. time: 0,
  210. btn: ['确定', '取消'],
  211. yes: function(index){
  212. layer.close(index);
  213. jQuery.post(
  214. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  215. {"examId": examId, "examName": examName, "createTime": createTime},
  216. function(data){
  217. data = JSON.parse(data);
  218. if(data.success == 1){
  219. layer.msg(data.message);
  220. setTimeout(function(){location.reload();}, 1300);
  221. }
  222. else{
  223. layer.msg(data.message);
  224. }
  225. }
  226. );
  227. }
  228. });
  229. });
  230. jQuery(".enterStudentsList1").click(function(){
  231. layer.msg("请先发送标注任务");
  232. });
  233. jQuery(".paperType").click(function(){
  234. if(testFlag != 1)
  235. return false;
  236. var examId = jQuery(this).attr("examId");
  237. var tpl_index = jQuery(this).attr("tpl_index");
  238. if(in_array(jQuery(this).attr("tpl_index"), customTplsIds)){
  239. if(in_array(jQuery(this).attr("tpl_index"), [10,1011,11])){
  240. var style = "width:200px;color:gray;";
  241. var state = "disabled";
  242. }else{
  243. var style = "width:200px;";
  244. var state = "enabled";
  245. }
  246. }
  247. else{
  248. var style = "width:200px;color:gray;";
  249. var state = "disabled";
  250. }
  251. html = ""+
  252. '<div style="padding:10px 30px">'+
  253. '<div style="margin:5px 0; float: left">选择纸张:</div>'+
  254. '<div style="float: left"><select id="paperSize" style="'+style+'" '+state+' >'+
  255. '<option value="A3" ';
  256. if(jQuery(this).attr("paper_size")=='A3'){ html=html+'selected';}
  257. html=html+'>A3</option>'+
  258. '<option value="A4" ';
  259. if(jQuery(this).attr("paper_size")=='A4'){ html=html+'selected';}
  260. html=html+'>A4</option>'+
  261. '<option value="8K" ';
  262. if(jQuery(this).attr("paper_size")=='8K'){ html=html+'selected';}
  263. html=html+'>8K</option>'+
  264. '<option value="16K" ';
  265. if(jQuery(this).attr("paper_size")=='16K'){ html=html+'selected';}
  266. html=html+'>16K</option>'+
  267. '</select></div>'+
  268. '<div style="padding-top:10px;clear: left"></div>'+
  269. '<div style="margin:5px 0; float: left">阅卷方式:</div>'+
  270. '<div style="float: left"><select id="mark_type" style="width:200px">'+
  271. '<option value="0" ';
  272. if(jQuery(this).attr("mark_type")=='0'){ html=html+'selected';}
  273. html=html+'>线下阅卷</option>'+
  274. '<option value="1" ';
  275. if(jQuery(this).attr("mark_type")=='1'){ html=html+'selected';}
  276. html=html+'>在线阅卷(题)</option> <option value="3" ';
  277. if(jQuery(this).attr("mark_type")=='3'){ html=html+'selected';}
  278. html=html+'>班级混合阅卷</option> <option value="4" ';
  279. if(jQuery(this).attr("mark_type")=='4'){ html=html+'selected';}
  280. html=html+'>班级单独阅卷</option> '+
  281. '</select></div>'+
  282. '<div class="row" style="margin:30px auto;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>'+
  283. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>'+
  284. '</div>'+
  285. '</div>'+
  286. "";
  287. layer.open({
  288. type: 1,
  289. area: ['350px', '220px'],
  290. title: "更改试卷",
  291. content: html,
  292. success: function(index, layerObj){
  293. jQuery("#cancel").on("click", function(){
  294. layer.closeAll();
  295. });
  296. jQuery("#confirm").on("click", function(){
  297. var paperSize = jQuery("#paperSize").val();
  298. var mark_type = jQuery("#mark_type").val();
  299. jQuery.post(
  300. "<?php echo $this->createUrl("print/setpapersize");?>",
  301. {"examId": examId, "paperSize": paperSize,"mark_type":mark_type,"tpl_index":tpl_index},
  302. function(data){
  303. data = JSON.parse(data);
  304. layer.msg(data.message);
  305. if(data.success == 1){
  306. setTimeout(function(){location.reload();}, 1300);
  307. }
  308. }
  309. );
  310. layer.closeAll();
  311. });
  312. },
  313. end: function(){
  314. }
  315. });
  316. });
  317. // 根据年级筛选班级
  318. jQuery("#grade").change(function(){
  319. var grade = $(this).val();
  320. var subjectId='<?php echo $subjectId?>';
  321. if (!grade) return false;
  322. jQuery.post(
  323. '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade,"subjectId":subjectId},function(data){
  324. data = JSON.parse(data);
  325. if(data.success == 1){
  326. var classObj = $("#class");
  327. var html = "<option value=''>全部班级</option>";
  328. //classObj.empty();
  329. $.each(data.message,function(i,n){
  330. html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
  331. });
  332. classObj.html(html);
  333. }else
  334. {
  335. var classObj = $("#class");
  336. var html = "<option value=''>全部班级</option>";
  337. classObj.html(html);
  338. }
  339. }
  340. );
  341. });
  342. });
  343. </script>
  344. <style>
  345. /*切换选择*/
  346. .tab-con{
  347. position: relative;
  348. height: 30px;
  349. width: 200px;
  350. background: #F2F2F2;
  351. border: 1px solid #01B677;
  352. border-radius: 15px;
  353. }
  354. .has-sel{
  355. background: #01B677;
  356. color: #fff;
  357. width: 50%;
  358. height: 30px;
  359. border-top-left-radius: 15px;
  360. border-bottom-left-radius: 15px;
  361. text-align: center;
  362. line-height: 30px;
  363. }
  364. .sel-opt{
  365. width: 50%;
  366. position: relative;
  367. color: #01B677;
  368. line-height: 30px;
  369. text-indent: 6px;
  370. cursor: pointer;
  371. }
  372. .sel-opt:after{
  373. content: '';
  374. border-left: 6px solid transparent;
  375. border-right: 6px solid transparent;
  376. border-top: 8px solid #01B677;
  377. position: absolute;
  378. right: 12px;
  379. top: 12px;
  380. }
  381. // .sel-opt select{
  382. // width: 100%;
  383. // height: 30px;
  384. // background: #F2F2F2;
  385. // color: #01B677;
  386. // text-indent: 6px;
  387. // font-size: inherit;
  388. // border-top-right-radius: 15px;
  389. // border-bottom-right-radius: 15px;
  390. // cursor: pointer;
  391. // }
  392. // .sel-opt select option{
  393. // position: relative;
  394. // }
  395. .points{
  396. position: absolute;
  397. top: -2px;
  398. right: 0;
  399. width: 10px;
  400. height: 10px;
  401. background: #F01516;
  402. border-radius: 50%;
  403. }
  404. .sel-cons{
  405. border: 1px solid #01B677;
  406. width: 50%;
  407. position: absolute;
  408. right: 0;
  409. top: 30px;
  410. text-indent: 10px;
  411. display: none;
  412. }
  413. .sc-lis{
  414. line-height: 30px;
  415. cursor: pointer;
  416. }
  417. .sc-lis span{
  418. position: relative;
  419. }
  420. .sc-lis .points{
  421. top: 2px;
  422. right: -16px;
  423. }
  424. .review_fram_table th{
  425. border:0!important;
  426. text-align: center;
  427. font-weight:normal!important;
  428. }
  429. .review_fram_table tr{
  430. background:none!important;
  431. }
  432. .review_fram_table tr:nth-child(2n) td:first-child{
  433. text-align: left;
  434. }
  435. .review_fram_table tr td:last-child span{
  436. background: #15ae68;
  437. color: #fff;
  438. padding: 5px 20px;
  439. border-radius: 3px;
  440. cursor:pointer;
  441. border:1px solid #15ae68;
  442. }
  443. .review_fram_table tr td:last-child span.status1{
  444. border:1px solid #15ae68;
  445. background: #fff;
  446. color: #15ae68;
  447. }
  448. .review_fram_table tr td:last-child span.status2{
  449. border:1px solid #ccc;
  450. background: #fff;
  451. color: #ccc;
  452. }
  453. .review_fram_table tr td:last-child span.status3{
  454. border:1px solid #ccc;
  455. background: #ccc;
  456. color: #fff;
  457. }
  458. .review_fram_table tr td:first-child,.review_fram_table tr td:last-child{
  459. text-align:center
  460. }
  461. </style>
  462. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  463. <div class="main-content-inner">
  464. <!-- 导航栏开始-->
  465. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  466. <!-- 导航栏结束-->
  467. <div class="page-content">
  468. <div class="row" style="margin:0px;">
  469. <div class="col-xs-12">
  470. <!-- PAGE CONTENT BEGINS -->
  471. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  472. <div class="row">
  473. <form method="get" id="form1" action="<?php echo $this->createUrl("print/student_product");?>">
  474. <div class="col-xs-12">
  475. <div class="dataTables_length margin-zy">
  476. <select class="form-control" id="grade" name="grade">
  477. <option value="">年级</option>
  478. <option value="1" <?php if($grade == 1) echo "selected";?>>高一</option>
  479. <option value="2" <?php if($grade == 2) echo "selected";?>>高二</option>
  480. <option value="3" <?php if($grade == 3) echo "selected";?>>高三</option>
  481. </select>
  482. <select class="form-control" id="class" name="class_id">
  483. <option value="">全部班级</option>
  484. <?php foreach($class_all as $class){
  485. if($grade){
  486. if($grade == $class->grade){
  487. ?>
  488. <option <?php if($class_id == $class->class_id) echo "selected";?> value="<?php echo $class->class_id;?>"><?php echo $class->class_name;?></option>
  489. <?php
  490. }
  491. }else{
  492. ?>
  493. <option <?php if($class_id == $class->class_id) echo "selected";?> value="<?php echo $class->class_id;?>"><?php echo $class->class_name;?></option>
  494. <?php
  495. } }?>
  496. </select>
  497. <select class="form-control" id="ptype" name="ptype">
  498. <option value="">类型</option>
  499. <option value="1" <?php if($ptype == 1) echo "selected";?>>期中</option>
  500. <option value="2" <?php if($ptype == 2) echo "selected";?>>期末</option>
  501. <option value="3" <?php if($ptype == 3) echo "selected";?>>总复习</option>
  502. </select>
  503. <select class="form-control" id="season" name="season">
  504. <option value="">季节</option>
  505. <option value="1" <?php if($season == 1) echo "selected";?>>春季</option>
  506. <option value="2" <?php if($season == 2) echo "selected";?>>秋季</option>
  507. </select>
  508. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  509. <!-- <button class="label-primary-s bth-s" id="generate_review" style="padding:4px 12px;">生成阶段复习个性化学习宝</button>-->
  510. <span class="label-primary-s bth-s fr" id="generate_review" style="display:inline-block; padding:4px 12px;margin-top:1px;cursor:pointer;">生成阶段复习学习宝</span>
  511. <span id="selectPrint" class="label-primary-s bth-s fr" style="display:inline-block; padding:4px 12px;margin-top:1px;cursor:pointer;">发送云印任务</span>
  512. <span id="batchPrint" class="label-primary-s bth-s fr" style="display:inline-block; padding:4px 12px;margin-top:1px;cursor:pointer;">批量下载</span>
  513. <span id="batchPrintToolsJieDuan" class="label-primary-s bth-s fr" style="display:inline-block; padding:4px 12px;margin-top:1px;cursor:pointer;">批量打印</span>
  514. </div>
  515. </div>
  516. </form>
  517. </div>
  518. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  519. <thead>
  520. <tr>
  521. <th class="center">
  522. <input type="checkbox" class="ace selectAll">
  523. </th>
  524. <th>名称</th>
  525. <th>季节</th>
  526. <th>班级</th>
  527. <th >已生成/总数</th>
  528. <th>是否下载/打印</th>
  529. <th >操作</th>
  530. </tr>
  531. </thead>
  532. <tbody>
  533. <?php if(!empty($class_data)){
  534. foreach($class_data as $cl){
  535. for($i=1;$i<7;$i++){
  536. //下载和云印,类型只有123,转换
  537. $turnType=$i;
  538. if($i==4){
  539. $turnType=1;
  540. }elseif($i==5){
  541. $turnType=2;
  542. }elseif($i==6){
  543. $turnType=3;
  544. }
  545. if($ptype ){
  546. if($ptype==1 && !in_array($i,array(1,4))){
  547. continue;
  548. }elseif($ptype==2 && !in_array($i,array(2,5))){
  549. continue;
  550. }elseif($ptype==3 && !in_array($i,array(3,6))){
  551. continue;
  552. }
  553. }
  554. if($season){
  555. if($season==1 && !in_array($i,array(1,2,3))){
  556. continue;
  557. }elseif($season==2 && !in_array($i,array(4,5,6))){
  558. continue;
  559. }
  560. }
  561. $disabled=false;
  562. if(Yii::app()->params['season_product']==1){
  563. //春季
  564. if(in_array($i,array(1,2,3))){
  565. $disabled=true;
  566. }
  567. }elseif(Yii::app()->params['season_product']==2){
  568. //秋季
  569. if(in_array($i,array(4,5,6))){
  570. $disabled=true;
  571. }
  572. }
  573. ?>
  574. <tr>
  575. <td>
  576. <?php if(Yii::app()->cache->getValue("cloud_print_task_fx_tfb_".$cl['class_id'].'_'.$cl['semester_id'].'_'.$turnType) != 1){?>
  577. <input type="checkbox" class="ace myselect" value="<?php echo $cl['class_id'];?>_<?php echo $turnType;?>_<?php switch($i){
  578. case 1:echo $semester_name."期中阶段复习学习宝";break;
  579. case 2:echo $semester_name."期末阶段复习学习宝";break;
  580. case 3:echo $semester_name."总复习学习宝";break;
  581. case 4:echo $semester_name."期中阶段复习学习宝";break;
  582. case 5:echo $semester_name."期末阶段复习学习宝";break;
  583. case 6:echo $semester_name."总复习学习宝";break;
  584. }?>">
  585. <?php }?>
  586. </td>
  587. <td style="max-width:260px"> <?php switch($i){
  588. case 1:echo $semester_name."期中阶段复习学习宝";break;
  589. case 2:echo $semester_name."期末阶段复习学习宝";break;
  590. case 3:echo $semester_name."总复习学习宝";break;
  591. case 4:echo $semester_name."期中阶段复习学习宝";break;
  592. case 5:echo $semester_name."期末阶段复习学习宝";break;
  593. case 6:echo $semester_name."总复习学习宝";break;
  594. }?> </td>
  595. <td style="max-width:100px"><?php if($i<4){echo '春季';}else{echo '秋季';}?></td>
  596. <td style="max-width:100px"><?php echo $cl->class_name;?></td>
  597. <td><?php if(isset($class_student[$cl->class_id]))
  598. {
  599. if(isset($class_create[$cl->class_id][$i]))
  600. {
  601. echo $class_create[$cl->class_id][$i]['student_sum'].'/'.count($class_student[$cl->class_id]);
  602. }else{
  603. echo "0/".count($class_student[$cl->class_id]);
  604. }
  605. }else
  606. {
  607. echo '0/0' ;
  608. }
  609. if(isset($class_bt[$cl->class_id])){
  610. if(isset($class_bt[$cl->class_id][$i])){
  611. echo '<span class="red" style="display: inline-block;float: right">补题中,请稍候</span>';
  612. }
  613. }
  614. ?></td>
  615. <td>
  616. <?php if(isset($class_student[$cl->class_id]))
  617. {
  618. if(isset($class_down[$cl->class_id][$i]))
  619. {
  620. if($class_down[$cl->class_id][$i]['student_sum'] == count($class_student[$cl->class_id]))
  621. {
  622. echo '已下载/打印';
  623. }else
  624. {
  625. echo '已下载/打印';
  626. }
  627. }else
  628. {
  629. echo '未下载/打印';
  630. }
  631. }else
  632. {
  633. echo '未下载/打印';
  634. }?>
  635. </td>
  636. <td style="width:265px;">
  637. <span class="iconfont click-sc addbx printToolsJieDuan" aria-hidden="true" title="打印<?php switch($turnType){
  638. case 1:echo "期中阶段复习学习宝";break;
  639. case 2:echo "期末阶段复习学习宝";break;
  640. case 3:echo "总复习学习宝";break;
  641. }?>" cid="<?php echo $cl['class_id'];?>" trun-type="<?php echo $turnType?>" >&#xe6bb;</span>
  642. <span class="iconfont click-sc addbx" aria-hidden="true" title="下载<?php switch($turnType){
  643. case 1:echo "期中阶段复习学习宝";break;
  644. case 2:echo "期末阶段复习学习宝";break;
  645. case 3:echo "总复习学习宝";break;
  646. }?>" onclick="printBook('<?php echo $cl['class_id'];?>',<?php echo $turnType?>)"><img src="/images/download.png" style="margin-bottom:-2px;"></span>
  647. <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('print/class_student_product',array('cid'=>$cl['class_id'],'type'=>$i))?>'">&#xe668;</span>
  648. <span class="iconfont click-sc addbx" <?php if(Yii::app()->cache->getValue("cloud_print_task_fx_tfb_".$cl['class_id'].'_'.$cl['semester_id'].'_'.$turnType) == 1) echo 'style="background-color:gray"';?> aria-hidden="true" title="<?php if(Yii::app()->cache->getValue("cloud_print_task_fx_tfb_".$cl['class_id'].'_'.$cl['semester_id'].'_'.$turnType) == 1){echo '24小时内不可重复发送';}else{echo '发送云印任务';};?>" onclick="sendCloudTask('<?php echo $cl['class_id'];?>','<?php echo $turnType;?>','<?php switch($turnType){
  649. case 1:echo $semester_name."期中阶段复习学习宝";break;
  650. case 2:echo $semester_name."期末阶段复习学习宝";break;
  651. case 3:echo $semester_name."总复习学习宝";break;
  652. }?>',<?php echo Yii::app()->cache->getValue("cloud_print_task_fx_tfb_".$cl['class_id'].'_'.$cl['semester_id'].'_'.$turnType) == 1 ? 1 :0;?>)">云</span>
  653. <?php if(isset(Yii::app()->session['testFlag']) && Yii::app()->session['testFlag']==1 && isset($cate3_rel_cate6[$i]) && $disabled):?>
  654. <span class="iconfont click-sc addbx reset-review" aria-hidden="true" class_id="<?php echo $cl['class_id'];?>" cate="<?php echo $cate3_rel_cate6[$i];?>" title="重置阶段复习学习宝"></span>
  655. <?php endif;?>
  656. </td>
  657. </tr>
  658. <?php }}}else{?>
  659. <tr><td colspan="8">暂无数据!</td></tr>
  660. <?php }?>
  661. </tbody>
  662. </table>
  663. <?php if(!empty($pape_count)){
  664. $times=6;
  665. if($season) $times=$times/2;
  666. if($ptype) $times=$times/3;
  667. ?>
  668. <div class="row">
  669. <div class="col-xs-6">
  670. &nbsp;
  671. </div>
  672. <div class="col-xs-6">
  673. <div class="dataTables_paginate paging_simple_numbers">
  674. <?php
  675. $this->widget('CLinkPager', array(
  676. 'header' => '',
  677. 'firstPageLabel'=> '首页',
  678. 'lastPageLabel' => '末页',
  679. 'prevPageLabel' => '上一页',
  680. 'nextPageLabel' => '下一页',
  681. 'pages' => $pages,
  682. 'maxButtonCount'=> 5,
  683. ));
  684. echo '共:'.($pape_count*$times).'条';
  685. ?>
  686. </div>
  687. </div>
  688. </div>
  689. <?php }?>
  690. </div>
  691. <!--上传模板弹窗-->
  692. <!--发送云印任务弹窗-->
  693. <div class="confirmbox-mask" id="classModal-1" style="display: none;">
  694. <div class="class-modal-1">
  695. <i class="icon icon-close-1" style="color: white">X</i><div class="class-modal-head-1">发送云印任务</div>
  696. <div class="class-modal-body-1">
  697. <div>
  698. <span>亲爱的学管:您正在发起云印任务,请核对以下云印任务数据!</span>
  699. <span style="float: right;">共<i id="task_count"></i>条任务,<i id="total_print_num">0</i>份云印任务</span>
  700. </div>
  701. <table style="margin-top: 15px;" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  702. <thead>
  703. <tr>
  704. <th>序号</th>
  705. <th>任务名称</th>
  706. <th>班级</th>
  707. <th>完成日期</th>
  708. <th>已生成/已开通/可下载</th>
  709. <th>已下载</th>
  710. <th>云印份数</th>
  711. <th>备注</th>
  712. </tr>
  713. </thead>
  714. <tbody id="taskList">
  715. </tbody>
  716. </table>
  717. <div style="margin-top: 40px;">
  718. <span><img width="20px" height="20px" src="/images/icon-tip.svg">发送后,请至学管端【IMS-云印任务】模块查看任务进程,请等待云印中心打印后,寄回给学校!</span>
  719. <span style="margin-left:15px;float: right;"><input id="filter-uploaded" checked="checked" type="checkbox">过滤【已下载】的学生</span>
  720. </div>
  721. <div class="btn_area" style="text-align: center;">
  722. <input type="hidden" id="sendJson" name="sendJson" value="">
  723. <button id="sendCloudPrint" class="download">发送</button>
  724. <button class="cancel">取消</button>
  725. </div>
  726. </div>
  727. </div>
  728. </div>
  729. <!-- PAGE CONTENT ENDS -->
  730. </div>
  731. </div>
  732. </div>
  733. </div>
  734. <!--阶段复习个性化学习宝弹框-->
  735. <div class="review_fram" style="display: none">
  736. <table class="table table-striped table-bordered table-hover dataTable no-footer review_fram_table DTTT_selectable"
  737. style="font-size:12px">
  738. <thead>
  739. <tr>
  740. <th>产品名称</th>
  741. <th>季节</th>
  742. <th>操作</th>
  743. </tr>
  744. </thead>
  745. <tbody>
  746. <?php foreach ($review_isp as $info):?>
  747. <?php foreach ($info['season_arr'] as $k => $v):
  748. $disabled=false;
  749. if(Yii::app()->params['season_product']==1){
  750. //春季
  751. if(in_array($v['category_id'],array(1,2,3))){
  752. $disabled=true;
  753. }
  754. }elseif(Yii::app()->params['season_product']==2){
  755. //秋季
  756. if(in_array($v['category_id'],array(4,5,6))){
  757. $disabled=true;
  758. }
  759. }
  760. ?>
  761. <tr>
  762. <?php if(!$k):?>
  763. <td rowspan="2"><?php echo $info['product_name'];?></td>
  764. <?php endif;?>
  765. <td><?php echo $v['category_name'];?></td>
  766. <td>
  767. <?php if($v['status'] == 1):?>
  768. <span class="status2">生成</span>
  769. <?php
  770. // if($v['reset_time']==0 || (isset(Yii::app()->session['testFlag']) && Yii::app()->session['testFlag']==1 && (time()-$v['reset_time'])>3600*2)){
  771. if($v['reset_time']==0 || (isset(Yii::app()->session['testFlag']) && Yii::app()->session['testFlag']==1 && (time()-$v['reset_time'])>600)){
  772. if($disabled){
  773. echo '<span cate="'.$v['category_id'].'" handle_type="reset" class="handle_btn">重置</span>';
  774. }else{
  775. echo '<span cate="'.$v['category_id'].'" handle_type="reset" class="status2">重置</span>';
  776. }
  777. }
  778. ?>
  779. <?php elseif($v['status'] == 90):?>
  780. <span class="status2">生成</span>
  781. <?php if(isset(Yii::app()->session['testFlag']) && Yii::app()->session['testFlag']==1 ):?>
  782. <span class="status2">重置</span>
  783. <?php endif;?>
  784. <?php else:?>
  785. <?php if($disabled):?>
  786. <span cate="<?php echo $v['category_id'];?>" handle_type="generat" class="handle_btn">生成</span>
  787. <?php else:?>
  788. <span cate="<?php echo $v['category_id'];?>" handle_type="generat" class="status2">生成</span>
  789. <?php endif;?>
  790. <?php if(isset(Yii::app()->session['testFlag']) && Yii::app()->session['testFlag']==1 ):?>
  791. <span class="status2" cate="<?php echo $v['category_id'];?>">重置</span>
  792. <?php endif;?>
  793. <?php endif;?>
  794. </td>
  795. </tr>
  796. <?php endforeach;?>
  797. <?php endforeach;?>
  798. </tbody>
  799. </table>
  800. </div>
  801. <?php require_once "_print.php"?>
  802. <script src="/js/jquery.ajaxfileupload.js"></script>
  803. <script type="text/javascript">
  804. $(document).ready(function(){
  805. /*var str = '<div class="points"></div>';
  806. $(".sc-lis").each(function(){
  807. if($(this).find(".points").length>0){
  808. $(".sel-opt").append(str);
  809. }
  810. });*/
  811. $(".sel-opt,.sel-cons").mouseover(function(){
  812. $(".sel-cons").show();
  813. }).mouseout(function(){
  814. $(".sel-cons").hide();
  815. });
  816. $(".sc-lis").click(function(){
  817. var data = {
  818. subjectId : $(this).attr('val')
  819. };
  820. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>",data,function(flags){
  821. if(flags)
  822. {
  823. location.reload();
  824. }else
  825. {
  826. alert('网络异常');
  827. }
  828. });
  829. $('.has-sel').text($(this).text());
  830. $(".sel-cons").hide();
  831. });
  832. $(".ruanyun").click(function(){
  833. var exam_id = $(this).attr('exam_id');
  834. layer.msg("确定发送吗?学生是否全部上传成绩", {
  835. time: 0,
  836. btn: ['确定', '取消'],
  837. yes: function(index){
  838. layer.close(index);
  839. $.ajax({
  840. url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
  841. type: "POST",
  842. dataType: "json",
  843. data:{ examId: exam_id
  844. },
  845. success: function (data){
  846. if(data.status == 1){
  847. layer.msg('发送成功',{
  848. icon: 1
  849. }, function(){
  850. layer.closeAll();
  851. location.reload();
  852. });
  853. }else if(data.status == 2){
  854. layer.msg('发送失败,未上传成绩',{
  855. icon: 5
  856. }, function(){
  857. layer.closeAll();
  858. location.reload();
  859. });
  860. }else{
  861. layer.msg('发送失败',{
  862. icon: 5
  863. }, function(){
  864. layer.closeAll();
  865. location.reload();
  866. });
  867. }
  868. },
  869. error: function (data, status, e){ //服务器响应失败处理函数
  870. layer.msg('返回失败!',{
  871. icon: 1
  872. }, function(){
  873. layer.closeAll();
  874. });
  875. }
  876. });
  877. }
  878. });
  879. });
  880. //生成阶段复习个性化学习宝
  881. $("#generate_review").click(function () {
  882. var review_fram = $(".review_fram").html();
  883. layer.open({
  884. type: 1,
  885. title: '生成阶段复习学习宝',
  886. btn: [],
  887. area: ['640px', '380px'], //宽高
  888. btnAlign: 'c',
  889. content: '<div style="padding:0 20px;margin:20px 0"><div id="review_fram_win">'+review_fram+'</div><p style="font-size: 12px;color:red;line-height: 20px;">报告只可生成一次,请大家慎重点击!!点击生成后,最晚一天后可进行下载使用(如果在当前月份还没有任何考试,误点击生成按钮,会在第一场考试结束后,自动生成)一定要看清日期!!</p></div>',
  890. btn2: function (index, layero) {
  891. }
  892. });
  893. });
  894. //重置班级
  895. $(".reset-review").click(function () {
  896. var btn_obj = $(this);
  897. var semester_id = "<?php echo $semester_id;?>";
  898. var class_id = btn_obj.attr('class_id');
  899. var category = btn_obj.attr('cate');
  900. var handle_type = 'reset';
  901. $.ajax({
  902. url: "<?php echo $this->createUrl('print/setReviewIsp');?>",
  903. type: "POST",
  904. dataType: "json",
  905. data: {
  906. semester_id: semester_id,
  907. class_id: class_id,
  908. category: category,
  909. handle_type:handle_type
  910. },
  911. success: function (data){
  912. if(data.status == 1){
  913. layer.msg('操作成功',{
  914. icon: 1,time:1000
  915. }, function(){
  916. // layer.closeAll();
  917. });
  918. $(this).hide();
  919. }else{
  920. layer.msg(data.msg,{
  921. icon: 5,time:2000
  922. }, function(){
  923. // layer.closeAll();
  924. });
  925. }
  926. },
  927. error: function (data, status, e){ //服务器响应失败处理函数
  928. layer.msg('返回失败!',{
  929. icon: 1
  930. }, function(){
  931. layer.closeAll();
  932. });
  933. }
  934. });
  935. });
  936. //设置阶段个性化学习宝
  937. $("body").delegate('.handle_btn','click',function () {
  938. var btn_obj = $(this);
  939. var semester_id = "<?php echo $semester_id;?>";
  940. var category = btn_obj.attr('cate');
  941. var handle_type = btn_obj.attr('handle_type');
  942. layer.confirm('确定要生成吗?', {
  943. btn: ['确定', '取消'] //按钮
  944. }, function () {
  945. layer.msg('正在发送',{
  946. icon: 1,time:5000
  947. }, function(){
  948. // layer.closeAll();
  949. });
  950. $.ajax({
  951. url: "<?php echo $this->createUrl('print/setReviewIsp');?>",
  952. type: "POST",
  953. dataType: "json",
  954. data: {
  955. semester_id: semester_id,
  956. category: category,
  957. handle_type:handle_type
  958. },
  959. success: function (data){
  960. if(data.status == 1){
  961. layer.msg('操作成功',{
  962. icon: 1,time:1000
  963. }, function(){
  964. // layer.closeAll();
  965. });
  966. if(handle_type == 'generat'){
  967. btn_obj.addClass('status2').removeClass('handle_btn').siblings('span').removeClass('status2');
  968. btn_obj.siblings('span').attr('handle_type','reset').addClass('handle_btn');
  969. }else{
  970. btn_obj.addClass('status2').removeClass('handle_btn');
  971. }
  972. $(".review_fram").html($("#review_fram_win").html());
  973. }else{
  974. layer.msg(data.msg,{
  975. icon: 5,time:2000
  976. }, function(){
  977. // layer.closeAll();
  978. });
  979. }
  980. },
  981. error: function (data, status, e){ //服务器响应失败处理函数
  982. layer.msg('返回失败!',{
  983. icon: 1
  984. }, function(){
  985. layer.closeAll();
  986. });
  987. }
  988. });
  989. });
  990. });
  991. });
  992. function objToJson(obj){
  993. var json = "{ ";
  994. for(var item in obj){
  995. json += "'"+item+"':'"+obj[item]+"',";
  996. }
  997. json += " }";
  998. return json;
  999. }
  1000. function ccc(){
  1001. layer.msg('敬请期待!', {
  1002. time: 0,
  1003. btn: ['确定', '取消'],
  1004. yes: function(index){
  1005. layer.close(index);
  1006. return false;
  1007. }
  1008. });
  1009. }
  1010. function delExam(odj){
  1011. if (!odj) return false;
  1012. var classId = odj.getAttribute("w_class_id");
  1013. var examId = odj.getAttribute("w_exam_id");
  1014. if (!classId || !examId) return false;
  1015. var msg = '您确定要删除此班的考试吗?';
  1016. layer.msg(msg, {
  1017. time: 0,
  1018. btn: ['确定', '取消'],
  1019. yes: function(index){
  1020. layer.close(index);
  1021. $.ajax({
  1022. url: "<?php echo $this->createUrl('print/delexam');?>",
  1023. type: "POST",
  1024. dataType: "json",
  1025. data: {
  1026. examId: examId,
  1027. classId:classId
  1028. },
  1029. success: function (data){
  1030. if(data.status == 1){
  1031. layer.msg('删除成功',{
  1032. icon: 1
  1033. }, function(){
  1034. layer.closeAll();
  1035. location.reload();
  1036. });
  1037. }else{
  1038. layer.msg('删除失败',{
  1039. icon: 5
  1040. }, function(){
  1041. layer.closeAll();
  1042. location.reload();
  1043. });
  1044. }
  1045. },
  1046. error: function (data, status, e){ //服务器响应失败处理函数
  1047. layer.msg('返回失败!',{
  1048. icon: 1
  1049. }, function(){
  1050. layer.closeAll();
  1051. });
  1052. }
  1053. });
  1054. }
  1055. });
  1056. }
  1057. // 确认上传成绩
  1058. function uploadConfirm(classId, examId,className,is_uploaded_count,students_count) {
  1059. //if (confirm('您确定已上传成绩了吗?')) {
  1060. msg = "<div style='text-align:left;'>("+className+")已上传(<span style=' font-size:20px;color:#15ae68 ;font-weight: bold'>"+is_uploaded_count+"</span>)份试卷,还有(<span style='font-size:20px;color: red;font-weight: bold'>"+(students_count-is_uploaded_count)+"</span>)份试卷未上传!是否确认本班级试卷都已上传?<br/><br/><span style='color: red'>请注意!试卷上传确认后将不能再次上传本班的试卷!!!</span></div>";
  1061. layer.msg(msg, {
  1062. time: 0,
  1063. btn: ['确定', '取消'],
  1064. yes: function(index, layerObj){
  1065. layer.close(index);
  1066. $.ajax({
  1067. url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
  1068. type: "POST",
  1069. data: {
  1070. classId: classId,
  1071. examId: examId
  1072. },
  1073. beforeSend:function(){
  1074. // 发送请求显示打印中
  1075. layer.msg('确认中...', {time: 20000});
  1076. },
  1077. dataType: "JSON",
  1078. success: function(data) {
  1079. if (data.status == 1) {
  1080. layer.msg('确认成功!');
  1081. setTimeout(function(){location.reload();}, 1300);
  1082. } else {
  1083. layer.msg(data.error);
  1084. }
  1085. },
  1086. complete:function(){
  1087. },
  1088. error:function(){
  1089. }
  1090. });
  1091. }
  1092. });
  1093. //}
  1094. }
  1095. // 打印错题本
  1096. function printBook(cid,type){
  1097. if (!cid || !type) {
  1098. layer.msg("打印参数有误");return;
  1099. }
  1100. var message = '';
  1101. var objUrl = '';
  1102. if (type == 1) {
  1103. message = "您确定要下载该班级期中阶段复习学习宝吗?";
  1104. //objUrl = "<?php echo $this->createUrl('print/download_student_product');?>";
  1105. divTitle = "期中阶段复习学习宝";
  1106. improveName = "期中阶段复习学习宝";
  1107. } else if (type == 2){
  1108. message = "您确定要下载该班级期末阶段复习学习宝吗?";
  1109. ///objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1110. divTitle = "期末阶段复习学习宝";
  1111. improveName = "期末阶段复习学习宝";
  1112. }else if (type == 3){
  1113. message = "您确定要下载该班级总复习学习宝吗?";
  1114. // objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1115. divTitle = "总复习学习宝";
  1116. improveName = "总复习学习宝";
  1117. }
  1118. else{
  1119. layer.msg("打印参数有误");return;
  1120. }
  1121. html = ""+
  1122. '<div style="padding:20px 30px 0px 30px">'+
  1123. '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
  1124. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1125. '<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>'+
  1126. '</div>'+
  1127. '</div>'+
  1128. "";
  1129. layer.msg(message, {
  1130. time: 0,
  1131. btn: ['确定', '取消'],
  1132. yes: function(index){
  1133. layer.close(index);
  1134. $.ajax({
  1135. url: "<?php echo $this->createUrl('productdownload/download_student_product');?>",
  1136. type: "GET",
  1137. dataType: "json",
  1138. data: { "classId": cid, "type": type},
  1139. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  1140. beforeSend:function(){
  1141. layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  1142. },
  1143. error: function (jqXHR, textStatus, errorThrown) {
  1144. if(textStatus=="timeout"){
  1145. $.ajax({
  1146. type:'GET',
  1147. url: "<?php echo $this->createUrl("productdownload/addSpTask");?>",
  1148. data: { "classId": cid, "type": type},
  1149. dataType: "json",
  1150. success:function (data) {
  1151. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
  1152. icon: 1,
  1153. yes:function(){
  1154. layer.closeAll();
  1155. }
  1156. });
  1157. }
  1158. })
  1159. }else {
  1160. layer.msg('返回失败!',{
  1161. icon: 5
  1162. }, function(){
  1163. layer.closeAll();
  1164. });
  1165. }
  1166. },
  1167. success: function (data){
  1168. layer.closeAll();
  1169. if(data.success == 1||data.success == 2){
  1170. layer.open({
  1171. type: 1,
  1172. area: ['550px', '220px'],
  1173. title: divTitle,
  1174. content: html,
  1175. success: function(index, layerObj){
  1176. 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>');
  1177. jQuery("#confirm, #cancel").on("click", function(){
  1178. layer.close(layerObj);
  1179. });
  1180. jQuery("#copy").on("click", function(){
  1181. jQuery("#url").select();
  1182. });
  1183. },
  1184. end: function(){
  1185. }
  1186. });
  1187. }else if(data.success == 3){
  1188. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
  1189. icon: 1,
  1190. yes:function(){
  1191. layer.closeAll();
  1192. }
  1193. });
  1194. }
  1195. else if(data.success == 0){
  1196. layer.msg(data.message, {"time": 3000});
  1197. }
  1198. },
  1199. });
  1200. }
  1201. });
  1202. }
  1203. // 上传试卷模板
  1204. function uploadTemplate(eid,name, type){
  1205. if (!eid) {
  1206. layer.msg('操作失败!');
  1207. return false;
  1208. }
  1209. if(type == 1)
  1210. forCheckUrl = "<?php echo $this->createUrl('print/verifyTpl');?>";
  1211. else
  1212. forCheckUrl = "<?php echo $this->createUrl('print/checkanswercard');?>";
  1213. $.post(forCheckUrl,{eid:eid},function(data){
  1214. var obj = JSON.parse(data);
  1215. var html ='<div class="layer_notice" style="padding:5px;">';
  1216. html +='<table class="table table-striped table-bordered table-hover ">';
  1217. html +='<thead class="thin-border-bottom">';
  1218. html +='<tr>';
  1219. html +='<th>试卷名称</th>';
  1220. html +='<th>是否上传</th>';
  1221. html +='<th>操作</th>';
  1222. html +='</tr>';
  1223. html +='</thead>';
  1224. html +='<tbody class="content_tbody">';
  1225. if (obj.success == 1) {
  1226. html +='<td>'+name+'</td><td><span style="color:red;">已上传</span></td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1227. } else {
  1228. html +='<td>'+name+'</td><td id="alreadUpload">未上传</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1229. }
  1230. html +='</tbody>';
  1231. html +='</table>';
  1232. html +='<span style="width:582px;display:inline-block;text-align:center;">';
  1233. html +='<button class="btn btn-success btn-sm" onclick="uploadWord('+type+')"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
  1234. html +='</span>';
  1235. html +='<input type="hidden" id="mpEid" value="'+eid+'">';
  1236. html +='</div>';
  1237. layer.open({
  1238. type: 1,
  1239. skin: 'layui-layer-rim', //加上边框
  1240. area: ['600px', '300px'], //宽高
  1241. content: html
  1242. });
  1243. });
  1244. }
  1245. function uploadWord(type) {
  1246. var paramEid = $('#mpEid').val();
  1247. if (!paramEid) {
  1248. layer.msg('没找到周周练ID!');
  1249. return false;
  1250. }
  1251. var obj_file = $("#word_file").val();
  1252. if (!obj_file) {
  1253. layer.msg('请选择上传文件');
  1254. return false;
  1255. }
  1256. var extStart = obj_file.lastIndexOf('.');
  1257. var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
  1258. if (extName != ".dotx" && extName != ".dotm") {
  1259. layer.msg('模板格式有误,请上传dotx格式word!');
  1260. return false;
  1261. }
  1262. $.ajaxFileUpload({
  1263. url: "<?php echo $this->createUrl('print/uploadTpl');?>", //用于文件上传的服务器端请求地址
  1264. secureuri: false, //是否需要安全协议,一般设置为false
  1265. fileElementId: 'word_file', //文件上传域的ID
  1266. dataType: 'text', //返回值类型 一般设置为json
  1267. data:{"eid":paramEid, "type": type},
  1268. success: function (data, status){
  1269. var obj = JSON.parse(data);
  1270. if (obj.success == 1) {
  1271. layer.msg(obj.message,{
  1272. icon: 1,
  1273. }, function(){
  1274. layer.closeAll();
  1275. });
  1276. $("#alreadUpload").html('<span style="color:red;">已上传</span>');
  1277. } else {
  1278. layer.msg(obj.message,{
  1279. icon: 1,
  1280. }, function(){
  1281. layer.closeAll();
  1282. });
  1283. }
  1284. },
  1285. error: function (data, status, e){ //服务器响应失败处理函数
  1286. layer.msg('返回失败!',{
  1287. icon: 1,
  1288. }, function(){
  1289. layer.closeAll();
  1290. });
  1291. }
  1292. });
  1293. return false;
  1294. }
  1295. // 搜索事件
  1296. $("#search").click(function(){
  1297. $("#form1").submit();
  1298. });
  1299. function print(cid,eid,tid,fg){
  1300. if (!cid || !eid) return false;
  1301. var msg = '';
  1302. if (tid == 0) {
  1303. if (fg == 1) {
  1304. msg = '打印答题卡';
  1305. } else {
  1306. msg = '您确定要打印该试卷嘛?';
  1307. }
  1308. } else if (tid == 1) {
  1309. msg = '您确定要打印该错题本嘛?';
  1310. } else if (tid == 2) {
  1311. msg = '您确定要打印该学习宝吗?';
  1312. }
  1313. layer.msg(msg, {
  1314. time: 0,
  1315. btn: ['确定', '取消'],
  1316. yes: function(index){
  1317. layer.close(index);
  1318. ajaxPrint(cid, eid, tid);
  1319. }
  1320. });
  1321. }
  1322. function ajaxPrint(cid, eid, tid) {
  1323. $.ajax({
  1324. url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
  1325. type:"post",
  1326. data:{cid:cid,eid:eid,tid:tid},
  1327. dataType: "json",
  1328. beforeSend:function(){
  1329. // 发送请求显示打印中
  1330. layer.msg('打印中', {icon: 16,time: 20000});
  1331. },
  1332. success:function(obj){
  1333. var index = layer.msg();
  1334. layer.close(index);
  1335. if (obj.success == 1) {
  1336. if (tid == 0) {//console.log(JSON.stringify(obj.message));
  1337. evaluationClient.printPaper(JSON.stringify(obj.message));
  1338. //alert('提交打印试卷成功!');
  1339. } else if (tid == 1) {
  1340. evaluationClient.printCTB(JSON.stringify(obj.message));
  1341. //alert('提交打印错题本成功!');
  1342. } else if (tid == 2) {
  1343. evaluationClient.printTFFA(JSON.stringify(obj.message));
  1344. //alert('提交打印提分册成功!');
  1345. } else {
  1346. layer.msg('操作错误!');
  1347. }
  1348. location.reload();
  1349. } else {//alert(obj.message);
  1350. layer.msg(obj.message);
  1351. }
  1352. },
  1353. complete:function(){
  1354. //layer.msg('打印失败!');
  1355. //var index = layer.msg();
  1356. //layer.close(index);
  1357. },
  1358. error:function(){
  1359. //var index = layer.msg();
  1360. //layer.close(index);
  1361. }
  1362. });
  1363. }
  1364. // 生成试卷模板
  1365. function createTemplate (eid,flag){
  1366. if (!eid) {
  1367. layer.msg('未找到周周练id');
  1368. }
  1369. var msg = '';
  1370. if (flag == 2) {
  1371. msg = '您确定要下载试卷嘛?';
  1372. } else if(flag == 1){
  1373. msg = '您确定要生成模板嘛?';
  1374. }
  1375. else if(flag == 3){
  1376. msg = "<div style='text-align:left;'>编辑答题卡注意事项:<br/>1、试卷的名字最多支持2行,字体的大小和字体种类保持原有格式不变<br/>2、选择题和填空题的答题区域中里面的内容和识别点不许更改<br/>3、整套试卷中所有的识别点不许更改<br/><br/>点击确定下载</div>";
  1377. }else if(flag == 4){
  1378. msg = "<div style='text-align:left;'>编辑题卡合一注意事项:<br/>1、试卷的名字最多支持2行,字体的大小和字体种类保持原有格式不变<br/>2、选择题和填空题的答题区域中里面的内容和识别点不许更改<br/>3、整套试卷中所有的识别点不许更改<br/><br/>点击确定下载</div>";
  1379. }else{
  1380. layer.msg("参数错误");
  1381. }
  1382. layer.msg(msg, {
  1383. time: 0,
  1384. btn: ['确定', '取消'],
  1385. yes: function(index){
  1386. layer.close(index);
  1387. $.post('<?php echo $this->createUrl('print/createtempelate');?>',{eid:eid},function(data){
  1388. var obj = JSON.parse(data);
  1389. if (obj.success == 1) {
  1390. if (flag == 2) {
  1391. evaluationClient.CreatePaperTiGan(JSON.stringify(obj.object));
  1392. } else if(flag == 1){
  1393. evaluationClient.createPaper(JSON.stringify(obj.object));
  1394. }
  1395. else if(flag == 3){
  1396. evaluationClient.CreatePaperDaTiKa(JSON.stringify(obj.object));
  1397. }else if(flag == 4){
  1398. evaluationClient.CreatePaperDaTiKa(JSON.stringify(obj.object));
  1399. }else{
  1400. layer.msg("参数错误");
  1401. }
  1402. } else {
  1403. layer.msg(obj.message);
  1404. }
  1405. });
  1406. }
  1407. });
  1408. }
  1409. function wb_html(odj){
  1410. if (!odj) return false;
  1411. var classId = odj.getAttribute("w_class_id");
  1412. var examId = odj.getAttribute("w_exam_id");
  1413. if (!classId || !examId) return false;
  1414. var msg = '您确定要生成该班级的错题本吗?';
  1415. layer.msg(msg, {
  1416. time: 0,
  1417. btn: ['确定', '取消'],
  1418. yes: function(index){
  1419. layer.close(index);
  1420. $.ajax({
  1421. url: "<?php echo $this->createUrl('client/wbhtml');?>",
  1422. type: "POST",
  1423. dataType: "json",
  1424. data: {
  1425. examId: examId,
  1426. classId:classId
  1427. },
  1428. success: function (data){
  1429. if(data > 0){
  1430. layer.msg('操作成功,重新生成错题本',{
  1431. icon: 1
  1432. }, function(){
  1433. layer.closeAll();
  1434. });
  1435. }else if(data==0){
  1436. layer.msg('操作失败,此班无错题本',{
  1437. icon: 1
  1438. }, function(){
  1439. layer.closeAll();
  1440. });
  1441. }
  1442. else{
  1443. layer.msg('操作失败,重新生成错题本',{
  1444. icon: 1
  1445. }, function(){
  1446. layer.closeAll();
  1447. });
  1448. }
  1449. },
  1450. error: function (data, status, e){ //服务器响应失败处理函数
  1451. layer.msg('返回失败!',{
  1452. icon: 1
  1453. }, function(){
  1454. layer.closeAll();
  1455. });
  1456. }
  1457. });
  1458. }
  1459. });
  1460. }
  1461. function isp2_html(odj){
  1462. if (!odj) return false;
  1463. var classId = odj.getAttribute("w_class_id");
  1464. var examId = odj.getAttribute("w_exam_id");
  1465. if (!classId || !examId) return false;
  1466. var msg = '您确定要生成该班级的二步提分方案吗?';
  1467. layer.msg(msg, {
  1468. time: 0,
  1469. btn: ['确定', '取消'],
  1470. yes: function(index){
  1471. layer.close(index);
  1472. $.ajax({
  1473. url: "<?php echo $this->createUrl('client/isp2html');?>",
  1474. type: "POST",
  1475. dataType: "json",
  1476. data: {
  1477. examId: examId,
  1478. classId:classId
  1479. },
  1480. success: function (data){
  1481. if(data > 0){
  1482. layer.msg('操作成功,重新生成提分方案',{
  1483. icon: 1
  1484. }, function(){
  1485. layer.closeAll();
  1486. });
  1487. }else if(data==0){
  1488. layer.msg('操作失败,此班无提分方案',{
  1489. icon: 1
  1490. }, function(){
  1491. layer.closeAll();
  1492. });
  1493. }
  1494. else{
  1495. layer.msg('操作失败,重新生成提分方案',{
  1496. icon: 1
  1497. }, function(){
  1498. layer.closeAll();
  1499. });
  1500. }
  1501. },
  1502. error: function (data, status, e){ //服务器响应失败处理函数
  1503. layer.msg('返回失败!',{
  1504. icon: 1
  1505. }, function(){
  1506. layer.closeAll();
  1507. });
  1508. }
  1509. });
  1510. }
  1511. });
  1512. }
  1513. function isp3_html(odj){
  1514. if (!odj) return false;
  1515. var classId = odj.getAttribute("w_class_id");
  1516. var examId = odj.getAttribute("w_exam_id");
  1517. if (!classId || !examId) return false;
  1518. var msg = '您确定要生成该班级的学习宝吗?';
  1519. layer.msg(msg, {
  1520. time: 0,
  1521. btn: ['确定', '取消'],
  1522. yes: function(index){
  1523. layer.close(index);
  1524. $.ajax({
  1525. url: "<?php echo $this->createUrl('client/isp3html');?>",
  1526. type: "POST",
  1527. dataType: "json",
  1528. data: {
  1529. examId: examId,
  1530. classId:classId
  1531. },
  1532. success: function (data){
  1533. if(data > 0){
  1534. layer.msg('操作成功,重新生成提分方案',{
  1535. icon: 1
  1536. }, function(){
  1537. layer.closeAll();
  1538. });
  1539. }else if(data==0){
  1540. layer.msg('操作失败,此班无提分方案',{
  1541. icon: 1
  1542. }, function(){
  1543. layer.closeAll();
  1544. });
  1545. }
  1546. else{
  1547. layer.msg('操作失败,重新生成提分方案',{
  1548. icon: 1
  1549. }, function(){
  1550. layer.closeAll();
  1551. });
  1552. }
  1553. },
  1554. error: function (data, status, e){ //服务器响应失败处理函数
  1555. layer.msg('返回失败!',{
  1556. icon: 1
  1557. }, function(){
  1558. layer.closeAll();
  1559. });
  1560. }
  1561. });
  1562. }
  1563. });
  1564. }
  1565. // 隐藏试卷
  1566. function oprateExam(examId,flag){
  1567. if (examId) {
  1568. layer.msg('未找到周周练id');
  1569. }
  1570. var msg = '您确定要隐藏该试卷吗?';
  1571. if (flag == 0) {
  1572. msg = '您确定要恢复该试卷吗?';
  1573. }
  1574. layer.msg(msg, {
  1575. time: 0,
  1576. btn: ['确定', '取消'],
  1577. yes: function(index){
  1578. layer.close(index);
  1579. $.post('<?php echo $this->createUrl("print/oprateexam");?>',{examId:examId,flag:flag},function(data){
  1580. var obj = JSON.parse(data);
  1581. if (obj.success == 1) {
  1582. location.reload();
  1583. } else {
  1584. layer.msg(obj.message);
  1585. }
  1586. });
  1587. }
  1588. });
  1589. }
  1590. //批量发送云印任务
  1591. $("#selectPrint").click(function() {
  1592. // 判断是否有选中
  1593. if (!$("input[class='ace myselect']").is(':checked')) {
  1594. layer.msg('至少选择一个目标!');
  1595. return false;
  1596. }
  1597. var result = [];
  1598. $(".myselect").each(function(m,n){
  1599. if ($(this).prop('checked')) {
  1600. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1601. result.push($(this).val());
  1602. }
  1603. }
  1604. });
  1605. var sp = [];
  1606. var cid = 0;
  1607. var type = 0;
  1608. var taskName = '';
  1609. var saveDataAry=[];
  1610. var data1 = [];
  1611. for(i=0;i<result.length;i++)
  1612. {
  1613. sp = result[i].split('_');
  1614. cid = sp[0];
  1615. type = sp[1];
  1616. taskName = sp[2];
  1617. if( !cid || !type || !taskName) continue;
  1618. data1 = {"classId": cid, "type": type,"taskName":taskName};
  1619. saveDataAry.push(data1);
  1620. }
  1621. $.ajax({
  1622. type: "POST",
  1623. url: "<?php echo $this->createUrl("printCloud/generateFxTfbTask");?>",
  1624. dataType: "json",
  1625. contentType: "application/json",
  1626. data: JSON.stringify(saveDataAry),
  1627. beforeSend:function(){
  1628. layer.load(1, {
  1629. shade: [0.1,'#fff'] //0.1透明度的白色背景
  1630. });
  1631. },
  1632. success:function(data) {
  1633. var index = layer.load();
  1634. layer.close(index);
  1635. if (data.status == 1) {
  1636. $('#sendJson').attr('value', JSON.stringify(data));
  1637. var con = '';
  1638. var task_count = 0;
  1639. var totalCount = 0;
  1640. $.each(data.data, function(index, item) {
  1641. var one_count = item.enable_download_count - item.download_count;
  1642. totalCount += (one_count>0?one_count:0);
  1643. if((item.enable_download_count - item.download_count)>0) {
  1644. task_count += 1;
  1645. }
  1646. con += '<tr><td>' + (index + 1) + '</td><td>' + item.taskName + '</td><td>' + item.clazzName + '</td><td>' + item.complete_time + '</td><td>'
  1647. + item.generate_count + '/' + item.dredge_count + '/' + '<i style="color: green">' + item.enable_download_count + '</i><input type="hidden" name="drege_count" value="'+ item.enable_download_count +'"></td><td>'
  1648. + item.download_count + '</td><td>' + (one_count>0?one_count:0) + '</td><td>' + (one_count>0?'可发送':'不可发送')
  1649. + '</td></tr>'
  1650. });
  1651. $('#task_count').html(task_count);
  1652. $('#total_print_num').html(totalCount);
  1653. $('#taskList').html(con);
  1654. $('#filter-uploaded').prop("checked", true);
  1655. $('.confirmbox-mask').show();
  1656. } else if (data.status == 0) {
  1657. layer.msg(data.message);
  1658. }
  1659. }
  1660. }
  1661. );
  1662. });
  1663. // 生成任务列表
  1664. function sendCloudTask(cid,type,taskName,isDisable){
  1665. if(isDisable === 1){
  1666. return false;
  1667. }
  1668. if (!cid || !type) {
  1669. layer.msg("参数有误");return;
  1670. }
  1671. var saveDataAry=[];
  1672. var data1={"classId": cid, "type": type,'taskName':taskName};
  1673. saveDataAry.push(data1);
  1674. $.ajax({
  1675. type: "POST",
  1676. url: "<?php echo $this->createUrl("printCloud/generateFxTfbTask");?>",
  1677. dataType: "json",
  1678. contentType: "application/json",
  1679. data: JSON.stringify(saveDataAry),
  1680. beforeSend:function(){
  1681. layer.load(1, {
  1682. shade: [0.1,'#fff'] //0.1透明度的白色背景
  1683. });
  1684. },
  1685. success:function(data) {
  1686. var index = layer.load();
  1687. layer.close(index);
  1688. if (data.status == 1) {
  1689. $('#sendJson').attr('value', JSON.stringify(data));
  1690. var con = '';
  1691. var task_count = 0;
  1692. var totalCount = 0;
  1693. $.each(data.data, function(index, item) {
  1694. var one_count = item.enable_download_count - item.download_count;
  1695. totalCount += (one_count>0?one_count:0);
  1696. if((item.enable_download_count - item.download_count)>0) {
  1697. task_count += 1;
  1698. }
  1699. con += '<tr><td>' + (index + 1) + '</td><td>' + item.taskName + '</td><td>' + item.clazzName + '</td><td>' + item.complete_time + '</td><td>'
  1700. + item.generate_count + '/' + item.dredge_count + '/' + '<i style="color: green">' + item.enable_download_count + '</i><input type="hidden" name="drege_count" value="'+ item.enable_download_count +'"></td><td>'
  1701. + item.download_count + '</td><td>' + (one_count>0?one_count:0) + '</td><td>' + (one_count>0?'可发送':'不可发送')
  1702. + '</td></tr>'
  1703. });
  1704. $('#task_count').html(task_count);
  1705. $('#total_print_num').html(totalCount);
  1706. $('#taskList').html(con);
  1707. $('#filter-uploaded').prop("checked", true)
  1708. $('.confirmbox-mask').show();
  1709. } else if (data.status == 0) {
  1710. layer.msg(data.message);
  1711. }
  1712. }
  1713. }
  1714. );
  1715. }
  1716. // 全选\反选
  1717. $(".selectAll").click(function(){
  1718. if ($(this).prop("checked")) {
  1719. var s_obj = $(".myselect");
  1720. var s_len = s_obj.length;
  1721. for (var i=0;i<s_len;i++) {
  1722. if (!s_obj[i].disabled) {
  1723. s_obj[i].checked=true;
  1724. }
  1725. }
  1726. } else {
  1727. $(".myselect").prop("checked",false);
  1728. }
  1729. });
  1730. //过滤已下载学生
  1731. $('#filter-uploaded').click(function () {
  1732. if($(this).is(':checked')){
  1733. var totalCount = 0;
  1734. var task_count = 0;
  1735. $('#taskList tr').each(function () {
  1736. var enable_count = parseInt($(this).children("td:eq(4)").children('i').html());
  1737. var dowanload_count = parseInt($(this).children("td:eq(5)").html());
  1738. $(this).children("td:eq(6)").html((enable_count-dowanload_count)>0?(enable_count-dowanload_count):0);
  1739. totalCount += ((enable_count-dowanload_count)>0?(enable_count-dowanload_count):0);
  1740. if((enable_count-dowanload_count)==0){
  1741. $(this).children("td:eq(7)").html('不可发送');
  1742. }else{
  1743. $(this).children("td:eq(7)").html('可发送');
  1744. task_count += 1;
  1745. }
  1746. });
  1747. $('#task_count').html(task_count);
  1748. $('#total_print_num').html(totalCount)
  1749. }else {
  1750. var totalCount = 0;
  1751. var task_count = 0;
  1752. $('#taskList tr').each(function () {
  1753. var enable_count = $(this).children("td:eq(4)").children('i').html();
  1754. $(this).children("td:eq(6)").html(enable_count);
  1755. totalCount += parseInt(enable_count);
  1756. if(enable_count==0){
  1757. $(this).children("td:eq(7)").html('不可发送');
  1758. }else{
  1759. $(this).children("td:eq(7)").html('可发送');
  1760. task_count += 1;
  1761. }
  1762. });
  1763. $('#task_count').html(task_count);
  1764. $('#total_print_num').html(totalCount);
  1765. $('#filter-uploaded').attr('isFilter',0)
  1766. }
  1767. });
  1768. //发送云印任务(真正发送)
  1769. $('#sendCloudPrint').click(function (){
  1770. var task_count = parseInt($('#task_count').html());
  1771. if(task_count === 0){
  1772. layer.msg('没有可发送的任务');
  1773. return false;
  1774. }
  1775. var json_data = $('#sendJson').val();
  1776. var is_filter = $('#filter-uploaded').is(':checked') ? 1 : 0;
  1777. $.post({
  1778. url: "<?php echo $this->createUrl("printCloud/sendFxTfbTask");?>",
  1779. data: {
  1780. 'json_data' : json_data,
  1781. 'is_filter' : is_filter,
  1782. },
  1783. dataType: "json",
  1784. beforeSend:function(){
  1785. layer.load(1, {
  1786. shade: [0.1,'#fff'] //0.1透明度的白色背景
  1787. });
  1788. },
  1789. success:function(data) {
  1790. var index = layer.load();
  1791. layer.close(index);
  1792. if (data.status == 1) {
  1793. layer.msg('操作成功,请耐心等待后台打包');
  1794. $('.confirmbox-mask').hide();
  1795. location.reload();
  1796. } else if (data.status == 0) {
  1797. layer.msg(data.message);
  1798. }
  1799. }
  1800. });
  1801. })
  1802. $('.confirmbox-mask .icon-close-1').click(function () {
  1803. $('.confirmbox-mask').hide();
  1804. })
  1805. $('.confirmbox-mask .cancel').click(function () {
  1806. $('.confirmbox-mask').hide();
  1807. })
  1808. //批量下载
  1809. $("#batchPrint").click(function(){
  1810. var message = "您确定要批量下载该产品吗?";
  1811. // 判断是否有选中
  1812. if (!$("input[class='ace myselect']").is(':checked')) {
  1813. layer.msg('至少选择一个目标!');
  1814. return false;
  1815. }
  1816. var result = [];
  1817. $(".myselect").each(function(m,n){
  1818. if ($(this).prop('checked')) {
  1819. if ($(this).val() /*&& $(this).attr("stnm")*/) {
  1820. result.push($(this).val());
  1821. }
  1822. }
  1823. })
  1824. var sp = [];
  1825. var cid = 0;
  1826. var type = 0;
  1827. var saveDataAry=[];
  1828. var data1 = [];
  1829. for(i=0;i<result.length;i++)
  1830. {
  1831. sp = result[i].split('_');
  1832. cid = sp[0];
  1833. type = sp[1];
  1834. if(!cid || !type) continue;
  1835. data1 = {"classId": cid, "type": type,"printType":"<?php echo $printType;?>"};
  1836. saveDataAry.push(data1);
  1837. }
  1838. layer.msg(message, {
  1839. time: 0,
  1840. btn: ['确定', '取消'],
  1841. yes: function(index){
  1842. layer.close(index);
  1843. $.ajax({
  1844. type: "POST",
  1845. url: "<?php echo $this->createUrl('productdownload/batchSp');?>",
  1846. dataType: "json",
  1847. contentType: "application/json",
  1848. data: JSON.stringify(saveDataAry),
  1849. success: function (data){
  1850. layer.closeAll();
  1851. if(data.success == 1) {
  1852. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
  1853. icon: 1,
  1854. yes: function () {
  1855. layer.closeAll();
  1856. }
  1857. });
  1858. }else {
  1859. layer.msg(data.message);
  1860. }
  1861. },
  1862. });
  1863. }
  1864. });
  1865. });
  1866. </script>