|
@@ -95,6 +95,7 @@
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item @click.native="reset">修改密码</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click.native="editInfoOpen">修改信息</el-dropdown-item>
|
|
|
<el-dropdown-item divided @click.native="logout">退出登录</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
@@ -217,6 +218,45 @@
|
|
|
<el-button type="primary" @click.native="resetPwd" :loading="editLoading">提交</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!--修改信息-->
|
|
|
+ <el-dialog
|
|
|
+ title="修改信息"
|
|
|
+ v-if="editInformation"
|
|
|
+ :visible.sync="editInformation"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ customClass="customWidth"
|
|
|
+ >
|
|
|
+ <el-form :model="editInfoForm" label-width="80px" :rules="passRule" ref="editInfoForm">
|
|
|
+ <el-form-item label="姓名" prop="username">
|
|
|
+ <el-input v-model="editInfoForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form :model="editInfoForm" label-width="80px" :rules="passRule" ref="editInfoForm">
|
|
|
+ <el-form-item label="手机号" prop="mobile">
|
|
|
+ <el-input
|
|
|
+ v-model="editInfoForm.mobile"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder="请输入手机号"
|
|
|
+ :disabled="true"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form :model="editInfoForm" label-width="80px" :rules="passRule" ref="editInfoForm">
|
|
|
+ <el-form-item label="所属公司" prop="companyName">
|
|
|
+ <el-input
|
|
|
+ v-model="editInfoForm.companyName"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder="请输入所属公司"
|
|
|
+ :disabled="true"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click.native="editPassWord = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click.native="editInfo" :loading="editLoading2">提交</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -231,13 +271,25 @@ export default {
|
|
|
collapsed: false,
|
|
|
sysUserName: "",
|
|
|
|
|
|
+ editInformation: false,
|
|
|
editPassWord: false,
|
|
|
editLoading: false,
|
|
|
+ editLoading2: false,
|
|
|
addForm: {
|
|
|
+ id: "",
|
|
|
password: ""
|
|
|
},
|
|
|
+ editInfoForm: {
|
|
|
+ id: "",
|
|
|
+ username: "",
|
|
|
+ mobile: "",
|
|
|
+ companyName: ""
|
|
|
+ },
|
|
|
passRule: {
|
|
|
- password: [{ required: true, message: "请输入新密码", trigger: "blur" }]
|
|
|
+ password: [
|
|
|
+ { required: true, message: "请输入新密码", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ username: [{ required: true, message: "请输入姓名", trigger: "blur" }]
|
|
|
},
|
|
|
//消息数据
|
|
|
popoverData: [],
|
|
@@ -277,6 +329,62 @@ export default {
|
|
|
)[0].style.display = status ? "block" : "none";
|
|
|
},
|
|
|
|
|
|
+ //打开编辑信息界面
|
|
|
+ editInfoOpen() {
|
|
|
+ this.editInformation = true;
|
|
|
+ this.editInfoForm.id = JSON.parse(sessionStorage.getItem("user")).id;
|
|
|
+ this.editInfoForm.username = JSON.parse(
|
|
|
+ sessionStorage.getItem("user")
|
|
|
+ ).username;
|
|
|
+ this.editInfoForm.mobile = JSON.parse(
|
|
|
+ sessionStorage.getItem("user")
|
|
|
+ ).account;
|
|
|
+ this.editInfoForm.companyName = JSON.parse(
|
|
|
+ sessionStorage.getItem("user")
|
|
|
+ ).companyName;
|
|
|
+ },
|
|
|
+
|
|
|
+ //编辑信息
|
|
|
+ editInfo() {
|
|
|
+ this.$refs.editInfoForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ this.editLoading2 = true;
|
|
|
+ this.http.post(
|
|
|
+ this.port.pwd.resetPwd,
|
|
|
+ { id: this.editInfoForm.id, username: this.editInfoForm.username },
|
|
|
+ res => {
|
|
|
+ this.editLoading2 = false;
|
|
|
+ this.editInformation = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ //读取并覆盖session storage
|
|
|
+ var userObject = JSON.parse(sessionStorage.getItem("user"));
|
|
|
+ userObject.username = this.editInfoForm.username;
|
|
|
+ sessionStorage.setItem("user", JSON.stringify(userObject));
|
|
|
+ this.sysUserName = this.editInfoForm.username;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.editLoading2 = false;
|
|
|
+ this.editInformation = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
reset() {
|
|
|
this.editPassWord = true;
|
|
|
this.addForm.id = JSON.parse(sessionStorage.getItem("user")).id;
|