| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getForeignRegisterOne, |
| | | selectUserCondition, |
| | | addForeignRegister, |
| | | updateForeignRegister |
| | | } from '@/api/cnas/resourceDemand/foreignRegister/foreignRegister' |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: 'Personnel-management-dia', |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | |
| | | mounted() { |
| | | |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userId"]), |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | // 打开弹框 |
| | |
| | | if (type !== 'add') { |
| | | this.searchInfo(row) |
| | | } else { |
| | | this.form.accompanyingId = JSON.parse(localStorage.getItem("user")).userId |
| | | this.form.accompanyingId = this.userId |
| | | this.form.area = '装备电缆试验室' |
| | | this.form.reason = '参观实验室' |
| | | this.form.accompanyingId = 64 |
| | | this.form.approveId = 65 |
| | | this.form.confidentiality = '符合' |
| | | } |
| | | }, |
| | | // 查询详情 |
| | | searchInfo (row) { |
| | | this.diaLoading = true |
| | | this.$axios(this.$api.foreignRegister.getForeignRegisterOne + '?registerId=' + row.registerId).then(res => { |
| | | getForeignRegisterOne({registerId : row.registerId}).then(res =>{ |
| | | this.diaLoading = false |
| | | if (res.code === 201) return |
| | | this.form = res.data |
| | | if (res.code === 200){ |
| | | this.form = res.data |
| | | } |
| | | }).catch(err => { |
| | | console.log(err) |
| | | this.diaLoading = false |
| | |
| | | internalImplementDto.approveName = this.personList[index].label |
| | | } |
| | | if (this.operationType === 'add') { |
| | | this.$axios.post(this.$api.foreignRegister.addForeignRegister, internalImplementDto, { |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | }, |
| | | noQs: true |
| | | }).then(res => { |
| | | addForeignRegister(internalImplementDto).then(res => { |
| | | this.loading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('操作成功') |
| | | this.closeThreeWastesDia() |
| | | if (res.code === 200){ |
| | | this.$message.success('操作成功') |
| | | this.closeThreeWastesDia() |
| | | } |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.loading = false |
| | | }) |
| | | } else if (this.operationType === 'edit') { |
| | | this.$axios.post(this.$api.foreignRegister.updateForeignRegister, internalImplementDto, { |
| | | headers: { |
| | | "Content-Type": "application/json" |
| | | }, |
| | | noQs: true |
| | | }).then(res => { |
| | | updateForeignRegister(internalImplementDto).then(res => { |
| | | this.loading = false |
| | | if (res.code === 201) return |
| | | this.$message.success('操作成功') |
| | | this.closeThreeWastesDia() |
| | | if (res.code === 200){ |
| | | this.$message.success('操作成功') |
| | | this.closeThreeWastesDia() |
| | | } |
| | | |
| | | }).catch(err => { |
| | | console.log('err---', err); |
| | | this.loading = false |
| | |
| | | this.$emit('closeThreeWastesDia') |
| | | }, |
| | | getAuthorizedPerson() { |
| | | this.$axios.get(this.$api.user.getUserMenu).then(res => { |
| | | selectUserCondition().then(res => { |
| | | let data = [] |
| | | res.data.forEach(a => { |
| | | data.push({ |