|
@@ -173,12 +173,12 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :md="6">
|
|
|
- <el-form-item label="网点" prop="adminWebsitId">
|
|
|
+ <el-form-item label="网点" prop="rwaide">
|
|
|
<el-cascader
|
|
|
style="width: 100%"
|
|
|
:options="departmentList"
|
|
|
- :props="{ checkStrictly: true, value: 'websitId', label: 'name' }"
|
|
|
- v-model="addForm.adminWebsitId"
|
|
|
+ :props="{ checkStrictly: true, value: 'adminDeptId', label: 'deptName' }"
|
|
|
+ v-model="addForm.rwaide"
|
|
|
clearable
|
|
|
>
|
|
|
</el-cascader>
|
|
@@ -272,6 +272,7 @@ import {
|
|
|
getDepartmentList,
|
|
|
getMerchantList
|
|
|
} from '@/api/setting'
|
|
|
+import { adminDeptTreeWebsit } from '@/api/departmentManagement.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
var validatePass = (rule, value, callback) => {
|
|
@@ -337,12 +338,6 @@ export default {
|
|
|
listTotal: 0, // 列表总数
|
|
|
roleList: [], // 角色列表
|
|
|
departmentList: [], // 部门列表
|
|
|
- props: {
|
|
|
- multiple: true,
|
|
|
- value: 'id',
|
|
|
- label: 'name',
|
|
|
- children: 'children'
|
|
|
- },
|
|
|
merchantList: [], // 商户列表
|
|
|
resetId: null,
|
|
|
resetForm: {
|
|
@@ -360,17 +355,19 @@ export default {
|
|
|
nickName: '', // 用户名
|
|
|
role: '', // 角色组
|
|
|
adminWebsitId: '',
|
|
|
+ adminDeptId: '',
|
|
|
newPassword: '', // 新密码
|
|
|
confirmPassword: '', // 确认密码
|
|
|
pubNotice: true,
|
|
|
- linkPhone: ''
|
|
|
+ linkPhone: '',
|
|
|
+ rwaide: ''
|
|
|
},
|
|
|
addFormRules: {
|
|
|
account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
|
|
|
nickName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
|
|
linkPhone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
|
|
|
role: [{ required: true, message: '请选择角色组', trigger: 'change' }],
|
|
|
- adminWebsitId: [{ required: true, message: '请选择网点', trigger: 'change' }],
|
|
|
+ rwaide: [{ required: true, message: '请选择网点', trigger: 'change' }],
|
|
|
newPassword: [{ required: true, validator: validatePass3, trigger: 'blur' }],
|
|
|
confirmPassword: [{ required: true, validator: validatePass4, trigger: 'blur' }]
|
|
|
},
|
|
@@ -445,7 +442,7 @@ export default {
|
|
|
// 获取部门列表
|
|
|
async getDepartmentList() {
|
|
|
const result = await new Promise((resolve, reject) => {
|
|
|
- getDepartmentList()
|
|
|
+ adminDeptTreeWebsit()
|
|
|
.then(res => {
|
|
|
resolve(res.data)
|
|
|
})
|
|
@@ -563,7 +560,9 @@ export default {
|
|
|
nickName: res.data.nickName,
|
|
|
pubNotice: res.data.pubNotice,
|
|
|
adminWebsitId: res.data.adminWebsitId,
|
|
|
- linkPhone: res.data.linkPhone
|
|
|
+ adminDeptId: res.data.adminDeptId,
|
|
|
+ linkPhone: res.data.linkPhone,
|
|
|
+ rwaide: res.data.adminWebsitId || res.data.adminDeptId
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -584,20 +583,43 @@ export default {
|
|
|
submitAddForm(removeTab) {
|
|
|
this.$refs.addForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- let adminWebsitId = null
|
|
|
- if (this.addForm.adminWebsitId instanceof Array) {
|
|
|
- adminWebsitId = this.addForm.adminWebsitId[this.addForm.adminWebsitId.length - 1]
|
|
|
+ let rwaide = null
|
|
|
+ if (this.addForm.rwaide instanceof Array) {
|
|
|
+ rwaide = this.addForm.rwaide[this.addForm.rwaide.length - 1]
|
|
|
} else {
|
|
|
- adminWebsitId = this.addForm.adminWebsitId
|
|
|
+ rwaide = this.addForm.rwaide
|
|
|
}
|
|
|
let params = {
|
|
|
userName: this.addForm.account,
|
|
|
nickName: this.addForm.nickName,
|
|
|
roleId: this.addForm.role,
|
|
|
- adminWebsitId: adminWebsitId,
|
|
|
password: this.addForm.newPassword,
|
|
|
pubNotice: this.addForm.pubNotice,
|
|
|
- linkPhone: this.addForm.linkPhone
|
|
|
+ linkPhone: this.addForm.linkPhone,
|
|
|
+ ...(() => {
|
|
|
+ var aaa = list => {
|
|
|
+ for (var item of list) {
|
|
|
+ if (item.adminDeptId == rwaide) {
|
|
|
+ return item.isWebsit
|
|
|
+ } else if (item?.children && item?.children?.length) {
|
|
|
+ var data = aaa(item?.children)
|
|
|
+ if (data !== undefined) {
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return undefined
|
|
|
+ }
|
|
|
+ if (aaa(this.departmentList)) {
|
|
|
+ return {
|
|
|
+ adminWebsitId: rwaide
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return {
|
|
|
+ adminDeptId: rwaide
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })()
|
|
|
}
|
|
|
if (this.addFormType == 'edit') {
|
|
|
params.adminUserId = this.editId
|