123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450 |
- <template>
- <el-container>
- <el-main class="el-main-padding">
- <commonFormVue :form="form" :getExamCondition="getExamCondition">
- <el-col :span="6">
- <el-form-item label="是否缺考">
- <el-select
- class="form_search_width"
- size="small"
- v-model="form.finished"
- clearable
- placeholder="全部"
- >
- <el-option value="false" label="是"></el-option>
- <el-option value="true" label="否"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </commonFormVue>
- <el-row>
- <el-col :span="24">
- <el-button
- @click="search('clickSelectBtn')"
- size="small"
- type="primary"
- icon="el-icon-search"
- >查询</el-button
- >
- <el-button size="small" icon="el-icon-refresh" @click="resetForm"
- >重置</el-button
- >
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24" v-show="currentPagePrivileges.SCORE_STATICS_EXPORT">
- <div class="block-seperator"></div>
- <span>操作:</span>
- <el-button
- type="primary"
- size="small"
- icon="el-icon-download"
- @click="openExportDialog"
- v-show="!exportLoading"
- >导出</el-button
- >
- <el-button
- size="small"
- icon="el-icon-download"
- :loading="true"
- v-show="exportLoading"
- >导出数据中...</el-button
- >
- </el-col>
- </el-row>
- <el-row class="margin-top-10">
- <el-col :span="24">
- <el-table
- v-loading="tableLoading"
- element-loading-text="数据加载中"
- ref="multipleTable"
- @selection-change="handleSelectionChange"
- :data="tableData"
- border
- >
- <el-table-column
- sortable
- label="学习中心"
- prop="orgName"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="姓名"
- prop="studentName"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="身份证号"
- prop="identityNumber"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="学号"
- prop="studentCode"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="课程"
- prop="courseNameAndCode"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="课程层次"
- prop="courseLevel"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="年级"
- prop="grade"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="采集人"
- prop="infoCollector"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="专业"
- prop="specialtyName"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- :sort-method="sortByDisciplineCount"
- label="违纪次数"
- prop="disciplineCount"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- :sort-method="sortBySubmitCount"
- label="正常交卷次数"
- prop="submitCount"
- width="150"
- ></el-table-column>
- <el-table-column
- sortable
- label="剩余考试次数"
- prop="leftExamTimes"
- width="150"
- ></el-table-column>
- <el-table-column
- sortable
- label="是否缺考"
- prop="isAbsent"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="客观分"
- prop="objectiveScore"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="主观分"
- prop="subjectiveScore"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="最终成绩"
- prop="finalExamScore"
- width="120"
- ></el-table-column>
- <el-table-column
- sortable
- label="成绩统计时间"
- prop="startTime"
- width="155"
- ></el-table-column>
- </el-table>
- <div class="block pull-right">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page.sync="form.pageNo"
- :page-sizes="[10, 20, 50, 100, 200, 300]"
- :page-size="form.pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- ></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 pagePrivilege from "../mixin/pagePrivilege.js";
- export default {
- components: { commonFormVue },
- mixins: [pagePrivilege],
- data() {
- return {
- total: 0,
- tableLoading: false,
- dialogExportTypeVisible: false,
- exportLoading: false,
- form: {
- rootOrgId: null,
- examRecordDataId: null,
- hasStranger: null,
- courseId: null,
- courseLevel: null,
- examId: null,
- faceSuccessPercentLower: null,
- faceSuccessPercentUpper: null,
- livenessSuccessPercentLower: null,
- livenessSuccessPercentUpper: null,
- identityNumber: null,
- orgId: null,
- studentCode: null,
- studentName: null,
- isWarn: null,
- pageNo: 1,
- pageSize: 10,
- finished: "",
- startLimit: "",
- endLimit: "",
- ORG_FIND_ALL: false, //查询所有机构
- examStageId: null
- },
- getExamCondition: {
- params: {
- name: "",
- examTypes: "ONLINE#OFFLINE#ONLINE_HOMEWORK"
- },
- filterCondition: ""
- },
- tableData: [],
- exportUrl: "/api/ecs_oe_admin/exam/score/statistic/list/export/async",
- exportFileName: "成绩统计",
- currentPagePrivileges: {
- SCORE_STATICS_EXPORT: false //导出
- },
- exportType: "ALL"
- };
- },
- computed: {
- ...mapState({ user: state => state.user })
- },
- methods: {
- resetForm() {
- this.form = {
- examRecordDataId: null,
- hasStranger: null,
- courseId: null,
- courseLevel: null,
- examId: null,
- faceSuccessPercentLower: null,
- faceSuccessPercentUpper: null,
- livenessSuccessPercentLower: null,
- livenessSuccessPercentUpper: null,
- identityNumber: null,
- orgId: this.form.ORG_FIND_ALL ? null : this.form.orgId,
- studentCode: null,
- studentName: null,
- isWarn: null,
- pageNo: 1,
- pageSize: 10,
- finished: "",
- startLimit: "",
- endLimit: "",
- ORG_FIND_ALL: this.form.ORG_FIND_ALL,
- examStageId: null
- };
- },
- search(type) {
- if (!this.form.examId) {
- this.$notify({
- title: "警告",
- message: "请选择考试",
- type: "warning",
- duration: 1000
- });
- return false;
- }
- if (type && type == "clickSelectBtn") {
- this.form.pageNo = 1;
- }
- this.tableLoading = true;
- this.$http
- .post("/api/ecs_oe_admin/exam/score/statistic/list", this.form)
- .then(response => {
- if (response.data) {
- this.tableData = response.data.content;
- this.total = response.data.totalElements;
- } else {
- this.tableData = [];
- }
- this.tableLoading = false;
- });
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- /**
- * pagesize改变时触发
- */
- handleSizeChange(val) {
- this.form.pageSize = val;
- this.search();
- },
- /**
- * 当前页改变时触发
- */
- 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();
- this.asyncExportData();
- });
- } else {
- this.dialogExportTypeVisible = false;
- // this._exportData();
- this.asyncExportData();
- }
- });
- },
- asyncExportData() {
- this.form.rootOrgId = this.user.rootOrgId;
- this.$http
- .get(this.exportUrl, {
- params: {
- query: this.form
- }
- })
- .then(() => {
- this.$notify({
- type: "success",
- message: "正在后台导出中,请稍后到“导出任务列表”中下载!"
- });
- });
- },
- _exportData() {
- this.exportLoading = true;
- this.$http
- .get(this.exportUrl, {
- params: {
- query: this.form
- },
- responseType: "arraybuffer",
- timeout: 20 * 60 * 1000 //限时20分钟
- })
- .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;
- });
- },
- sortByDisciplineCount(obj1, obj2) {
- let p1 = Number(obj1.disciplineCount);
- let p2 = Number(obj2.disciplineCount);
- if (isNaN(p1)) {
- p1 = 0;
- }
- if (isNaN(p2)) {
- p2 = 0;
- }
- return p1 - p2;
- },
- sortBySubmitCount(obj1, obj2) {
- let p1 = Number(obj1.submitCount);
- let p2 = Number(obj2.submitCount);
- if (isNaN(p1)) {
- p1 = 0;
- }
- if (isNaN(p2)) {
- p2 = 0;
- }
- return p1 - p2;
- }
- },
- created() {}
- };
- </script>
- <style scoped src="../style/common.css"></style>
|