| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- <!-- 考试安排 -->
- <template>
- <div class="app-container examinationArrange">
- <div class="page-container examinationArrangePage" v-if="pageType === 1">
- <div class="page-form-title-box">
- <el-form :model="queryParams" class="form-box" ref="queryForm"
- :inline="true" style="width:100%;">
- <el-form-item label="" prop="shareStatus">
- <el-select v-model="queryParams.shareStatus" placeholder="是否共享" style="width: 120px">
- <el-option label="共享" value="1"/>
- <el-option label="不共享" value="2"/>
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="disciplineTypeId">
- <el-select v-model="queryParams.disciplineTypeId" placeholder="专业类别" style="width: 140px">
- <el-option
- v-for="dict in optionListA"
- :key="dict.id"
- :label="dict.disciplineName"
- :value="dict.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="examTypeId">
- <el-select v-model="queryParams.examTypeId" placeholder="考试类别" style="width: 140px">
- <el-option
- v-for="dict in optionListB"
- :key="dict.id"
- :label="dict.examTypeName"
- :value="dict.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="deptId">
- <el-cascader
- style="width: 180px"
- v-model="queryParams.deptId"
- :options="optionListC"
- :props="{
- emitPath:false,
- checkStrictly: true,
- value: 'deptId',
- label: 'deptName',
- children: 'child',
- }"
- :show-all-levels="false"
- filterable
- placeholder="学院单位"
- ></el-cascader>
- </el-form-item>
- <el-form-item label="" prop="status">
- <el-select v-model="queryParams.status" placeholder="状态" style="width: 120px">
- <el-option label="停用" value="0"/>
- <el-option label="未开始" value="1"/>
- <el-option label="进行中" value="2"/>
- <el-option label="已结束" value="3"/>
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="makeup">
- <el-select v-model="queryParams.makeup" placeholder="是否补考" style="width: 140px">
- <el-option label="正常考试" value="0"/>
- <el-option label="补考" value="1"/>
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="searchValue">
- <el-input
- maxLength="30"
- v-model="queryParams.searchValue"
- placeholder="考试名称"
- style="width: 140px"
- />
- </el-form-item>
- <el-form-item label="" prop="state">
- <el-date-picker
- :clearable="false"
- v-model="dateRange"
- size="small"
- style="width: 220px"
- value-format="yyyy-MM-dd"
- type="daterange"
- range-separator="-"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- ></el-date-picker>
- </el-form-item>
- <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
- <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
- <p class="page-submit-common-style-button"
- style="float: right;"
- @click="tableButton(1)"
- v-hasPermiRouter="['exam:elExam:add']"
- >新建考试</p>
- </el-form>
- </div>
- <div class="page-content-box">
- <el-table class="table-box" border :data="dataList">
- <el-table-column label="考试名称" prop="examName" show-overflow-tooltip>
- <template slot-scope="scope">
- <span style="color:#0183fa;cursor: pointer;" @click="tableButton(7,scope.row)">{{scope.row.examName}}</span>
- </template>
- </el-table-column>
- <el-table-column label="考试类型" prop="examTypeName" width="140" show-overflow-tooltip/>
- <el-table-column label="专业类别" prop="disciplineTypeName" width="140" show-overflow-tooltip/>
- <el-table-column label="是否共享" prop="shareStatus" width="120" show-overflow-tooltip>
- <template slot-scope="scope">
- <span style="padding:2px 10px;border:1px solid rgb(1, 131, 251);border-radius:4px;color: rgb(1, 131, 251);background-color:rgba(1, 131, 251,0.2)" v-if="scope.row.shareStatus==1">共享</span>
- <span style="padding:2px 10px;border:1px solid rgb(245, 154, 35);border-radius:4px;color: rgb(245, 154, 35);background-color:rgba(245, 154, 35,0.2)" v-if="scope.row.shareStatus==0">不共享</span>
- </template>
- </el-table-column>
- <el-table-column label="考试时间" prop="createTime" width="300" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{parseTime(scope.row.startTime,"{y}-{m}-{d} {h}:{i}")}} 至 {{parseTime(scope.row.endTime,"{y}-{m}-{d} {h}:{i}")}}</span>
- </template>
- </el-table-column>
- <el-table-column label="可考次数" prop="attemptLimit" width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{scope.row.attemptLimit==0?'不限次数':scope.row.attemptLimit}}</span>
- </template>
- </el-table-column>
- <el-table-column label="考试范围" prop="scopeType" width="140" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{scope.row.scopeType==1?'全校':(scope.row.scopeType==2?'规则范围':(scope.row.scopeType==3?'指定考生':''))}}</span>
- </template>
- </el-table-column>
- <el-table-column label="状态" prop="status" width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- <span>{{scope.row.status==0?'停用':(scope.row.status==1?'未开始':(scope.row.status==2?'进行中':(scope.row.status==3?'已结束':'')))}}</span>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="220" show-overflow-tooltip v-if="tableButtonType">
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p"
- v-if="scope.row.showMakeup"
- v-hasPermiRouter="['exam:elExam:makeupAdd']"
- @click="tableButton(2,scope.row)"
- >补考</p>
- <p class="table-button-p"
- v-hasPermiRouter="['exam:elExam:edit']"
- @click="tableButton(3,scope.row)"
- >编辑</p>
- <p class="table-button-p"
- v-hasPermiRouter="['exam:elExam:copy']"
- @click="tableButton(4,scope.row)"
- >复制</p>
- <p class="table-button-p"
- v-hasPermiRouter="['exam:elExam:del']"
- @click="tableButton(5,scope.row)"
- >删除</p>
- <p class="table-button-null"></p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.page"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </div>
- <add-page :propsData="propsData" v-if="pageType === 2"></add-page>
- <students-taking-make-up-exams :propsData="propsData" v-if="pageType === 3"></students-taking-make-up-exams>
- </div>
- </template>
- <script>
- //import { getDicts } from "@/api/commonality/noPermission";
- //import { systemUserSelect } from "@/api/commonality/permission";
- //import { getInfo } from "@/api/basicsModules/index";
- import addPage from "./addPage.vue";
- import studentsTakingMakeUpExams from "./studentsTakingMakeUpExams.vue";
- import {
- examElExamPage,examElExamCopy,examElExamDel,
- examElDisciplineTypeList,examElExamTypeList,systemDeptCurrentDept,
- } from "@/api/safetyEducationExaminationNew/index";
- export default {
- name: 'index',
- components: {
- addPage,
- studentsTakingMakeUpExams
- },
- data () {
- return {
- tableButtonType:this.hasPermiDom(['exam:elExam:makeupAdd','exam:elExam:edit','exam:elExam:copy','exam:elExam:del']),
- //页面状态
- pageType:1,
- //下拉列表数据
- optionListA:[],
- optionListB:[],
- optionListC:[],
- //查询条件
- queryParams:{
- page:1,
- pageSize:20,
- shareStatus :null,
- disciplineTypeId :null,
- examTypeId :null,
- deptId :null,
- status :null,
- makeup :null,
- searchValue:"",
- },
- //时间数据
- dateRange:[],
- //列表数据
- dataList:[{}],
- //数据数量
- total:0,
- //组件传参
- propsData:{},
- }
- },
- created () {
- },
- mounted () {
- this.getList();
- this.examElDisciplineTypeList();
- this.examElExamTypeList();
- this.systemDeptCurrentDept();
- },
- methods: {
- //查询按钮
- handleQuery(){
- this.$set(this.queryParams,'page',1);
- this.getList();
- },
- //重置按钮
- resetQuery(){
- this.$set(this,'dateRange',[])
- this.$set(this,'queryParams',{
- page:1,
- pageSize:20,
- shareStatus :null,
- disciplineTypeId :null,
- examTypeId :null,
- deptId :null,
- status :null,
- makeup :null,
- searchValue:"",
- });
- this.getList();
- },
- //获取数据列表
- getList(){
- let obj = JSON.parse(JSON.stringify(this.queryParams))
- if(this.dateRange[0]){
- obj.startTime = this.dateRange[0]+'T00:00:00'
- obj.endTime = this.dateRange[1]+'T23:59:59'
- }else{
- obj.startTime = "";
- obj.endTime = "";
- }
- examElExamPage(obj).then(response => {
- this.$set(this,'dataList',response.data.records);
- this.$set(this,'total',response.data.total);
- });
- },
- //操作按钮
- tableButton(type,row){
- let self = this;
- if(type == 1){
- //新增
- this.$set(this,'pageType',2);
- this.$set(this,'propsData',{});
- }else if(type == 2){
- //补考
- this.$set(this,'pageType',3);
- this.$set(this,'propsData',{id:row.id});
- }else if(type == 3){
- //编辑
- this.$set(this,'pageType',2);
- let obj = JSON.parse(JSON.stringify(row))
- this.$set(this,'propsData',obj);
- }else if(type == 4){
- //复制
- this.$confirm('是否确认复制?', "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- }).then(() => {
- examElExamCopy({id:row.id}).then(response => {
- self.msgSuccess(response.message)
- self.getList();
- });
- }).catch(() => {});
- }else if(type == 5){
- //删除
- this.$confirm('是否确认删除?', "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- }).then(() => {
- examElExamDel({id:row.id}).then(response => {
- self.msgSuccess(response.message)
- self.getList();
- });
- }).catch(() => {});
- }else if(type == 6){
- //返回并刷新
- this.$set(this,'pageType',1);
- this.getList();
- }else if(type == 7){
- //详情
- this.$set(this,'pageType',2);
- let obj = JSON.parse(JSON.stringify(row))
- obj.showType = true;
- this.$set(this,'propsData',obj);
- }
- },
- //查询全部专业类别
- examElDisciplineTypeList(){
- examElDisciplineTypeList({}).then(response => {
- this.$set(this,'optionListA',response.data);
- });
- },
- //查询全部考试类型
- examElExamTypeList(){
- examElExamTypeList({}).then(response => {
- this.$set(this,'optionListB',response.data);
- });
- },
- //学院列表
- systemDeptCurrentDept(){
- systemDeptCurrentDept({}).then(response => {
- const list = response.data || [];
- this.formatTreeData(list);
- this.$set(this,'optionListC',list);
- });
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .examinationArrange{
- .examinationArrangePage{
- }
- }
- </style>
|