123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206 |
- <style>
- .nav-btns {
- margin: 10px 20px;
- }
- .nav-btns > a {
- display: inline-block;
- width: 120px;
- border: 1px solid #40c180;
- text-align: center;
- line-height: 30px;
- }
- .active {
- color: #fff;
- background-color: #40c180;
- }
- .btn-garder {
- margin-right: 10px;
- display: inline-block;
- width: 100px;
- border: none;
- text-align: center;
- line-height: 30px;
- color: #fff;
- background-color: #2977ff;
- }
- .confirmbox {
- background: #fff;
- border: 1px solid #cccccc;
- border-radius: 3px;
- padding: 40px 40px 30px;
- text-align: center;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- }
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- .btn_area button {
- border: none;
- background: #009965;
- width: 111px;
- height: 36px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- .btn_area button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal-body .classes {
- margin-bottom: 10px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b
- }
- .class-modal .icon-close {
- position: absolute;
- right: 20px;
- top: 20px;
- }
- .class-modal-1 {
- width: auto;
- background: #fff;
- border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .class-modal-head-1 {
- font-size: 14px;
- text-align: left;
- color: #fff;
- line-height: 30px;
- background: #2977ff;
- padding-left: 15px;
- }
- .class-modal-body-1 {
- padding: 15px;
- }
- .class-modal-body-1 h2, .class-modal-body-1 h3 {
- font-size: 14px;
- font-weight: normal;
- margin-top: 10px;
- }
- .class-modal-body-1 h3 span {
- font-size: 10px;
- color: #ccc;
- }
- .class-modal-body-1 label {
- display: inline-block;
- font-weight: normal;
- margin-right: 15px;
- height: 30px;
- position: relative;
- }
- .class-modal-1 .icon-close-1 {
- position: absolute;
- right: 10px;
- top: 5px;
- }
- .class-modal-1 .class_area {
- height: 115px;
- border: 1px solid #ccc;
- padding: 5px;
- overflow-y: auto;
- margin-bottom: 15px;
- }
- .class-modal-1 .checkAll {
- position: absolute;
- right: 5px;
- top: 115px;
- }
- .class-modal-1 .subsection {
- }
- .class-modal-1 .btn p {
- color: #000;
- }
- .class-modal-1 .btn_area {
- padding: 10px;
- border-top: 1px solid #aab6aa;
- margin-top: 10px;
- }
- .class-modal-1 .btn_area p {
- display: inline-block;
- }
- .class-modal-1 .btn_area button {
- margin-left: 5px;
- }
- .class-modal-1 .btn_area .cancel {
- background: #fff;
- color: #000;
- border: 1px solid #666;
- }
- .c-red-1 {
- color: #CC3300;
- font-size: 10px;
- display: inline-block;
- position: absolute;
- left: 15px;
- top: 18px;
- }
- .vtm {
- vertical-align: middle;
- }
- .pointer {
- cursor: pointer;
- }
- .dib {
- display: inline-block;
- }
- .pdp-con .pop-opt-con {
- border-top: 1px solid #ddd;
- padding-top: 20px;
- }
- .tit-sub-intro {
- color: #666;
- }
- .tit-sub-intro span {
- font-size: 12px;
- }
- .subsection {
- width: 44px;
- height: 24px;
- border: 1px solid #ddd;
- text-align: center;
- font-size: 12px;
- }
- .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;
- }
- .reduce-btn.forbidden, .add-btn.forbidden {
- color: #bbb;
- border: 1px solid #bbb;
- cursor: no-drop;
- }
- .disable-btn, .disable-btn:hover {
- background: gray;
- }
- .input-page-no {
- width: 40px;
- }
- .page-go {
- background-color: #2977ff;
- padding: 5px;
- color: white;
- cursor: pointer;
- }
- .magic-tips {
- padding: 5px;
- position: absolute;
- z-index: 100;
- right: 450px;
- background: #15ae68;
- color: white;
- display: none;
- }
- .magic-tips li {
- list-style: none;
- }
- .tip-icon {
- cursor: pointer;
- }
- </style>
- <script type="text/javascript">
- function in_array(search, array) {
- for (var i in array) {
- if (array[i] == search) {
- return true;
- }
- }
- return false;
- }
- testFlag = "<?php echo $this->testFlag;?>";
- customTplsIds = new Array();
- var i = 0;
- <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
- customTplsIds[i] = "<?php echo $tplId;?>";
- i++;
- <?php }?>
- jQuery(document).ready(function () {
- // 根据年级筛选班级
- jQuery("#grade").change(function () {
- var grade = $(this).val();
- if (!grade) return false;
- jQuery.post(
- '<?php echo $this->createUrl("print/getGradeClass");?>', {"grade": grade}, function (data) {
- data = JSON.parse(data);
- if (data.success == 1) {
- var classObj = $("#class");
- var html = "<option value=''>全部班级</option>";
- classObj.empty();
- $.each(data.message, function (i, n) {
- html += "<option value='" + n.class_id + "'>" + n.class_name + "</option>";
- });
- classObj.append(html);
- }
- }
- );
- });
- });
- </script>
- <link rel="stylesheet" href="/fonts/fpdf/iconfont.css"/>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath . '/views/layouts/view_production_navigation.php'); ?>
- <!-- 导航栏结束-->
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row" style="position: relative;">
- <form method="get" id="form1" action="<?php echo $this->createUrl("writing/index"); ?>">
- <div class="col-xs-12">
- <div class="dataTables_length margin-zy clearfix">
- <select class="form-control" id="grade" name="grade">
- <option value="">年级</option>
- <option value="1" <?php if ($grade == 1) echo "selected"; ?>>高一</option>
- <option value="2" <?php if ($grade == 2) echo "selected"; ?>>高二</option>
- <option value="3" <?php if ($grade == 3) echo "selected"; ?>>高三</option>
- </select>
- <select class="form-control" id="class" name="classId">
- <option value="">全部班级</option>
- <?php foreach ($classes as $class) { ?>
- <option <?php if ((string)$classId === (string)$class["class_id"]) echo "selected=selected"; ?>
- value="<?php echo $class["class_id"]; ?>"><?php echo $class["class_name"]; ?></option>
- <?php } ?>
- </select>
- <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name"
- value="<?php echo $printName; ?>">
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索
- </button>
- <span class="fr">
- <span class="magic-tips">
- <li>* 请确认扫描时题目编号和写作卡题目编号完全对应。</li>
- <li>* 请勿反复点击恢复按钮,反复点击会导致批改后写作卡生成时间延长。</li>
- <li>* 生成写作宝并打印后,请务必同时分发对应班级的写作卡。</li>
- </span>
- <span class="tip-icon"><img width="35" height="35" src="/images/tongzhi.png"></span>
- <span style="font-size:13px;padding-left:2px;color:red;margin-right: 10px;">
- 温馨提示
- </span>
- <a href="<?php echo $this->createUrl("writing/setting"); ?>" class="btn-garder">生成写作宝</a>
- <a id="selectPrint" href="javascript:void(0);" class="btn-garder">发送云印任务</a>
- <a id="batchPrint" href="javascript:void(0);" class="btn-garder">批量下载</a>
- <a id="batchPrintToolsXzb" href="javascript:void(0);" class="btn-garder">批量打印</a>
- </span>
- </div>
- </div>
- </form>
- </div>
- <table id="dynamic-table"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
- style="font-size:12px">
- <thead>
- <tr>
- <th class="center">
- <input type="checkbox" class="ace selectAll"/>
- </th>
- <th>名称</th>
- <th>班级</th>
- <th>已生成/总数</th>
- <th>已批改/批改PDF</th>
- <th>创建时间</th>
- <th>是否下载/打印</th>
- <th>下载/打印时间</th>
- <th>题目编号</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if (!empty($printList)):foreach ($printList as $cl): ?>
- <tr>
- <td>
- <?php if (Yii::app()->cache->getValue("cloud_print_task:english_writing" . $cl['ew_id']) != 1) { ?>
- <input type="checkbox" class="ace myselect"
- value="<?php echo $cl['ew_id']; ?>">
- <?php } ?>
- </td>
- <?php $mwName = '写作宝' . $cl['name'] . '第' . $cl['week_no'] . '次'; ?>
- <td>
- <a href="<?php echo $this->createUrl("writing/classes", array("ew_group_id" => $cl['ew_group_id'], "ew_name" => $mwName)); ?>"><?php echo $mwName; ?></a>
- </td>
- <td style="max-width:100px"><?php echo $cl['class_name']; ?></td>
- <td><?php echo $cl['pdfCount'] . '/' . $cl['totalCount']; ?></td>
- <td><?php echo $cl['markCount'] . '/' . $cl['cardCount']; ?></td>
- <td><?php echo date("Y-m-d H:i:s", $cl['create_time']); ?></td>
- <td><?php if ($cl['isDown']) {
- echo '已下载/打印';
- } else {
- echo '未下载/打印';
- } ?></td>
- <td><?php echo $cl['downTime']; ?></td>
- <td><?php echo !empty($cl['is_write']) ? $cl['topic_no'] : '无'; ?></td>
- <td style="width:360px;">
- <!-- 班级下载 -->
- <span class="iconfont click-sc addbx printToolsXzb" aria-hidden="true"
- ewid="<?php echo (string)$cl['ew_id']; ?>" title="打印写作宝"
- ></span>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="下载写作宝"
- onclick="printWeek('<?php echo (string)$cl['ew_id']; ?>')"><img
- src="/images/download.png" style="margin-bottom:-2px;"></span>
- <!-- 按学生下载 -->
- <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生下载写作宝"
- onclick="javascript:location.href='<?php echo $this->createUrl('writing/stu', array('ew_id' => (string)$cl['ew_id'])); ?>'"></span>
- <!-- 云印任务 -->
- <span class="iconfont click-sc addbx" <?php if (Yii::app()->cache->getValue("cloud_print_task:english_writing:" . $cl['ew_id']) == 1) echo 'style="background-color:gray"'; ?>
- aria-hidden="true"
- title="<?php if (Yii::app()->cache->getValue("cloud_print_task:english_writing:" . $cl['ew_id']) == 1) {
- echo '24小时内不可重复发送';
- } else {
- echo '发送云印任务';
- } ?>"
- onclick="sendCloudTask('<?php echo $cl['ew_id']; ?>',<?php echo Yii::app()->cache->getValue("cloud_print_task:english_writing:" . $cl['ew_id']) == 1 ? 1 : 0; ?>)">云
- </span>
- <!-- 下载教师版按钮 -->
- <span class="iconfont click-sc addbx" style="margin-left: 3px;" aria-hidden="true"
- title="下载写作宝教师版" onclick="downPdfXZBTeacherPrint('<?php echo (string)$cl['ew_id']; ?>')"><img
- width="18" height="25" src="/images/magic_word/u114.svg"></span>
- <!-- 扫描答题卡按钮 -->
- <?php if ($cl['marking_status'] == 0 && !empty($cl['is_write'])): ?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="扫描在线答题卡"
- onclick="createTemplateScanOnline('<?php echo $cl['ew_group_id']; ?>',this,'词汇宝','<?php echo $cl['ew_id']; ?>')">扫</span>
- <?php else: ?>
- <span class="iconfont click-sc addbx disable-btn" aria-hidden="true"
- title="扫描在线答题卡">扫</span>
- <?php endif; ?>
- <!-- 确认上传按钮 -->
- <?php if($cl['marking_status']==0 && $cl['markCount']>0):?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="确认全部批改完成" onclick="confirmUpload('<?php echo (string)$cl['ew_id']; ?>')"></span>
- <?php else:?>
- <span class="iconfont click-sc addbx disable-btn" aria-hidden="true" title="确认全部批改完成"></span>
- <?php endif;?>
- <!-- 恢复上传按钮 -->
- <?php if ($cl['marking_status'] == 1): ?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="恢复答题卡上传"
- onclick="resumeUpload('<?php echo (string)$cl['ew_id']; ?>')"><i
- class="fa fa-reply"></i></span>
- <?php else: ?>
- <span class="iconfont click-sc addbx disable-btn" aria-hidden="true"
- title="恢复答题卡上传"><i class="fa fa-reply"></i></span>
- <?php endif; ?>
- <!-- 下载批改后答题卡按钮 -->
- <?php if ($cl['marking_status'] == 1): ?>
- <span class="iconfont click-sc addbx printToolsCorrectXzb" ewid="<?php echo (string)$cl['ew_id']; ?>" aria-hidden="true" title="下载批改后答题卡"
- ><img
- width="18" height="25" src="/images/magic_word/u120.svg"></span>
- <?php else: ?>
- <span class="iconfont click-sc addbx disable-btn" aria-hidden="true"
- title="下载批改后答题卡"><img width="18" height="25"
- src="/images/magic_word/u120.svg"></span>
- <?php endif; ?>
- <!-- 下载批改后统计excel -->
- <?php if ($cl['marking_status'] == 1): ?>
- <span class="iconfont click-sc addbx" aria-hidden="true" title="下载批改后统计excel"
- onclick="downExcel('<?php echo (string)$cl['ew_id']; ?>','<?php echo (string)$cl['class_id']; ?>')"><img
- width="18" height="25" src="/images/magic_word/tongji.svg"></span>
- <?php else: ?>
- <span class="iconfont click-sc addbx disable-btn" aria-hidden="true"
- title="下载批改后统计excel"><img width="18" height="25"
- src="/images/magic_word/tongji.svg"></span>
- <?php endif; ?>
- </td>
- </tr>
- <?php endforeach; else: ?>
- <tr>
- <td colspan="8">暂无数据!</td>
- </tr>
- <?php endif; ?>
- </tbody>
- </table>
- <?php if (!empty($page_total)): ?>
- <div class="row">
- <div class="col-xs-6">
-
- </div>
- <div class="col-xs-6">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- 'firstPageLabel' => '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $pages,
- 'maxButtonCount' => 5,
- ));
- echo '共:' . $page_total . '条';
- ?>
- <?php if ($pages->pagesCount > 1): ?>
- <span><input class="input-page-no" name="toPageNo" type="text" placeholder="页码"></span>
- <span class="page-go">Go</span>
- <?php endif; ?>
- </div>
- </div>
- </div>
- <?php endif; ?>
- </div>
- <!--上传模板弹窗-->
- <!--发送云印任务弹窗-->
- <div class="confirmbox-mask" id="classModal-1" style="display: none;">
- <div class="class-modal-1">
- <i class="icon icon-close-1" style="color: white">X</i>
- <div class="class-modal-head-1">发送云印任务</div>
- <div class="class-modal-body-1">
- <div>
- <span>亲爱的学管:您正在发起云印任务,请核对以下云印任务数据!</span>
- <span style="float: right;">共<i id="task_count">0</i>条任务,<i id="total_print_num">0</i>份云印任务</span>
- </div>
- <table style="margin-top: 15px;"
- class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <th>序号</th>
- <th>任务名称</th>
- <th>班级</th>
- <th>已生成/已开通/可下载</th>
- <th>已下载/打印</th>
- <th>云印份数</th>
- <th>备注</th>
- </tr>
- </thead>
- <tbody id="taskList">
- </tbody>
- </table>
- <div style="margin-top: 40px;">
- <span><img width="20px" height="20px" src="/images/icon-tip.svg">发送后,请至学管端【IMS-云印任务】模块查看任务进程,请等待云印中心打印后,寄回给学校!</span>
- <span style="margin-left:15px;float: right;"><input id="filter-uploaded"
- checked="checked" type="checkbox">过滤【已下载】的学生</span>
- </div>
- <div class="btn_area" style="text-align: center;">
- <input type="hidden" id="sendJson" name="sendJson" value="">
- <button id="sendCloudPrint" class="download">发送</button>
- <button class="cancel">取消</button>
- </div>
- </div>
- </div>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <?php include(Yii::app()->basePath.'/views/print/_print.php');?>
- <script src="/js/jquery.ajaxfileupload.js"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- });
- function downpdf(weekId) {
- layer.msg('生成中,请稍后...', {time: 0, shade: 0.4})
- location.href = "<?php echo $this->createUrl("writing/teacherWeek")?>?mwId=" + weekId;
- layer.closeAll();
- }
- function objToJson(obj) {
- var json = "{ ";
- for (var item in obj) {
- json += "'" + item + "':'" + obj[item] + "',";
- }
- json += " }";
- return json;
- }
- function ccc() {
- layer.msg('敬请期待!', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function (index) {
- layer.close(index);
- return false;
- }
- });
- }
- // 搜索事件
- $("#search").click(function () {
- $("#form1").submit();
- });
- function printWeek(weekId) {
- if (!weekId) {
- layer.msg("打印参数有误");
- return;
- }
- var message = "您确定要下载该班级写作宝吗?";
- var divTitle = '下载词汇宝';
- var objUrl = '';
- html = "" +
- '<div style="padding:20px 30px 0px 30px">' +
- '<div style="padding:8px 0;">请复制下方链接下载写作宝。</div>' +
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>' +
- '<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>' +
- '</div>' +
- '</div>' +
- "";
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function (index) {
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('productdownload/getWritingFile');?>",
- type: "GET",
- dataType: "json",
- title: divTitle,
- data: {"ew_id": weekId},
- timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
- beforeSend: function () {
- layer.msg("下载中请稍后...", {"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
- },
- error: function (jqXHR, textStatus, errorThrown) {
- layer.closeAll();
- if (textStatus == "timeout") {
- $.ajax({
- type: 'GET',
- url: "<?php echo $this->createUrl("productdownload/addWritingTask");?>",
- data: {"ew_id": weekId},
- dataType: "json",
- success: function (data) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
- icon: 1,
- yes: function () {
- layer.closeAll();
- }
- });
- }
- })
- } else {
- layer.msg('返回失败!', {
- icon: 5
- }, function () {
- layer.closeAll();
- });
- }
- },
- success: function (data) {
- layer.closeAll();
- if (data.success == 1 || data.success == 2) {
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: divTitle,
- content: html,
- success: function (index, layerObj) {
- 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>');
- jQuery("#confirm, #cancel").on("click", function () {
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function () {
- jQuery("#url").select();
- });
- },
- end: function () {
- }
- });
- } else if (data.success == 3) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
- icon: 1,
- yes: function () {
- layer.closeAll();
- }
- });
- } else if (data.success == 0) {
- layer.msg(data.message, {"time": 3000});
- }
- },
- });
- }
- });
- }
- //发送云印任务
- function sendCloudTask(weekId, isDisable) {
- if (isDisable === 1) {
- return false;
- }
- //$('.confirmbox-mask').show();return false;
- if (!weekId) {
- layer.msg("参数有误");
- return;
- }
- var saveDataAry = [];
- var data1 = {"ew_id": weekId};
- saveDataAry.push(data1);
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("printCloud/generateWriting");?>",
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify(saveDataAry),
- beforeSend: function () {
- layer.load(1, {
- shade: [0.1, '#fff'] //0.1透明度的白色背景
- });
- },
- success: function (data) {
- var index = layer.load();
- layer.close(index);
- if (data.status == 1) {
- $('#sendJson').attr('value', JSON.stringify(data));
- var con = '';
- var task_count = 0;
- var totalCount = 0;
- $.each(data.data, function (index, item) {
- var one_count = item.enable_download_count - item.download_count;
- totalCount += (one_count > 0 ? one_count : 0);
- if ((item.enable_download_count - item.download_count) > 0) {
- task_count += 1;
- }
- con += '<tr><td>' + (index + 1) + '</td><td>' + item.taskName + '</td><td>' + item.clazzName + '</td><td>'
- + 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>'
- + item.download_count + '</td><td>' + (one_count > 0 ? one_count : 0) + '</td><td>' + (one_count > 0 ? '可发送' : '不可发送')
- + '</td></tr>'
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount);
- $('#taskList').html(con);
- $('#filter-uploaded').prop("checked", true)
- $('.confirmbox-mask').show();
- } else if (data.status == 0) {
- layer.msg(data.message);
- }
- }
- }
- );
- }
- //批量发送云印任务
- $("#selectPrint").click(function () {
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('至少选择一个目标!');
- return false;
- }
- var result = [];
- $(".myselect").each(function (m, n) {
- if ($(this).prop('checked')) {
- if ($(this).val() /*&& $(this).attr("stnm")*/) {
- result.push($(this).val());
- }
- }
- });
- var saveDataAry = [];
- var data1 = [];
- for (i = 0; i < result.length; i++) {
- var weekId = result[i];
- data1 = {"ew_id": weekId};
- saveDataAry.push(data1);
- }
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl("printCloud/generateWriting");?>",
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify(saveDataAry),
- beforeSend: function () {
- layer.load(1, {
- shade: [0.1, '#fff'] //0.1透明度的白色背景
- });
- },
- success: function (data) {
- var index = layer.load();
- layer.close(index);
- if (data.status == 1) {
- $('#sendJson').attr('value', JSON.stringify(data));
- var con = '';
- var task_count = 0;
- var totalCount = 0;
- $.each(data.data, function (index, item) {
- var one_count = item.enable_download_count - item.download_count;
- totalCount += (one_count > 0 ? one_count : 0);
- if ((item.enable_download_count - item.download_count) > 0) {
- task_count += 1;
- }
- con += '<tr><td>' + (index + 1) + '</td><td>' + item.taskName + '</td><td>' + item.clazzName + '</td><td>'
- + 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>'
- + item.download_count + '</td><td>' + (one_count > 0 ? one_count : 0) + '</td><td>' + (one_count > 0 ? '可发送' : '不可发送')
- + '</td></tr>'
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount);
- $('#taskList').html(con);
- $('#filter-uploaded').prop("checked", true);
- $('.confirmbox-mask').show();
- } else if (data.status == 0) {
- layer.msg(data.message);
- }
- }
- }
- );
- });
- // 全选\反选
- $(".selectAll").click(function () {
- if ($(this).prop("checked")) {
- var s_obj = $(".myselect");
- var s_len = s_obj.length;
- for (var i = 0; i < s_len; i++) {
- if (!s_obj[i].disabled) {
- s_obj[i].checked = true;
- }
- }
- } else {
- $(".myselect").prop("checked", false);
- }
- });
- //过滤已下载学生
- $('#filter-uploaded').click(function () {
- if ($(this).is(':checked')) {
- var totalCount = 0;
- var task_count = 0;
- $('#taskList tr').each(function () {
- var enable_count = parseInt($(this).children("td:eq(3)").children('i').html());
- var dowanload_count = parseInt($(this).children("td:eq(4)").html());
- $(this).children("td:eq(5)").html((enable_count - dowanload_count) > 0 ? (enable_count - dowanload_count) : 0);
- totalCount += ((enable_count - dowanload_count) > 0 ? (enable_count - dowanload_count) : 0);
- if ((enable_count - dowanload_count) == 0) {
- $(this).children("td:eq(6)").html('不可发送');
- } else {
- $(this).children("td:eq(6)").html('可发送');
- task_count += 1;
- }
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount)
- } else {
- var totalCount = 0;
- var task_count = 0;
- $('#taskList tr').each(function () {
- var enable_count = $(this).children("td:eq(3)").children('i').html();
- $(this).children("td:eq(5)").html(enable_count);
- totalCount += parseInt(enable_count);
- if (enable_count == 0) {
- $(this).children("td:eq(6)").html('不可发送');
- } else {
- $(this).children("td:eq(6)").html('可发送');
- task_count += 1;
- }
- });
- $('#task_count').html(task_count);
- $('#total_print_num').html(totalCount);
- $('#filter-uploaded').attr('isFilter', 0)
- }
- });
- //发送云印任务(真正发送)
- $('#sendCloudPrint').click(function () {
- var task_count = parseInt($('#task_count').html());
- if (task_count === 0) {
- layer.msg('没有可发送的任务');
- return false;
- }
- var json_data = $('#sendJson').val();
- var is_filter = $('#filter-uploaded').is(':checked') ? 1 : 0;
- $.post({
- url: "<?php echo $this->createUrl("printCloud/sendWritingTask");?>",
- data: {
- 'json_data': json_data,
- 'is_filter': is_filter,
- },
- dataType: "json",
- beforeSend: function () {
- layer.load(1, {
- shade: [0.1, '#fff'] //0.1透明度的白色背景
- });
- },
- success: function (data) {
- var index = layer.load();
- layer.close(index);
- if (data.status == 1) {
- layer.msg('操作成功,请耐心等待后台打包');
- $('.confirmbox-mask').hide();
- location.reload();
- } else if (data.status == 0) {
- layer.msg(data.message);
- }
- }
- });
- });
- $('.confirmbox-mask .icon-close-1').click(function () {
- $('.confirmbox-mask').hide();
- });
- $('.confirmbox-mask .cancel').click(function () {
- $('.confirmbox-mask').hide();
- });
- //批量下载
- $("#batchPrint").click(function () {
- var message = "您确定要批量下载该产品吗?";
- // 判断是否有选中
- if (!$("input[class='ace myselect']").is(':checked')) {
- layer.msg('至少选择一个目标!');
- return false;
- }
- var result = [];
- $(".myselect").each(function (m, n) {
- if ($(this).prop('checked')) {
- if ($(this).val() /*&& $(this).attr("stnm")*/) {
- result.push($(this).val());
- }
- }
- });
- var saveDataAry = [];
- var data1 = [];
- for (i = 0; i < result.length; i++) {
- var weekId = result[i];
- data1 = {"ew_id": weekId};
- saveDataAry.push(data1);
- }
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function (index) {
- layer.close(index);
- $.ajax({
- type: "POST",
- url: "<?php echo $this->createUrl('productdownload/batchWriting');?>",
- dataType: "json",
- contentType: "application/json",
- data: JSON.stringify(saveDataAry),
- success: function (data) {
- layer.closeAll();
- if (data.success == 1) {
- layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!', {
- icon: 1,
- yes: function () {
- layer.closeAll();
- }
- });
- } else {
- layer.msg(data.message);
- }
- },
- });
- }
- });
- });
- //扫描在线答题卡
- function createTemplateScanOnline(exam_group_id, obj, exam_name, exam_id) {
- if ($(obj).hasClass('disabled')) {
- return false;
- }
- if (!exam_group_id) {
- layer.msg('未找到词汇宝组ID');
- }
- evaluationClient.NewScan(exam_group_id + "," + exam_name + "," + "001" + "," + exam_id);//TODO 考试id (ew_id)
- return false;
- }
- //确认上传
- function confirmUpload(weekId) {
- if (!weekId) {
- layer.msg("参数有误");
- return;
- }
- var message = "请先在【右上角>上传】页面内,确认学生上传(自动批阅)完毕。<br><br>确定答题卡完成上传吗?一旦确定后,后台开始生成已上传学生批改后的答题卡,且无法再进行扫描上传操作!";
- layer.msg(message, {
- time: 0,
- area: ["480px", "160px"],
- btn: ['确定', '取消'],
- yes: function (index) {
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('writing/confirmUpload');?>",
- type: "GET",
- dataType: "json",
- data: {"ew_id": weekId},
- success: function (data) {
- layer.closeAll();
- if (data.status == 1) {
- layer.msg('操作成功')
- location.reload();
- } else {
- layer.msg(data.message, {"time": 3000});
- }
- },
- });
- }
- });
- }
- //确认上传
- function resumeUpload(weekId) {
- if (!weekId) {
- layer.msg("参数有误");
- return;
- }
- var message = "确定恢复答题卡上传吗?";
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function (index) {
- layer.close(index);
- $.ajax({
- url: "<?php echo $this->createUrl('writing/resumeUpload');?>",
- type: "GET",
- dataType: "json",
- data: {"ew_id": weekId},
- success: function (data) {
- layer.closeAll();
- if (data.status == 1) {
- layer.msg('操作成功')
- location.reload();
- } else {
- layer.msg(data.message, {"time": 3000});
- }
- },
- });
- }
- });
- }
- function downloadCard(mwId) {
- if (!mwId) {
- layer.msg("打印参数有误");
- return;
- }
- var message = "您确定要下载该班级写作卡吗?";
- html = "" +
- '<div style="padding:20px 30px 0px 30px">' +
- '<div style="padding:8px 0;">请复制下方链接下载写作卡。</div>' +
- '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>' +
- '<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>' +
- '</div>' +
- '</div>' +
- "";
- layer.msg(message, {
- time: 0,
- btn: ['确定', '取消'],
- yes: function (index) {
- layer.close(index);
- msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
- startTime = (new Date()).getTime();
- showTip = true;
- tipShowed = false;
- toPromptTime = 3000;
- window.interval = setInterval(function () {
- execTime = (new Date()).getTime() - startTime;
- if (execTime > toPromptTime && showTip && !tipShowed) {
- msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
- tipShowed = true;
- }
- }, 1000);
- jQuery.get(
- "<?php echo $this->createUrl("productdownload/getWritingCard");?>",
- {"ew_id": mwId},
- function (data) {
- data = JSON.parse(data);
- if (data.success == 1 || data.success == 2) {
- layer.open({
- type: 1,
- area: ['550px', '220px'],
- title: "下载写作卡",
- content: html,
- success: function (index, layerObj) {
- clearInterval(window.interval);
- msgIndex = layer.msg(data.limitinfo, {"time": 3000});
- clearInterval(window.interval);
- layer.close(msgIndex);
- 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>');
- jQuery("#confirm, #cancel").on("click", function () {
- layer.close(layerObj);
- });
- jQuery("#copy").on("click", function () {
- jQuery("#url").select();
- });
- },
- end: function () {
- }
- });
- }
- else if (data.success == 0) {
- clearInterval(window.interval);
- msgIndex = layer.msg(data.message, {"time": 3000});
- }
- }
- );
- }
- });
- }
- function downExcel(ewId, classId) {
- layer.msg('生成中,请稍后...', {time: 0, shade: 0.4})
- location.href = "<?php echo $this->createUrl("writing/downExcel")?>?ewId=" + ewId + "&classId=" + classId;
- layer.closeAll();
- }
- $(".page-go").click(function () {
- var page = $("input[name='toPageNo']").val();
- if (!isPositiveInteger(page)) {
- layer.msg("请输入正确的页码");
- return;
- }
- <?php
- $urlParams = array();
- if ($grade) $urlParams['grade'] = $grade;
- if ($classId) $urlParams['classId'] = $grade;
- if ($printName) $urlParams['name'] = $printName;
- ?>
- location.href = "<?php echo $this->createUrl('writing/index', $urlParams) . '/page/';?>" + page;
- });
- function isPositiveInteger(s) {//是否为正整数
- var reg = /^[1-9]\d*$/;
- return reg.test(s)
- }
- $('.tip-icon').mouseover(function () {
- $('.magic-tips').show()
- })
- $('.tip-icon').mouseleave(function () {
- $('.magic-tips').hide()
- })
- </script>
|