|
@@ -29,12 +29,21 @@
|
|
|
<el-button size="small" icon="el-icon-refresh" @click="resetForm">
|
|
|
重置
|
|
|
</el-button>
|
|
|
- <commonExportVue
|
|
|
- v-show="currentPagePrivileges.SCORE_STATICS_EXPORT"
|
|
|
- :form="form"
|
|
|
- :exportUrl="exportUrl"
|
|
|
- :exportFileName="exportFileName"
|
|
|
- ></commonExportVue>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-refresh"
|
|
|
+ @click="openExportDialog"
|
|
|
+ v-show="!exportLoading"
|
|
|
+ >
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-download"
|
|
|
+ :loading="true"
|
|
|
+ v-show="exportLoading"
|
|
|
+ >导出数据中...
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -94,23 +103,59 @@
|
|
|
>
|
|
|
</el-pagination></div></el-col
|
|
|
></el-row>
|
|
|
+ <el-dialog title="导出方式选择" :visible.sync="dialogExportTypeVisible">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-radio v-model="exportType" label="ALL">全部导出</el-radio>
|
|
|
+ <el-radio v-model="exportType" label="BATCH">分批导出</el-radio>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="margin-top-10" v-show="exportType == 'BATCH'">
|
|
|
+ <el-col :span="4">导出区间</el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ v-model="form.startLimit"
|
|
|
+ placeholder="下限"
|
|
|
+ ></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" style="text-align:center;color:#c0c4cc;">——</el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ v-model="form.endLimit"
|
|
|
+ placeholder="上限"
|
|
|
+ ></el-input>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="margin-top-20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-button type="primary" plain @click="exportData">确定</el-button>
|
|
|
+ <el-button plain @click="dialogExportTypeVisible = false">
|
|
|
+ 取消
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-dialog>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</template>
|
|
|
<script>
|
|
|
import { mapState } from "vuex";
|
|
|
import commonFormVue from "../component/commonForm.vue";
|
|
|
-import commonExportVue from "../component/commonExport.vue";
|
|
|
+//import commonExportVue from "../component/commonExport.vue";
|
|
|
import { DISCIPLINE_TYPE_LIST } from "../constants/constants";
|
|
|
import pagePrivilege from "../mixin/pagePrivilege.js";
|
|
|
export default {
|
|
|
- components: { commonFormVue, commonExportVue },
|
|
|
+ components: { commonFormVue },
|
|
|
mixins: [pagePrivilege],
|
|
|
data() {
|
|
|
return {
|
|
|
disciplineTypeList: DISCIPLINE_TYPE_LIST,
|
|
|
total: 0,
|
|
|
tableLoading: false,
|
|
|
+ dialogExportTypeVisible: false,
|
|
|
+ exportLoading: false,
|
|
|
form: {
|
|
|
examRecordDataId: null,
|
|
|
hasStranger: null,
|
|
@@ -129,7 +174,9 @@ export default {
|
|
|
isWarn: null,
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
- finished: ""
|
|
|
+ finished: "",
|
|
|
+ startLimit: "",
|
|
|
+ endLimit: ""
|
|
|
},
|
|
|
|
|
|
getExamCondition: {
|
|
@@ -144,7 +191,8 @@ export default {
|
|
|
exportFileName: "成绩统计",
|
|
|
currentPagePrivileges: {
|
|
|
SCORE_STATICS_EXPORT: false //导出
|
|
|
- }
|
|
|
+ },
|
|
|
+ exportType: "ALL"
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -170,7 +218,9 @@ export default {
|
|
|
isWarn: null,
|
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
|
- finished: ""
|
|
|
+ finished: "",
|
|
|
+ startLimit: "",
|
|
|
+ endLimit: ""
|
|
|
};
|
|
|
},
|
|
|
search() {
|
|
@@ -211,6 +261,66 @@ export default {
|
|
|
*/
|
|
|
handleCurrentChange() {
|
|
|
this.search();
|
|
|
+ },
|
|
|
+ openExportDialog() {
|
|
|
+ if (!this.form.examId) {
|
|
|
+ this.$notify({
|
|
|
+ title: "警告",
|
|
|
+ message: "请选择考试批次",
|
|
|
+ type: "warning",
|
|
|
+ duration: 1000
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.dialogExportTypeVisible = true;
|
|
|
+ this.exportType = "ALL";
|
|
|
+ this.form.startLimit = "";
|
|
|
+ this.form.endLimit = "";
|
|
|
+ },
|
|
|
+ exportData() {
|
|
|
+ this.$http
|
|
|
+ .post("/api/ecs_oe_admin/exam/record/detail/check", this.form)
|
|
|
+ .then(response => {
|
|
|
+ if (response.data > 0) {
|
|
|
+ this.$confirm("成绩统计存在待审数据,是否继续导出?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.dialogExportTypeVisible = false;
|
|
|
+ this._exportData();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.dialogExportTypeVisible = false;
|
|
|
+ this._exportData();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ _exportData() {
|
|
|
+ this.exportLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get(this.exportUrl, {
|
|
|
+ params: {
|
|
|
+ query: this.form
|
|
|
+ },
|
|
|
+ responseType: "arraybuffer"
|
|
|
+ })
|
|
|
+ .then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ var blob = new Blob([response.data], {
|
|
|
+ type:
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ });
|
|
|
+ var url = URL.createObjectURL(blob);
|
|
|
+ var a = document.createElement("a");
|
|
|
+ a.href = url;
|
|
|
+ a.download = this.exportFileName + ".xlsx";
|
|
|
+ a.target = "_blank";
|
|
|
+ a.click();
|
|
|
+ URL.revokeObjectURL(url);
|
|
|
+ }
|
|
|
+ this.exportLoading = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
created() {}
|
|
@@ -223,4 +333,7 @@ export default {
|
|
|
.margin-top-10 {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+.margin-top-20 {
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
</style>
|