| | |
| | | <el-form-item label="备注:" label-width="120px"> |
| | | <div style="display: flex;align-items: center;"><el-input |
| | | v-model="item.mark"></el-input> |
| | | <img style="width: 19px;height: 21px;cursor: pointer;margin-left: 26px;" |
| | | <img @click="delEmail(item, index)" |
| | | style="width: 19px;height: 21px;cursor: pointer;margin-left: 26px;" |
| | | src="@/assets/delete.png" alt=""> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | <el-col :span="20" style="padding-right: 52px;position: relative;"> |
| | | <el-form-item label="备注:"> |
| | | <div style="display: flex;align-items: center;"><el-input type="textarea" :rows="3" |
| | | v-model="item.mark"></el-input> |
| | | <img style="width: 19px;height: 21px;cursor: pointer;position: absolute;right: -175px;" |
| | | v-model="item.remark"></el-input> |
| | | <img @click="delContact(item, index)" |
| | | style="width: 19px;height: 21px;cursor: pointer;position: absolute;right: -175px;" |
| | | src="@/assets/delete.png" alt=""> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | import { saveUserInfo, getUserInfo } from '@/view/service' |
| | | export default { |
| | | props: ['show'], |
| | | data() { |
| | |
| | | submit() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | console.log(this.form); |
| | | let params = { |
| | | extra: localStorage.getItem('extra'), |
| | | info: { |
| | | name: this.form.userName, |
| | | phone: this.form.phone, |
| | | mail: this.form.userEmail, |
| | | }, |
| | | emails: this.form.otherEmails, |
| | | addressInfos: this.form.contactInfoList |
| | | } |
| | | saveUserInfo(params).then(res => { |
| | | if (res.status == 0) { |
| | | this.$message.success('保存成功') |
| | | this.$store.commit('SET_USERNAME', this.form.userName) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 打开 |
| | | 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, |
| | | } |
| | | getUserInfo({ extra: localStorage.getItem('extra') }).then(res => { |
| | | if (res.data.emails) { |
| | | res.data.emails.map(item => { |
| | | item.mail = item.email |
| | | }) |
| | | } |
| | | if (res.data.addressInfo) { |
| | | res.data.addressInfo.map(item => { |
| | | item.remark = item.mark |
| | | }) |
| | | } |
| | | this.form = { |
| | | userName: res.data.name, |
| | | phone: res.data.phone, |
| | | userEmail: res.data.email, |
| | | otherEmails: res.data.emails || [], |
| | | contactInfoList: res.data.addressInfo || [], |
| | | } |
| | | }) |
| | | }, |
| | | // 删除其他邮箱 |
| | | delEmail(item, index) { |
| | | this.form.otherEmails.splice(index, 1) |
| | | }, |
| | | // 新增其他邮箱 |
| | | addEmail() { |
| | | this.form.otherEmails.push({ |
| | | email: '', |
| | | mail: '', |
| | | mark: '' |
| | | }) |
| | | }, |
| | | // 删除收件人 |
| | | delContact(item, index) { |
| | | this.form.contactInfoList.splice(index, 1) |
| | | }, |
| | | // 新增收件人 |
| | | addContact() { |
| | | this.form.contactInfoList.push({ |