| | |
| | | } |
| | | |
| | | |
| | | export const addBatchApply = (row) => { |
| | | export const addBatchApply = (ids, deptId) => { |
| | | return request({ |
| | | url: '/api/apply/batchApply', |
| | | method: 'post', |
| | | data: row |
| | | params: { |
| | | ids, |
| | | deptId |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | //批量报名 |
| | | handleBatchApply() { |
| | | this.dialogBatchFormVisible = true; |
| | | // this.dialogBatchFormVisible = true; |
| | | if (this.questionBankSelectionList.length === 0) { |
| | | this.$confirm("确定全部人员报名?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | var userIds = ""; |
| | | addBatchApply(userIds,this.userInfo.dept_id).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }) |
| | | }else{ |
| | | this.$confirm("确定选择人员报名?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | addBatchApply(this.ids,this.userInfo.dept_id).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | //批量报名提交 |
| | | submitBatchApply(){ |
| | | addBatchApply({ |
| | | userIds: this.BatchApply.userId.join(","), |
| | | }).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }, |
| | | // submitBatchApply(){ |
| | | // addBatchApply({ |
| | | // userIds: this.BatchApply.userId.join(","), |
| | | // }).then( |
| | | // (res) => { |
| | | // this.questionBankOnLoad(this.questionBankPage); |
| | | // if (res.data.data == 201) { |
| | | // this.$message({ |
| | | // type: "warning", |
| | | // message: "已报名,不能重复报名", |
| | | // }); |
| | | // } else if (res.data.data == 201) { |
| | | // this.$message({ |
| | | // type: "warning", |
| | | // message: "报名失败", |
| | | // }); |
| | | // } else { |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "报名成功", |
| | | // }); |
| | | // this.$refs.formBatchApply.resetFields(); |
| | | // this.dialogBatchFormVisible = false; |
| | | // } |
| | | // }, |
| | | // (error) => { |
| | | // window.console.log(error); |
| | | // } |
| | | // ); |
| | | // }, |
| | | |
| | | //关闭窗口清除数据 |
| | | closeDialog(){ |