Commit 5400f919 by 王志慧

Merge branch 'v1.0.1' of http://192.168.3.233:8090/saas/scrm-micro-settings into v1.0.1

2 parents dce0b16a 953ad1f9
......@@ -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) {
......
......@@ -31,7 +31,7 @@
<el-row>
<el-col :span="12">
<el-form-item size="small" label="登录密码" prop="merchantLoginPassword" class="form-row">
<el-input type="password" :readonly="pwdStatus ? 'readonly' : false" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码(必须包含6-20个字母+数字)" show-password></el-input>
<el-input type="password" maxlength="20" :readonly="pwdStatus ? 'readonly' : false" v-model="accountInfoForm.merchantLoginPassword" placeholder="请输入登录密码(必须包含6-20个字母+数字)" show-password></el-input>
<el-button
type="primary"
class="form-btn"
......@@ -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 {
......
......@@ -99,7 +99,7 @@ export default {
{
required: true,
validator: (rule, value, callback) => {
;/^[\S]{6,15}$/.test(value) ? callback() : callback(new Error('密码必须6-15位'))
;/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value) ? callback() : callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
},
trigger: 'change'
}
......@@ -141,7 +141,7 @@ export default {
name: 'password',
showPass: true,
type: 'input',
maxlength: 15,
maxlength: 20,
suffixSlot: 'passwordSlot'
},
{
......
......@@ -18,10 +18,10 @@
<el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input>
</el-form-item>
<el-form-item label="角色名称" prop="roleName">
<el-input size="small" maxlength="20" style="width: 40%; padding-right: 50px" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
<el-input size="small" maxlength="20" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleName" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色说明" prop="roleDesc">
<el-input size="small" maxlength="50" style="width: 40%; padding-right: 50px" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
<el-input size="small" maxlength="50" style="width: 40%; padding-right: 50px" @input="changeInput" v-model="ruleForm.roleDesc" placeholder="请输入角色说明"></el-input>
</el-form-item>
<!-- <el-form-item label="角色权限" prop="roleRoot">
<div class="custom_element">
......@@ -107,7 +107,8 @@ export default {
// tree数据
treeDataList: [],
accountLevel: 1,
isHaveEdit: false
isHaveEdit: false,
isChangeEdit:false
}
},
watch: {
......@@ -119,6 +120,10 @@ export default {
}
},
methods: {
// 输入有变就触发提醒
changeInput(){
this.isChangeEdit = true
},
// 获取角色信息
getRoleData(id) {
this.$apis.role.roleInfoData({ id }).then(res => {
......@@ -195,6 +200,7 @@ export default {
},
// 选择商户权限
selectCurAccount(item, index) {
this.isChangeEdit = true
this.roleRootRules = false
this.accountListSelect[index].select = !item.select
this.curRootIndex = 0
......@@ -292,34 +298,22 @@ export default {
}
},
insertRole(para) {
this.$confirm('是否保存当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.createRole(para).then(res => {
this.$apis.role.createRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
})
},
updateRole(para) {
this.$confirm('是否保存当前信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.updateRole(para).then(res => {
this.$apis.role.updateRole(para).then(res => {
if (res) {
this.$router.push('/role/index')
}
})
})
},
toBack() {
if (this.isHaveEdit&&this.pageType=='create') {
this.$confirm('离开当前页面内容将不会保存,是否继续?', '提示', {
if ((this.isHaveEdit&&this.pageType=='create') ||(this.isChangeEdit&&this.pageType=='edit')) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!