|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="business-data-export">
|
|
<div class="business-data-export">
|
|
- <div class="part-box part-box-filter part-box-flex">
|
|
|
|
|
|
+ <div class="part-box part-box-filter">
|
|
<el-form ref="FilterForm" label-position="left" label-width="85px" inline>
|
|
<el-form ref="FilterForm" label-position="left" label-width="85px" inline>
|
|
<template v-if="checkPrivilege('condition', 'condition')">
|
|
<template v-if="checkPrivilege('condition', 'condition')">
|
|
<el-form-item label="学期:">
|
|
<el-form-item label="学期:">
|
|
@@ -17,13 +17,21 @@
|
|
></exam-select>
|
|
></exam-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="印刷计划:">
|
|
<el-form-item label="印刷计划:">
|
|
- <print-plan-select
|
|
|
|
|
|
+ <el-select
|
|
v-model.trim="filter.printPlanIdList"
|
|
v-model.trim="filter.printPlanIdList"
|
|
placeholder="印刷计划"
|
|
placeholder="印刷计划"
|
|
clearable
|
|
clearable
|
|
multiple
|
|
multiple
|
|
@change="printPlanChange"
|
|
@change="printPlanChange"
|
|
- ></print-plan-select>
|
|
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in plans"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="课程(代码):" label-width="110px">
|
|
<el-form-item label="课程(代码):" label-width="110px">
|
|
<course-select
|
|
<course-select
|
|
@@ -89,33 +97,41 @@
|
|
>
|
|
>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <div class="part-box-action">
|
|
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'TempleteDownload')"
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- type="success"
|
|
|
|
- :loading="loading"
|
|
|
|
- @click="toDownloadTemplate"
|
|
|
|
- >
|
|
|
|
- 考务数据模板下载
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'import')"
|
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
|
- type="success"
|
|
|
|
- @click="toUpload"
|
|
|
|
- >
|
|
|
|
- 导入
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'export')"
|
|
|
|
- icon="el-icon-download"
|
|
|
|
- type="primary"
|
|
|
|
- :loading="loading"
|
|
|
|
- @click="toExport"
|
|
|
|
- >
|
|
|
|
- 导出查询结果
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <div class="box-justify">
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'export')"
|
|
|
|
+ icon="el-icon-download"
|
|
|
|
+ type="primary"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ @click="toExport"
|
|
|
|
+ >
|
|
|
|
+ 导出查询结果
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'export')"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-s-order"
|
|
|
|
+ @click="toDataTask('EXAMINATION_EXPORT')"
|
|
|
|
+ >导出结果查询</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ type="success"
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
+ @click="toImport"
|
|
|
|
+ >导入考务数据</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-s-order"
|
|
|
|
+ @click="toDataTask('EXAMINATION_IMPORT')"
|
|
|
|
+ >导入结果查询</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -214,11 +230,57 @@
|
|
ref="PreviewBusinessDetail"
|
|
ref="PreviewBusinessDetail"
|
|
:instance="curRow"
|
|
:instance="curRow"
|
|
></preview-business-detail>
|
|
></preview-business-detail>
|
|
- <!-- UploadBusinessDataDialog -->
|
|
|
|
- <upload-business-data-dialog
|
|
|
|
- ref="UploadBusinessDataDialog"
|
|
|
|
- @modified="getList"
|
|
|
|
- ></upload-business-data-dialog>
|
|
|
|
|
|
+ <!-- ImportFile -->
|
|
|
|
+ <import-file
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ ref="ImportFile"
|
|
|
|
+ title="导入考务数据"
|
|
|
|
+ :upload-url="uploadUrl"
|
|
|
|
+ :upload-data="uploadData"
|
|
|
|
+ :format="['xls', 'xlsx']"
|
|
|
|
+ :auto-upload="false"
|
|
|
|
+ :before-submit-handle="submitImport"
|
|
|
|
+ @upload-success="uploadSuccess"
|
|
|
|
+ >
|
|
|
|
+ <el-form
|
|
|
|
+ ref="modalFormComp"
|
|
|
|
+ :model="modalForm"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ label-width="90px"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="模板下载:">
|
|
|
|
+ <el-button type="text" :loading="loading" @click="toDownloadTemplate">
|
|
|
|
+ <span class="cont-link">
|
|
|
|
+ {{ dfilename }}
|
|
|
|
+ </span>
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item prop="printPlanId" label="印刷计划:">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="modalForm.printPlanId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ filterable
|
|
|
|
+ :disabled="loading"
|
|
|
|
+ style="width:100%"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in plans"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </import-file>
|
|
|
|
+ <!-- data-task-dialog -->
|
|
|
|
+ <data-task-dialog
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ ref="DataTaskDialog"
|
|
|
|
+ :task-type="taskType"
|
|
|
|
+ ></data-task-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -227,17 +289,18 @@ import {
|
|
businessDataListPage,
|
|
businessDataListPage,
|
|
businessTotalData,
|
|
businessTotalData,
|
|
businessTemplateDownload,
|
|
businessTemplateDownload,
|
|
- businessDataExport
|
|
|
|
|
|
+ businessDataExport,
|
|
|
|
+ printPlanQuery
|
|
} from "../api";
|
|
} from "../api";
|
|
import PreviewBusinessDetail from "../components/PreviewBusinessDetail";
|
|
import PreviewBusinessDetail from "../components/PreviewBusinessDetail";
|
|
-import UploadBusinessDataDialog from "../components/UploadBusinessDataDialog";
|
|
|
|
|
|
+import ImportFile from "../../../components/ImportFile.vue";
|
|
import { parseTimeRangeDateAndTime } from "@/plugins/utils";
|
|
import { parseTimeRangeDateAndTime } from "@/plugins/utils";
|
|
import { downloadByApi } from "@/plugins/download";
|
|
import { downloadByApi } from "@/plugins/download";
|
|
import pickerOptions from "@/constants/datePickerOptions";
|
|
import pickerOptions from "@/constants/datePickerOptions";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "business-data-export",
|
|
name: "business-data-export",
|
|
- components: { PreviewBusinessDetail, UploadBusinessDataDialog },
|
|
|
|
|
|
+ components: { PreviewBusinessDetail, ImportFile },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
filter: {
|
|
filter: {
|
|
@@ -258,28 +321,31 @@ export default {
|
|
dataList: [],
|
|
dataList: [],
|
|
curRow: {},
|
|
curRow: {},
|
|
totalData: {},
|
|
totalData: {},
|
|
- curPrintPlan: {},
|
|
|
|
loading: false,
|
|
loading: false,
|
|
// date-picker
|
|
// date-picker
|
|
createTime: [],
|
|
createTime: [],
|
|
pickerOptions,
|
|
pickerOptions,
|
|
// import
|
|
// import
|
|
|
|
+ plans: [],
|
|
|
|
+ modalForm: { type: "FILE", printPlanId: "" },
|
|
|
|
+ rules: {
|
|
|
|
+ printPlanId: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请选择印刷计划",
|
|
|
|
+ trigger: "change"
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ taskType: "",
|
|
uploadUrl: "/api/admin/exam/print/data_import",
|
|
uploadUrl: "/api/admin/exam/print/data_import",
|
|
- uploadData: {
|
|
|
|
- type: "FILE",
|
|
|
|
- printPlanId: ""
|
|
|
|
- }
|
|
|
|
|
|
+ dfilename: "考务数据模板.xlsx",
|
|
|
|
+ uploadData: {}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- computed: {
|
|
|
|
- canImport() {
|
|
|
|
- return (
|
|
|
|
- this.curPrintPlan && ["NEW", "READY"].includes(this.curPrintPlan.status)
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
mounted() {
|
|
mounted() {
|
|
this.search();
|
|
this.search();
|
|
|
|
+ this.getPlans();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async getList() {
|
|
async getList() {
|
|
@@ -330,9 +396,6 @@ export default {
|
|
this.filter.examRoom = "";
|
|
this.filter.examRoom = "";
|
|
this.filter.examPlace = "";
|
|
this.filter.examPlace = "";
|
|
},
|
|
},
|
|
- toUpload() {
|
|
|
|
- this.$refs.UploadBusinessDataDialog.open();
|
|
|
|
- },
|
|
|
|
async toExport() {
|
|
async toExport() {
|
|
// 异步导出
|
|
// 异步导出
|
|
if (this.loading) return;
|
|
if (this.loading) return;
|
|
@@ -373,6 +436,29 @@ export default {
|
|
toPreview(row) {
|
|
toPreview(row) {
|
|
this.curRow = { ...row };
|
|
this.curRow = { ...row };
|
|
this.$refs.PreviewBusinessDetail.open();
|
|
this.$refs.PreviewBusinessDetail.open();
|
|
|
|
+ },
|
|
|
|
+ // import
|
|
|
|
+ async getPlans() {
|
|
|
|
+ const res = await printPlanQuery();
|
|
|
|
+ this.plans = res.filter(item => ["NEW", "READY"].includes(item.status));
|
|
|
|
+ },
|
|
|
|
+ toImport() {
|
|
|
|
+ this.$refs.ImportFile.open();
|
|
|
|
+ },
|
|
|
|
+ toDataTask(taskType) {
|
|
|
|
+ this.taskType = taskType;
|
|
|
|
+ this.$refs.DataTaskDialog.open();
|
|
|
|
+ },
|
|
|
|
+ async submitImport() {
|
|
|
|
+ this.uploadData = { ...this.modalForm };
|
|
|
|
+ return this.$refs.modalFormComp.validate();
|
|
|
|
+ },
|
|
|
|
+ validError(errorData) {
|
|
|
|
+ this.$message.error(errorData.message);
|
|
|
|
+ },
|
|
|
|
+ uploadSuccess() {
|
|
|
|
+ this.$message.success("文件上传成功,后台正在导入!");
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|