group_list_united.php 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725
  1. <script type="text/javascript">
  2. function in_array(search, array) {
  3. for (var i in array) {
  4. if (array[i] == search) {
  5. return true;
  6. }
  7. }
  8. return false;
  9. }
  10. testFlag = "<?php echo $this->testFlag;?>";
  11. customTplsIds = new Array();
  12. var i = 0;
  13. <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
  14. customTplsIds[i] = "<?php echo $tplId;?>";
  15. i++;
  16. <?php }?>
  17. jQuery(document).ready(function () {
  18. // 打印答案解析
  19. $(".answerAnalysis").click(function () {
  20. var element = this;
  21. layer.msg('您确定下载答案解析嘛?', {
  22. time: 0,
  23. btn: ['确定', '取消'],
  24. yes: function (index) {
  25. layer.close(index);
  26. var wpCode = jQuery(element).attr("examId");
  27. if (!wpCode) {
  28. layer.msg('周周练id有误!');
  29. return false;
  30. }
  31. jQuery.post(
  32. '<?php echo $this->createUrl('print/createtempelate');?>',
  33. {"eid": wpCode, "flag": 0},
  34. function (data) {
  35. var obj = JSON.parse(data);
  36. if (obj.success == 1) {
  37. /*alert(obj.message);
  38. alert(obj);*/
  39. evaluationClient.printDAJX(JSON.stringify(obj.object));
  40. } else {
  41. layer.msg(obj.message);
  42. }
  43. }
  44. );
  45. }
  46. });
  47. });
  48. //发送/取消/重新发送标注
  49. var flag = true;
  50. $(".sendLabelTask").bind("click", function () {
  51. var examId = jQuery(this).attr("examId");
  52. var examName = jQuery(this).attr("examName");
  53. var subjectId = jQuery(this).attr("subjectId");
  54. var createTime = jQuery(this).attr("createTime");
  55. var type = jQuery(this).attr("type");
  56. var status = jQuery(this).attr("status");
  57. var _this = jQuery(this);
  58. if (type=='cancel') {
  59. //取消标注
  60. layer.msg('本次考试不需要后台老师标注吗?', {
  61. time: 0,
  62. btn: ['确定', '取消'],
  63. yes: function (index) {
  64. _this.removeClass('sendlabeltask');
  65. _this.unbind();
  66. layer.close(index);
  67. if (flag){
  68. flag = false;
  69. jQuery.post(
  70. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  71. {"examId": examId, "examName": examName, "createTime": createTime, 'type': type,'status':status},
  72. function (data) {
  73. data = JSON.parse(data);
  74. if (data.success == 1) {
  75. layer.alert('取消成功', {'icon': 1,'closeBtn':0}, function () {
  76. location.reload();
  77. });
  78. }else if (data.success == 2){
  79. layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
  80. location.reload();
  81. });
  82. }
  83. else {
  84. flag = true;
  85. layer.msg(data.message);
  86. }
  87. }
  88. );
  89. }
  90. }
  91. });
  92. }else{
  93. if (flag){
  94. flag = false;
  95. indexSend=layer.msg('正在发送,请稍候......',{time:0});
  96. jQuery.post(
  97. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  98. {"examId": examId, "examName": examName, "createTime": createTime,'type': type,'status':status},
  99. function (data) {
  100. layer.close(indexSend);
  101. data = JSON.parse(data);
  102. if (data.success == 1) {
  103. layer.msg('发送成功');
  104. setTimeout(function () {
  105. location.reload();
  106. }, 2000);
  107. }else if (data.success == 2){
  108. layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
  109. location.reload();
  110. });
  111. }
  112. else {
  113. flag = true;
  114. layer.msg(data.message);
  115. }
  116. }
  117. );
  118. }
  119. }
  120. });
  121. jQuery(".enterStudentsList1").click(function () {
  122. layer.msg("请先发送标注任务");
  123. });
  124. jQuery(".paperType").click(function () {
  125. var is_show = jQuery(this).attr("is_show");
  126. if (is_show > 0) {
  127. return false;
  128. }
  129. var _display = '';
  130. var examId = jQuery(this).attr("examId");
  131. var tpl_index = jQuery(this).attr("tpl_index");
  132. if (in_array(jQuery(this).attr("tpl_index"), customTplsIds)) {
  133. if (in_array(jQuery(this).attr("tpl_index"), [1010, 1009, 10, 1011, 7, 2011, 3011, 11, 3007, 4007])) {
  134. var style = "width:200px;color:gray; ";
  135. var state = "disabled";
  136. } else {
  137. _display = '';
  138. var style = "width:200px;";
  139. var state = "enabled";
  140. }
  141. }
  142. else {
  143. _display = '';
  144. var style = "width:200px;color:gray;";
  145. var state = "disabled";
  146. }
  147. var mar = 'margin:10px auto;';
  148. html = "" +
  149. '<div style="padding:10px 30px">' +
  150. '<div style="margin:5px 0; float: left;' + _display + '">选择纸张:</div>' +
  151. '<div style="float: left"><select id="paperSize" style="' + style + '" ' + state + ' >' +
  152. '<option value="A3" ';
  153. if (jQuery(this).attr("paper_size") == 'A3') {
  154. html = html + 'selected';
  155. }
  156. html = html + '>A3</option>' +
  157. '<option value="A4" ';
  158. if (jQuery(this).attr("paper_size") == 'A4') {
  159. html = html + 'selected';
  160. }
  161. html = html + '>A4</option>' +
  162. '<option value="8K" ';
  163. if (jQuery(this).attr("paper_size") == '8K') {
  164. html = html + 'selected';
  165. }
  166. html = html + '>8K</option>' +
  167. '<option value="16K" ';
  168. if (jQuery(this).attr("paper_size") == '16K') {
  169. html = html + 'selected';
  170. }
  171. html = html + '>16K</option>' +
  172. '</select></div>' +
  173. '<div style="padding-top:10px;clear: left"></div>';
  174. html = html + '<div class="row" style="' + mar + 'text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>' +
  175. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>' +
  176. '<div>注意:<br/>切换完答题卡纸张类型后请记住使用切换后的答题卡类型打印复印</div>' +
  177. '</div>' +
  178. "";
  179. layer.open({
  180. type: 1,
  181. area: ['350px', '250px'],
  182. title: "更改试卷",
  183. content: html,
  184. success: function (index, layerObj) {
  185. jQuery("#cancel").on("click", function () {
  186. layer.closeAll();
  187. });
  188. jQuery("#confirm").on("click", function () {
  189. var paperSize = jQuery("#paperSize").val();
  190. jQuery.post(
  191. "<?php echo $this->createUrl("print/setpapersize");?>",
  192. {"examId": examId, "paperSize": paperSize, "tpl_index": tpl_index},
  193. function (data) {
  194. data = JSON.parse(data);
  195. layer.msg(data.message);
  196. if (data.success == 1) {
  197. setTimeout(function () {
  198. location.reload();
  199. }, 1300);
  200. }
  201. }
  202. );
  203. layer.closeAll();
  204. });
  205. },
  206. end: function () {
  207. }
  208. });
  209. });
  210. jQuery(".maskType").click(function () {
  211. var is_show = jQuery(this).attr("is_show");
  212. if (is_show > 0) {
  213. return false;
  214. }
  215. var _display = '';
  216. var exam_group_id = jQuery(this).attr("examId");
  217. var tpl_index = jQuery(this).attr("tpl_index");
  218. var mar = 'margin:30px auto;';
  219. html = "" +
  220. '<div style="padding:10px 30px">' +
  221. '<div style="padding-top:10px;clear: left"></div>' +
  222. '<div style="margin:5px 0; float: left;';
  223. if (parseInt(jQuery(this).attr("mark_type")) != 0 && parseInt(jQuery(this).attr("mark_type")) != 3) {
  224. html = html + 'display:none';
  225. mar = 'margin:0px auto;';
  226. }
  227. html = html + '">阅卷方式:</div>' +
  228. '<div style="float: left"><select id="mark_type" style="width:200px;';
  229. if (parseInt(jQuery(this).attr("mark_type")) != 0 && parseInt(jQuery(this).attr("mark_type")) != 3) {
  230. html = html + 'display:none';
  231. }
  232. html = html + '">' +
  233. '<option value="0" ';
  234. if (jQuery(this).attr("mark_type") == '0') {
  235. html = html + 'selected';
  236. }
  237. html = html + '>线下阅卷</option>';
  238. html = html + ' <option value="3" ';
  239. if (jQuery(this).attr("mark_type") == '3') {
  240. html = html + 'selected';
  241. }
  242. html = html + '>班级混合阅卷</option> ' +
  243. '</select></div>' +
  244. '<div class="row" style="' + mar + 'text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>' +
  245. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>' +
  246. '<div>注意:<br/>1、班级单独阅卷暂时不能与其他阅卷方式相互切换<br/>2、固定模板不能切换答题卡模板类型,只有自定义的可以<br/></div>' +
  247. '</div>' +
  248. "";
  249. layer.open({
  250. type: 1,
  251. area: ['350px', '300px'],
  252. title: "更改试卷",
  253. content: html,
  254. success: function (index, layerObj) {
  255. jQuery("#cancel").on("click", function () {
  256. layer.closeAll();
  257. });
  258. jQuery("#confirm").on("click", function () {
  259. var mark_type = jQuery("#mark_type").val();
  260. jQuery.post(
  261. "<?php echo $this->createUrl("print/Setmasktype");?>",
  262. {"exam_group_id": exam_group_id, "mark_type": mark_type, "tpl_index": tpl_index},
  263. function (data) {
  264. data = JSON.parse(data);
  265. layer.msg(data.message);
  266. if (data.success == 1) {
  267. setTimeout(function () {
  268. location.reload();
  269. }, 1300);
  270. }
  271. }
  272. );
  273. layer.closeAll();
  274. });
  275. },
  276. end: function () {
  277. }
  278. });
  279. });
  280. // 根据年级筛选班级
  281. jQuery("#grade").change(function () {
  282. var grade = $(this).val();
  283. if (!grade) return false;
  284. jQuery.post(
  285. '<?php echo $this->createUrl("print/getGradeClass");?>', {"grade": grade}, function (data) {
  286. data = JSON.parse(data);
  287. if (data.success == 1) {
  288. var classObj = $("#class");
  289. var html = "<option value=''>全部班级</option>";
  290. classObj.empty();
  291. $.each(data.message, function (i, n) {
  292. html += "<option value='" + n.class_id + "'>" + n.class_name + "</option>";
  293. });
  294. classObj.append(html);
  295. }
  296. }
  297. );
  298. });
  299. });
  300. </script>
  301. <style>
  302. /*切换选择*/
  303. .tab-con {
  304. position: relative;
  305. height: 30px;
  306. width: 200px;
  307. background: #F2F2F2;
  308. border: 1px solid #01B677;
  309. border-radius: 15px;
  310. }
  311. .has-sel {
  312. background: #01B677;
  313. color: #fff;
  314. width: 50%;
  315. height: 30px;
  316. border-top-left-radius: 15px;
  317. border-bottom-left-radius: 15px;
  318. text-align: center;
  319. line-height: 30px;
  320. }
  321. .sel-opt {
  322. width: 50%;
  323. position: relative;
  324. color: #01B677;
  325. line-height: 30px;
  326. text-indent: 6px;
  327. cursor: pointer;
  328. }
  329. .sel-opt:after {
  330. content: '';
  331. border-left: 6px solid transparent;
  332. border-right: 6px solid transparent;
  333. border-top: 8px solid #01B677;
  334. position: absolute;
  335. right: 12px;
  336. top: 12px;
  337. }
  338. /
  339. /
  340. .sel-opt select {
  341. / / width: 100 %;
  342. / / height: 30 px;
  343. / / background: #F2F2F2;
  344. / / color: #01B677;
  345. / / text-indent: 6 px;
  346. / / font-size: inherit;
  347. / / border-top-right-radius: 15 px;
  348. / / border-bottom-right-radius: 15 px;
  349. / / cursor: pointer;
  350. / /
  351. }
  352. /
  353. /
  354. .sel-opt select option {
  355. / / position: relative;
  356. / /
  357. }
  358. .points {
  359. position: absolute;
  360. top: -2px;
  361. right: 0;
  362. width: 10px;
  363. height: 10px;
  364. background: #F01516;
  365. border-radius: 50%;
  366. }
  367. .sel-cons {
  368. border: 1px solid #01B677;
  369. width: 50%;
  370. position: absolute;
  371. right: 0;
  372. top: 30px;
  373. text-indent: 10px;
  374. display: none;
  375. }
  376. .sc-lis {
  377. line-height: 30px;
  378. cursor: pointer;
  379. }
  380. .sc-lis span {
  381. position: relative;
  382. }
  383. .sc-lis .points {
  384. top: 2px;
  385. right: -16px;
  386. }
  387. .ellipsis { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
  388. .class_btn{text-align: center}
  389. </style>
  390. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
  391. <link rel="stylesheet" href="/css/alert.css"/>
  392. <div class="main-content-inner">
  393. <!-- 导航栏开始-->
  394. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  395. <!-- 导航栏结束-->
  396. <div class="page-content">
  397. <div class="row" style="margin:0px;">
  398. <div class="col-xs-12">
  399. <!-- PAGE CONTENT BEGINS -->
  400. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  401. <div class="row">
  402. <form method="get" id="form1" action="<?php echo $this->createUrl("print/united"); ?>">
  403. <div class="col-xs-12">
  404. <div class="dataTables_length margin-zy">
  405. <?php if($sub_id != 8):?>
  406. <select class="form-control" id="labelled" name="labelled">
  407. <option value="-1">标注状态</option>
  408. <option value="0" <?php if ($labelled === '0') echo "selected"; ?> >未发送</option>
  409. <option value="2" <?php if ($labelled == 2) echo "selected"; ?> >已发送未开始</option>
  410. <option value="1" <?php if ($labelled == 1) echo "selected"; ?>>已标注</option>
  411. <option value="3" <?php if ($labelled == 3) echo "selected"; ?> >标注中</option>
  412. <option value="4" <?php if ($labelled == 4) echo "selected"; ?> >已取消</option>
  413. <option value="5" <?php if ($labelled == 5) echo "selected"; ?>>补题中</option>
  414. </select>
  415. <?php endif;?>
  416. <select class="form-control" id="grade" name="grade">
  417. <option value="0">年级</option>
  418. <option value="1" <?php if ($grade == 1) echo "selected"; ?>>高一</option>
  419. <option value="2" <?php if ($grade == 2) echo "selected"; ?>>高二</option>
  420. <option value="3" <?php if ($grade == 3) echo "selected"; ?>>高三</option>
  421. </select>
  422. <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName; ?>">
  423. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  424. <?php if(isset($task_exam) && !empty($task_exam)):?>
  425. <span style="color:#16AE68;font-size:18px;">
  426. <img src="/images/tongzhi.png">各位学管请悉知,校本课程平台大数据联合质量评估考试登陆学管端啦!请与学校领导做好沟通工作,推荐报名呦!
  427. <button type="button" class=" view_untied" style="margin-right:10px;border-radius: 20px;display: inline-block">
  428. <span style="display: inline-block;vertical-align: middle">去看看</span>
  429. </button>
  430. </span>
  431. <?php endif;?>
  432. </div>
  433. </div>
  434. </form>
  435. </div>
  436. <table id="dynamic-table"
  437. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  438. style="font-size:12px">
  439. <tbody>
  440. <?php if(!empty($printList)):?>
  441. <thead>
  442. <tr>
  443. <th>名称</th>
  444. <th>文理科</th>
  445. <th>阅卷方式</th>
  446. <th>年级</th>
  447. <th>申请日期</th>
  448. <th>考试日期</th>
  449. <th>打印班级</th>
  450. <?php if($sub_id != 8):?>
  451. <th>状态</th>
  452. <?php endif;?>
  453. <th>操作</th>
  454. </tr>
  455. </thead>
  456. <?php foreach ($printList as $cl): ?>
  457. <tr>
  458. <td style="max-width:260px"><?php
  459. if ($cl['is_new'] == 0) {
  460. echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";
  461. }
  462. $wp = '';
  463. if ($cl["paper_size"] == '8K') {
  464. if (isset($exam_use_wp) && $exam_use_wp > 0) {
  465. $wp = '/纸张大小(270*390)';
  466. } else {
  467. $wp = '/纸张大小(260*370)';
  468. }
  469. }
  470. $imgSrc = "";
  471. if ($cl["mark_type"] > 0) {
  472. $imgTitle = "线上阅卷" . $wp;
  473. $imgSrc .= "/images/online/";
  474. } else {
  475. $imgTitle = "线下阅卷" . $wp;
  476. $imgSrc .= "/images/offline/";
  477. }
  478. $imgSrc .= "{$cl["paper_size"]}.png";
  479. $cursor = "pointer";
  480. echo "<img class='paperType' examId='{$cl["exam_id"]}' tpl_index='" . $cl["tpl_index"] . "' paper_size='" . $cl["paper_size"] . "' mark_type='" . $cl["mark_type"] . "' is_show = '" . $cl['upload_status'] . "' style='cursor:pointer;width:22px;height:22px;margin-right:5px;' title='{$imgTitle}' src='{$imgSrc}'/>"; ?>
  481. <?php if (isset(Yii::app()->session['testFlag']) && (Yii::app()->session['testFlag'] == 1)) {
  482. ?>
  483. <a href="<?php echo Yii::app()->createUrl('paper/index', array('eid' => $cl['exam_id'])) ?>"><?php echo $cl['print_name']; ?></a>
  484. <?php } else {
  485. echo $cl['print_name'];
  486. } ?>
  487. <!-- <a href="<?php /*echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id']))*/ ?>"><?php /*echo $cl['print_name'];*/ ?></a>-->
  488. </td>
  489. <?php if($sub_id != 8):?>
  490. <td><?php echo $cl['branch_name'] ?>
  491. </td>
  492. <?php endif;?>
  493. <td style="max-width:100px">
  494. <?php if ($cl['mark_type'] == 0) {
  495. if ($cl['upload_status'] > 0) {
  496. echo '线下阅卷';
  497. } else {
  498. echo '<a href="javascript::void()" class="maskType" is_show="' . $cl['upload_status'] . '" examId="' . $cl["exam_group_id"] . '" tpl_index="' . $cl["tpl_index"] . '" mark_type="' . $cl["mark_type"] . '" >线下阅卷</a>';
  499. }
  500. } elseif ($cl['mark_type'] == 3) {
  501. if ($cl['upload_status'] > 0 || $cl['is_scan_changed']==1) {
  502. echo '混合阅卷';
  503. } else {
  504. echo '<a href="javascript::void()" class="maskType" is_show="' . $cl['upload_status'] . '" examId="' . $cl["exam_group_id"] . '" tpl_index="' . $cl["tpl_index"] . '" mark_type="' . $cl["mark_type"] . '" >混合阅卷</a>';
  505. }
  506. } elseif ($cl['mark_type'] == 4) {
  507. echo '班级单独阅卷';
  508. } ?></td>
  509. <td>
  510. <?php
  511. if (isset($class_grade[$cl['class_id']])) {
  512. switch ($class_grade[$cl['class_id']]) {
  513. case 1:
  514. echo '高一';
  515. break;
  516. case 2:
  517. echo '高二';
  518. break;
  519. case 3:
  520. echo '高三';
  521. break;
  522. }
  523. }
  524. ?>
  525. </td>
  526. <td><?php if (!empty($cl['create_time'])) {
  527. echo date('Y-m-d H:i', $cl['create_time']);
  528. } ?></td>
  529. <td><?php if (!empty($cl['exam_time'])) {
  530. echo date('Y-m-d', $cl['exam_time']);
  531. } ?></td>
  532. <td>
  533. <?php
  534. if (isset($printer[$cl['exam_group_id']])) {
  535. echo count($printer[$cl['exam_group_id']]);
  536. } else {
  537. echo 0;
  538. }
  539. ?>/<?php
  540. if (isset($exam_class[$cl['exam_group_id']])) {
  541. echo count($exam_class[$cl['exam_group_id']]);
  542. } else {
  543. echo 0;
  544. }
  545. ?>
  546. </td>
  547. <?php if($sub_id != 8):?>
  548. <td>
  549. <?php
  550. if (isset($paper[$cl['exam_group_id']]) && $paper[$cl['exam_group_id']] == 1) {
  551. echo "<span style='color:green;font-weight:normal;'>已标注</span>";
  552. } else if (isset($paper[$cl['exam_group_id']]) && $paper[$cl['exam_group_id']] == 2) {
  553. echo "<span style='color:red;font-weight:normal;'>已发送未开始</span>";
  554. } else if (isset($paper[$cl['exam_group_id']]) && $paper[$cl['exam_group_id']] == 3) {
  555. echo "<span style='color:orange;font-weight:normal;'>标注中</span>";
  556. } else if (isset($paper[$cl['exam_group_id']]) && $paper[$cl['exam_group_id']] == 4) {
  557. echo "<span style='color:#333333;font-weight:normal;'>已取消</span>";
  558. } else if (isset($paper[$cl['exam_group_id']]) && $paper[$cl['exam_group_id']] == 5) {
  559. echo "<span style='color:#CC0099;font-weight:normal;'>补题中</span>";
  560. } else {
  561. echo "<span style='color:red;font-weight:normal;'>未发送</span>";
  562. }
  563. ?>
  564. </td>
  565. <?php endif;?>
  566. <td style="width:120px;">
  567. <?php
  568. $_num = '';
  569. $use_version = '';
  570. if (isset(Yii::app()->session['coachInfo']->use_version)) {
  571. $use_version = Yii::app()->session['coachInfo']->use_version;
  572. } else {
  573. $use_version = Yii::app()->session['coachInfo']['use_version'];
  574. }
  575. if (!$use_version) {
  576. $use_version = 100;
  577. }
  578. $version_number = implode('', explode('.', $use_version));
  579. if (strlen($version_number) < 7) {
  580. for ($i = 0; $i < 7 - strlen($version_number); $i++) {
  581. $_num .= '0';
  582. }
  583. }
  584. $version_number = (int)$version_number . $_num;
  585. if (in_array($cl['tpl_index'], array(2011, 3011))) {
  586. ?>
  587. <span class=" click-sc addbx" aria-hidden="true" title="查看考试班级"
  588. onclick="javascript:location.href='<?php echo $this->createUrl('print/class_exam_united', array('exam_group_id' => $cl['exam_group_id'])); ?>'">班</span>
  589. <?php
  590. } else {
  591. if ($cl['is_custom_tpl'] && $cl['is_custom_optional_topic'] == 1 && $version_number < 1610000) {
  592. ?>
  593. <span class=" click-sc addbx" aria-hidden="true" title="查看考试班级"
  594. onclick="show_version()">班</span>
  595. <?php
  596. } else {
  597. if ($cl['is_paper_49'] && $version_number < 1630000) {
  598. ?>
  599. <span class=" click-sc addbx" aria-hidden="true" title="查看考试班级"
  600. onclick="show_version()">班</span>
  601. <?php
  602. } else {
  603. ?>
  604. <span class=" click-sc addbx" aria-hidden="true" title="查看考试班级"
  605. onclick="javascript:location.href='<?php echo $this->createUrl('print/class_exam_united', array('exam_group_id' => $cl['exam_group_id'])); ?>'">班</span>
  606. <?php
  607. }
  608. }
  609. } ?>
  610. <!-- 发送标注按钮 -->
  611. <?php if (isset($paper[$cl['exam_group_id']])):?>
  612. <?php if($cl['is_united']==1):?>
  613. <?php if($cl['upload_status']==0):?>
  614. <span class="add_class click-sc addbx" grade="<?php echo $class_grade[$cl['class_id']];?>" branch="<?php echo $cl['branch']; ?>" eid="<?php echo $cl['exam_group_id']?>" aria-hidden="true" title="考试班级" >+</span>
  615. <?php endif; ?>
  616. <?php endif; ?>
  617. <?php if ($paper[$cl['exam_group_id']]=== '0'):?>
  618. <?php if($sub_id != 8):?>
  619. <span class="iconfont click-sc addbx sendLabelTask"
  620. examId="<?php echo $cl["exam_id"];?>"
  621. examName="<?php echo $cl["print_name"];?>"
  622. subjectId="<?php echo $cl["subject_id"];?>"
  623. createTime="<?php echo $cl["create_time"];?>"
  624. isLabelled = "<?php echo $paper[$cl['exam_group_id']];?>"
  625. status = '0'
  626. type="send"
  627. aria-hidden="true" title="发送试题标注">&#xe71f;
  628. </span>
  629. <?php endif;?>
  630. <?php elseif ($paper[$cl['exam_group_id']]=== '4'):?>
  631. <span class="iconfont click-sc addbx sendLabelTask"
  632. examId="<?php echo $cl["exam_id"];?>"
  633. examName="<?php echo $cl["print_name"];?>"
  634. subjectId="<?php echo $cl["subject_id"];?>"
  635. createTime="<?php echo $cl["create_time"];?>"
  636. isLabelled = "<?php echo $paper[$cl['exam_group_id']];?>"
  637. status = '2'
  638. type="resend"
  639. aria-hidden="true" title="重新发送">&#xe71f;</span>
  640. <?php elseif ($paper[$cl['exam_group_id']]=== '2' || $paper[$cl['exam_group_id']]=== '3'):?>
  641. <span class="iconfont click-delete addbx sendLabelTask"
  642. examId="<?php echo $cl["exam_id"];?>"
  643. examName="<?php echo $cl["print_name"];?>"
  644. subjectId="<?php echo $cl["subject_id"];?>"
  645. createTime="<?php echo $cl["create_time"];?>"
  646. isLabelled = "<?php echo $paper[$cl['exam_group_id']];?>"
  647. status = '4'
  648. type="cancel"
  649. aria-hidden="true" title="取消标注"><i class="fa fa-reply"></i></span>
  650. <?php endif;?>
  651. <?php endif;?>
  652. </td>
  653. </tr>
  654. <?php endforeach; else: ?>
  655. <tr>
  656. <td colspan="8" style="text-align: center;">
  657. <div style="min-height: 300px;padding-top:100px">
  658. <img src="/images/kongbai.png"><br>
  659. 学校还没有参加过联合质量评估考试哦!</div>
  660. </td>
  661. </tr>
  662. <?php endif; ?>
  663. </tbody>
  664. </table>
  665. <?php if (!empty($page_total)): ?>
  666. <div class="row">
  667. <div class="col-xs-6">
  668. &nbsp;
  669. </div>
  670. <div class="col-xs-6">
  671. <div class="dataTables_paginate paging_simple_numbers">
  672. <?php
  673. $this->widget('CLinkPager', array(
  674. 'header' => '',
  675. 'firstPageLabel' => '首页',
  676. 'lastPageLabel' => '末页',
  677. 'prevPageLabel' => '上一页',
  678. 'nextPageLabel' => '下一页',
  679. 'pages' => $pages,
  680. 'maxButtonCount' => 5,
  681. ));
  682. echo '共:' . $page_total . '条';
  683. ?>
  684. </div>
  685. </div>
  686. </div>
  687. <?php endif; ?>
  688. </div>
  689. <!--上传模板弹窗-->
  690. <!-- PAGE CONTENT ENDS -->
  691. </div>
  692. </div>
  693. </div>
  694. </div>
  695. <!--弹窗-->
  696. <!-- 弹窗 -->
  697. <div class="confirmbox-mask" style="display: none" id="fieldModal">
  698. <div class="class-modal">
  699. <i class="icon close_1 icon-close"></i>
  700. <div class="class-modal-head">添加考试班级</div>
  701. <form id="examSelect">
  702. <div class="class-modal-body">
  703. <p class="title">年级:高一 分科:文科</p>
  704. <div class="class_area">
  705. <div class="class_left">
  706. <p>A层班级</p>
  707. <input type="checkbox" class="checkAll">全选
  708. </div>
  709. <ul class="class_right area_1">
  710. </ul>
  711. <div class="clear"></div>
  712. <div class="class_left">
  713. <p>B层班级</p>
  714. <input type="checkbox" class="checkAll">全选
  715. </div>
  716. <ul class="class_right area_2">
  717. </ul>
  718. <div class="clear"></div>
  719. <div class="class_left">
  720. <p>C层班级</p>
  721. <input type="checkbox" class="checkAll">全选
  722. </div>
  723. <ul class="class_right area_3">
  724. </ul>
  725. </div>
  726. </div>
  727. <p class="class_btn">
  728. <input type="hidden" name="exam_gruop_id" value="0">
  729. <button type="button" class="setting_sumbit">确定</button>
  730. </p>
  731. </form>
  732. </div>
  733. </div>
  734. <script src="/js/jquery.ajaxfileupload.js"></script>
  735. <script type="text/javascript">
  736. $(document).ready(function () {
  737. var gradeArr=[],branchArr=[];
  738. gradeArr[1]='高一';
  739. gradeArr[2]='高二';
  740. gradeArr[3]='高三';
  741. branchArr[0]='不分科';
  742. branchArr[1]='文科';
  743. branchArr[2]='理科';
  744. $('.add_class').click(function(){
  745. var branch=$(this).attr('branch');
  746. var eid=$(this).attr('eid');
  747. var grade=$(this).attr('grade');
  748. var title="年级:"+gradeArr[grade]+"  分科:"+branchArr[branch];
  749. $('.area_1').html('');
  750. $('.area_2').html('');
  751. $('.area_3').html('');
  752. $('.checkAll').prop('checked',false);
  753. $('.class-modal-body .title').html(title);
  754. $.ajax({
  755. url:'<?php echo $this->createUrl('print/loadclass')?>',
  756. type:'POST',
  757. dataType:'json',
  758. data:{'branch':branch,'eid':eid,'grade':grade},
  759. success:function(res){
  760. if(res.status==1){
  761. class_data=res.classData;
  762. $('input[name=exam_gruop_id]').val(eid);
  763. if(class_data[1]!=undefined){
  764. area_1_html='';
  765. for(var i=0;i<class_data[1].length;i++){
  766. if(class_data[1][i]['is_used']==1){
  767. $('.checkAll').eq(0).prop('checked',true);
  768. area_1_html+="<li class='ellipsis' title='"+class_data[1][i]['class_name']+"'><input type='checkbox' class='choose_class' checked value='"+class_data[1][i]['class_id']+"'>"+class_data[1][i]['class_name']+"</li>";
  769. }else{
  770. area_1_html+="<li class='ellipsis' title='"+class_data[1][i]['class_name']+"'><input type='checkbox' class='choose_class' title='"+class_data[1][i]['class_name']+"' value='"+class_data[1][i]['class_id']+"'>"+class_data[1][i]['class_name']+"</li>";
  771. }
  772. }
  773. $('.area_1').html(area_1_html);
  774. }
  775. if(class_data[2]!=undefined){
  776. area_2_html='';
  777. for(var i=0;i<class_data[2].length;i++){
  778. if(class_data[2][i]['is_used']==1){
  779. $('.checkAll').eq(1).prop('checked',true);
  780. area_2_html+="<li class='ellipsis' title='"+class_data[2][i]['class_name']+"'><input type='checkbox' class='choose_class' checked value='"+class_data[2][i]['class_id']+"'>"+class_data[2][i]['class_name']+"</li>";
  781. }else{
  782. area_2_html+="<li class='ellipsis' title='"+class_data[2][i]['class_name']+"'><input type='checkbox' class='choose_class' value='"+class_data[2][i]['class_id']+"'>"+class_data[2][i]['class_name']+"</li>";
  783. }
  784. }
  785. $('.area_2').html(area_2_html);
  786. }
  787. if(class_data[3]!=undefined){
  788. area_3_html='';
  789. for(var i=0;i<class_data[3].length;i++){
  790. if(class_data[3][i]['is_used']==1){
  791. $('.checkAll').eq(2).prop('checked',true);
  792. area_3_html+="<li class='ellipsis' title='"+class_data[3][i]['class_name']+"'><input type='checkbox' class='choose_class' title='"+class_data[3][i]['class_name']+"' checked value='"+class_data[3][i]['class_id']+"'>"+class_data[3][i]['class_name']+"</li>";
  793. }else{
  794. area_3_html+="<li class='ellipsis' title='"+class_data[3][i]['class_name']+"'><input type='checkbox' class='choose_class' title='"+class_data[3][i]['class_name']+"' value='"+class_data[3][i]['class_id']+"'>"+class_data[3][i]['class_name']+"</li>";
  795. }
  796. }
  797. $('.area_3').html(area_3_html);
  798. }
  799. $('#fieldModal').show();
  800. }
  801. }
  802. });
  803. });
  804. $('.icon-close').click(function () {
  805. $('#fieldModal').hide();
  806. });
  807. //全选
  808. $('.checkAll').click(function(){
  809. var index=$('.checkAll').index(this)+1;
  810. if($(this).is(':checked')) {
  811. $('.area_'+index).find('input').prop("checked", true);
  812. }else {
  813. $('.area_'+index).find('input').prop("checked", false);
  814. }
  815. });
  816. //保存班级加减操作
  817. $('.setting_sumbit').click(function(){
  818. var class_id=[];
  819. // console.log($('.choose_class').length);
  820. for(var i=0;i<$('.choose_class').length;i++){
  821. if($('.choose_class').eq(i).is(':checked')){
  822. class_id.push($('.choose_class').eq(i).val());
  823. }
  824. }
  825. var eid=$('input[name=exam_gruop_id]').val();
  826. console.log(class_id);
  827. if(class_id.length==0){
  828. layer.msg('请选择考试班级');
  829. return false;
  830. }else{
  831. $.ajax({
  832. url:'<?php echo $this->createUrl('print/saveexamclass')?>',
  833. type:'POST',
  834. dataType:'json',
  835. data:{'eid':eid,'classId':class_id},
  836. success:function(res){
  837. if(res.status==1){
  838. layer.msg('修改成功');
  839. $('#fieldModal').hide();
  840. window.location.reload();
  841. }
  842. }
  843. });
  844. }
  845. });
  846. $(".sel-opt,.sel-cons").mouseover(function () {
  847. $(".sel-cons").show();
  848. }).mouseout(function () {
  849. $(".sel-cons").hide();
  850. });
  851. $(".sc-lis").click(function () {
  852. var data = {
  853. subjectId: $(this).attr('val')
  854. };
  855. $.post("<?php echo Yii::app()->createUrl('print/setSubjectId')?>", data, function (flags) {
  856. if (flags) {
  857. location.reload();
  858. } else {
  859. alert('网络异常');
  860. }
  861. });
  862. $('.has-sel').text($(this).text());
  863. $(".sel-cons").hide();
  864. });
  865. $(".ruanyun").click(function () {
  866. var exam_id = $(this).attr('exam_id');
  867. layer.msg("确定发送吗?学生是否全部上传成绩", {
  868. time: 0,
  869. btn: ['确定', '取消'],
  870. yes: function (index) {
  871. layer.close(index);
  872. $.ajax({
  873. url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
  874. type: "POST",
  875. dataType: "json",
  876. data: {
  877. examId: exam_id
  878. },
  879. success: function (data) {
  880. if (data.status == 1) {
  881. layer.msg('发送成功', {
  882. icon: 1
  883. }, function () {
  884. layer.closeAll();
  885. location.reload();
  886. });
  887. } else if (data.status == 2) {
  888. layer.msg('发送失败,未上传成绩', {
  889. icon: 5
  890. }, function () {
  891. layer.closeAll();
  892. location.reload();
  893. });
  894. } else {
  895. layer.msg('发送失败', {
  896. icon: 5
  897. }, function () {
  898. layer.closeAll();
  899. location.reload();
  900. });
  901. }
  902. },
  903. error: function (data, status, e) { //服务器响应失败处理函数
  904. layer.msg('返回失败!', {
  905. icon: 5
  906. }, function () {
  907. layer.closeAll();
  908. });
  909. }
  910. });
  911. }
  912. });
  913. });
  914. });
  915. function objToJson(obj) {
  916. var json = "{ ";
  917. for (var item in obj) {
  918. json += "'" + item + "':'" + obj[item] + "',";
  919. }
  920. json += " }";
  921. return json;
  922. }
  923. function ccc() {
  924. layer.msg('敬请期待!', {
  925. time: 0,
  926. btn: ['确定', '取消'],
  927. yes: function (index) {
  928. layer.close(index);
  929. return false;
  930. }
  931. });
  932. }
  933. function delExam(odj) {
  934. if (!odj) return false;
  935. var classId = odj.getAttribute("w_class_id");
  936. var examId = odj.getAttribute("w_exam_id");
  937. if (!classId || !examId) return false;
  938. var msg = '您确定要删除此班的考试吗?';
  939. layer.msg(msg, {
  940. time: 0,
  941. btn: ['确定', '取消'],
  942. yes: function (index) {
  943. layer.close(index);
  944. $.ajax({
  945. url: "<?php echo $this->createUrl('print/delexam');?>",
  946. type: "POST",
  947. dataType: "json",
  948. data: {
  949. examId: examId,
  950. classId: classId
  951. },
  952. success: function (data) {
  953. if (data.status == 1) {
  954. layer.msg('删除成功', {
  955. icon: 1
  956. }, function () {
  957. layer.closeAll();
  958. location.reload();
  959. });
  960. } else {
  961. layer.msg('删除失败', {
  962. icon: 5
  963. }, function () {
  964. layer.closeAll();
  965. location.reload();
  966. });
  967. }
  968. },
  969. error: function (data, status, e) { //服务器响应失败处理函数
  970. layer.msg('返回失败!', {
  971. icon: 5
  972. }, function () {
  973. layer.closeAll();
  974. });
  975. }
  976. });
  977. }
  978. });
  979. }
  980. // 确认上传成绩
  981. function uploadConfirm(classId, examId, className, is_uploaded_count, students_count) {
  982. //if (confirm('您确定已上传成绩了吗?')) {
  983. 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>";
  984. layer.msg(msg, {
  985. time: 0,
  986. btn: ['确定', '取消'],
  987. yes: function (index, layerObj) {
  988. layer.close(index);
  989. $.ajax({
  990. url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
  991. type: "POST",
  992. data: {
  993. classId: classId,
  994. examId: examId
  995. },
  996. beforeSend: function () {
  997. // 发送请求显示打印中
  998. layer.msg('确认中...', {time: 20000});
  999. },
  1000. dataType: "JSON",
  1001. success: function (data) {
  1002. if (data.status == 1) {
  1003. layer.msg('确认成功!');
  1004. setTimeout(function () {
  1005. location.reload();
  1006. }, 1300);
  1007. } else {
  1008. layer.msg(data.error);
  1009. }
  1010. },
  1011. complete: function () {
  1012. },
  1013. error: function () {
  1014. }
  1015. });
  1016. }
  1017. });
  1018. //}
  1019. }
  1020. // 打印错题本
  1021. function printBook(cid, eid, type) {
  1022. if (!cid || !eid || !type) {
  1023. layer.msg("打印参数有误");
  1024. return;
  1025. }
  1026. var message = '';
  1027. var objUrl = '';
  1028. if (type == 1) {
  1029. message = "您确定要下载该班级纠错本吗?";
  1030. objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
  1031. divTitle = "下载错题本";
  1032. improveName = "错题本";
  1033. } else if (type == 2) {
  1034. message = "您确定要下载该班级个性化学习方案吗?";
  1035. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1036. divTitle = "下载个性化学习方案";
  1037. improveName = "个性化学习方案";
  1038. } else if (type == 3) {
  1039. message = "您确定要下载该班级个性化学习宝吗?";
  1040. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1041. divTitle = "下载个性化学习宝";
  1042. improveName = "个性化学习宝";
  1043. }
  1044. else {
  1045. layer.msg("打印参数有误");
  1046. return;
  1047. }
  1048. html = "" +
  1049. '<div style="padding:20px 30px 0px 30px">' +
  1050. '<div style="padding:8px 0;">请复制下方链接下载' + improveName + '。</div>' +
  1051. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>' +
  1052. '<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>' +
  1053. '</div>' +
  1054. '</div>' +
  1055. "";
  1056. layer.msg(message, {
  1057. time: 0,
  1058. btn: ['确定', '取消'],
  1059. yes: function (index) {
  1060. layer.close(index);
  1061. msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
  1062. // 更试卷打印时间
  1063. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {
  1064. cid: cid,
  1065. eid: eid,
  1066. type: type
  1067. });
  1068. /*if(type == 1)
  1069. location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
  1070. else
  1071. location.href = objUrl+"/cid/"+cid+"/eid/"+eid+"/type/"+type;*/
  1072. startTime = (new Date()).getTime();
  1073. showTip = true;
  1074. tipShowed = false;
  1075. toPromptTime = 3000;
  1076. window.interval = setInterval(function () {
  1077. execTime = (new Date()).getTime() - startTime;
  1078. if (execTime > toPromptTime && showTip && !tipShowed) {
  1079. // msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
  1080. // tipShowed = true;
  1081. }
  1082. }, 1000);
  1083. jQuery.get(
  1084. "<?php echo $this->createUrl("print/getImproveFile");?>",
  1085. {"examId": eid, "classId": cid, "type": type},
  1086. function (data) {
  1087. data = JSON.parse(data);
  1088. if (data.success == 1 || data.success == 2) {
  1089. layer.open({
  1090. type: 1,
  1091. area: ['550px', '220px'],
  1092. title: divTitle,
  1093. content: html,
  1094. success: function (index, layerObj) {
  1095. clearInterval(window.interval);
  1096. msgIndex = layer.msg(data.limitinfo, {"time": 3000});
  1097. clearInterval(window.interval);
  1098. layer.close(msgIndex);
  1099. 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>');
  1100. jQuery("#confirm, #cancel").on("click", function () {
  1101. layer.close(layerObj);
  1102. });
  1103. jQuery("#copy").on("click", function () {
  1104. jQuery("#url").select();
  1105. });
  1106. },
  1107. end: function () {
  1108. }
  1109. });
  1110. }
  1111. else if (data.success == 0) {
  1112. clearInterval(window.interval);
  1113. msgIndex = layer.msg(data.message, {"time": 3000});
  1114. }
  1115. }
  1116. );
  1117. }
  1118. });
  1119. }
  1120. // 上传试卷模板
  1121. function uploadTemplate(eid, name, type) {
  1122. if (!eid) {
  1123. layer.msg('操作失败!');
  1124. return false;
  1125. }
  1126. if (type == 1)
  1127. forCheckUrl = "<?php echo $this->createUrl('print/verifyTpl');?>";
  1128. else
  1129. forCheckUrl = "<?php echo $this->createUrl('print/checkanswercard');?>";
  1130. $.post(forCheckUrl, {eid: eid}, function (data) {
  1131. var obj = JSON.parse(data);
  1132. var html = '<div class="layer_notice" style="padding:5px;">';
  1133. html += '<table class="table table-striped table-bordered table-hover ">';
  1134. html += '<thead class="thin-border-bottom">';
  1135. html += '<tr>';
  1136. html += '<th>试卷名称</th>';
  1137. html += '<th>是否上传</th>';
  1138. html += '<th>操作</th>';
  1139. html += '</tr>';
  1140. html += '</thead>';
  1141. html += '<tbody class="content_tbody">';
  1142. if (obj.success == 1) {
  1143. html += '<td>' + name + '</td><td><span style="color:red;">已上传</span></td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1144. } else {
  1145. html += '<td>' + name + '</td><td id="alreadUpload">未上传</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1146. }
  1147. html += '</tbody>';
  1148. html += '</table>';
  1149. html += '<span style="width:582px;display:inline-block;text-align:center;">';
  1150. html += '<button class="btn btn-success btn-sm" onclick="uploadWord(' + type + ')"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
  1151. html += '</span>';
  1152. html += '<input type="hidden" id="mpEid" value="' + eid + '">';
  1153. html += '</div>';
  1154. layer.open({
  1155. type: 1,
  1156. skin: 'layui-layer-rim', //加上边框
  1157. area: ['600px', '300px'], //宽高
  1158. content: html
  1159. });
  1160. });
  1161. }
  1162. function uploadWord(type) {
  1163. var paramEid = $('#mpEid').val();
  1164. if (!paramEid) {
  1165. layer.msg('没找到周周练ID!');
  1166. return false;
  1167. }
  1168. var obj_file = $("#word_file").val();
  1169. if (!obj_file) {
  1170. layer.msg('请选择上传文件');
  1171. return false;
  1172. }
  1173. var extStart = obj_file.lastIndexOf('.');
  1174. var extName = obj_file.substring(extStart, obj_file.length).toLowerCase();
  1175. if (extName != ".dotx" && extName != ".dotm") {
  1176. layer.msg('模板格式有误,请上传dotx格式word!');
  1177. return false;
  1178. }
  1179. $.ajaxFileUpload({
  1180. url: "<?php echo $this->createUrl('print/uploadTpl');?>", //用于文件上传的服务器端请求地址
  1181. secureuri: false, //是否需要安全协议,一般设置为false
  1182. fileElementId: 'word_file', //文件上传域的ID
  1183. dataType: 'text', //返回值类型 一般设置为json
  1184. data: {"eid": paramEid, "type": type},
  1185. success: function (data, status) {
  1186. var obj = JSON.parse(data);
  1187. if (obj.success == 1) {
  1188. layer.msg(obj.message, {
  1189. icon: 1,
  1190. }, function () {
  1191. layer.closeAll();
  1192. });
  1193. $("#alreadUpload").html('<span style="color:red;">已上传</span>');
  1194. } else {
  1195. layer.msg(obj.message, {
  1196. icon: 5,
  1197. }, function () {
  1198. layer.closeAll();
  1199. });
  1200. }
  1201. },
  1202. error: function (data, status, e) { //服务器响应失败处理函数
  1203. layer.msg('返回失败!', {
  1204. icon: 5,
  1205. }, function () {
  1206. layer.closeAll();
  1207. });
  1208. }
  1209. });
  1210. return false;
  1211. }
  1212. // 搜索事件
  1213. $("#search").click(function () {
  1214. $("#form1").submit();
  1215. });
  1216. //切换扫描方式
  1217. $('#changeScan').click(function(){
  1218. window.location.href="<?php echo $this->createUrl('print/changeScan')?>";
  1219. return false;
  1220. });
  1221. function print(cid, eid, tid, fg) {
  1222. if (!cid || !eid) return false;
  1223. var msg = '';
  1224. if (tid == 0) {
  1225. if (fg == 1) {
  1226. msg = '打印答题卡';
  1227. } else {
  1228. msg = '您确定要打印该试卷嘛?';
  1229. }
  1230. } else if (tid == 1) {
  1231. msg = '您确定要打印该错题本嘛?';
  1232. } else if (tid == 2) {
  1233. msg = '您确定要打印该个性化学习宝吗?';
  1234. }
  1235. layer.msg(msg, {
  1236. time: 0,
  1237. btn: ['确定', '取消'],
  1238. yes: function (index) {
  1239. layer.close(index);
  1240. ajaxPrint(cid, eid, tid);
  1241. }
  1242. });
  1243. }
  1244. function ajaxPrint(cid, eid, tid) {
  1245. $.ajax({
  1246. url: "<?php echo $this->createUrl('print/ajaxupdate');?>",
  1247. type: "post",
  1248. data: {cid: cid, eid: eid, tid: tid},
  1249. dataType: "json",
  1250. beforeSend: function () {
  1251. // 发送请求显示打印中
  1252. layer.msg('打印中', {icon: 16, time: 20000});
  1253. },
  1254. success: function (obj) {
  1255. var index = layer.msg();
  1256. layer.close(index);
  1257. if (obj.success == 1) {
  1258. if (tid == 0) {//console.log(JSON.stringify(obj.message));
  1259. evaluationClient.printPaper(JSON.stringify(obj.message));
  1260. //alert('提交打印试卷成功!');
  1261. } else if (tid == 1) {
  1262. evaluationClient.printCTB(JSON.stringify(obj.message));
  1263. //alert('提交打印错题本成功!');
  1264. } else if (tid == 2) {
  1265. evaluationClient.printTFFA(JSON.stringify(obj.message));
  1266. //alert('提交打印提分册成功!');
  1267. } else {
  1268. layer.msg('操作错误!');
  1269. }
  1270. location.reload();
  1271. } else {//alert(obj.message);
  1272. layer.msg(obj.message);
  1273. }
  1274. },
  1275. complete: function () {
  1276. //layer.msg('打印失败!');
  1277. //var index = layer.msg();
  1278. //layer.close(index);
  1279. },
  1280. error: function () {
  1281. //var index = layer.msg();
  1282. //layer.close(index);
  1283. }
  1284. });
  1285. }
  1286. // 生成试卷模板
  1287. function createTemplate(eid, flag) {
  1288. if (!eid) {
  1289. layer.msg('未找到周周练id');
  1290. }
  1291. var msg = '';
  1292. if (flag == 2) {
  1293. msg = '您确定要下载试卷嘛?';
  1294. } else if (flag == 1) {
  1295. msg = '您确定要生成模板嘛?';
  1296. }
  1297. else if (flag == 3) {
  1298. msg = "<div style='text-align:left;'>编辑答题卡注意事项:<br/>1、试卷的名字最多支持2行,字体的大小和字体种类保持原有格式不变<br/>2、选择题和填空题的答题区域中里面的内容和识别点不许更改<br/>3、整套试卷中所有的识别点不许更改<br/><br/>点击确定下载</div>";
  1299. } else if (flag == 4) {
  1300. msg = "<div style='text-align:left;'>编辑题卡合一注意事项:<br/>1、试卷的名字最多支持2行,字体的大小和字体种类保持原有格式不变<br/>2、选择题和填空题的答题区域中里面的内容和识别点不许更改<br/>3、整套试卷中所有的识别点不许更改<br/><br/>点击确定下载</div>";
  1301. } else {
  1302. layer.msg("参数错误");
  1303. }
  1304. layer.msg(msg, {
  1305. time: 0,
  1306. btn: ['确定', '取消'],
  1307. yes: function (index) {
  1308. layer.close(index);
  1309. $.post('<?php echo $this->createUrl('print/createtempelate');?>', {
  1310. "eid": eid,
  1311. "flag": flag
  1312. }, function (data) {
  1313. var obj = JSON.parse(data);
  1314. if (obj.success == 1) {
  1315. if (flag == 2) {
  1316. evaluationClient.CreatePaperTiGan(JSON.stringify(obj.object));
  1317. } else if (flag == 1) {
  1318. evaluationClient.createPaper(JSON.stringify(obj.object));
  1319. }
  1320. else if (flag == 3) {
  1321. evaluationClient.CreatePaperDaTiKa(JSON.stringify(obj.object));
  1322. } else if (flag == 4) {
  1323. evaluationClient.CreatePaperDaTiKa(JSON.stringify(obj.object));
  1324. } else {
  1325. layer.msg("参数错误");
  1326. }
  1327. } else {
  1328. layer.msg(obj.message);
  1329. }
  1330. });
  1331. }
  1332. });
  1333. }
  1334. function wb_html(odj) {
  1335. if (!odj) return false;
  1336. var classId = odj.getAttribute("w_class_id");
  1337. var examId = odj.getAttribute("w_exam_id");
  1338. if (!classId || !examId) return false;
  1339. var msg = '您确定要生成该班级的错题本吗?';
  1340. layer.msg(msg, {
  1341. time: 0,
  1342. btn: ['确定', '取消'],
  1343. yes: function (index) {
  1344. layer.close(index);
  1345. $.ajax({
  1346. url: "<?php echo $this->createUrl('client/wbhtml');?>",
  1347. type: "POST",
  1348. dataType: "json",
  1349. data: {
  1350. examId: examId,
  1351. classId: classId
  1352. },
  1353. success: function (data) {
  1354. if (data > 0) {
  1355. layer.msg('操作成功,重新生成错题本', {
  1356. icon: 1
  1357. }, function () {
  1358. layer.closeAll();
  1359. });
  1360. } else if (data == 0) {
  1361. layer.msg('操作失败,此班无错题本', {
  1362. icon: 5
  1363. }, function () {
  1364. layer.closeAll();
  1365. });
  1366. }
  1367. else {
  1368. layer.msg('操作失败,重新生成错题本', {
  1369. icon: 5
  1370. }, function () {
  1371. layer.closeAll();
  1372. });
  1373. }
  1374. },
  1375. error: function (data, status, e) { //服务器响应失败处理函数
  1376. layer.msg('返回失败!', {
  1377. icon: 5
  1378. }, function () {
  1379. layer.closeAll();
  1380. });
  1381. }
  1382. });
  1383. }
  1384. });
  1385. }
  1386. function isp2_html(odj) {
  1387. if (!odj) return false;
  1388. var classId = odj.getAttribute("w_class_id");
  1389. var examId = odj.getAttribute("w_exam_id");
  1390. if (!classId || !examId) return false;
  1391. var msg = '您确定要生成该班级的二步提分方案吗?';
  1392. layer.msg(msg, {
  1393. time: 0,
  1394. btn: ['确定', '取消'],
  1395. yes: function (index) {
  1396. layer.close(index);
  1397. $.ajax({
  1398. url: "<?php echo $this->createUrl('client/isp2html');?>",
  1399. type: "POST",
  1400. dataType: "json",
  1401. data: {
  1402. examId: examId,
  1403. classId: classId
  1404. },
  1405. success: function (data) {
  1406. if (data > 0) {
  1407. layer.msg('操作成功,重新生成提分方案', {
  1408. icon: 1
  1409. }, function () {
  1410. layer.closeAll();
  1411. });
  1412. } else if (data == 0) {
  1413. layer.msg('操作失败,此班无提分方案', {
  1414. icon: 5
  1415. }, function () {
  1416. layer.closeAll();
  1417. });
  1418. }
  1419. else {
  1420. layer.msg('操作失败,重新生成提分方案', {
  1421. icon: 5
  1422. }, function () {
  1423. layer.closeAll();
  1424. });
  1425. }
  1426. },
  1427. error: function (data, status, e) { //服务器响应失败处理函数
  1428. layer.msg('返回失败!', {
  1429. icon: 5
  1430. }, function () {
  1431. layer.closeAll();
  1432. });
  1433. }
  1434. });
  1435. }
  1436. });
  1437. }
  1438. function isp3_html(odj) {
  1439. if (!odj) return false;
  1440. var classId = odj.getAttribute("w_class_id");
  1441. var examId = odj.getAttribute("w_exam_id");
  1442. if (!classId || !examId) return false;
  1443. var msg = '您确定要生成该班级的个性化学习宝吗?';
  1444. layer.msg(msg, {
  1445. time: 0,
  1446. btn: ['确定', '取消'],
  1447. yes: function (index) {
  1448. layer.close(index);
  1449. $.ajax({
  1450. url: "<?php echo $this->createUrl('client/isp3html');?>",
  1451. type: "POST",
  1452. dataType: "json",
  1453. data: {
  1454. examId: examId,
  1455. classId: classId
  1456. },
  1457. success: function (data) {
  1458. if (data > 0) {
  1459. layer.msg('操作成功,重新生成提分方案', {
  1460. icon: 1
  1461. }, function () {
  1462. layer.closeAll();
  1463. });
  1464. } else if (data == 0) {
  1465. layer.msg('操作失败,此班无提分方案', {
  1466. icon: 5
  1467. }, function () {
  1468. layer.closeAll();
  1469. });
  1470. }
  1471. else {
  1472. layer.msg('操作失败,重新生成提分方案', {
  1473. icon: 5
  1474. }, function () {
  1475. layer.closeAll();
  1476. });
  1477. }
  1478. },
  1479. error: function (data, status, e) { //服务器响应失败处理函数
  1480. layer.msg('返回失败!', {
  1481. icon: 5
  1482. }, function () {
  1483. layer.closeAll();
  1484. });
  1485. }
  1486. });
  1487. }
  1488. });
  1489. }
  1490. function show_version() {
  1491. layer.msg('你的客户端版本太低,请升最新版本');
  1492. }
  1493. // 隐藏试卷
  1494. function oprateExam(exam_groupId, flag) {
  1495. if (exam_groupId) {
  1496. layer.msg('未找到周周练id');
  1497. }
  1498. var msg = '您确定要隐藏该试卷吗?';
  1499. if (flag == 0) {
  1500. msg = '您确定要恢复该试卷吗?';
  1501. }
  1502. layer.msg(msg, {
  1503. time: 0,
  1504. btn: ['确定', '取消'],
  1505. yes: function (index) {
  1506. layer.close(index);
  1507. $.post('<?php echo $this->createUrl("print/oprateexam");?>', {
  1508. exam_groupId: exam_groupId,
  1509. flag: flag
  1510. }, function (data) {
  1511. var obj = JSON.parse(data);
  1512. if (obj.success == 1) {
  1513. location.reload();
  1514. } else {
  1515. layer.msg(obj.message);
  1516. }
  1517. });
  1518. }
  1519. });
  1520. }
  1521. $(".create_sheet").click(function(){
  1522. var exam_group_id = $(this).attr("exam_group_id");
  1523. var sheet_id = $(this).attr("sheet_id");
  1524. if(exam_group_id>0){
  1525. $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
  1526. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
  1527. }
  1528. });
  1529. //扫描答题卡
  1530. function createTemplateScan (exam_group_id){
  1531. if (!exam_group_id) {
  1532. layer.msg('未找到试卷ID');
  1533. }
  1534. var data={
  1535. exam_group_id:exam_group_id
  1536. }
  1537. $.post("<?php echo Yii::app()->createUrl("third/paper")?>",data,function(rs){
  1538. var m = JSON.parse(rs);
  1539. if(m.status==1)
  1540. {
  1541. evaluationClient.loadThirdParty(exam_group_id);
  1542. }else {
  1543. layer.msg('尚未创建答题卡,请创建');
  1544. }
  1545. });
  1546. }
  1547. $('.view_untied').click(function(){
  1548. window.location.href='<?php echo $this->createUrl('print/unitedTask')?>';
  1549. return false;
  1550. });
  1551. </script>