|
@@ -150,38 +150,38 @@
|
|
|
</div>
|
|
|
|
|
|
<!--修改密码-->
|
|
|
- <el-dialog title="修改密码" v-if="editPassWord" :visible.sync="editPassWord" :close-on-click-modal="false" customClass="customWidth">
|
|
|
- <el-form :model="addForm" label-width="80px" :rules="passRule" ref="addForm">
|
|
|
- <el-form-item label="新密码" prop="password">
|
|
|
- <el-input v-model="addForm.password" autocomplete="off" placeholder="请输入新密码" show-password></el-input>
|
|
|
+ <el-dialog :title="$t('home.pwd')" v-if="editPassWord" :visible.sync="editPassWord" :close-on-click-modal="false" customClass="customWidth">
|
|
|
+ <el-form :model="addForm" label-width="120px" :rules="passRule" ref="addForm">
|
|
|
+ <el-form-item :label="$t('home.newPwd')" prop="password">
|
|
|
+ <el-input v-model="addForm.password" autocomplete="off" :placeholder="$t('msg.inputNewPwd')" show-password></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="resetPwd" :loading="editLoading">提交</el-button>
|
|
|
+ <el-button @click.native="editPassWord = false">{{$t('el.messagebox.cancel')}}</el-button>
|
|
|
+ <el-button type="primary" @click.native="resetPwd" :loading="editLoading">{{$t('el.messagebox.confirm')}}</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-dialog :title="$t('home.msg')" v-if="editInformation" :visible.sync="editInformation" :close-on-click-modal="false" customClass="customWidth">
|
|
|
+ <el-form :model="editInfoForm" label-width="120px" :rules="passRule" ref="editInfoForm">
|
|
|
+ <el-form-item :label="$t('base.name')" prop="username">
|
|
|
+ <el-input v-model="editInfoForm.username" autocomplete="off" :placeholder="$t('msg.inputName')"></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 :label="$t('base.mobile')" prop="mobile">
|
|
|
+ <el-input v-model="editInfoForm.mobile" autocomplete="off" :placeholder="$t('msg.inputMobile')" :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 :label="$t('base.company')" prop="companyName">
|
|
|
+ <el-input v-model="editInfoForm.companyName" autocomplete="off" :placeholder="$t('msg.inputCompany')" :disabled="true"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click.native="editInformation = false">取消</el-button>
|
|
|
- <el-button type="primary" @click.native="editInfo" :loading="editLoading2">提交</el-button>
|
|
|
+ <el-button @click.native="editInformation = false">{{$t('el.messagebox.cancel')}}</el-button>
|
|
|
+ <el-button type="primary" @click.native="editInfo" :loading="editLoading2">{{$t('el.messagebox.confirm')}}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -193,6 +193,17 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
data() {
|
|
|
+ const msg = (rule, value, callback) => {
|
|
|
+ if (!value) {
|
|
|
+ if(rule.field == "password") {
|
|
|
+ return callback(new Error(this.$t('msg.inputNewPwd')));
|
|
|
+ } else {
|
|
|
+ return callback(new Error(this.$t('msg.loginPass')));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
user: sessionStorage.getItem("user"),
|
|
|
collapsed: false,
|
|
@@ -213,10 +224,8 @@
|
|
|
companyName: ""
|
|
|
},
|
|
|
passRule: {
|
|
|
- password: [
|
|
|
- { required: true, message: "请输入新密码", trigger: "blur" }
|
|
|
- ],
|
|
|
- username: [{ required: true, message: "请输入姓名", trigger: "blur" }]
|
|
|
+ password: [{ validator: msg , trigger: "blur" }],
|
|
|
+ username: [{ validator: msg , trigger: "blur" }]
|
|
|
},
|
|
|
//消息数据
|
|
|
popoverData: ["", "", ""],
|
|
@@ -297,39 +306,36 @@
|
|
|
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 },
|
|
|
+ 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"
|
|
|
- });
|
|
|
- }
|
|
|
+ this.editLoading2 = false;
|
|
|
+ this.editInformation = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('prompt.success'),
|
|
|
+ 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"
|
|
|
+ this.editLoading2 = false;
|
|
|
+ this.editInformation = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
});
|
|
|
- }
|
|
|
- );
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -338,53 +344,48 @@
|
|
|
this.editPassWord = true;
|
|
|
this.addForm.id = JSON.parse(sessionStorage.getItem("user")).id;
|
|
|
this.addForm.account = JSON.parse(sessionStorage.getItem("user")).account;
|
|
|
- },
|
|
|
+ },
|
|
|
|
|
|
- resetPwd() {
|
|
|
+ resetPwd() {
|
|
|
this.$refs.addForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.editLoading = true;
|
|
|
- this.http.post(
|
|
|
- this.port.pwd.resetPwd,
|
|
|
- this.addForm,
|
|
|
+ this.editLoading = true;
|
|
|
+ this.http.post( this.port.pwd.resetPwd, this.addForm,
|
|
|
res => {
|
|
|
- this.editLoading = false;
|
|
|
- this.editPassWord = false;
|
|
|
- if (res.code == "ok") {
|
|
|
- this.$message({
|
|
|
- message: "修改成功,请重新登录",
|
|
|
- type: "success"
|
|
|
- });
|
|
|
- this.$router.push("/login");
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
+ this.editLoading = false;
|
|
|
+ this.editPassWord = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('prompt.success1'),
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ this.$router.push("/login");
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
error => {
|
|
|
- this.editLoading = false;
|
|
|
- this.editPassWord = false;
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error"
|
|
|
+ this.editLoading = false;
|
|
|
+ this.editPassWord = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
});
|
|
|
- }
|
|
|
- );
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
//读取消息提示
|
|
|
loadNotice() {
|
|
|
- this.http.post(
|
|
|
- this.port.notice.list,
|
|
|
- {
|
|
|
+ this.http.post( this.port.notice.list, {
|
|
|
pageNum: 1,
|
|
|
pageSize: 5
|
|
|
- },
|
|
|
- res => {
|
|
|
+ },
|
|
|
+ res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.popoverData = [];
|
|
|
this.popoverData.push(res.data[0].approvelList.list);
|
|
@@ -403,14 +404,13 @@
|
|
|
type: "error"
|
|
|
});
|
|
|
}
|
|
|
- },
|
|
|
- error => {
|
|
|
+ },
|
|
|
+ error => {
|
|
|
this.$message({
|
|
|
message: error,
|
|
|
type: "error"
|
|
|
});
|
|
|
- }
|
|
|
- );
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
//点击消息的跳转
|