review_setting.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
  2. <link rel="stylesheet" href="/css/alert.css"/>
  3. <style>
  4. .color-red{
  5. color: red;
  6. }
  7. .en-tfb-grade-1 .date>span{
  8. margin-right: 40px;
  9. }
  10. .option-wrap{
  11. margin-top: 20px;
  12. min-width: 600px;
  13. }
  14. .option-name{
  15. display: inline-block;
  16. width: 100px;
  17. vertical-align: top;
  18. margin-top: 10px;
  19. }
  20. .option-con{
  21. display: inline-block;
  22. width: 80%;
  23. min-width: 490px;
  24. padding: 10px;
  25. border: 1px solid #ccc;
  26. }
  27. .option-con>span{
  28. display: inline-block;
  29. margin-right: 20px;
  30. line-height: 1rem;
  31. cursor: pointer;
  32. }
  33. .select-grade{
  34. width: 150px;
  35. line-height: 30px;
  36. margin-bottom: 10px;
  37. }
  38. .option-con-class label{
  39. display: inline-block;
  40. margin-right: 20px;
  41. }
  42. .active{
  43. color: #619aff;
  44. }
  45. .btn-start{
  46. display: inline-block;
  47. margin-top: 20px;
  48. margin-left: 100px;
  49. padding: 10px 30px;
  50. color: #fff;
  51. background-color: #2977ff;
  52. cursor: pointer;
  53. }
  54. .en-tfb-grade-1{
  55. margin-left: 20px;
  56. }
  57. .hgc_leader-btn {
  58. display: flex;
  59. justify-content: space-between;
  60. padding: 10px 0;
  61. font-size: 14px;
  62. }
  63. .hgc_leader-btn span {
  64. display: flex;
  65. align-items: center;
  66. cursor: pointer;
  67. }
  68. .hgc_leader-btn span .icon {
  69. width: 15px;
  70. height: 15px;
  71. background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAYAAADNX8xBAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHXSURBVDhPnZS/S4JRFIZvYlDQYOBg0ODg4ODW4ugaNDT2HxRE0NA/EA0NFQUNDRENjQUN0dRQQVDgEmQ4aBQouLQVJBTZ816PpvX5o154Oufce87r57X7uU6qOReBsJV/16dzU5DHpEZ8g2MYt+3+ZCYVTKZhCKLUa1Aij1hbbzGgJ5kmzmgYstRJ4j6sWFugBiw2zqTEwijxkaUNmIBXOIX5kHOTxECx15QGpIT+sLGF6R5pklgklrXeSU0jmj8IFxAD5Q3prGS+XC/7EANxziIN+mqqM6Bf7wXebS/N2pAf6CYzaxop1yDxQKZCa5CAtB9CrWfUSU987So8YHJFPQhl6gLxBLMzNXkjGsL6BOU9VLSzLDKzTj5GridLhVhIgn72Agvn5DpsL/JnQq5etYv+ezPVE0dlNEtxBMNwC8fgxePmYEE5fTcMXPqNIPEUq3BopepN8IfdSewnMB6xXN8io0/SfcrLwHch8kVLe6ppJJHEfpr1KxlBysr/m9F/zWzcyrr+akZ/hF69dn6/AFvMtgMbWkTPEuxa+VtmloU7ct23NkNqXaMd8FfFloOlYZrmQG9H3S+96DRYAf8KZj1q7d8vtm5iIEnw//Hkumeiqrou574AaXrOncWtEY0AAAAASUVORK5CYII=') no-repeat center;
  72. background-size: contain;
  73. }
  74. .hgc_leader-btn span:nth-child(2) .icon {
  75. background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE6SURBVDhP7ZStTgNBFEZvmwpkRUUFsqJJKyoqKhBIRCWiD4CkggRPeAIEgodA8gAYEgQPgICktrJJDUkJ5dztV5id7KZDlqA4ydf7N/duZtIZK+PD7Bi9rM3WoTyHTrQsDRoHNK3QEs0iLTV4rOW7YfGNmiZKfUFupNq9UjlqFI5qZm3FGTRcY/bQlNpblgygfkW+iT3DLpR2Fj5wRbKhRGV84CkDW/gXm5RdyqYS9n3vxs/FpTCZuK8u+2sUDuQYJsj/b33Ft+hRfgc9o3OPYwoHcqZd1NHZOkP8kTvYfa/j9jyO+ZstV+F/YHVSB77LOqFfTniF+GmhQ+QvjsddNJDfQAcoe6GwxVe2tLCDuC+3ZbKvcpOh50FuHu7m3fZrPxW9TxrjV3MDhTbyl3p7f1OZM8Rf7rmZ2Sd4TZIuop129AAAAABJRU5ErkJggg==') no-repeat center;
  76. background-size: contain;
  77. }
  78. .hgc_leader-btn i {
  79. font-style: normal;
  80. }
  81. .hgc_option-con label {
  82. position: relative;
  83. padding: 5px;
  84. padding-right: 30px;
  85. border: 1px solid #999;
  86. }
  87. .hgc_option-con .icon {
  88. position: absolute;
  89. top: 50%;
  90. right: 5px;
  91. transform: translateY(-50%);
  92. width: 15px;
  93. height: 15px;
  94. background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAWCAYAAADAQbwGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAE6SURBVDhP7ZStTgNBFEZvmwpkRUUFsqJJKyoqKhBIRCWiD4CkggRPeAIEgodA8gAYEgQPgICktrJJDUkJ5dztV5id7KZDlqA4ydf7N/duZtIZK+PD7Bi9rM3WoTyHTrQsDRoHNK3QEs0iLTV4rOW7YfGNmiZKfUFupNq9UjlqFI5qZm3FGTRcY/bQlNpblgygfkW+iT3DLpR2Fj5wRbKhRGV84CkDW/gXm5RdyqYS9n3vxs/FpTCZuK8u+2sUDuQYJsj/b33Ft+hRfgc9o3OPYwoHcqZd1NHZOkP8kTvYfa/j9jyO+ZstV+F/YHVSB77LOqFfTniF+GmhQ+QvjsddNJDfQAcoe6GwxVe2tLCDuC+3ZbKvcpOh50FuHu7m3fZrPxW9TxrjV3MDhTbyl3p7f1OZM8Rf7rmZ2Sd4TZIuop129AAAAABJRU5ErkJggg==') no-repeat center;
  95. background-size: contain;
  96. cursor: pointer;
  97. }
  98. #kp .kp-name{
  99. display: inline-block;
  100. margin-right: 20px;
  101. }
  102. </style>
  103. <div class="main-content-inner">
  104. <!-- 导航栏开始-->
  105. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  106. <!-- 导航栏结束-->
  107. <div class="en-tfb-grade-1">
  108. <h2>二轮学习指导手册</h2>
  109. <p class="date">
  110. <span>生成方式:</span>
  111. <span><input type="radio" name="create_type" checked value="1">自动生成(根据学生历次考试大数据)&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="create_type" value="2">手动生成(自主选择考点范围)</span>
  112. </p>
  113. <div class="option-wrap">
  114. <span class="option-name">专题:</span>
  115. <div class="option-con" id="optionEdition">
  116. <?php if(isset($special_arr) && $special_arr):?>
  117. <?php $no =1;?>
  118. <?php foreach($special_arr as $k=>$v):?>
  119. <span code="<?php echo $v['special_id'];?>" class="special-name <?php echo $no==1?'active':'';?>"><?php echo $v['special_name'];?></span>
  120. <?php $no++;?>
  121. <?php endforeach;?>
  122. <?php endif;?>
  123. </div>
  124. </div>
  125. <div class="option-wrap kp-select-area" style="display:none ">
  126. <span class="option-name">知识点:</span>
  127. <?php if(isset($special_arr) && $special_arr):?>
  128. <?php $no =1;?>
  129. <?php foreach($special_arr as $k=>$special):?>
  130. <div class="option-con" id="special_item_<?php echo $special['special_id'];?>" style="display: <?php echo $no == 1?'':'none';?>">
  131. <div class="option-con-class" id="kp">
  132. <?php if($special['kps']):?>
  133. <?php foreach($special['kps'] as $item):?>
  134. <span code="<?php echo $item['kp_id'];?>" class="kp-name <?php echo $no==1?'active':'';?>"><?php echo $item['kp_name'];?></span>
  135. <?php $no++;?>
  136. <?php endforeach;?>
  137. <?php endif;?>
  138. </div>
  139. </div>
  140. <?php endforeach;?>
  141. <?php endif;?>
  142. </div>
  143. <div class="option-wrap method-select-area" style="display:none ">
  144. <span class="option-name">考点:</span>
  145. <?php if(isset($special_arr) && $special_arr):?>
  146. <?php $no =1;?>
  147. <?php foreach($special_arr as $k=>$special):?>
  148. <?php foreach($special['kps'] as $i=>$method):?>
  149. <div class="option-con method-list" id="method_item_<?php echo $method['kp_id'];?>" style="display: <?php echo $no == 1?'':'none';?>">
  150. <div class="hgc_leader-btn select-all">
  151. <span class="color-red" is_all="1"><i class="icon"></i>全选</span>
  152. <span class="color-red" is_all="0"><i class="icon"></i>全不选</span>
  153. </div>
  154. <div class="option-con-class" id="">
  155. <?php if($method['methods']):?>
  156. <?php foreach($method['methods'] as $item):?>
  157. <label>
  158. <input type="checkbox" name="option-class" value="<?php echo $item['method_id'];?>" item_name="<?php echo $item['method_name'];?>">
  159. <?php echo $item['method_name'];?>
  160. </label>
  161. <?php endforeach;?>
  162. <?php endif;?>
  163. </div>
  164. </div>
  165. <?php $no++;?>
  166. <?php endforeach;?>
  167. <?php endforeach;?>
  168. <?php endif;?>
  169. </div>
  170. <div class="option-wrap">
  171. <span class="option-name">已选择:</span>
  172. <div class="option-con">
  173. <div class="hgc_leader-btn">
  174. <span>已选<i class="color-red item-num">0</i>个选项</span>
  175. <span class="color-red clear-all-item"><i class="icon"></i>清空所有选项</span>
  176. </div>
  177. <div class="option-con-class hgc_option-con special-item-box">
  178. <!-- <label>一般现在时<i class="icon"></i></label>-->
  179. </div>
  180. </div>
  181. </div>
  182. <div class="option-wrap">
  183. <span class="option-name">班级:</span>
  184. <div class="option-con">
  185. <div class="option-con-class" id="optionClass">
  186. </div>
  187. </div>
  188. </div>
  189. <span class="btn-start" id="confirm" active="true">开始生成</span>
  190. </div>
  191. </div>
  192. <input type="hidden" value="1" class="is-new-version"/>
  193. <script src="/js/jquery.ajaxfileupload.js"></script>
  194. <script type="text/javascript">
  195. $(document).ready(function () {
  196. var createType=1; //生成类型
  197. var grade=3;
  198. var kpId=$('#kp').find('span').eq(0).attr('code');
  199. getClassByGrade(grade);
  200. //增加专项
  201. function addItem(id,name) {
  202. var ele = '<label item_id="'+id+'">'+name+'<i class="icon selected-item"></i></label>';
  203. $(".special-item-box").append(ele);
  204. }
  205. function itmeNume() {
  206. $(".item-num").text($(".special-item-box>label").length);
  207. }
  208. //切换生成类型
  209. $('input[name=create_type]').click(function(){
  210. if($(this).val()==1){
  211. // $('#method_item_'+kpId).find('span').eq(1).click();
  212. $('.method-select-area').find('.method-list').each(function(){
  213. $(this).find('span').eq(1).click();
  214. })
  215. $('.kp-select-area').hide();
  216. $('.method-select-area').hide();
  217. }else{
  218. $('.kp-select-area').show();
  219. $('.method-select-area').show();
  220. }
  221. createType=$(this).val();
  222. });
  223. //切换专题
  224. $(".special-name").click(function () {
  225. $("#optionEdition>span").removeClass('active')
  226. $(this).addClass('active');
  227. var specialId = $(this).attr('code');
  228. $('#special_item_'+specialId).show().siblings('.option-con').hide();
  229. kpId=$('#special_item_'+specialId).find('span').eq(0).attr('code');
  230. $('#method_item_'+kpId).show().siblings('.option-con').hide();
  231. $(".select-all>span").eq(1).click();
  232. $('.clear-all-item').click();
  233. getClassByGrade(grade);
  234. $('#optionClass').html('');
  235. });
  236. // 切换知识点
  237. $('.kp-name').click(function(){
  238. if(createType==1){
  239. return false;
  240. }
  241. $("#kp>span").removeClass('active')
  242. $(this).addClass('active');
  243. kpId = $(this).attr('code');
  244. $('#method_item_'+kpId).show().siblings('.option-con').hide();
  245. });
  246. //选择专项
  247. $(".select-all>span").click(function () {
  248. if(createType==1){
  249. return false;
  250. }
  251. var input_arr = $(this).parent().siblings('.option-con-class').children('label').children('input');
  252. //全选
  253. if ($(this).attr('is_all') > 0) {
  254. if (input_arr) {
  255. $.each(input_arr,function () {
  256. if (!$(this).is(':checked')) {
  257. $(this).prop("checked",true);
  258. addItem($(this).val(), $(this).attr('item_name'));
  259. }
  260. })
  261. }
  262. }else{//全不选
  263. if (input_arr) {
  264. $.each(input_arr,function () {
  265. if ($(this).is(':checked')) {
  266. $(this).prop("checked",false);
  267. var item_id = $(this).val();
  268. $('label[item_id="'+item_id+'"]').remove();
  269. }
  270. })
  271. }
  272. }
  273. itmeNume();
  274. });
  275. //选择单个专项
  276. $('input[name="option-class"]').change(function () {
  277. if(createType==1){
  278. $(this).attr('checked',false);
  279. return false;
  280. }
  281. if (!$(this).is(':checked')) {
  282. var item_id = $(this).val();
  283. $('label[item_id="'+item_id+'"]').remove();
  284. }else{
  285. addItem($(this).val(), $(this).attr('item_name'));
  286. }
  287. itmeNume();
  288. });
  289. //清空所有选项
  290. $(".clear-all-item").click(function () {
  291. $.each($(".special-item-box>label"),function () {
  292. $('input[value="'+$(this).attr('item_id')+'"]').prop("checked",false);
  293. })
  294. $(".special-item-box").empty();
  295. itmeNume();
  296. });
  297. //清空单个选项
  298. $("body").delegate(".selected-item", "click", function() {
  299. $('input[value="'+$(this).parent('label').attr('item_id')+'"]').prop("checked",false);
  300. $(this).parent('label').remove();
  301. itmeNume();
  302. });
  303. var optionData={
  304. edition:0,
  305. modular:0,
  306. unit:0,
  307. class:[],
  308. }
  309. // 单选按钮
  310. $("input[name='option-class']").change(function() {
  311. getsClassSelected();
  312. });
  313. function getsClassSelected() {
  314. optionData.class=[];
  315. var selectedData = $("input[name='option-class']:checked"); //获取所以选中学生
  316. for (var i = 0; i < selectedData.length; i++) {
  317. code = $(selectedData[i]).val();
  318. optionData.class.push(code);
  319. }
  320. };
  321. var active=true;
  322. $("#confirm[active='true']").on("click", function() {
  323. if(!active){
  324. return false;
  325. }
  326. active=false;
  327. var error = [];
  328. var selectClassIds = [];
  329. var selectedItemIds = [];
  330. var specialId = parseInt($('#optionEdition span.active').attr("code"));
  331. var specialName = $('#optionEdition span.active').html();
  332. var isNewVersion=parseInt($('.is-new-version').val());
  333. $('#optionClass input:checked').each(function(k,v){
  334. if($(this).attr("status") == 0){
  335. selectClassIds.push($(this).val());
  336. }
  337. });
  338. $(".special-item-box>label").each(function(k,v){
  339. if($(this).attr("item_id")){
  340. selectedItemIds.push($(this).attr("item_id"));
  341. }
  342. });
  343. if(selectedItemIds.length == 0 && createType==2){
  344. error.push("请选择考点");
  345. }
  346. if(selectClassIds.length == 0){
  347. error.push("请选择班级");
  348. }
  349. var data={
  350. grade:3,
  351. selectClassIds:selectClassIds,
  352. selectedItemIds:selectedItemIds,
  353. createType:createType,
  354. special:specialId,
  355. specialName:specialName,
  356. isNewVersion:isNewVersion
  357. };
  358. if(error.length == 0){
  359. var index=layer.msg('正在发送中,请稍候。。。。。。',{time:0});
  360. $.ajax({
  361. url: "<?php echo $this->createUrl('print/ajaxSaveMathReview');?>",
  362. type: "POST",
  363. dataType: "json",
  364. data: data,
  365. success: function (data) {
  366. layer.close(index);
  367. if(data.status == 1){
  368. layer.msg('已发送到后台,预计1小时左右生成!', {
  369. time: 2000,
  370. });
  371. setTimeout(function(){window.location.href = "<?php echo Yii::app()->createUrl('print/review');?>";}, 2000);
  372. }else{
  373. layer.msg(data.error.join('</br>'));
  374. active=true;
  375. }
  376. }
  377. });
  378. }else{
  379. active=true;
  380. layer.msg(error.join('</br>'));
  381. }
  382. });
  383. function getClassByGrade(grade){
  384. var specialId = parseInt($('#optionEdition span.active').attr("code"));
  385. if(grade){
  386. $.ajax({
  387. url: "<?php echo $this->createUrl('print/ajaxGetClassesBySettingMath');?>",
  388. type: "POST",
  389. dataType: "json",
  390. data: {
  391. grade: grade,
  392. specialId:specialId
  393. },
  394. success: function (data) {
  395. var html = '';
  396. if(data && data.length > 0){
  397. for(var i in data){
  398. html +='<label>';
  399. if(data[i].status == 1){
  400. html += ' <input type="checkbox" name="option-class" value="'+data[i].class_id+'" checked="checked" disabled="disabled" status="1">'+data[i].class_name;
  401. }else{
  402. html += ' <input type="checkbox" name="option-class" value="'+data[i].class_id+'" status="0">'+data[i].class_name;
  403. }
  404. html +='</label>';
  405. }
  406. }
  407. $('#optionClass').html(html);
  408. }
  409. });
  410. }
  411. }
  412. });
  413. </script>