You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.4 KiB

<template>
<view class="page">
<view class="input">
<uni-easyinput v-model.trim="account" placeholder="请输入账号"></uni-easyinput>
</view>
<button type="primary" @click="submit">确认</button>
</view>
</template>
<script>
import { queryUserInfoDetails, updatePersonCenter } from '@/apis/modules/user.js'
export default {
data() {
return {
account: '',
hrUserInfo: {},
personalFileList: [],
userAccountList: [],
}
},
onShow() {
this.getInfo()
},
methods: {
// 获取个人信息
getInfo() {
queryUserInfoDetails().then(({ result }) => {
this.hrUserInfo = result.hrUserInfo
this.userAccountList = result.userAccountList
}).catch(e => {})
},
submit() {
const { account, hrUserInfo, userAccountList } = this
if(!account) return this.$util.errMsg('请输入账号')
userAccountList[0].userId = hrUserInfo.userId
userAccountList[0].account = account
updatePersonCenter({
hrUserInfo,
userAccountList
}).then(res => {
this.$util.sucMsg('修改成功!')
setTimeout(() => {
uni.reLaunch({
url: '../person/person'
})
}, 1000)
}).catch(e => {})
}
}
}
</script>
<style scoped lang="scss">
.page {
padding: 20px;
background-color: #fff;
}
/deep/.input {
margin-bottom: 15px;
.is-input-border {
border-color: #dedede !important;
}
}
</style>