|
@@ -136,26 +136,33 @@
|
|
<el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
|
|
<el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="部门" prop="department" v-show="accountType === 0">
|
|
|
|
|
|
+ <el-form-item label="部门" prop="department" v-show="roleObj.type === 0">
|
|
<el-tree
|
|
<el-tree
|
|
:data="departmentList"
|
|
:data="departmentList"
|
|
show-checkbox
|
|
show-checkbox
|
|
|
|
+ :check-strictly="true"
|
|
node-key="adminWebsitId"
|
|
node-key="adminWebsitId"
|
|
ref="tree"
|
|
ref="tree"
|
|
highlight-current
|
|
highlight-current
|
|
:props="props">
|
|
:props="props">
|
|
</el-tree>
|
|
</el-tree>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="经销商" prop="dealer" v-show="accountType === 0">
|
|
|
|
|
|
+ <el-form-item label="经销商" prop="dealer" v-show="roleObj.type === 0 && roleObj.name === '经销商'">
|
|
<el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%;">
|
|
<el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%;">
|
|
<el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
|
|
<el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="商户" prop="merchant" v-show="accountType === 1 || accountType === 2">
|
|
|
|
|
|
+ <el-form-item label="商户" prop="merchant" v-show="roleObj.type === 1 || roleObj.type === 2">
|
|
<el-select v-model="AccountForm.merchant" placeholder="请选择商户" style="width: 100%;">
|
|
<el-select v-model="AccountForm.merchant" placeholder="请选择商户" style="width: 100%;">
|
|
<el-option :label="item.adminCompanyName" :value="item.adminCompanyId" v-for="(item, index) in merchantList" :key="index"></el-option>
|
|
<el-option :label="item.adminCompanyName" :value="item.adminCompanyId" v-for="(item, index) in merchantList" :key="index"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="集团公司" prop="isGroup" v-show="roleObj.type === 0 && roleObj.name === '经销商'">
|
|
|
|
+ <el-radio-group v-model="AccountForm.isGroup">
|
|
|
|
+ <el-radio :label="false">否</el-radio>
|
|
|
|
+ <el-radio :label="true">是</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="密码" prop="newPassword">
|
|
<el-form-item label="密码" prop="newPassword">
|
|
<el-input v-model="AccountForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入密码" :type="passwordType1"></el-input>
|
|
<el-input v-model="AccountForm.newPassword" ref="password1" autocomplete="off" placeholder="请输入密码" :type="passwordType1"></el-input>
|
|
<span class="show-pwd" @click="showPwd(1)">
|
|
<span class="show-pwd" @click="showPwd(1)">
|
|
@@ -271,6 +278,7 @@ export default {
|
|
merchant: '', // 商户
|
|
merchant: '', // 商户
|
|
dealer: '', //经销商
|
|
dealer: '', //经销商
|
|
role: '', // 角色组
|
|
role: '', // 角色组
|
|
|
|
+ isGroup: false,
|
|
newPassword: '', // 新密码
|
|
newPassword: '', // 新密码
|
|
confirmPassword: '', // 确认密码
|
|
confirmPassword: '', // 确认密码
|
|
},
|
|
},
|
|
@@ -326,8 +334,8 @@ export default {
|
|
],
|
|
],
|
|
},
|
|
},
|
|
|
|
|
|
- accountType: '',
|
|
|
|
roleList: [], // 角色列表
|
|
roleList: [], // 角色列表
|
|
|
|
+ roleObj: {}, // 选中的角色
|
|
merchantList: [],
|
|
merchantList: [],
|
|
dealerList: [],
|
|
dealerList: [],
|
|
|
|
|
|
@@ -342,7 +350,7 @@ export default {
|
|
'AccountForm.role'() {
|
|
'AccountForm.role'() {
|
|
if(this.AccountForm.role) {
|
|
if(this.AccountForm.role) {
|
|
let index = findElem(this.roleList, 'adminRoleId', this.AccountForm.role);
|
|
let index = findElem(this.roleList, 'adminRoleId', this.AccountForm.role);
|
|
- this.accountType = this.roleList[index].type;
|
|
|
|
|
|
+ this.roleObj = this.roleList[index];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -505,6 +513,7 @@ export default {
|
|
this.AccountForm.nickName = res.data.nickName;
|
|
this.AccountForm.nickName = res.data.nickName;
|
|
this.AccountForm.merchant = res.data.companyWechatId;
|
|
this.AccountForm.merchant = res.data.companyWechatId;
|
|
this.AccountForm.dealer = res.data.customerId;
|
|
this.AccountForm.dealer = res.data.customerId;
|
|
|
|
+ this.AccountForm.isGroup = res.data.isGroupCompany;
|
|
this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
|
|
this.$refs.tree.setCheckedKeys(res.data.adminWebsitIds || []);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -528,9 +537,12 @@ export default {
|
|
roleId: this.AccountForm.role,
|
|
roleId: this.AccountForm.role,
|
|
password: this.AccountForm.newPassword,
|
|
password: this.AccountForm.newPassword,
|
|
}
|
|
}
|
|
- if(this.accountType === 0) {
|
|
|
|
|
|
+ if(this.roleObj.type === 0) {
|
|
params.adminWebsitIds = this.$refs.tree.getCheckedKeys();
|
|
params.adminWebsitIds = this.$refs.tree.getCheckedKeys();
|
|
- params.customerId = this.AccountForm.dealer;
|
|
|
|
|
|
+ if(this.roleObj.name === '经销商') {
|
|
|
|
+ params.customerId = this.AccountForm.dealer;
|
|
|
|
+ params.isGroupCompany = this.AccountForm.isGroup;
|
|
|
|
+ }
|
|
}else {
|
|
}else {
|
|
params.adminCompanyId = this.AccountForm.merchant;
|
|
params.adminCompanyId = this.AccountForm.merchant;
|
|
}
|
|
}
|