| | |
| | | /* |
| | | * @Author: Morpheus |
| | | * @Date: 2021-07-05 16:31:54 |
| | | * @Last Modified by: liu |
| | | * @Last Modified time: 2021-11-23 14:19:17 |
| | | * menu-name 报名考试 |
| | | */ |
| | | /* * @Author: Morpheus * @Date: 2021-07-05 16:31:54 * @Last Modified by: liu * |
| | | @Last Modified time: 2021-11-23 14:19:17 * menu-name 报名考试 */ |
| | | <template> |
| | | <el-row class="morpheus-box-apply-exam"> |
| | | <el-col |
| | | :span="24" |
| | | :class="[ |
| | | 'hasButOne', |
| | | $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '', |
| | | ]" |
| | | <basic-container |
| | | :class="[ |
| | | 'exam-card-body', |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | v-model="obj" |
| | | class="company-box tablesss" |
| | | :option="questionBankOption" |
| | | :search.sync="questionBankSearch" |
| | | :table-loading="questionBankLoading" |
| | | :data="questionBankData" |
| | | ref="questionBankCrud" |
| | | :page.sync="questionBankPage" |
| | | @on-load="questionBankOnLoad" |
| | | @selection-change="questionBankSelectionChange" |
| | | @search-change="questionBankSearchChange" |
| | | @search-reset="questionBankSearchReset" |
| | | @current-change="questionBankCurrentChange" |
| | | @size-change="questionBankSizeChange" |
| | | @row-save="questionBankRowSave" |
| | | @row-del="questionBankRowDel" |
| | | > |
| | | <el-card> |
| | | <div |
| | | :class="[ |
| | | 'exam-card-body', |
| | | $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '', |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | v-model="obj" |
| | | class="company-box" |
| | | :option="questionBankOption" |
| | | :search.sync="questionBankSearch" |
| | | :table-loading="questionBankLoading" |
| | | :data="questionBankData" |
| | | ref="questionBankCrud" |
| | | :page.sync="questionBankPage" |
| | | @on-load="questionBankOnLoad" |
| | | @selection-change="questionBankSelectionChange" |
| | | @search-change="questionBankSearchChange" |
| | | @search-reset="questionBankSearchReset" |
| | | @current-change="questionBankCurrentChange" |
| | | @size-change="questionBankSizeChange" |
| | | @row-save="questionBankRowSave" |
| | | @row-del="questionBankRowDel" |
| | | > |
| | | <!-- 自定义按钮 --> |
| | | <!-- <template slot="menuLeft"> |
| | | <!-- 自定义按钮 --> |
| | | <!-- <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="mini" |
| | | icon="el-icon-delete" |
| | |
| | | </el-button> |
| | | </template> --> |
| | | |
| | | <!-- <template slot="menuLeft"> |
| | | <!-- <template slot="menuLeft"> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | @click="questionBankHandleDelete">删 除 |
| | | </el-button> |
| | | </template> --> |
| | | <!-- 自定义按钮 --> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | @click="handleBatchExam" |
| | | v-if="permission.applyexam_exam" |
| | | >生成考试 |
| | | </el-button> |
| | | <!-- v-if="examPersission" --> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | v-if="permission.applyexam_import" |
| | | @click="handleImport" |
| | | >批量报名 |
| | | </el-button> |
| | | </template> |
| | | <!-- 自定义按钮 --> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | @click="handleBatchExam" |
| | | v-if="permission.applyexam_exam" |
| | | >生成考试 |
| | | </el-button> |
| | | <!-- v-if="examPersission" --> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | v-if="permission.applyexam_import" |
| | | @click="handleImport" |
| | | >批量报名 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{ type, row }" slot="menu"> |
| | | <el-button |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-refresh-left" |
| | | v-if="permission.applyexam_cancel" |
| | | :disabled="row.isApply == 2" |
| | | @click="handleCancel(row)" |
| | | >取消报名 |
| | | </el-button> |
| | | <el-button |
| | | style="display: none" |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-folder-checked" |
| | | :disabled="row.applyStatus == 4" |
| | | @click="handleAudit(row)" |
| | | >审核 |
| | | </el-button> |
| | | <el-button |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-receiving" |
| | | v-if="permission.applyexam_print && row.candidateNo != ''" |
| | | @click="handlePrint(row)" |
| | | >准考证打印 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ type, row }" slot="menu"> |
| | | <el-button |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-refresh-left" |
| | | v-if="permission.applyexam_cancel" |
| | | :disabled="row.isApply == 2" |
| | | @click="handleCancel(row)" |
| | | >取消报名 |
| | | </el-button> |
| | | <el-button |
| | | style="display: none" |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-folder-checked" |
| | | :disabled="row.applyStatus == 4" |
| | | @click="handleAudit(row)" |
| | | >审核 |
| | | </el-button> |
| | | <el-button |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-receiving" |
| | | v-if="permission.applyexam_print && row.candidateNo != ''" |
| | | @click="handlePrint(row)" |
| | | >准考证打印 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="age"> |
| | | {{ row.age == -1 ? "" : row.age }} |
| | | </template> |
| | | </avue-crud> |
| | | <template slot-scope="{ row }" slot="age"> |
| | | {{ row.age == -1 ? "" : row.age }} |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <el-dialog |
| | | title="考试资格审核" |
| | | :visible.sync="dialogFormVisible" |
| | | modal-append-to-body="false" |
| | | append-to-body="true" |
| | | :close-on-click-model="true" |
| | | > |
| | | <avue-form |
| | | ref="formAudit" |
| | | v-model="Audit" |
| | | :option="optionAudit" |
| | | @reset-change="emptytChange" |
| | | @submit="submit" |
| | | ></avue-form> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="考试资格审核" |
| | | :visible.sync="dialogFormVisible" |
| | | modal-append-to-body="false" |
| | | append-to-body="true" |
| | | :close-on-click-model="true" |
| | | > |
| | | <avue-form |
| | | ref="formAudit" |
| | | v-model="Audit" |
| | | :option="optionAudit" |
| | | @reset-change="emptytChange" |
| | | @submit="submit" |
| | | ></avue-form> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="批量报名导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="批量报名导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="考试生成" |
| | | append-to-body |
| | | :visible.sync="dialogExamFormVisible" |
| | | width="900px" |
| | | @close="closeDialog" |
| | | > |
| | | <avue-form |
| | | ref="formExamApply" |
| | | v-model="examApply" |
| | | :option="optionExamApply" |
| | | @reset-change="emptytChange" |
| | | @submit="submitExamApply" |
| | | ></avue-form> |
| | | </el-dialog> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | <el-dialog |
| | | title="考试生成" |
| | | append-to-body |
| | | :visible.sync="dialogExamFormVisible" |
| | | width="900px" |
| | | @close="closeDialog" |
| | | > |
| | | <avue-form |
| | | ref="formExamApply" |
| | | v-model="examApply" |
| | | :option="optionExamApply" |
| | | @reset-change="emptytChange" |
| | | @submit="submitExamApply" |
| | | ></avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | addApply, |
| | | cancelApply, |
| | | remove, |
| | | addExam, |
| | | addExam |
| | | } from "@/api/examapi/applyexam"; |
| | | import { mapState } from "vuex"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | applyStatus: [ |
| | | { |
| | | label: "已报名", |
| | | value: 2, |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "已取消", |
| | | value: 4, |
| | | }, |
| | | ], |
| | | value: 4 |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | export default { |
| | |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | res: "data" |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/apply/import-apply", |
| | | action: "/api/apply/import-apply" |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | span: 24 |
| | | } |
| | | ] |
| | | }, |
| | | optionAudit: { |
| | | height: "auto", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择审核类型", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | dicData: [ |
| | | { |
| | | label: "审核通过", |
| | | value: 2, |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "不通过", |
| | | value: 3, |
| | | }, |
| | | ], |
| | | value: 3 |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "审核明细", |
| | | span: 24, |
| | | type: "textarea", |
| | | prop: "auditDetail", |
| | | }, |
| | | ], |
| | | prop: "auditDetail" |
| | | } |
| | | ] |
| | | }, |
| | | optionExamApply: { |
| | | height: "auto", |
| | |
| | | type: "number", |
| | | max: 1000, |
| | | min: 0, |
| | | precision: 0, |
| | | precision: 0 |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入考试人数", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | minRows: 0, |
| | | maxRows: 1000, |
| | | value: 50, |
| | | value: 50 |
| | | }, |
| | | { |
| | | label: "序号开始", |
| | |
| | | type: "number", |
| | | max: 1000, |
| | | min: 1, |
| | | precision: 0, |
| | | precision: 0 |
| | | }, |
| | | minRows: 1, |
| | | maxRows: 1000, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入序号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "序号结束", |
| | |
| | | type: "number", |
| | | max: 1000, |
| | | min: 1, |
| | | precision: 0, |
| | | precision: 0 |
| | | }, |
| | | minRows: 1, |
| | | maxRows: 1000, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入序号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "考试时间", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择考试时间", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | span: 12, |
| | | span: 12 |
| | | }, |
| | | { |
| | | label: "截止时间", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择考试时间", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | span: 12, |
| | | }, |
| | | ], |
| | | span: 12 |
| | | } |
| | | ] |
| | | }, |
| | | questionBankOption: { |
| | | // 操作栏多余按钮去除 |
| | |
| | | editDetail: false, |
| | | props: { |
| | | label: "title", |
| | | value: "id", |
| | | value: "id" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择保安姓名", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | width: 80, |
| | | width: 80 |
| | | }, |
| | | { |
| | | label: "保安姓名", |
| | |
| | | viewDisplay: true, |
| | | props: { |
| | | label: "title", |
| | | value: "id", |
| | | value: "id" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请选择保安姓名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "年龄", |
| | |
| | | editDisplay: false, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | viewDisplay: true, |
| | | viewDisplay: true |
| | | }, |
| | | // { |
| | | // label: "考试名称", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择所属公司", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | width: 220, |
| | | width: 220 |
| | | }, |
| | | { |
| | | label: "准考证号", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择准考证号", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | width: 100, |
| | | width: 100 |
| | | }, |
| | | { |
| | | label: "身份证号", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择准考证号", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | width: 150, |
| | | width: 150 |
| | | }, |
| | | { |
| | | label: "报考证件", |
| | |
| | | { |
| | | required: true, |
| | | message: "请选择准考证号", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // label: "试卷分数", |
| | |
| | | ? "0" + new Date().getSeconds() |
| | | : new Date().getSeconds()), |
| | | |
| | | width: 150, |
| | | }, |
| | | width: 150 |
| | | } |
| | | // { |
| | | // label: "考试时间", |
| | | // prop: "examTime", |
| | |
| | | // addDisplay: false, |
| | | // width: 100, |
| | | // }, |
| | | ], |
| | | ] |
| | | }, |
| | | questionBankSearch: {}, |
| | | questionBankLoading: true, |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 16, |
| | | ...this.$store.state.control.changePageSize, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | questionBankQuery: {}, |
| | | questionBankSelectionList: [], |
| | | questionBankSelectionList: [] |
| | | }; |
| | | }, |
| | | |
| | |
| | | } |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.userInfo.role_name.indexOf("ksxtadmin") != -1) { |
| | |
| | | |
| | | this.questionBankSearch["applyStatus"] = 2; |
| | | }, |
| | | mounted() {}, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | | userInfo: state => state.user.userInfo |
| | | }), |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | |
| | | addBtn: this.vaildData(null, false), |
| | | viewBtn: this.vaildData(this.permission.applyexam_view, false), |
| | | delBtn: this.vaildData(null, false), |
| | | editBtn: this.vaildData(null, false), |
| | | editBtn: this.vaildData(null, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.questionBankSelectionList.forEach((ele) => { |
| | | this.questionBankSelectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | //准考证查看 |
| | |
| | | obj["name"] = "准考证信息"; |
| | | this.$router.push({ |
| | | path: `/applyexam/papers`, |
| | | query: obj, |
| | | query: obj |
| | | }); |
| | | }, |
| | | questionBankOnLoad(page, params = {}) { |
| | |
| | | var that = this; |
| | | //获取当前登录人员的角色信息 |
| | | var roleIds = this.userInfo.role_id.split(","); |
| | | roleIds.forEach((roleId) => { |
| | | getRoleDetail(roleId).then((res) => { |
| | | roleIds.forEach(roleId => { |
| | | getRoleDetail(roleId).then(res => { |
| | | var roleAlias = res.data.data.roleAlias; |
| | | if (roleAlias == "保安公司管理员" || roleAlias == "保安") { |
| | | //如果是保安公司管理员 |
| | |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.questionBankQuery) |
| | | ).then((res) => { |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.questionBankPage.total = data.total; |
| | | this.questionBankData = data.records; |
| | | this.questionBankLoading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.questionBankSelectionClear(); |
| | | }); |
| | | }); |
| | |
| | | addApply({ |
| | | userId: row.userId, |
| | | examId: row.examName, |
| | | applyTime: row.applyTime, |
| | | applyTime: row.applyTime |
| | | }).then( |
| | | (res) => { |
| | | res => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | message: "已报名,不能重复报名" |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | message: "报名失败" |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | message: "报名成功" |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | if (row.number != row.serialEnd - row.serialStart + 1) { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "考试人数与序号不匹配!", |
| | | message: "考试人数与序号不匹配!" |
| | | }); |
| | | done(); |
| | | return; |
| | |
| | | if (s > e) { |
| | | this.$message({ |
| | | type: "error", |
| | | message: "截止时间不能早于考试考试开始时间!", |
| | | message: "截止时间不能早于考试考试开始时间!" |
| | | }); |
| | | done(); |
| | | return; |
| | |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | that.$refs.formExamApply.resetFields(); |
| | | that.dialogExamFormVisible = false; |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | 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(() => { |
| | | row.applyStatus = 4; |
| | |
| | | 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(); |
| | | }); |
| | |
| | | |
| | | refreshChange() { |
| | | this.questionBankOnLoad(this.page, this.query); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | </style> |
| | | <style lang="scss" scoped></style> |