|
|
@@ -46,9 +46,6 @@
|
|
|
<el-col :span="1.5">
|
|
|
<el-button plain type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['company:user:edit']">修改</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
- <el-button plain type="success" icon="el-icon-edit" size="mini" :disabled="multiple" @click="batchEditRole"v-hasPermi="['company:user:edit']">批量修改角色</el-button>
|
|
|
- </el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button plain type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['company:user:remove']">删除</el-button>
|
|
|
</el-col>
|
|
|
@@ -490,21 +487,38 @@
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="归属部门" prop="deptId">
|
|
|
- <treeselect v-model="formBindCompany.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="角色" prop="roleIds">
|
|
|
- <el-select v-model="formBindCompany.roleIds" multiple placeholder="请选择">
|
|
|
- <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId "></el-option>
|
|
|
+ <el-form-item label="销售公司" prop="companyId">
|
|
|
+ <el-select filterable v-model="formBindCompany.companyId" placeholder="请选择销售公司" clearable size="small" @change="formBindCompanyChange">
|
|
|
+ <el-option
|
|
|
+ v-for="item in companys"
|
|
|
+ :key="item.companyId"
|
|
|
+ :label="item.companyName"
|
|
|
+ :value="item.companyId"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <div v-if="formBindCompany.companyId!=null">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="归属部门" prop="deptId">
|
|
|
+ <treeselect v-model="formBindCompany.deptId" :options="deptOptionsByCompanyId" :show-count="true" placeholder="请选择归属部门" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="角色" prop="roleIds">
|
|
|
+ <el-select v-model="formBindCompany.roleIds" multiple placeholder="请选择">
|
|
|
+ <el-option v-for="item in roleBindOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId "></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="销售区域" prop="addressId">
|
|
|
@@ -742,6 +756,7 @@ export default {
|
|
|
postOptions: [],
|
|
|
// 角色选项
|
|
|
roleOptions: [],
|
|
|
+ roleBindOptions: [],
|
|
|
userTypeOptions:[
|
|
|
{ "dictLabel": "临时管理员","dictValue": "02"},
|
|
|
{ "dictLabel": "普通用户","dictValue": "01"}
|
|
|
@@ -849,6 +864,9 @@ export default {
|
|
|
},
|
|
|
// 表单校验
|
|
|
bindCompanyRules: {
|
|
|
+ companyId: [
|
|
|
+ { required: true, message: "销售公司不能为空", trigger: "blur" },
|
|
|
+ ],
|
|
|
deptId: [
|
|
|
{ required: true, message: "归属部门不能为空", trigger: "blur" },
|
|
|
],
|
|
|
@@ -984,20 +1002,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // 在 methods 中添加批量修改角色的方法
|
|
|
- batchEditRole() {
|
|
|
- if (this.ids.length === 0) {
|
|
|
- this.$message.warning("请至少选择一个用户");
|
|
|
- return;
|
|
|
- }
|
|
|
- // 获取角色列表数据
|
|
|
- getUser().then((response) => {
|
|
|
- this.roleOptions = response.roles;
|
|
|
- this.batchRoleDialogVisible = true;
|
|
|
- this.selectedRoleIds = []; // 清空之前的选择
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
// 添加批量角色更新提交方法
|
|
|
submitBatchRoles() {
|
|
|
// 验证选择的角色
|
|
|
@@ -1146,6 +1150,7 @@ export default {
|
|
|
deptId: null,
|
|
|
addressId: null,
|
|
|
roleIds: [],
|
|
|
+ companyId: null,
|
|
|
};
|
|
|
this.resetForm("formBindCompany");
|
|
|
},
|
|
|
@@ -1201,12 +1206,10 @@ export default {
|
|
|
handleBindCompanyUserCode() {
|
|
|
this.reset();
|
|
|
this.getTreeselect();
|
|
|
- getUser().then((response) => {
|
|
|
- this.postOptions = response.posts;
|
|
|
- this.roleOptions = response.roles;
|
|
|
- this.bindCompanyOpen = true;
|
|
|
- this.title = "创建 新增/绑定销售 的二维码";
|
|
|
- });
|
|
|
+
|
|
|
+ this.bindCompanyOpen = true;
|
|
|
+ this.title = "创建 新增/绑定销售 的二维码";
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
@@ -1298,6 +1301,28 @@ export default {
|
|
|
document.body.removeChild(link);
|
|
|
},
|
|
|
|
|
|
+ formBindCompanyChange(){
|
|
|
+
|
|
|
+
|
|
|
+ if (this.formBindCompany.companyId == null) {
|
|
|
+ return this.$message.warning("请选择公司");
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getTreeselectByCompanyId(this.formBindCompany.companyId);
|
|
|
+
|
|
|
+ addInfo(this.formBindCompany.companyId).then((response) => {
|
|
|
+
|
|
|
+ this.formBindCompany.deptId= null;
|
|
|
+ this.formBindCompany.roleIds=[];
|
|
|
+
|
|
|
+ this.postOptions = response.posts;
|
|
|
+ this.roleBindOptions = response.roles;
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
submitBingCompanyForm: function() {
|
|
|
|
|
|
this.$refs["formBindCompany"].validate((valid) => {
|