密码修改优化

master
schry 2 years ago
parent 55abdf9518
commit 2ea9e5491c

@ -103,7 +103,7 @@
width="35%"
v-if="isVisible"
>
<el-form :model="inputQuery" label-width="100px" :rules="rules" ref="inputQuery">
<el-form :model="inputQuery" label-width="100px" :rules="formRules" ref="dataForm">
<el-row :gutter="20">
<el-col :span="20">
<el-form-item prop="userName" label="用户账号:">
@ -119,7 +119,7 @@
</el-row>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item prop="locInvCode" label="当前密码:">
<el-form-item prop="passWord" label="当前密码:">
<el-input
size="small"
placeholder="请输入当前密码"
@ -132,7 +132,7 @@
</el-row>
<el-row :gutter="20">
<el-col :span="20">
<el-form-item prop="locInvCode" label="新密码:">
<el-form-item prop="newPassword" label="新密码:">
<el-input
size="small"
placeholder="请输入新密码"
@ -146,7 +146,7 @@
<el-row :gutter="20">
<el-col :span="20">
<el-form-item prop="locInvCode" label="确认密码:">
<el-form-item prop="confirmPassword" label="确认密码:">
<el-input
size="small"
placeholder="请输入确认密码"
@ -160,8 +160,8 @@
<div style='text-align: center; margin-bottom: 10px;margin-top: 18px ;'>
<el-button type="primary" @click="onSubmit('inputQuery')"></el-button>
<el-button type="primary" @click="closeDialog"></el-button>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button @click="closeDialog"></el-button>
</div>
</el-form>
</el-dialog>
@ -187,15 +187,15 @@ import router from "@/router";
export default {
data() {
let validatePass2 = (rule, value, callback) => {
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.inputQuery.passWord) {
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
// let validatePass2 = (rule, value, callback) => {
// if (value === "") {
// callback(new Error(""));
// } else if (value !== this.inputQuery.passWord) {
// callback(new Error("!"));
// } else {
// callback();
// }
// };
return {
inputQuery: {
passWord: "",
@ -216,19 +216,25 @@ export default {
locDeptCode: [
{required: true, message: "请选择当前部门", trigger: "blur"}
],
locInvCode: [
{required: true, message: "请选择当前仓库", trigger: "blur"}
// locInvCode: [
// {required: true, message: "", trigger: "blur"}
// ],
password: [{required: true, message: "请输入密码", trigger: "blur"}],
newPassword: [{required: true, message: "请输入密码", trigger: "blur"}],
confirmPassword: [
{required: true, message: "请确认密码", trigger: "blur"},
// {validator: validatePass2, trigger: "blur"},
],
},
rules: {
password: [{required: true, message: "请输入密码", trigger: "blur"}],
newPassword: [{required: true, message: "请输入密码", trigger: "blur"}],
confirmPassword: [
{required: true, message: "请确认密码", trigger: "blur"},
{validator: validatePass2, trigger: "blur"},
// {validator: validatePass2, trigger: "blur"},
],
},
};
},
components: {
@ -265,8 +271,16 @@ export default {
}
},
methods: {
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
onSubmit() {
if (this.inputQuery.newPassword != this.inputQuery.confirmPassword) {
this.$message.error("新密码与确认密码不一致!!!!");
return
}
if (this.inputQuery.passWord == this.inputQuery.newPassword) {
this.$message.error("旧密码与新密码不能相同!!!!");
return
}
this.$refs["dataForm"].validate((valid) => {
if (valid) {
this.loading = true;
modifyPasswd(this.inputQuery).then((response) => {

@ -73,7 +73,7 @@
<el-divider style="margin: 15px"></el-divider>
<el-table v-loading="loading" :data="list" key="1" style="width: 100%"
border>
border highlight-current-row @row-click="getCompanyId">
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="注册企业" prop="companyName" show-overflow-tooltip></el-table-column>
<el-table-column label="填报者身份" prop="companyName" show-overflow-tooltip>
@ -248,6 +248,9 @@ export default {
},
methods: {
getCompanyId(row) {
this.filterQuery.companyIdFk = row.id;
},
onReset() {
this.$router.push({
path: "",

Loading…
Cancel
Save