12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058 |
- <template>
- <section class="content" style="margin-top: 20px;">
- <div class="box box-info">
- <!-- 正文信息 -->
- <div class="box-body">
- <el-form
- :model="formSearch"
- :inline="true"
- label-position="right"
- label-width="90px"
- class="el-form el-form--inline"
- style="border-bottom: 1px solid rgb(221, 221, 221);padding-bottom: 10px;margin-bottom: 10px;"
- >
- <el-form-item label="学校">
- <el-select
- v-model="formSearch.orgId"
- placeholder="请选择"
- @change="loadExamList(formSearch.orgId)"
- >
- <el-option
- v-for="item in orgList"
- :label="item.orgName"
- :value="item.orgId"
- :key="item.orgId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="考试">
- <el-select
- v-model="formSearch.examId"
- @change="searchRecords(1)"
- placeholder="请选择"
- >
- <el-option
- v-for="item in examList"
- :label="item.examName"
- :value="item.examId"
- :key="item.examId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="试卷状态">
- <el-select
- v-model="formSearch.paperStatus"
- clearable
- placeholder="请选择"
- >
- <el-option label="请选择" value=""></el-option>
- <el-option
- v-for="item in coursePaperStatusList"
- :label="item.label"
- :value="item.value"
- :key="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="课程名称">
- <el-select
- v-model="formSearch.courseId"
- placeholder="请选择"
- filterable
- clearable
- remote
- :remote-method="loadCourseList"
- >
- <el-option label="请选择" value=""></el-option>
- <el-option
- v-for="item in courseList"
- :label="item.name"
- :value="item.id"
- :key="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="试卷名称">
- <el-input
- v-model="formSearch.paperName"
- style="width: 221px"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item style="padding-left: 22px">
- <el-button
- size="small"
- type="primary"
- icon="el-icon-search"
- @click="searchRecords(1)"
- >查询
- </el-button>
- <el-button
- size="small"
- icon="el-icon-refresh"
- @click="resetSearchForm"
- >
- 重置
- </el-button>
- </el-form-item>
- </el-form>
- <div style="margin-bottom: 5px;">
- 操作:
- <el-button
- size="small"
- type="primary"
- icon="el-icon-menu"
- @click="openAllotAllDialog"
- :disabled="!hasPermit"
- >分配待指定试卷
- </el-button>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-download"
- @click="openExportAllDialog"
- >整体导出
- </el-button>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-download"
- :disabled="selectElements.length == 0"
- @click="openExportDialog"
- >批量导出
- </el-button>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-refresh"
- :disabled="selectElements.length == 0"
- @click="refreshStatistic"
- >统计刷新
- </el-button>
- </div>
- <!-- 数据列表 -->
- <el-table
- v-loading="loading"
- :data="tableData"
- element-loading-text="数据加载中"
- style="width:100%;"
- border
- stripe
- @selection-change="handleSelection"
- >
- <el-table-column type="selection" width="35px"> </el-table-column>
- <el-table-column label="课程名称" prop="courseName" sortable />
- <el-table-column
- width="140px"
- label="课程代码"
- prop="courseCode"
- sortable
- />
- <el-table-column
- width="102px"
- label="试卷类型"
- prop="paperType"
- sortable
- />
- <el-table-column width="102px" label="试卷状态" sortable>
- <template slot-scope="scope">
- <span
- @click="openAllotDialog(scope.row)"
- style="cursor: pointer"
- >{{ scope.row.paperStatusName }}</span
- >
- </template>
- </el-table-column>
- <el-table-column label="试卷名称" prop="paperName" sortable />
- <el-table-column
- width="102px"
- label="试卷P数"
- prop="paperP"
- sortable
- />
- <el-table-column
- width="102px"
- label="考生人数"
- prop="totalStudent"
- sortable
- />
- <el-table-column width="180px" label="操作" :context="_self">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-download"
- :disabled="scope.row.paperStatus <= 1"
- @click="openExportDialog(scope.row)"
- plain
- >下载
- </el-button>
- <el-dropdown style="margin-left: 10px;">
- <el-button
- size="mini"
- type="primary"
- :disabled="scope.row.paperStatus == 0"
- plain
- >
- 更多<i class="el-icon-arrow-down el-icon--right"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item>
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-view"
- :disabled="scope.row.paperStatus <= 1"
- @click="preview(scope.row)"
- plain
- >试卷预览
- </el-button>
- </el-dropdown-item>
- <el-dropdown-item>
- <el-button
- size="mini"
- type="primary"
- icon="el-icon-menu"
- :disabled="!hasPermit"
- @click="openAllotDialog(scope.row)"
- plain
- >试卷指定
- </el-button>
- </el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <div class="page pull-right">
- <el-pagination
- @current-change="handlePagerNo"
- :current-page="formSearch.pageNo"
- @size-change="handlePagerSize"
- :page-size="formSearch.pageSize"
- :page-sizes="[10, 20, 50, 100]"
- :total="totalElements"
- layout="total, sizes, prev, pager, next, jumper"
- ></el-pagination>
- </div>
- </div>
- <el-dialog
- title="试卷指定"
- width="380px"
- :visible.sync="allotDialog"
- @close="closeAllotDialog"
- >
- <el-form
- :model="allotForm"
- ref="allotForm"
- :rules="rules"
- label-position="right"
- label-width="80px"
- inline-message
- >
- <el-form-item label="课程名称" prop="courseName">
- <el-input
- v-model="allotForm.courseName"
- :disabled="true"
- class="w220"
- >
- {{ allotForm.courseName }}</el-input
- >
- </el-form-item>
- <el-form-item label="试卷类型" prop="paperType">
- <el-input
- v-model="allotForm.paperType"
- :disabled="true"
- class="w220"
- >
- {{ allotForm.paperType }}</el-input
- >
- </el-form-item>
- <el-form-item label="试卷名称" prop="coursePaperId">
- <el-select
- v-model="allotForm.coursePaperId"
- placeholder="请选择"
- class="w220"
- >
- <el-option
- v-for="item in coursePaperList"
- :value="item.coursePaperId"
- :key="item.coursePaperId"
- :label="item.paperName"
- ></el-option>
- </el-select>
- </el-form-item>
- <div style="text-align: center">
- <el-button type="primary" @click="saveAllot">确 定</el-button>
- <el-button @click="closeAllotDialog">取 消</el-button>
- </div>
- </el-form>
- </el-dialog>
- <el-dialog
- title="试卷整体分配"
- width="400px"
- :visible.sync="allotAllDialog"
- @close="closeAllotAllDialog"
- >
- <el-form
- :model="allotAllForm"
- ref="allotAllForm"
- :rules="rules"
- label-position="right"
- label-width="80px"
- inline-message
- >
- <el-form-item label="学校名称" prop="orgId">
- <el-select
- v-model="allotAllForm.orgId"
- @change="loadAllotExamList(allotAllForm.orgId)"
- placeholder="请选择"
- class="w220"
- >
- <el-option
- v-for="item in orgList"
- :label="item.orgName"
- :value="item.orgId"
- :key="item.orgId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="考试名称" prop="examId">
- <el-select
- v-model="allotAllForm.examId"
- placeholder="请选择"
- class="w220"
- >
- <el-option
- v-for="item in allotExamList"
- :label="item.examName"
- :value="item.examId"
- :key="item.examId"
- ></el-option>
- </el-select>
- </el-form-item>
- <div style="text-align: center">
- <p style="color: red;">
- 警告:确定后当前考试中“未指定试卷”的课程会在已有的试卷中随机选取一套试卷分配关联,是否确定执行?
- </p>
- <el-button
- type="primary"
- @click="saveAllotAll"
- :disabled="allotAllForm.examId == ''"
- >确 定</el-button
- >
- <el-button @click="closeAllotAllDialog">取 消</el-button>
- </div>
- </el-form>
- </el-dialog>
- <el-dialog
- title="导出"
- width="450px"
- :visible.sync="exportDialog"
- @close="closeExportDialog"
- >
- <el-form
- :model="exportForm"
- ref="exportForm"
- :rules="rules"
- label-position="right"
- label-width="90px"
- inline-message
- >
- <el-form-item label="导出内容" prop="types">
- <el-checkbox-group v-model="exportForm.types">
- <el-checkbox label="1">试卷</el-checkbox>
- <el-checkbox label="2">答案</el-checkbox>
- <el-checkbox label="3">试卷结构</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <div style="text-align: center">
- <el-button
- type="primary"
- @click="doExport"
- :disabled="exportForm.types.length == 0"
- >确定</el-button
- >
- <el-button @click="closeExportDialog">取 消</el-button>
- </div>
- </el-form>
- </el-dialog>
- <el-dialog
- title="试卷整体导出"
- width="430px"
- :visible.sync="exportAllDialog"
- @close="closeExportAllDialog"
- >
- <el-form
- :model="exportAllForm"
- ref="exportAllForm"
- :rules="rules"
- label-position="right"
- label-width="90px"
- inline-message
- >
- <el-form-item label="学校名称" prop="orgId">
- <el-select
- v-model="exportAllForm.orgId"
- @change="loadExportExamList(exportAllForm.orgId)"
- placeholder="请选择"
- class="w245"
- >
- <el-option
- v-for="item in orgList"
- :label="item.orgName"
- :value="item.orgId"
- :key="item.orgId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="考试名称" prop="examId">
- <el-select
- v-model="exportAllForm.examId"
- @change="loadExamCoursePaperTotal"
- placeholder="请选择"
- class="w245"
- >
- <el-option
- v-for="item in exportExamList"
- :label="item.examName"
- :value="item.examId"
- :key="item.examId"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="导出内容" prop="types">
- <el-checkbox-group v-model="exportAllForm.types">
- <el-checkbox label="1">试卷</el-checkbox>
- <el-checkbox label="2">答案</el-checkbox>
- <el-checkbox label="3">试卷结构</el-checkbox>
- </el-checkbox-group>
- </el-form-item>
- <el-form-item label="试卷总数" prop="allNum">
- {{ exportAllForm.allNum }}
- </el-form-item>
- <el-form-item label="已有试卷数" prop="existNum">
- {{ exportAllForm.existNum }}
- </el-form-item>
- <el-form-item label="缺少试卷数" prop="missNum">
- {{ exportAllForm.missNum }}
- </el-form-item>
- <div style="text-align: center">
- <el-button
- type="primary"
- @click="doExportAll"
- :disabled="exportAllForm.existNum == 0"
- >确定</el-button
- >
- <el-button @click="closeExportAllDialog">取 消</el-button>
- </div>
- </el-form>
- </el-dialog>
- </div>
- </section>
- </template>
- <script>
- import { CORE_API, PRINT_API } from "@/constants/constants";
- import { coursePaperStatusList } from "../constants/constants.js";
- import { mapState } from "vuex";
- import { checkEmptyStr, checkEmptyNumber } from "../utils/common.js";
- export default {
- data() {
- return {
- formSearch: {
- orgId: "",
- examId: "",
- courseId: "",
- paperStatus: "",
- paperName: "",
- pageNo: 1,
- pageSize: 10
- },
- curUserRole: {},
- hasPermit: false,
- totalElements: 0,
- loading: false,
- tableData: [],
- orgList: [],
- examList: [],
- courseList: [],
- coursePaperList: [],
- coursePaperStatusList: coursePaperStatusList,
- allotExamList: [],
- allotDialog: false,
- allotForm: {
- id: "",
- coursePaperId: "",
- courseName: "",
- paperType: ""
- },
- allotAllDialog: false,
- allotAllForm: {
- orgId: "",
- examId: ""
- },
- selectElements: [],
- exportExamList: [],
- exportDialog: false,
- exportForm: {
- ids: [],
- types: []
- },
- exportAllDialog: false,
- exportAllForm: {
- orgId: "",
- examId: "",
- types: [],
- allNum: 0,
- existNum: 0,
- missNum: 0
- },
- rules: {
- orgId: [
- { required: true, message: "学校不能为空!", trigger: "change" }
- ],
- examId: [
- { required: true, message: "考试不能为空!", trigger: "change" }
- ],
- coursePaperId: [
- { required: true, message: "试卷不能为空!", trigger: "change" }
- ],
- courseName: [
- { required: true, message: "课程不能为空!", trigger: "change" }
- ],
- paperType: [
- { required: true, message: "试卷类型不能为空!", trigger: "change" }
- ],
- types: [
- { required: true, message: "请选择导出内容!", trigger: "change" }
- ]
- }
- };
- },
- methods: {
- handleSelection(elements) {
- /* 处理选中记录 */
- this.selectElements = elements;
- },
- handlePagerNo(pageNo) {
- /* 处理分页 */
- this.searchRecords(pageNo);
- },
- handlePagerSize(pageSize) {
- /* 处理每页条数 */
- this.formSearch.pageSize = pageSize;
- this.searchRecords(1);
- },
- resetSearchForm() {
- this.formSearch.courseId = "";
- this.formSearch.paperStatus = "";
- this.formSearch.paperName = "";
- //this.searchRecords(1);
- },
- searchRecords(pageNo) {
- this.formSearch.pageNo = pageNo;
- /* 查询记录列表 */
- let orgId = this.formSearch.orgId;
- if (checkEmptyNumber(orgId)) {
- this.$notify({
- title: "提示",
- message: "请选择学校!",
- type: "warning"
- });
- return;
- }
- let examId = this.formSearch.examId;
- if (checkEmptyNumber(examId)) {
- this.$notify({
- title: "提示",
- message: "请选择考试!",
- type: "warning"
- });
- return;
- }
- this.loading = true;
- let url = PRINT_API + "/course/statistic/list";
- this.$http.post(url, this.formSearch).then(
- response => {
- this.tableData = response.data.content;
- this.totalElements = response.data.totalElements;
- this.loading = false;
- },
- error => {
- console.log(error);
- this.loading = false;
- }
- );
- },
- selectDefault() {
- if (this.orgList.length > 0) {
- let firstOrgId = this.orgList[0].orgId;
- this.formSearch.orgId = firstOrgId;
- this.loadExamList(firstOrgId);
- }
- },
- loadOrgList() {
- /* 查询学校列表 */
- let url = PRINT_API + "/printing/project/org/list";
- this.$http.post(url).then(
- response => {
- this.orgList = response.data;
- this.selectDefault();
- },
- error => {
- console.log(error.response);
- // ignore
- }
- );
- },
- loadExamList(orgId) {
- /* 查询考试列表 */
- this.formSearch.examId = "";
- this.examList = [];
- this.tableData = [];
- if (checkEmptyNumber(orgId)) {
- return;
- }
- let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
- this.$http.post(url).then(response => {
- this.examList = response.data;
- if (this.examList.length > 0) {
- this.formSearch.examId = this.examList[0].examId;
- this.searchRecords(1);
- }
- });
- },
- loadAllotExamList(orgId) {
- /* 查询考试列表 */
- this.allotAllForm.examId = "";
- this.allotExamList = [];
- if (!checkEmptyNumber(orgId)) {
- let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
- this.$http.post(url).then(response => {
- this.allotExamList = response.data;
- });
- }
- },
- loadExportExamList(orgId) {
- /* 查询考试列表 */
- this.exportAllForm.examId = "";
- this.exportExamList = [];
- if (!checkEmptyNumber(orgId)) {
- let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
- this.$http.post(url).then(response => {
- this.exportExamList = response.data;
- });
- }
- },
- loadCourseList(query) {
- /* 查询课程列表 */
- this.courseList = [];
- let url = CORE_API + "/course/query?enable=true";
- let orgId = this.formSearch.orgId;
- if (!checkEmptyNumber(orgId)) {
- url += "&rootOrgId=" + orgId;
- }
- if (!checkEmptyStr(query)) {
- url += "&name=" + query;
- }
- this.$http.get(url).then(response => {
- this.courseList = response.data;
- });
- },
- refreshStatistic() {
- let checkUrl = PRINT_API + "/course/statistic/refresh/check";
- this.$http.get(checkUrl).then(response => {
- if (response.data.data) {
- this.$notify({
- title: "提示",
- message: "尚有课程统计任务正在刷新中,请稍后再刷新!",
- type: "warning"
- });
- } else {
- /* 刷新当前统计信息 */
- this.$confirm("刷新当前统计信息?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- if (this.selectElements.length == 0) {
- this.$notify({
- title: "提示",
- message: "请选择要刷新的项!",
- type: "warning"
- });
- return;
- }
- let params = {};
- params.orgId = this.selectElements[0].orgId;
- params.examId = this.selectElements[0].examId;
- params.couses = [];
- this.selectElements.forEach(element => {
- params.couses.push({
- courseId: element.courseId,
- paperType: element.paperType
- });
- });
- let url = PRINT_API + "/course/statistic/refresh";
- this.$http.post(url, params).then(
- () => {
- this.$notify({
- title: "提示",
- type: "success",
- message: "刷新成功!"
- });
- this.searchRecords(this.formSearch.pageNo);
- },
- error => {
- console.log(error.response);
- this.$notify({
- title: "错误",
- type: "error",
- message: error.response.data.desc
- });
- }
- );
- })
- .catch(() => {
- //ignore
- });
- }
- });
- },
- preview(row) {
- /* 预览试卷PDF */
- let url = row.paperPdfUrl;
- if (!url) {
- this.$notify({
- title: "提示",
- message: "当前试卷不存在!",
- type: "warning"
- });
- return;
- }
- this.$confirm("确定预览?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- window.open(url);
- })
- .catch(() => {
- /*ignore*/
- });
- },
- openAllotDialog(row) {
- /* 试卷状态为"已有"时,打开试卷指定弹窗 */
- if (!this.hasPermit) {
- console.log("no permit.");
- return;
- }
- if (row.paperStatus > 0) {
- this.allotDialog = true;
- this.allotForm.id = row.id;
- this.allotForm.coursePaperId = row.coursePaperId;
- this.allotForm.courseName = row.courseName;
- this.allotForm.paperType = row.paperType;
- let params = {
- orgId: row.orgId,
- examId: row.examId,
- courseId: row.courseId
- };
- let url = PRINT_API + "/course/paper/list";
- this.$http.post(url, params).then(
- response => {
- this.coursePaperList = response.data;
- },
- error => {
- console.log(error);
- }
- );
- }
- },
- closeAllotDialog() {
- /* 关闭试卷指定弹窗 */
- this.allotDialog = false;
- },
- saveAllot() {
- /* 保存试卷指定 */
- this.$refs.allotForm.validate(valid => {
- if (!valid) {
- return false;
- }
- let curLoading = this.$loading({
- lock: true,
- text: "数据保存中!"
- });
- let url =
- PRINT_API +
- "/course/paper/allot/" +
- this.allotForm.id +
- "/" +
- this.allotForm.coursePaperId;
- this.$http.post(url).then(
- () => {
- curLoading.close();
- this.$notify({
- title: "提示",
- message: "试卷指定成功!",
- type: "success"
- });
- this.allotDialog = false;
- this.searchRecords(this.formSearch.pageNo);
- },
- error => {
- console.log(error.response);
- curLoading.close();
- this.$notify({
- title: "错误",
- type: "error",
- message: error.response.data.desc
- });
- }
- );
- });
- },
- openAllotAllDialog() {
- /* 打开试卷整体分配弹窗 */
- this.allotAllDialog = true;
- },
- closeAllotAllDialog() {
- /* 关闭试卷整体分配弹窗 */
- this.allotAllDialog = false;
- },
- saveAllotAll() {
- /* 保存试卷整体分配 */
- this.$refs.allotAllForm.validate(valid => {
- if (!valid) {
- return false;
- }
- let curLoading = this.$loading({
- lock: true,
- text: "数据保存中!"
- });
- let url =
- PRINT_API +
- "/course/paper/allot/all/" +
- this.allotAllForm.orgId +
- "/" +
- this.allotAllForm.examId;
- this.$http.post(url).then(
- () => {
- curLoading.close();
- this.$notify({
- title: "提示",
- message: "试卷整体分配成功!",
- type: "success"
- });
- this.allotAllDialog = false;
- this.searchRecords(this.formSearch.pageNo);
- },
- error => {
- console.log(error.response);
- curLoading.close();
- this.$notify({
- title: "提示",
- type: "warning",
- message: error.response.data.desc
- });
- }
- );
- });
- },
- openExportDialog(row) {
- /* 打开批量导出弹窗 */
- this.exportDialog = true;
- this.exportForm.ids = [];
- if (row.id) {
- this.exportForm.ids.push(row.id);
- }
- },
- closeExportDialog() {
- /* 关闭批量导出弹窗 */
- this.exportDialog = false;
- },
- doExport() {
- /* 批量导出 */
- let ids = [];
- if (this.exportForm.ids.length > 0) {
- ids = this.exportForm.ids;
- } else {
- if (this.selectElements.length == 0) {
- this.$notify({
- title: "提示",
- message: "请选择要导出的项!",
- type: "warning"
- });
- return;
- }
- this.selectElements.forEach(element => {
- if (element.paperStatus > 1) {
- ids.push(element.id);
- }
- });
- }
- this.$refs.exportForm.validate(valid => {
- if (!valid) {
- return false;
- }
- if (ids.length == 0) {
- this.$notify({
- title: "提示",
- message: "包含未被指定试卷的课程则不可导出!",
- type: "warning"
- });
- return;
- }
- this.closeExportDialog();
- let url =
- PRINT_API +
- "/course/paper/export/batch?ids=" +
- ids.join(",") +
- "&types=" +
- this.exportForm.types.join(",");
- //console.log(url);
- window.location.href = url;
- });
- },
- openExportAllDialog() {
- /* 打开整体导出弹窗 */
- this.exportAllDialog = true;
- },
- closeExportAllDialog() {
- /* 关闭整体导出弹窗 */
- this.exportAllDialog = false;
- },
- doExportAll() {
- /* 整体导出 */
- this.$refs.exportAllForm.validate(valid => {
- if (!valid) {
- return false;
- }
- this.closeExportAllDialog();
- let url =
- PRINT_API +
- "/course/paper/export/all?orgId=" +
- this.exportAllForm.orgId +
- "&examId=" +
- this.exportAllForm.examId +
- "&types=" +
- this.exportAllForm.types.join(",");
- //console.log(url);
- window.location.href = url;
- });
- },
- loadExamCoursePaperTotal() {
- /* 查询考试的试卷数量情况 */
- let url =
- PRINT_API +
- "/course/paper/total/" +
- this.exportAllForm.orgId +
- "/" +
- this.exportAllForm.examId;
- this.$http.post(url).then(
- response => {
- let data = response.data;
- this.exportAllForm.allNum = data.allNum;
- this.exportAllForm.existNum = data.existNum;
- this.exportAllForm.missNum = data.missNum;
- },
- error => {
- console.log(error);
- }
- );
- }
- },
- computed: {
- ...mapState({ user: state => state.user })
- },
- created() {
- this.loadOrgList();
- this.loadUserRole(this.user);
- if (this.curUserRole.isSuperLeader || this.curUserRole.isPM) {
- this.hasPermit = true;
- } else {
- this.hasPermit = false;
- }
- }
- };
- </script>
- <style scoped>
- .page {
- margin-top: 10px;
- }
- .pull-right {
- float: right;
- }
- .pull-left {
- float: left;
- }
- .w220 {
- width: 220px;
- }
- .w245 {
- width: 245px;
- }
- </style>
|