|
|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
|
<div class="base-info">
|
|
|
<p class="title">基本信息</p>
|
|
|
- <el-form :model="ruleForm"
|
|
|
- :rules="rules"
|
|
|
- ref="ruleForm"
|
|
|
+ <el-form :model="ruleForm"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
label-width="104px"
|
|
|
- label-position="right"
|
|
|
+ label-position="right"
|
|
|
class="demo-ruleForm">
|
|
|
<el-form-item label="姓名:" prop="name" v-focus>
|
|
|
<el-input v-model="ruleForm.name" size="small" :placeholder="ruleForm.name" :disabled="editStatus" ref="nameEdit"></el-input>
|
|
|
@@ -86,8 +86,8 @@ export default {
|
|
|
let handle = (e) => {
|
|
|
if(!el.contains(e.target)) {
|
|
|
vm.context.ruleForm.name = vm.context.userInfo.name
|
|
|
- vm.context.editStatus = true
|
|
|
- vm.context.$refs.ruleForm.clearValidate()
|
|
|
+ vm.context.editStatus = true
|
|
|
+ vm.context.$refs.ruleForm.clearValidate()
|
|
|
}
|
|
|
}
|
|
|
el.handle = handle
|
|
|
@@ -102,8 +102,8 @@ export default {
|
|
|
let handle = (e) => {
|
|
|
if(!el.contains(e.target)) {
|
|
|
vm.context.ruleForm.email = vm.context.userInfo.hr.email
|
|
|
- vm.context.EmailStatus = true
|
|
|
- vm.context.$refs.ruleForm.clearValidate()
|
|
|
+ vm.context.EmailStatus = true
|
|
|
+ vm.context.$refs.ruleForm.clearValidate()
|
|
|
}
|
|
|
}
|
|
|
el.handle = handle
|
|
|
@@ -116,6 +116,9 @@ export default {
|
|
|
},
|
|
|
props:['userInfo'],
|
|
|
computed:{
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+
|
|
|
},
|
|
|
watch:{
|
|
|
userInfo: {
|
|
|
@@ -132,7 +135,7 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.nameEdit.focus()
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
EmailStatus: {
|
|
|
@@ -141,23 +144,24 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.email.focus()
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
save(type) {
|
|
|
if(!this.ruleForm.phonenumber) return this.$notify({
|
|
|
title:'提示',
|
|
|
message:'请填写手机号',
|
|
|
type: 'warning'
|
|
|
- })
|
|
|
+ })
|
|
|
this.$refs.ruleForm.validate(async val => {
|
|
|
if(!val) return this.$notify({
|
|
|
title:'提示',
|
|
|
message:'请按照要求填写信息',
|
|
|
type: 'warning'
|
|
|
- })
|
|
|
+ })
|
|
|
if( type == 'name') {
|
|
|
if(this.ruleForm.name == this.userInfo.name) {
|
|
|
this.$notify({
|
|
|
@@ -171,7 +175,7 @@ export default {
|
|
|
this.editStatus = true
|
|
|
this.edit.content.name = this.ruleForm.name
|
|
|
this.edit.content.phonenumber = this.ruleForm.phonenumber
|
|
|
-
|
|
|
+
|
|
|
let res = await this.$api.requested(this.edit)
|
|
|
this.tool.showMessage(res)
|
|
|
} else if( type == 'email' ) {
|
|
|
@@ -188,7 +192,7 @@ export default {
|
|
|
this.edit.content.name = this.ruleForm.name
|
|
|
this.edit.content.email = this.ruleForm.email
|
|
|
this.edit.content.phonenumber = this.ruleForm.phonenumber
|
|
|
-
|
|
|
+
|
|
|
let res = await this.$api.requested(this.edit)
|
|
|
this.tool.showMessage(res)
|
|
|
}
|