<!DOCTYPE html>
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
<head>
|
<th:block th:include="include :: header('评测报告列表')"/>
|
</head>
|
<body class="gray-bg">
|
<div class="container-div">
|
<div class="row">
|
<div class="col-sm-12 search-collapse">
|
<form id="formId">
|
<input th:type="hidden" id="productId" name="productId" readonly th:value="${prodId}"/>
|
<input th:type="hidden" id="testId" name="testId" th:value="${testId}">
|
<div class="select-list">
|
<ul>
|
<li>
|
<p>[[#{jsp.exam.report.userCode}]]:</p>
|
<input type="text" name="memberId" th:value="${memberId}"/>
|
</li>
|
<li>
|
<p>[[#{jsp.exam.report.downloadPermissions}]]:</p>
|
<select name="downloadTimes"
|
th:with="type=${@dict.getType('downloadDetailedReport_status')}">
|
<option value="">All</option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
th:value="${dict.dictValue}"></option>
|
</select>
|
</li>
|
<li>
|
<p>[[#{jsp.exam.report.answerStatus}]]:</p>
|
<select name="verifyStatus" th:with="type=${@dict.getType('test_member_status')}">
|
<option value="">All</option>
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
th:value="${dict.dictValue}"></option>
|
</select>
|
</li>
|
<li>
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
|
class="fa fa-search"></i> find</a>
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
|
class="fa fa-refresh"></i> [[#{basis.reset}]]</a>
|
</li>
|
</ul>
|
</div>
|
</form>
|
</div>
|
|
<div class="btn-group-sm" id="toolbar" role="group">
|
<a class="btn btn-warning" onclick="exportDataReport();" shiro:hasPermission="exam:report:export">
|
<i class="fa fa-download"></i> [[#{jsp.exam.report.exportEvaluationUserAnswerRecords}]]
|
</a>
|
<a class="btn btn-info" onclick="exportDetailReportExcel();"
|
shiro:hasPermission="exam:report:detailReportexport">
|
<i class="fa fa-download"></i> [[#{jsp.exam.report.regenerateReport}]]
|
</a>
|
<a class="btn btn-inverse" onclick="exportSendedReportExcel();">
|
<i class="fa fa-download"></i> [[#{jsp.exam.report.exportSendedReport}]]
|
</a>
|
</div>
|
<div class="col-sm-12 select-table table-striped">
|
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
</div>
|
</div>
|
<!--多语言的弹出-->
|
<div class="modal inmodal fade" id="langTypSelect" name = "langTypSelect" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="false">
|
<div class="modal-dialog modal-lg">
|
<div class="modal-content">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal"><span
|
aria-hidden="true">×</span><span class="sr-only">Close</span>
|
</button>
|
<h4 class="modal-title">[[#{jsp.exam.demographyParam.languagetype}]]</h4>
|
</div>
|
<div class="modal-body">
|
<div class="form-group">
|
<label class="col-sm-3 control-label">[[#{jsp.exam.product.questionnaireType}]]:</label>
|
<div class="col-sm-8" id="langTypeDiv" th:fragment="langTypeDiv">
|
<select th:if="${dictDatas} != null" name="langType"
|
class="form-control m-b">
|
<option th:each="dict, iterStat : ${dictDatas}" th:text="${dict.dictLabel}"
|
th:value="${dict.dictValue}"></option>
|
</select>
|
<div class="select-must" style="color: red" hidden="true">*[[#{jsp.exam.product.pleaseSelectLangType}]]</div>
|
</div>
|
</div>
|
</div>
|
<div class="modal-footer">
|
<button type="button" class="btn btn-white" data-dismiss="modal">close</button>
|
<button type="button" class="btn btn-primary next-step">next</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<th:block th:include="include :: footer"/>
|
<script th:inline="javascript">
|
var editFlag = [[${@permission.hasPermi('exam:report:edit')}]];
|
var removeFlag = [[${@permission.hasPermi('exam:report:remove')}]];
|
var statusDatas = [[${@dict.getType('downloadDetailedReport_status')}]];
|
var test_member_status = [[${@dict.getType('test_member_status')}]];
|
var prefix = ctx + "exam/report";
|
|
$(function () {
|
var columns = [{field: 'ID', checkbox: true}];
|
var options = {
|
url: prefix + "/listData",
|
createUrl: prefix + "/add",
|
updateUrl: prefix + "/edit/{id}",
|
removeUrl: prefix + "/remove",
|
exportUrl: prefix + "/exportReport",
|
modalName: "评测报告",
|
pageSize: 50,
|
pageList: [50, 100, 200],
|
onLoadSuccess: function (data) {
|
|
},
|
columns: [{
|
checkbox: true
|
},
|
{
|
field: 'id',
|
title: 'ID',
|
visible: false
|
},
|
{
|
field: 'memberId',
|
title: [[#{jsp.exam.test_package.033}]]
|
},
|
{
|
field: 'memberDept',
|
title: [[#{jsp.testPackage.department}]],
|
sortable: true
|
},
|
{
|
field: 'memberName',
|
title: [[#{jsp.system.user.profile.011}]]
|
},
|
{
|
field: 'downloadTimes',
|
title: [[#{jsp.exam.report.downloadRight}]],
|
formatter: function (value, row, index) {
|
return $.table.selectDictLabel(statusDatas, value);
|
},
|
visible: false
|
},
|
{
|
field: 'verifyStatus',
|
title: [[#{jsp.exam.report.questionStatus}]],
|
formatter: function (value, row, index) {
|
return $.table.selectDictLabel(test_member_status, value);
|
}
|
},
|
{
|
field: 'productId',
|
title: [[#{jsp.exam.product.productPackageNumber}]],
|
visible: false
|
},
|
{
|
field: 'productName',
|
title: [[#{jsp.exam.report.productName}]]
|
},
|
{
|
field: 'userId',
|
title: 'userId',
|
visible: false
|
},
|
{
|
title: [[#{basis.operate}]],
|
align: 'center',
|
formatter: function (value, row, index) {
|
var actions = [];
|
actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="testerReport(\'' + row.memberId + '\')"><i class="fa fa-edit"></i>'+[[#{jsp.exam.textPackageExport}]]+'</a> ');
|
return actions.join('');
|
}
|
},
|
]
|
};
|
$.table.init(options);
|
});
|
|
|
// 导出基础报告
|
function exportReportExcel() {
|
var rows = $.table.selectColumns("id");
|
if (rows.length == 0) {
|
$.modal.alertWarning([[#{jsp.exam.report.001}]]);
|
return;
|
}
|
|
var userIds = $.table.selectColumns("userId");
|
var productId = $.table.selectColumns("productId");
|
$('#langTypeDiv').load(prefix + "/langType/" + userIds + "/" + productId);
|
$('#langTypSelect').modal('show');
|
$('.next-step').click(function () {
|
if ($('[name="langType"]').val().trim() != "") {
|
|
$('#langTypSelect').modal('hide');
|
$.modal.confirm([[#{jsp.exam.report.002}]] + $.table._option.modalName + "?", function () {
|
$.modal.loading([[#{jsp.exam.report.003}]]);
|
$.post(prefix + "/exportBasisReport/" + rows + "/" + $('[name="langType"]').val(), "", function (result) {
|
if (result.code == web_status.SUCCESS) {
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
} else if (result.code == web_status.WARNING) {
|
$.modal.alertWarning(result.msg)
|
} else {
|
$.modal.alertError(result.msg);
|
}
|
$.modal.closeLoading();
|
});
|
});
|
} else {
|
$('select').each(function () {
|
if ($(this).val() == "") {
|
$(this).nextAll('.select-must').removeAttrs('hidden');
|
}
|
});
|
}
|
});
|
}
|
|
// 导出详细报告
|
function exportDetailReportExcel() {
|
var rows = $.table.selectColumns("id");
|
var detailStatus = $.table.selectColumns("verifyStatus");
|
if (rows.length == 0) {
|
$.modal.alertWarning([[#{jsp.exam.report.001}]]);
|
return;
|
}
|
//如果状态为不允许下载或者审核中,则提示存在不允许下载记录。
|
for (var i = 0; i < detailStatus.length; i++) {
|
if (detailStatus[i] != 1 && detailStatus[i] != 6) { // 6是超时提交
|
$.modal.alertWarning([[#{jsp.exam.report.004}]]);
|
return;
|
}
|
}
|
$.modal.loading([[#{jsp.exam.report.003}]]);
|
$.post(prefix + "/exportDetailedReport/" + rows + "/" + $('[name="langType"]').val(), rows, function (result) {
|
if (result.code == web_status.SUCCESS) {
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
} else if (result.code == web_status.WARNING) {
|
$.modal.alertWarning(result.msg)
|
} else {
|
$.modal.alertError(result.msg);
|
}
|
$.modal.closeLoading();
|
});
|
}
|
|
function exportSendedReportExcel() {
|
var ids = $.table.selectColumns("id");
|
|
if (ids.length == 0) {
|
$.modal.alertWarning([[#{please.choose.user}]]);
|
return;
|
}
|
|
$.modal.loading([[#{jsp.exam.report.003}]]);
|
$.post(prefix + "/exportSendedReport/" + ids, "", function (result) {
|
if (result.code == web_status.SUCCESS) {
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
} else if (result.code == web_status.WARNING) {
|
$.modal.alertWarning(result.msg)
|
} else {
|
$.modal.alertError(result.msg);
|
}
|
$.modal.closeLoading();
|
});
|
}
|
|
function exportDataReport(formId) {
|
var ids = $.table.selectColumns("id");
|
|
if (ids.length == 0) {
|
$.modal.alertWarning([[#{please.choose.user}]]);
|
return;
|
}
|
|
$.modal.loading([[#{jsp.exam.report.003}]]);
|
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
|
$.post(prefix + "/exportDataReport/" + ids, $("#" + currentId).serializeArray(), function(result) {
|
if (result.code == web_status.SUCCESS) {
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
} else if (result.code == web_status.WARNING) {
|
$.modal.alertWarning(result.msg)
|
} else {
|
$.modal.alertError(result.msg);
|
}
|
$.modal.closeLoading();
|
});
|
}
|
|
//申请第二份报告
|
function applicationReport() {
|
|
$.modal.alertWarning([[#{jsp.exam.report.005}]]);
|
return;
|
|
var rows = $.table.selectColumns("0");
|
if (rows.length == 0) {
|
$.modal.alertWarning([[#{jsp.exam.report.001}]]);
|
return;
|
}
|
$.modal.confirm("确认申请" + rows.length + "条用户报告吗?", function () {
|
var url = prefix + '/applicationReport/' + rows + "/" + testId;
|
$.modal.open('申请下载第二份测试报告', url);
|
});
|
}
|
|
// 下载用户的测试报告
|
function testerReport(memberId) {
|
$.modal.loading([[#{jsp.exam.report.003}]]);
|
$.post(prefix + "/testerReport/" + memberId, "", function (result) {
|
if (result.code == web_status.SUCCESS) {
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
} else if (result.code == web_status.WARNING) {
|
$.modal.alertWarning(result.msg)
|
} else {
|
$.modal.alertError(result.msg);
|
}
|
$.modal.closeLoading();
|
});
|
}
|
</script>
|
</body>
|
</html>
|