| | |
| | | <template> |
| | | <el-dialog :visible.sync="show" :show-close="false" width="80%" top="51px" :close-on-click-modal="false"> |
| | | <el-dialog :visible.sync="show" :show-close="false" width="80%" top="51px" :close-on-click-modal="false" |
| | | append-to-body @open="open"> |
| | | <div class="content"> |
| | | <el-form label-position="left" label-width="120px" :model="form" :rules="rules"> |
| | | <el-form label-position="left" label-width="120px" ref="form" :model="form" :rules="rules"> |
| | | <div class="title">个人信息</div> |
| | | <div class="company">所属公司:{{ userInfo.companyName }}</div> |
| | | <el-row :gutter="90" class="companyForm"> |
| | |
| | | </el-form> |
| | | <div class="btns"> |
| | | <el-button @click="$emit('close')">关闭</el-button> |
| | | <el-button type="primary">保存</el-button> |
| | | <el-button type="primary" @click="submit">保存</el-button> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | ...mapState(['userInfo']) |
| | | }, |
| | | watch: { |
| | | show(val) { |
| | | if (val) { |
| | | this.form = { |
| | | userName: this.userInfo.userName, |
| | | phone: this.userInfo.phone, |
| | | userEmail: this.userInfo.userEmail, |
| | | otherEmails: this.userInfo.otherEmails, |
| | | contactInfoList: this.userInfo.contactInfoList, |
| | | 'show': { |
| | | handler(val) { |
| | | if (val) { |
| | | this.open() |
| | | } |
| | | } |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | methods: { |
| | | // 提交 |
| | | submit() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.form); |
| | | } |
| | | }) |
| | | }, |
| | | // 打开 |
| | | open() { |
| | | let userInfo = JSON.parse(JSON.stringify(this.userInfo)); |
| | | this.form = { |
| | | userName: userInfo.userName, |
| | | phone: userInfo.phone, |
| | | userEmail: userInfo.userEmail, |
| | | otherEmails: userInfo.otherEmails, |
| | | contactInfoList: userInfo.contactInfoList, |
| | | } |
| | | }, |
| | | // 新增其他邮箱 |
| | | addEmail() { |
| | | this.form.otherEmails.push({ |