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 @@ ...@@ -29,8 +29,8 @@
<label class="el-form-item__label" style="width: 120px">账户等级</label> <label class="el-form-item__label" style="width: 120px">账户等级</label>
<div class="el-form-item__content" style="margin-left: 120px"> <div class="el-form-item__content" style="margin-left: 120px">
<el-select size="small" :disabled="nextStatus" v-model="accountDetail.merchantAccountLevel" placeholder="请选择"> <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-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -110,13 +110,14 @@ export default { ...@@ -110,13 +110,14 @@ export default {
} }
} }
const validatePwd = (rule, value, callback) => { const validatePwd = (rule, value, callback) => {
if (!(/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(value))) { if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个字母+数字密码')) callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
} else { } else {
callback() callback()
} }
} }
return { return {
editStatus: false,
nextStatus: false, nextStatus: false,
accountTypesRule: false, accountTypesRule: false,
filterText: '', filterText: '',
...@@ -161,17 +162,38 @@ export default { ...@@ -161,17 +162,38 @@ export default {
merchantLoginPassword: [ merchantLoginPassword: [
{ required: true, message: '请输入登录密码', trigger: 'blur' }, { required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', 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: { methods: {
getAddress() { getAddress() {
this.dialogMapVisible = false this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address this.accountAddForm.merchantAddress = this.$refs.mapForm.address
}, },
getBtnStatus(status, value) { getBtnStatus(status, value) {
this.editStatus = true
this.accountTypesRule = false this.accountTypesRule = false
if (status) { if (status) {
this.accounttypeId.push(value) this.accounttypeId.push(value)
...@@ -199,7 +221,21 @@ export default { ...@@ -199,7 +221,21 @@ export default {
}) })
}, },
handleCancel() { 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() { handlePrev() {
document.querySelector('#app').scrollTop = 0 document.querySelector('#app').scrollTop = 0
...@@ -339,6 +375,9 @@ export default { ...@@ -339,6 +375,9 @@ export default {
}) })
this.accountDetail.merchantAccountLevel = 4 this.accountDetail.merchantAccountLevel = 4
} }
this.$nextTick(() => {
this.editStatus = false
})
}) })
}, },
twoMerchantDetail(pid) { twoMerchantDetail(pid) {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item size="small" label="登录密码" prop="merchantLoginPassword" class="form-row"> <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 <el-button
type="primary" type="primary"
class="form-btn" class="form-btn"
...@@ -99,8 +99,8 @@ export default { ...@@ -99,8 +99,8 @@ export default {
}, },
data() { data() {
const validatePwd = (rule, value, callback) => { const validatePwd = (rule, value, callback) => {
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test(value)) { if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
callback(new Error('请输入正确的6-20个字母+数字密码')) callback(new Error('请输入正确的6-20个密码,必须同时包含字母、数字。'))
} else { } else {
callback() callback()
} }
...@@ -225,7 +225,21 @@ export default { ...@@ -225,7 +225,21 @@ export default {
} }
}, },
handleCancel() { 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) { handleSave(status) {
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<el-form-item size="small" label="商户号"> <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-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>
<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-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<el-form-item size="small" label="上级商户号"> <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-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>
<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-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -267,15 +267,19 @@ export default { ...@@ -267,15 +267,19 @@ export default {
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px; padding: 10px;
/deep/ { /deep/ {
.el-input--small .el-input__inner { .el-input--small .el-input__inner {
width: 215px; width: 215px;
} }
.el-form--inline .el-form-item {
margin-right: 10px;
}
} }
} }
.accountType-row { .accountType-row {
text-align: left; text-align: left;
position: relative; position: relative;
padding-left: 15px; padding-left: 15px;
margin-bottom: 2px;
&::before { &::before {
content: ''; content: '';
position: absolute; position: absolute;
...@@ -284,7 +288,7 @@ export default { ...@@ -284,7 +288,7 @@ export default {
background: #5850ff; background: #5850ff;
border-radius: 8px; border-radius: 8px;
left: 0px; left: 0px;
top: 7px; top: 5px;
} }
} }
.merchant-row { .merchant-row {
......
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
{ {
required: true, required: true,
validator: (rule, value, callback) => { 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' trigger: 'change'
} }
...@@ -141,7 +141,7 @@ export default { ...@@ -141,7 +141,7 @@ export default {
name: 'password', name: 'password',
showPass: true, showPass: true,
type: 'input', type: 'input',
maxlength: 15, maxlength: 20,
suffixSlot: 'passwordSlot' suffixSlot: 'passwordSlot'
}, },
{ {
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
<el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input> <el-input size="small" disabled style="width: 40%" v-model="ruleForm.merchantName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="角色名称" prop="roleName"> <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>
<el-form-item label="角色说明" prop="roleDesc"> <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>
<!-- <el-form-item label="角色权限" prop="roleRoot"> <!-- <el-form-item label="角色权限" prop="roleRoot">
<div class="custom_element"> <div class="custom_element">
...@@ -107,7 +107,8 @@ export default { ...@@ -107,7 +107,8 @@ export default {
// tree数据 // tree数据
treeDataList: [], treeDataList: [],
accountLevel: 1, accountLevel: 1,
isHaveEdit: false isHaveEdit: false,
isChangeEdit:false
} }
}, },
watch: { watch: {
...@@ -119,6 +120,10 @@ export default { ...@@ -119,6 +120,10 @@ export default {
} }
}, },
methods: { methods: {
// 输入有变就触发提醒
changeInput(){
this.isChangeEdit = true
},
// 获取角色信息 // 获取角色信息
getRoleData(id) { getRoleData(id) {
this.$apis.role.roleInfoData({ id }).then(res => { this.$apis.role.roleInfoData({ id }).then(res => {
...@@ -195,6 +200,7 @@ export default { ...@@ -195,6 +200,7 @@ export default {
}, },
// 选择商户权限 // 选择商户权限
selectCurAccount(item, index) { selectCurAccount(item, index) {
this.isChangeEdit = true
this.roleRootRules = false this.roleRootRules = false
this.accountListSelect[index].select = !item.select this.accountListSelect[index].select = !item.select
this.curRootIndex = 0 this.curRootIndex = 0
...@@ -292,34 +298,22 @@ export default { ...@@ -292,34 +298,22 @@ export default {
} }
}, },
insertRole(para) { insertRole(para) {
this.$confirm('是否保存当前信息?', '提示', { this.$apis.role.createRole(para).then(res => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.createRole(para).then(res => {
if (res) { if (res) {
this.$router.push('/role/index') this.$router.push('/role/index')
} }
}) })
})
}, },
updateRole(para) { updateRole(para) {
this.$confirm('是否保存当前信息?', '提示', { this.$apis.role.updateRole(para).then(res => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.role.updateRole(para).then(res => {
if (res) { if (res) {
this.$router.push('/role/index') this.$router.push('/role/index')
} }
}) })
})
}, },
toBack() { toBack() {
if (this.isHaveEdit&&this.pageType=='create') { if ((this.isHaveEdit&&this.pageType=='create') ||(this.isChangeEdit&&this.pageType=='edit')) {
this.$confirm('离开当前页面内容将不会保存,是否继续?', '提示', { this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!