| | |
| | | id, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getSecurityApplyInfo = (id, userId) => { |
| | | return request({ |
| | | url: '/api/apply/getSecurityApplyDetail', |
| | | method: 'get', |
| | | params: { |
| | | id, |
| | | userId |
| | | } |
| | | }) |
| | | } |
| | |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | @click="handleBatchExam" |
| | | v-if="examPersission" |
| | | |
| | | >生成考试 |
| | | </el-button> |
| | | <!-- v-if="examPersission" --> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | |
| | | <button class="security-btn" @click="applySubmit">报 名</button> |
| | | <button class="security-btn" @click="cancelApply">取 消 报 名</button> |
| | | </div> |
| | | <!-- <div class = "apply-status"> |
| | | <div class = "apply-status"> |
| | | <span>{{status}}</span> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import { mapState } from 'vuex'; |
| | | import { |
| | | addApply, |
| | | cancelApply |
| | | cancelApply, |
| | | getSecurityApplyInfo |
| | | } from "@/api/examapi/applyexam"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | status:"未报名" |
| | | status:null, |
| | | id:null, |
| | | form:{} |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | userInfo: state => state.user.userInfo |
| | | }), |
| | | }, |
| | | mounted() {}, |
| | | mounted() { |
| | | //查询保安人员报名信息 |
| | | this.getSecurityApplyInfo(null); |
| | | }, |
| | | methods:{ |
| | | getSecurityApplyInfo(id){ |
| | | getSecurityApplyInfo(id,this.userInfo.user_id).then((res) => { |
| | | this.form = res.data; |
| | | if(res.data.id!=-1){ |
| | | this.id = res.data.id; |
| | | } |
| | | if(res.data.isApply==-1 || res.data.isApply==2){ |
| | | this.status = "尚未报名"; |
| | | } |
| | | if(res.data.isApply==1){ |
| | | this.status = "已报名"; |
| | | } |
| | | }); |
| | | }, |
| | | applySubmit(){ |
| | | addApply({ |
| | | userId: this.userInfo.user_id |
| | |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.getSecurityApplyInfo(null); |
| | | } |
| | | }, |
| | | (error) => { |
| | |
| | | ); |
| | | }, |
| | | cancelApply(){ |
| | | cancelApply({ |
| | | cancelApply({ |
| | | id:this.id, |
| | | userId: this.userInfo.user_id |
| | | }).then( |
| | | (res) => { |
| | |
| | | type: "success", |
| | | message: "取消报名成功", |
| | | }); |
| | | this.getSecurityApplyInfo(null); |
| | | } |
| | | }, |
| | | (error) => { |