_third.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <script type="text/javascript">
  2. // 隐藏试卷
  3. function oprateExam(examGroupId,flag){
  4. if (examGroupId) {
  5. layer.msg('未找到周周练id',{
  6. icon: 5
  7. }, function(){
  8. layer.closeAll();
  9. });
  10. }
  11. var msg = '您确定要隐藏该试卷吗?';
  12. if (flag == 0) {
  13. msg = '您确定要恢复该试卷吗?';
  14. }
  15. layer.msg(msg, {
  16. time: 0,
  17. btn: ['确定', '取消'],
  18. yes: function(index){
  19. layer.close(index);
  20. $.post('<?php echo $this->createUrl("third/oprateexam");?>',{exam_group_id:examGroupId,flag:flag},function(data){
  21. var obj = JSON.parse(data);
  22. if (obj.success == 1) {
  23. location.reload();
  24. } else {
  25. layer.msg(obj.message,{
  26. icon: 5
  27. }, function(){
  28. layer.closeAll();
  29. });
  30. // layer.msg(obj.message);
  31. }
  32. });
  33. }
  34. });
  35. }
  36. //制卡
  37. function createCard(homeworkId) {
  38. $.ajax({
  39. url: "<?php echo $this->createUrl('homework/getCardUrl');?>",
  40. type: "POST",
  41. dataType: "json",
  42. data: {
  43. homeworkId: homeworkId
  44. },
  45. success: function (rs){
  46. if(rs.status==1){
  47. location.href=rs.data
  48. }
  49. },
  50. error: function (data, status, e){ //服务器响应失败处理函数
  51. layer.msg('返回失败!',{
  52. icon: 1
  53. }, function(){
  54. layer.closeAll();
  55. });
  56. }
  57. });
  58. }
  59. //打印
  60. function printOnline(url,name,id) {
  61. let $param={"typeId":2001,"params":{"name":name,"url":url}};
  62. $.post("<?php echo $this->createUrl('homework/updateOnlinePaperPrintTime');?>", { eid: id } );
  63. evaluationClient.BulkPrintPDF(JSON.stringify($param))
  64. }
  65. //下载
  66. function downloadOnline(id) {
  67. data={
  68. "exam_id":id,
  69. "homework":1
  70. };
  71. $.post("<?php echo $this->createUrl('homework/updateOnlinePaperPrintTime');?>", { eid: id } );
  72. evaluationClient.NewDownLoadPDF(JSON.stringify(data));
  73. }
  74. </script>