|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
|
|
|
|
|
+ <el-form ref="form" :model="user" :rules="rules" label-width="120px">
|
|
<el-form-item label="用户名称" prop="userName">
|
|
<el-form-item label="用户名称" prop="userName">
|
|
<el-input v-model="user.userName" disabled="disabled" maxlength="50"/>
|
|
<el-input v-model="user.userName" disabled="disabled" maxlength="50"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -27,11 +27,20 @@
|
|
<el-radio label="1">女</el-radio>
|
|
<el-radio label="1">女</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" size="mini" @click="submit">保存</el-button>
|
|
|
|
- <!--<el-button type="danger" size="mini" @click="close">关闭</el-button>-->
|
|
|
|
- </el-form-item>
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
+ <simulate-score
|
|
|
|
+ ref="score"
|
|
|
|
+ :form="scoreModel"
|
|
|
|
+ :disabled="!user.provinceName"
|
|
|
|
+ :hidden-ranking="true"
|
|
|
|
+ :province-name="user.provinceName"
|
|
|
|
+ :disable-required="disableScoreRequired"
|
|
|
|
+ :keep-value="true"
|
|
|
|
+ class="scoreForm"
|
|
|
|
+ />
|
|
|
|
+ <div class="mb30 ml60 pl60">
|
|
|
|
+ <el-button type="primary" size="mini" @click="submit">保存</el-button>
|
|
|
|
+ </div>
|
|
<el-dialog :visible.sync="dialogVisible" title="变更手机号" width="450px">
|
|
<el-dialog :visible.sync="dialogVisible" title="变更手机号" width="450px">
|
|
<reset-mobile-form @cancel="dialogVisible=false" @completed="dialogVisible=false,GetInfo()"></reset-mobile-form>
|
|
<reset-mobile-form @cancel="dialogVisible=false" @completed="dialogVisible=false,GetInfo()"></reset-mobile-form>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -42,20 +51,30 @@
|
|
import { updateUserProfile } from '@/api/system/user'
|
|
import { updateUserProfile } from '@/api/system/user'
|
|
import { mapActions, mapGetters } from 'vuex'
|
|
import { mapActions, mapGetters } from 'vuex'
|
|
import ResetMobileForm from '@/views/system/user/profile/components/ResetMobileForm'
|
|
import ResetMobileForm from '@/views/system/user/profile/components/ResetMobileForm'
|
|
|
|
+import MxConst from "@/common/MxConst";
|
|
|
|
+import SimulateScore from "@/views/career/zhiyuan/components/SimulateScore.vue";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- components: { ResetMobileForm },
|
|
|
|
|
|
+ components: {SimulateScore, ResetMobileForm },
|
|
props: {
|
|
props: {
|
|
user: {
|
|
user: {
|
|
type: Object
|
|
type: Object
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- ...mapGetters(['isFrontStudent'])
|
|
|
|
|
|
+ ...mapGetters(['isFrontStudent']),
|
|
|
|
+ disableScoreRequired() {
|
|
|
|
+ return this.user.scoreLock == MxConst.enum.scoreLock.unlock
|
|
|
|
+ }
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
|
|
+ scoreModel: {
|
|
|
|
+ score: '',
|
|
|
|
+ firstSubject: '',
|
|
|
|
+ lastSubject: ''
|
|
|
|
+ },
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
nickName: [
|
|
nickName: [
|
|
@@ -64,17 +83,27 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ mounted() {
|
|
|
|
+ const mode = this.user.mode?.split(',') || []
|
|
|
|
+ this.scoreModel.score = this.user.score
|
|
|
|
+ this.scoreModel.firstSubject = mode.first() || ''
|
|
|
|
+ this.scoreModel.lastSubject = mode.length > 1 ? mode.slice(1) : []
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
...mapActions(['GetInfo']),
|
|
...mapActions(['GetInfo']),
|
|
- submit() {
|
|
|
|
- this.$refs['form'].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- updateUserProfile(this.user).then((response) => {
|
|
|
|
- this.msgSuccess('修改成功')
|
|
|
|
- this.GetInfo()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ async submit() {
|
|
|
|
+ const validates = [this.$refs.form.validate(), this.$refs.score.validate()]
|
|
|
|
+ await Promise.all(validates)
|
|
|
|
+
|
|
|
|
+ const mode = [this.scoreModel.firstSubject].concat(this.scoreModel.lastSubject)
|
|
|
|
+ const commit = {
|
|
|
|
+ ...this.user,
|
|
|
|
+ mode: mode.toString(),
|
|
|
|
+ score: this.scoreModel.score
|
|
|
|
+ }
|
|
|
|
+ await updateUserProfile(commit)
|
|
|
|
+ this.msgSuccess('修改成功')
|
|
|
|
+ await this.GetInfo()
|
|
},
|
|
},
|
|
close() {
|
|
close() {
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
@@ -91,4 +120,13 @@ export default {
|
|
/deep/ .el-radio {
|
|
/deep/ .el-radio {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.scoreForm.form {
|
|
|
|
+ padding: 0;
|
|
|
|
+ width: auto;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.scoreForm.form >>> .el-form-item__label {
|
|
|
|
+ padding-right: 12px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|