| | |
| | | <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column prop="subjectId" label="课目" :formatter="subjectFormatter" width="120px" /> |
| | | <el-table-column prop="name" label="名称" /> |
| | | <el-table-column label="操作" align="center" width="260px"> |
| | | <el-table-column label="操作" align="center" width="360px"> |
| | | <template slot-scope="{row}"> |
| | | <el-button size="mini" @click="$router.push({path:'/exam/personalRandomTemplate/edit',query:{id:row.id}})" >编辑</el-button> |
| | | <el-button size="mini" type="primary" @click="missExam(row)">补考</el-button> |
| | | <el-button size="mini" type="danger" @click="deletePaper(row)" class="link-left">删除</el-button> |
| | | <el-button size="mini" type="danger" @click="handleExport(row)" class="link-left">导出</el-button> |
| | | <!-- <el-button size="mini" type="danger" @click="handleExport1(row)" class="link-left">导出1</el-button>--> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize" |
| | | @pagination="search"/> |
| | | |
| | | <el-dialog |
| | | title="补考" |
| | | :visible.sync="dialogVisible" |
| | | width="550px"> |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="考生:" prop="menuIds" required> |
| | | <el-cascader v-model="form.menuIds" :options="options" :props="{ multiple: true }" clearable collapse-tags></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="时间:" prop="limitDateTime" required v-if="examPaper.paperType === 4"> |
| | | <el-date-picker v-model="form.limitDateTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" |
| | | range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | <el-button type="primary" @click="submitUpdate">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { mapActions, mapGetters, mapState } from 'vuex' |
| | | import Pagination from '@/components/Pagination' |
| | | import examPaperApi from '@/api/examPaper' |
| | | import departmentApi from '@/api/department' |
| | | |
| | | export default { |
| | | components: { Pagination }, |
| | | data () { |
| | | return { |
| | | form: { |
| | | menuIds: [], |
| | | userIds: [], |
| | | id: null, |
| | | limitDateTime: [] |
| | | }, |
| | | examPaper: {}, |
| | | dialogVisible: false, |
| | | queryParam: { |
| | | id: null, |
| | | level: null, |
| | |
| | | this.subjectFilter = this.subjects |
| | | }, |
| | | methods: { |
| | | missExam(item) { |
| | | this.form = { |
| | | menuIds: [], |
| | | userIds: [], |
| | | id: null, |
| | | limitDateTime: [] |
| | | } |
| | | this.dialogVisible = true; |
| | | this.examPaper = item; |
| | | departmentApi.getDepartmentUserByTemplateId(item.id).then(res => { |
| | | this.options = res.response.map(x=>{return{value:x.department.id,label:x.department.name,children:x.userList.map(xx=>{return{value: xx.id,label: xx.realName}})}}) |
| | | }) |
| | | }, |
| | | submitUpdate () { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | let op = []; |
| | | for(var ele of this.form.menuIds){ |
| | | op.push(ele[1]) |
| | | }; |
| | | this.form.menuIds = JSON.stringify(this.form.menuIds); |
| | | this.form.userIds = op; |
| | | this.form.id = this.examPaper.id; |
| | | examPaperApi.missExamByTemplateId(this.form).then(re => { |
| | | if (re.code === 1) { |
| | | this.$message.success("操作成功") |
| | | this.dialogVisible = false; |
| | | } |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleExport(row){ |
| | | let fileName = row.name +'.xls' |
| | | let url ='/api/admin/exam/count/exportRandownTemplatesId/'+row.id |