123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718 |
- <template>
- <section class="content" style="margin-top: -18px;">
- <div class="box box-info">
- <!-- 头信息 -->
- <div
- class="box-header with-border"
- style="background-color:#d3dce6;margin-bottom:20px;"
- >
- <h2 class="box-title">课程统计</h2>
- <div class="box-tools pull-right">
- <button type="button" class="btn btn-box-tool" data-widget="collapse">
- <i class="fa fa-minus"></i>
- </button>
- </div>
- </div>
- <!-- 正文信息 -->
- <div class="box-body">
- <el-form
- :model="formSearch"
- :inline="true"
- label-position="right"
- label-width="100px"
- >
- <el-form-item label="学校">
- <el-select
- v-model="formSearch.orgId"
- placeholder="请选择"
- clearable
- @change="searchExamList(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"
- 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="searchCourseList"
- >
- <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"
- ></el-input>
- </el-form-item>
- <el-form-item style="padding-left: 30px">
- <el-button
- size="small"
- type="primary"
- icon="el-icon-search"
- @click="searchRecords"
- >查询
- </el-button>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-menu"
- @click="openAllotAllDialog"
- >分配待指定试卷
- </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"
- @click="openExportDialog"
- >批量导出
- </el-button>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-refresh"
- @click="refreshStatistic"
- >刷新
- </el-button>
- </el-form-item>
- </el-form>
- <!-- 数据列表 -->
- <el-table
- v-loading="loading"
- :data="tableData"
- element-loading-text="数据加载中"
- style="width:100%;"
- border
- >
- <el-table-column type="selection" width="55"> </el-table-column>
- <el-table-column label="课程名称" prop="courseName" />
- <el-table-column width="150" label="课程代码" prop="courseCode" />
- <el-table-column width="80" label="试卷类型" prop="paperType" />
- <el-table-column width="80" label="试卷状态">
- <template slot-scope="scope">
- <span
- @click="openAllotDialog(scope.row);"
- style="cursor: pointer"
- >{{ scope.row.paperStatusName }}</span
- >
- </template>
- </el-table-column>
- <el-table-column width="200" label="试卷名称" prop="paperName" />
- <el-table-column width="80" label="试卷P数" prop="paperP" />
- <el-table-column width="100" label="考生人数" prop="totalStudent" />
- <el-table-column width="180" label="操作" :context="_self">
- <template slot-scope="scope">
- <el-button
- size="mini"
- icon="el-icon-view"
- v-show="scope.row.paperStatus > 1"
- @click="preview(scope.row);"
- >预览
- </el-button>
- <el-button
- size="mini"
- icon="el-icon-download"
- v-show="scope.row.paperStatus > 1"
- @click="download(scope.row);"
- >下载
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <div class="page pull-right">
- <el-pagination
- @current-change="handlePager"
- :current-page="formSearch.pageNo"
- :page-size="formSearch.pageSize"
- :total="totalElements"
- layout="total, 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"
- >
- <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="试卷整体分配" :visible.sync="allotAllDialog">
- <el-form
- :model="allotAllForm"
- label-position="right"
- label-width="100px"
- >
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="学校名称">
- <el-select
- v-model="allotAllForm.orgId"
- @change="searchExamList(allotAllForm.orgId, 2);"
- >
- <el-option label="请选择" value></el-option>
- <el-option
- v-for="item in orgList"
- :label="item.orgName"
- :value="item.orgId"
- :key="item.orgId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="考试名称">
- <el-select v-model="allotAllForm.examId">
- <el-option label="请选择" value></el-option>
- <el-option
- v-for="item in examList"
- :label="item.examName"
- :value="item.examId"
- :key="item.examId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :span="20">
- <el-form-item>
- <span style="font-size:20px;color: red;"
- >警告!确定后,选中考试中待指定的课程会在推送试卷中随机选取一套试卷,是否确定执行?</span
- >
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col
- :span="24"
- class="text-center"
- style="border-top: 2px solid;padding-top: 10px;"
- >
- <el-button
- type="primary"
- :disabled="
- allotAllForm.orgId === '' || allotAllForm.examId === ''
- "
- @click="saveAllotAll"
- >确定</el-button
- >
- </el-col>
- </el-row>
- </el-form>
- </el-dialog>
- <el-dialog title="导出" :visible.sync="exportDialog">
- <el-form :model="exportForm" label-position="right" label-width="80px">
- <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>
- <div style="text-align: center">
- <el-button type="primary" @click="doExport">确定导出</el-button>
- <el-button @click="closeExportDialog">取 消</el-button>
- </div>
- </el-form>
- </el-dialog>
- <el-dialog title="试卷整体导出" :visible.sync="exportAllDialog">
- <el-form
- :model="exportAllForm"
- label-position="right"
- label-width="100px"
- >
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="学校名称">
- <el-select
- v-model="exportAllForm.orgId"
- @change="searchExamList(exportAllForm.orgId, 3);"
- >
- <el-option label="请选择" value></el-option>
- <el-option
- v-for="item in orgList"
- :label="item.orgName"
- :value="item.orgId"
- :key="item.orgId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="考试名称">
- <el-select
- v-model="exportAllForm.examId"
- @change="searchExamCoursePaperTotal"
- >
- <el-option label="请选择" value></el-option>
- <el-option
- v-for="item in examList"
- :label="item.examName"
- :value="item.examId"
- :key="item.examId"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="试卷总数">{{
- exportAllForm.allNum
- }}</el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="已有试卷数">{{
- exportAllForm.existNum
- }}</el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="缺少试卷数">{{
- exportAllForm.missNum
- }}</el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="10">
- <el-col :md="20">
- <el-form-item label="导出内容">
- <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-col>
- </el-row>
- <el-row :gutter="10">
- <el-col
- :span="24"
- class="text-center"
- style="border-top: 2px solid;padding-top: 10px;"
- >
- <el-button
- type="primary"
- :disabled="exportAllForm.existNum == 0"
- @click="doExportAll"
- >确定导出</el-button
- >
- </el-col>
- </el-row>
- </el-form>
- </el-dialog>
- </div>
- </section>
- </template>
- <script>
- import { CORE_API, PRINT_API } from "@/constants/constants";
- import { userRole, coursePaperStatusList } from "../constants/constants.js";
- import { mapState } from "vuex";
- export default {
- data() {
- return {
- formSearch: {
- orgId: "",
- examId: "",
- courseId: "",
- paperStatus: "",
- paperName: "",
- pageNo: 1,
- pageSize: 10
- },
- curUserRole: userRole,
- hasPermit: false,
- totalElements: 0,
- loading: false,
- tableData: [],
- orgList: [],
- examList: [],
- courseList: [],
- coursePaperList: [],
- coursePaperStatusList: coursePaperStatusList,
- allotDialog: false,
- allotForm: {
- id: "",
- coursePaperId: "",
- courseName: "",
- paperType: ""
- },
- allotAllDialog: false,
- allotAllForm: {
- orgId: "",
- examId: ""
- },
- exportDialog: false,
- exportForm: {
- orgId: "",
- examId: "",
- courseCode: "",
- courseName: "",
- paperType: "",
- coursePaperId: "",
- courseId: "",
- id: ""
- },
- exportAllDialog: false,
- exportAllForm: {
- orgId: "",
- examId: "",
- exportList: [],
- allNum: 0,
- existNum: 0,
- missNum: 0,
- types: []
- },
- rules: {
- coursePaperId: [
- { required: true, message: "试卷不能为空!", trigger: "change" }
- ],
- courseName: [
- { required: true, message: "课程不能为空!", trigger: "change" }
- ],
- paperType: [
- { required: true, message: "试卷类型不能为空!", trigger: "change" }
- ]
- }
- };
- },
- methods: {
- searchExamCoursePaperTotal() {
- /* xxx */
- },
- openAllotDialog(row) {
- /* 试卷状态为"已有"时,打开试卷指定弹窗 */
- 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 url =
- PRINT_API +
- "/course/paper/allot/" +
- this.allotForm.id +
- "/" +
- this.allotForm.coursePaperId;
- this.$http.post(url).then(
- () => {
- this.$notify({
- message: "试卷指定成功!",
- type: "success"
- });
- this.allotDialog = false;
- this.searchRecords();
- },
- () => {
- this.$notify({
- message: "试卷指定失败!",
- type: "error"
- });
- }
- );
- });
- },
- openAllotAllDialog() {
- /* 打开分配待指定试卷弹窗 */
- this.allotAllDialog = true;
- },
- closeAllotAllDialog() {
- /* 关闭分配待指定试卷弹窗 */
- this.allotAllDialog = false;
- },
- saveAllotAll() {
- /* 保存分配待指定试卷 */
- },
- openExportDialog() {
- /* 打开批量导出弹窗 */
- this.exportDialog = true;
- },
- closeExportDialog() {
- /* 关闭批量导出弹窗 */
- this.exportDialog = false;
- },
- doExport() {
- /* 批量导出 */
- },
- openExportAllDialog() {
- /* 打开整体导出弹窗 */
- this.exportAllDialog = true;
- },
- closeExportAllDialog() {
- /* 关闭整体导出弹窗 */
- this.exportAllDialog = false;
- },
- doExportAll() {
- /* 整体导出 */
- },
- handlePager(current) {
- /* 处理分页 */
- this.formSearch.pageNo = current;
- this.searchRecords();
- },
- searchRecords() {
- /* 查询记录列表 */
- let orgId = this.formSearch.orgId;
- if (this.isEmptyNumber(orgId)) {
- this.$notify({
- message: "请选择学校!",
- type: "warning"
- });
- return;
- }
- let examId = this.formSearch.examId;
- if (this.isEmptyNumber(examId)) {
- this.$notify({
- 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;
- }
- );
- },
- searchExamList(orgId) {
- /* 查询考试列表 */
- this.formSearch.examId = "";
- this.examList = [];
- this.tableData = [];
- if (!this.isEmptyNumber(orgId)) {
- let url = PRINT_API + "/printing/project/exam/list?orgId=" + orgId;
- this.$http.post(url).then(response => {
- this.examList = response.data;
- });
- }
- },
- searchCourseList(query) {
- /* 查询课程列表 */
- this.courseList = [];
- let url = CORE_API + "/course/query?enable=true";
- if (!this.isEmptyStr(query)) {
- url += "&name=" + query;
- }
- this.$http.get(url).then(response => {
- this.courseList = response.data;
- });
- },
- refreshStatistic() {
- /* 刷新当前统计信息 */
- this.$notify({
- message: "Todo...",
- type: "warning"
- });
- },
- preview(row) {
- /* 预览试卷PDF */
- console.log(row);
- this.$notify({
- message: "Todo...",
- type: "warning"
- });
- },
- download(row) {
- /* 下载试卷结构 */
- console.log(row);
- this.$notify({
- message: "Todo...",
- type: "warning"
- });
- }
- },
- 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;
- }
- </style>
|