<template>
<div class="app-container" :data="usermsg">
<div class="neibox">
<div style="display: flex;flex-flow: row nowrap;justify-content: space-between;">
<h3 class="agenttitle" style="margin-top: 0!important;">账户类型</h3>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="editUserinfo()">修改信息</el-button>
</div>
<div class="listtext">
<div class=" listinfo">账号:{{usermsg.mobile}}</div>
<div class="listinfo">账户类型:{{usermsg.roleList}}</div>
<div class="listinfo">密码:************</div>
</div><!--listtext1-->
</div>
<div class="neibox">
<div style="display: flex;flex-flow: row nowrap;justify-content: space-between;">
<h3 class="agenttitle" style="margin-top: 0!important;">基本信息</h3>
<el-button type="primary" icon="el-icon-edit" size="mini" @click="editBaseinfo()">修改信息</el-button>
</div>
<div class="listtext">
<div class=" listinfo">责任人:{{usermsg.realName}}</div>
<div class="listinfo">身份证:{{usermsg.idcard}}</div>
<div class="listinfo">邮箱:{{usermsg.email}}</div>
<div class="listinfo">注册时间:{{usermsg.createDate}}</div>
</div><!--listtext1-->
</div>
<!--修改账户类型对话框-->
<el-dialog
title="修改用户信息"
:visible.sync="editUinfoDialog"
width="50%" @close="">
<el-form :data="usermsg" status-icon :rules="editFormRules" ref="editFormRef" label-width="100px" >
<el-form-item label="账号" prop="username">
<el-input type="text" v-model="usermsg.mobile" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="账户类型" prop="email">
<el-input type="text" v-model="usermsg.roleList" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="密码" prop="mobile">
<el-input type="password" v-model="usermsg.password" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editUinfoDialog = false">取 消</el-button>
<el-button type="primary" @click="editUserpwd">确 定</el-button>
</span>
</el-dialog>
<!--修改基本信息对话框-->
<el-dialog
title="修改用户信息" :visible.sync="editBaseDialog"
width="50%" @close="">
<el-form :data="usermsgbb" status-icon :rules="editFormRules" ref="editFormRef" label-width="100px" >
<el-form-item label="责任人" prop="username">
<el-input type="text" v-model="usermsgbb.realName" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="身份证" prop="email">
<el-input type="text" v-model="usermsgbb.idcard" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="mobile">
<el-input type="text" v-model="usermsgbb.email" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editBaseDialog = false">取 消</el-button>
<el-button type="primary" @click="editUsers">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request';
export default {
data() {
return {
editBaseDialog: false,
editUinfoDialog: false,
queryInfo: {
id:'',
},
usermsg:[],
usermsgbb:{
account:'',
email:'',
password:'',
realName:''
},
id: '',
editForm:{},
editFormRules:{},
editBaseDialogs:{}
}
},
created() {
this.getUserInfo()
},
methods: {
getUserInfo(){
request({
url:'lit/protected/lit/getUser',
method: 'get'
}).then((res) => {
// debugger
console.log(res)
this.usermsg = res.vo;
// this.baifen = Math.floor(this.userInfo.shareProportion * 10000)/100
})
},
editUserinfo(){
this.editUinfoDialog= true
},
editBaseinfo(){
request({
url:'lit/protected/lit/getUser',
method: 'get'
}).then((res) => {
// debugger
// console.log(res)
this.usermsgbb = res.vo
})
this.editBaseDialog= true
},
editUserpwd(){
request({
url:'lit/protected/lit/modify',
method: 'post',
data:{
password:this.usermsg.password,
}
}).then((res)=>{
console.log(res)
this.$message.success("密码修改成功!")
})
},
editUsers(){
request({
// url:'lit/protected/lit/account/modify/'+ this.id,
url:'lit/protected/lit/modify',
method: 'post',
data:{
realName:this.usermsgbb.realName,
email:this.usermsgbb.email,
idcard:this.usermsgbb.idcard,
// name: '123'
}
}).then((res)=>{
console.log(res)
this.$message.success("信息修改成功!")
})
}
}
}
</script>
<style scoped>
.neibox{margin:0 25px 30px}
.agenttitle{font-weight: 400; padding-top: 5px;}
.listtext{display:flex;flex-wrap: wrap;padding-bottom: 12px;border-bottom: 1px solid #ccc}
.listinfo{ width:50%;box-sizing: border-box;font-size: 16px;margin: 12px 0;}
</style>
