| | |
| | | /* |
| | | * @Author: Morpheus |
| | | * @Date: 2021-07-07 17:30:05 |
| | | * @Last Modified by: liu |
| | | * @Last Modified time: 2021-12-10 09:56:51 |
| | | * menu-name 保安培训报名 |
| | | */ |
| | | /* * @Author: Morpheus * @Date: 2021-07-07 17:30:05 * @Last Modified by: liu * |
| | | @Last Modified time: 2021-12-10 09:56:51 * menu-name 保安培训报名 */ |
| | | <template> |
| | | <basic-container |
| | | :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']" |
| | | :class="[ |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | class="tablesss" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | getDetail, |
| | | add, |
| | | update, |
| | | remove, |
| | | remove |
| | | } from "@/api/securityCompany/train"; |
| | | import { |
| | | adddata, |
| | | batchTrain, |
| | | batchTrain |
| | | } from "@/api/trainingRegistration/trainingRegistration"; |
| | | import { mapGetters } from "vuex"; |
| | | import { mapState } from "vuex"; |
| | |
| | | form: {}, |
| | | auditStatus: false, |
| | | formTrainApply: { |
| | | num: 0, |
| | | num: 0 |
| | | }, |
| | | query: {}, |
| | | deptId: null, |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | |
| | | search: true, |
| | | searchSpan: 5, |
| | | searchLabelWidth: 60, |
| | | display: false, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "校长", |
| | |
| | | search: true, |
| | | searchSpan: 4, |
| | | searchLabelWidth: 60, |
| | | width: 120, |
| | | width: 120 |
| | | }, |
| | | { |
| | | label: "负责人", |
| | | prop: "contacts", |
| | | display: false, |
| | | display: false |
| | | }, |
| | | { |
| | | label: "联系方式", |
| | | prop: "contactscell", |
| | | display: false, |
| | | width: 130, |
| | | width: 130 |
| | | }, |
| | | { |
| | | label: "联系地址", |
| | | prop: "address", |
| | | display: false, |
| | | width: 280, |
| | | }, |
| | | ], |
| | | width: 280 |
| | | } |
| | | ] |
| | | }, |
| | | optionTrainApply: { |
| | | align: "center", |
| | |
| | | cascaderItem: ["trainExamId"], |
| | | props: { |
| | | label: "title", |
| | | value: "id", |
| | | value: "id" |
| | | }, |
| | | type: "select", |
| | | disabled: true, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入学校", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | hide: true, |
| | | searchSpan: 6, |
| | | searchLabelWidth: 110, |
| | | search: true, |
| | | span: 24, |
| | | span: 24 |
| | | }, |
| | | // { |
| | | // label: "企业名称", |
| | |
| | | // dicUrl: "/api/blade-user/page-security-unit?deptId="+this.deptId, |
| | | props: { |
| | | label: "name", |
| | | value: "id", |
| | | value: "id" |
| | | }, |
| | | //不包含父节点值 |
| | | leafOnly: true, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入姓名", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | span: 24, |
| | | span: 24 |
| | | }, |
| | | { |
| | | label: "总数", |
| | | prop: "num", |
| | | disabled: true, |
| | | span: 12, |
| | | }, |
| | | ], |
| | | span: 12 |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | data: [] |
| | | }; |
| | | }, |
| | | watch: { |
| | | "formTrainApply.userId"() { |
| | | // console.log(this.formTrainApply.userId.length,456); |
| | | this.formTrainApply.num = this.formTrainApply.userId.length; |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | addBtn: this.vaildData(null, false), |
| | | viewBtn: this.vaildData(null, false), |
| | | delBtn: this.vaildData(null, false), |
| | | editBtn: this.vaildData(null, false), |
| | | editBtn: this.vaildData(null, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | | }), |
| | | userInfo: state => state.user.userInfo |
| | | }) |
| | | }, |
| | | created() { |
| | | this.optionTrainApply.column[1].dicUrl = |
| | |
| | | |
| | | this.getUserDetail(); |
| | | }, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | methods: { |
| | | //获取用户信息 |
| | | getUserDetail() { |
| | | var that = this; |
| | | getUser(this.userInfo.Id).then((res) => { |
| | | getUser(this.userInfo.Id).then(res => { |
| | | var status = res.data.data.examinationType; |
| | | if (status == "1") { |
| | | that.auditStatus = true; |
| | |
| | | this.optionTrainApply.column.trainingUnitId = row.departmentid; |
| | | // this.deptId= this.userInfo.dept_id; |
| | | this.formTrainApply = { |
| | | trainingUnitId: row.departmentid, |
| | | trainingUnitId: row.departmentid |
| | | }; |
| | | }, |
| | | //批量报名提交 |
| | | submit() { |
| | | batchTrain({ |
| | | userIds: this.formTrainApply.userId.join(","), |
| | | trainingUnitId: this.formTrainApply.trainingUnitId, |
| | | trainingUnitId: this.formTrainApply.trainingUnitId |
| | | }).then( |
| | | (res) => { |
| | | res => { |
| | | this.onLoad(this.page); |
| | | 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: "报名成功" |
| | | }); |
| | | this.$refs.formTrainApply.resetFields(); |
| | | this.dialogDisable = false; |
| | | } |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | this.$refs.formTrainApply.resetFields(); |
| | | this.dialogDisable = false; |
| | |
| | | this.$confirm("是否确定报名?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }).then(() => { |
| | | row["userId"] = this.userInfo.user_id; |
| | | row["trainingUnitId"] = row.departmentid; |
| | | adddata(row).then( |
| | | (res) => { |
| | | res => { |
| | | // this.onLoad(this.page); |
| | | 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(); |
| | | } |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | } |
| | | |
| | | // // 行单击 |
| | | // handleRowClick(row) { |
| | |
| | | // query: obj, |
| | | // }); |
| | | // }, |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |