Commit 7b1c06a8 by yangming

password

1 parent 2db571b1
......@@ -29,8 +29,8 @@
<label class="el-form-item__label" style="width: 120px">账户等级</label>
<div class="el-form-item__content" style="margin-left: 120px">
<el-select size="small" :disabled="nextStatus" v-model="accountDetail.merchantAccountLevel" placeholder="请选择">
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</div>
</div>
</el-col>
......@@ -110,13 +110,14 @@ export default {
}
}
const validatePwd = (rule, value, callback) => {
if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(value))) {
callback(new Error('请输入正确的6-20个字母+数字密码'))
if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
} else {
callback()
}
}
return {
editStatus: false,
nextStatus: false,
accountTypesRule: false,
filterText: '',
......@@ -161,17 +162,38 @@ export default {
merchantLoginPassword: [
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' },
{ validator: validatePwd, trigger: 'blur' }
{ validator: validatePwd, trigger: 'blur' }
]
}
}
},
watch: {
accountInfoForm: {
handler() {
this.editStatus = true
},
deep: true
},
accountDetail: {
handler() {
this.editStatus = true
},
deep: true
},
accountAddForm: {
handler() {
this.editStatus = true
},
deep: true
}
},
methods: {
getAddress() {
this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address
},
getBtnStatus(status, value) {
this.editStatus = true
this.accountTypesRule = false
if (status) {
this.accounttypeId.push(value)
......@@ -199,7 +221,21 @@ export default {
})
},
handleCancel() {
this.$router.push('/account/index')
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({
path: '/account/index'
})
})
} else {
this.$router.push({
path: '/account/index'
})
}
},
handlePrev() {
document.querySelector('#app').scrollTop = 0
......@@ -339,6 +375,9 @@ export default {
})
this.accountDetail.merchantAccountLevel = 4
}
this.$nextTick(() => {
this.editStatus = false
})
})
},
twoMerchantDetail(pid) {
......
......@@ -99,8 +99,8 @@ export default {
},
data() {
const validatePwd = (rule, value, callback) => {
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个字母+数字密码'))
if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
} else {
callback()
}
......@@ -225,7 +225,21 @@ export default {
}
},
handleCancel() {
this.$router.push('/account/index')
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push({
path: '/account/index'
})
})
} else {
this.$router.push({
path: '/account/index'
})
}
},
//保存
handleSave(status) {
......
......@@ -64,7 +64,7 @@
<el-form-item size="small" label="商户号">
<el-input size="small" v-model="searchForm.merchantNo" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入商户号,仅限11位" maxlength="11"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right" v-if="$globalState.session.accountLevel == 4">
<el-form-item size="small" style="float: right; margin-right: 0px" v-if="$globalState.session.accountLevel == 4">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
......@@ -72,7 +72,7 @@
<el-form-item size="small" label="上级商户号">
<el-input size="small" v-model="searchForm.parentMerchantNo" onkeyup="value=value.replace(/[^\d]/g,'')" placeholder="请输入上级商户号,仅限11位" maxlength="11"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-form-item size="small" style="float: right; margin-right: 0px">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
......@@ -267,15 +267,19 @@ export default {
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px;
/deep/ {
.el-input--small .el-input__inner {
.el-input--small .el-input__inner {
width: 215px;
}
.el-form--inline .el-form-item {
margin-right: 10px;
}
}
}
.accountType-row {
text-align: left;
position: relative;
padding-left: 15px;
margin-bottom: 2px;
&::before {
content: '';
position: absolute;
......@@ -284,7 +288,7 @@ export default {
background: #5850ff;
border-radius: 8px;
left: 0px;
top: 7px;
top: 5px;
}
}
.merchant-row {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!