| | |
| | | /* |
| | | * @Author: Morpheus |
| | | * @Date: 2021-07-05 16:31:54 |
| | | * @Last Modified by: Morpheus |
| | | * @Last Modified time: 2021-07-19 19:39:45 |
| | | * @Last Modified by: liu |
| | | * @Last Modified time: 2021-10-26 15:33:54 |
| | | * menu-name 报名考试 |
| | | */ |
| | | <template> |
| | |
| | | <el-col :span="24" class="hasButOne"> |
| | | <el-card> |
| | | <div class="exam-card-body"> |
| | | |
| | | <avue-crud v-model="obj" |
| | | <avue-crud |
| | | v-model="obj" |
| | | class="company-box" |
| | | :option="questionBankOption" |
| | | :search.sync="questionBankSearch" |
| | |
| | | @current-change="questionBankCurrentChange" |
| | | @size-change="questionBankSizeChange" |
| | | @row-save="questionBankRowSave" |
| | | @row-del="questionBankRowDel"> |
| | | |
| | | @row-del="questionBankRowDel" |
| | | > |
| | | <!-- 自定义按钮 --> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | v-if="false" |
| | | icon="el-icon-download" |
| | | @click="handleImport" |
| | | >清册导入 |
| | |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-refresh-left" |
| | | :disabled="row.cancel==2 || row.isExam==2 || row.isExam==3" |
| | | :disabled=" |
| | | row.cancel == 2 || row.isExam == 2 || row.isExam == 3 |
| | | " |
| | | @click="revoke(row)" |
| | | >取消报名 |
| | | </el-button> |
| | |
| | | >审核通过 |
| | | </el-button> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | |
| | | <el-dialog |
| | |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getdata, |
| | | adddata, |
| | | cancelTrainAudit, |
| | | auditSucess, |
| | | remove, |
| | | } from "@/api/trainingRegistration/trainingRegistration"; |
| | | |
| | | import {getdata,adddata, cancelTrainAudit,auditSucess,remove} from "@/api/trainingRegistration/trainingRegistration"; |
| | | |
| | | import { mapState } from 'vuex' |
| | | import { mapState } from "vuex"; |
| | | |
| | | var DIC = { |
| | | cancel: [{ |
| | | label: '已报名', |
| | | value: 1 |
| | | }, { |
| | | label: '已取消', |
| | | value: 2 |
| | | }] |
| | | } |
| | | |
| | | |
| | | cancel: [ |
| | | { |
| | | label: "已报名", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "已取消", |
| | | value: 2, |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | export default { |
| | | data () { |
| | |
| | | |
| | | // title: '题库', |
| | | |
| | | align: 'center', |
| | | height: 'auto', |
| | | align: "center", |
| | | height: "auto", |
| | | calcHeight: 80, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 4, |
| | | index: true, |
| | | indexLabel: '序号', |
| | | indexLabel: "序号", |
| | | //dialogType: 'drawer', |
| | | dialogClickModal: false, |
| | | // 操作栏宽度 |
| | |
| | | { |
| | | label: "保安姓名", |
| | | prop: "userId", |
| | | type: 'tree', |
| | | dicUrl: '', |
| | | type: "tree", |
| | | dicUrl: "", |
| | | |
| | | hide:true, |
| | | slot: true, |
| | |
| | | label: "title", |
| | | value: "id", |
| | | }, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择保安姓名", |
| | | trigger: "blur" |
| | | }] |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "保安姓名", |
| | |
| | | label: "title", |
| | | value: "id", |
| | | }, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择保安姓名", |
| | | trigger: "blur" |
| | | }] |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "考试名称", |
| | | prop: "trainExamName", |
| | | type: 'tree', |
| | | dicUrl: '/api/exampaper/page-tree', |
| | | type: "tree", |
| | | dicUrl: "/api/exampaper/page-tree", |
| | | // search: true, |
| | | slot: true, |
| | | // 表单新增时是否禁止 |
| | |
| | | label: "examName", |
| | | value: "id", |
| | | }, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择试卷名称", |
| | | trigger: "blur" |
| | | }], |
| | | width: 220 |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "所属公司", |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择所属公司", |
| | | trigger: "blur" |
| | | }], |
| | | width: 220 |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "报名状态", |
| | |
| | | searchValue:1, |
| | | dicData:[ |
| | | { |
| | | label: '已报名', |
| | | value: 1 |
| | | }, { |
| | | label: '已取消', |
| | | value: 2 |
| | | } |
| | | ] |
| | | label: "已报名", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: "已取消", |
| | | value: 2, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "准考证号", |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择准考证号", |
| | | trigger: "blur" |
| | | }], |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | width:100, |
| | | }, |
| | | { |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择准考证号", |
| | | trigger: "blur" |
| | | }], |
| | | width: 200 |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | width: 200, |
| | | }, |
| | | { |
| | | label: "报考证件", |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | rules: [{ |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择准考证号", |
| | | trigger: "blur" |
| | | }], |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: "试卷分数", |
| | |
| | | prop: "trainingTime", |
| | | type: "datetime", |
| | | // span: 24, |
| | | format: 'yyyy-MM-dd HH:mm:ss', |
| | | valueFormat: 'yyyy-MM-dd HH:mm:ss', |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | // 表单新增时是否禁止 |
| | | addDisabled: true, |
| | | // 表单新增时是否可见 |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | value: (new Date().getFullYear() + '-' + (new Date().getMonth() + 1 < 10 |
| | | value: |
| | | new Date().getFullYear() + |
| | | "-" + |
| | | (new Date().getMonth() + 1 < 10 |
| | | ? "0" + (new Date().getMonth() + 1) |
| | | : new Date().getMonth() + 1) + '-' + (new Date().getDate() < 10 |
| | | : new Date().getMonth() + 1) + |
| | | "-" + |
| | | (new Date().getDate() < 10 |
| | | ? "0" + new Date().getDate() |
| | | : new Date().getDate()) + ' ' + (new Date().getHours() < 10 |
| | | : new Date().getDate()) + |
| | | " " + |
| | | (new Date().getHours() < 10 |
| | | ? "0" + new Date().getHours() |
| | | : new Date().getHours()) + ':' + (new Date().getMinutes() < 10 |
| | | : new Date().getHours()) + |
| | | ":" + |
| | | (new Date().getMinutes() < 10 |
| | | ? "0" + new Date().getMinutes() |
| | | : new Date().getMinutes()) + ':' + (new Date().getSeconds() < 10 |
| | | : new Date().getMinutes()) + |
| | | ":" + |
| | | (new Date().getSeconds() < 10 |
| | | ? "0" + new Date().getSeconds() |
| | | : new Date().getSeconds())), |
| | | : new Date().getSeconds()), |
| | | |
| | | width: 150 |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "考试时间", |
| | | prop: "trainExamTime", |
| | | type: "datetime", |
| | | // span: 24, |
| | | format: 'yyyy-MM-dd HH:mm:ss', |
| | | valueFormat: 'yyyy-MM-dd HH:mm:ss', |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | width: 150 |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "审核状态", |
| | |
| | | searchSpan: 4, |
| | | prop: "auditStatus", |
| | | searchValue: 4, |
| | | dicData: [{ |
| | | label: '全部', |
| | | dicData: [ |
| | | { |
| | | label: "全部", |
| | | value: 0, |
| | | }, |
| | | { |
| | | label: '审核通过', |
| | | label: "审核通过", |
| | | value: 1, |
| | | }, |
| | | { |
| | | label: '审核不通过', |
| | | label: "审核不通过", |
| | | value: 2, |
| | | }, |
| | | { |
| | | label: '已提交审核', |
| | | label: "已提交审核", |
| | | value: 3, |
| | | }, |
| | | { |
| | | label: '未提交审核', |
| | | label: "未提交审核", |
| | | value: 4, |
| | | } |
| | | }, |
| | | ], |
| | | props: { |
| | | label: "label", |
| | | value: "value" |
| | | value: "value", |
| | | }, |
| | | editDisplay: false, |
| | | addDisplay: false, |
| | |
| | | // search:true, |
| | | // type:"select" |
| | | // }, |
| | | ] |
| | | ], |
| | | }, |
| | | questionBankSearch: {}, |
| | | questionBankLoading: true, |
| | | questionBankData: [ |
| | | |
| | | ], |
| | | questionBankData: [], |
| | | questionBankPage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 16 |
| | | total: 16, |
| | | }, |
| | | questionBankQuery: {}, |
| | | questionBankSelectionList: [], |
| | |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/trainingRegistration/import-trainingRegistration?examId="+examId, |
| | | action: |
| | | "/api/trainingRegistration/import-trainingRegistration?examId=" + |
| | | examId, |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | } |
| | | }; |
| | | }, |
| | | |
| | | watch: { |
| | |
| | | }, |
| | | }, |
| | | created () { |
| | | console.log(this.userInfo); |
| | | |
| | | console.log(this.userInfo) |
| | | |
| | | if (this.userInfo.role_name.indexOf('ksxtadmin') != -1) { |
| | | |
| | | this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId=" |
| | | if (this.userInfo.role_name.indexOf("ksxtadmin") != -1) { |
| | | this.questionBankOption.column[0].dicUrl = |
| | | "/api/blade-system/dept/lazy-tree-user?parentId="; |
| | | } else { |
| | | this.questionBankOption.column[0].dicUrl = "/api/blade-system/dept/lazy-tree-user?parentId=" + this.userInfo.dept_id |
| | | |
| | | this.questionBankOption.column[0].dicUrl = |
| | | "/api/blade-system/dept/lazy-tree-user?parentId=" + |
| | | this.userInfo.dept_id; |
| | | } |
| | | this.questionBankSearch['cancel'] = 1; |
| | | this.questionBankSearch['auditStatus'] = 0; |
| | | this.questionBankSearch["cancel"] = 1; |
| | | this.questionBankSearch["auditStatus"] = 0; |
| | | }, |
| | | mounted() { |
| | | var flag = false, |
| | |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: state => state.user.userInfo |
| | | userInfo: (state) => state.user.userInfo, |
| | | }), |
| | | ids () { |
| | | let ids = []; |
| | | this.questionBankSelectionList.forEach(ele => { |
| | | this.questionBankSelectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | |
| | | }, |
| | | questionBankOnLoad (page, params = {}) { |
| | | params = this.questionBankSearch; |
| | | params['examId'] = this.$route.query.id; |
| | | params["examId"] = this.$route.query.id; |
| | | this.questionBankLoading = false; |
| | | getdata(page.currentPage, page.pageSize, Object.assign(params, this.questionBankQuery)).then(res => { |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.questionBankQuery) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.questionBankPage.total = data.total; |
| | | this.questionBankData = data.records; |
| | |
| | | |
| | | // 新增 |
| | | questionBankRowSave (row, done, loading) { |
| | | |
| | | adddata({ userId: row.name, examId: row.examName, applyTime: row.applyTime }).then(() => { |
| | | adddata({ |
| | | userId: row.name, |
| | | examId: row.examName, |
| | | applyTime: row.applyTime, |
| | | }).then( |
| | | () => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | }); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | questionBankRowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.questionBankCrud.toggleSelection(); |
| | | }); |
| | |
| | | this.excelBox = true; |
| | | }, |
| | | handleTemplate() { |
| | | window.open( |
| | | `/api/trainingRegistration/export-template` |
| | | ); |
| | | window.open(`/api/trainingRegistration/export-template`); |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | |
| | | refreshChange() { |
| | | this.questionBankOnLoad(this.page, this.query); |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |