|
@@ -46,8 +46,9 @@
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
|
|
|
|
|
|
|
+ <el-col :span="1.5" v-show="companyId != '000000'">
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini"
|
|
|
|
|
+ @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:ownUser:export']">导出</el-button>
|
|
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:ownUser:export']">导出</el-button>
|
|
@@ -92,8 +93,12 @@
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-form-item label="公司名称" prop="payroll" v-show="companyId == '000000'">
|
|
<el-form-item label="公司名称" prop="payroll" v-show="companyId == '000000'">
|
|
|
- <el-select v-model="form.companyId">
|
|
|
|
|
- <el-option v-for="(item, index) in companyList" :key="index" :label="item.scyName" :value="item.scyId"></el-option>
|
|
|
|
|
|
|
+ <el-select v-model="form.companyId" @change="getRodept">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in companyList"
|
|
|
|
|
+ :key="index" :label="item.scyName"
|
|
|
|
|
+ :value="item.scyId">
|
|
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
@@ -101,9 +106,10 @@
|
|
|
<el-input v-model="form.nickName" placeholder="请输入用户姓名" maxlength="50" />
|
|
<el-input v-model="form.nickName" placeholder="请输入用户姓名" maxlength="50" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+ <el-col :span="12" v-if="rodeptShow">
|
|
|
<el-form-item label="归属部门" prop="deptId">
|
|
<el-form-item label="归属部门" prop="deptId">
|
|
|
- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
|
|
|
|
|
|
|
+ <treeselect v-model="form.deptId" :options="rodeptOptions" :show-count="true"
|
|
|
|
|
+ placeholder="请选择归属部门"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -117,11 +123,11 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="手机号" prop="userName">
|
|
<el-form-item label="手机号" prop="userName">
|
|
|
- <el-input v-model="form.userName" placeholder="请输入登手机号" maxlength="11" :disabled="isUpdate" />
|
|
|
|
|
|
|
+ <el-input v-model="form.userName" placeholder="请输入登录手机号" maxlength="11" :disabled="isUpdate" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
|
|
|
|
+ <el-row v-if="rodeptShow">
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item label="角色" prop="roleIds">
|
|
<el-form-item label="角色" prop="roleIds">
|
|
|
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
|
<el-select v-model="form.roleIds" multiple placeholder="请选择">
|
|
@@ -192,12 +198,14 @@ import {
|
|
|
updateUser,
|
|
updateUser,
|
|
|
resetUserPwd,
|
|
resetUserPwd,
|
|
|
changeUserStatus,
|
|
changeUserStatus,
|
|
|
- getUserProfile
|
|
|
|
|
|
|
+ getUserProfile,
|
|
|
|
|
+ getNowUser,
|
|
|
|
|
+ getRoleDept,
|
|
|
|
|
+ companyList
|
|
|
} from "@/api/system/user";
|
|
} from "@/api/system/user";
|
|
|
import { getToken } from "@/utils/auth";
|
|
import { getToken } from "@/utils/auth";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
import { treeselect } from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
-import { companyList } from "@/api/system/company";
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import { columnQuery, columnfilter } from "@/api/common/columnSetting";
|
|
import { columnQuery, columnfilter } from "@/api/common/columnSetting";
|
|
|
import ColumnSetting from "../../../components/Table/columnSetting.vue";
|
|
import ColumnSetting from "../../../components/Table/columnSetting.vue";
|
|
@@ -207,6 +215,8 @@ export default {
|
|
|
components: { Treeselect, ColumnSetting },
|
|
components: { Treeselect, ColumnSetting },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ //当前登录用户企业id
|
|
|
|
|
+ signCompanyId:'',
|
|
|
//姓名
|
|
//姓名
|
|
|
nameList: [],
|
|
nameList: [],
|
|
|
// 遮罩层
|
|
// 遮罩层
|
|
@@ -219,6 +229,8 @@ export default {
|
|
|
multiple: true,
|
|
multiple: true,
|
|
|
// 显示搜索条件
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
showSearch: true,
|
|
|
|
|
+ rodeptShow:false,
|
|
|
|
|
+ roleShow:false,
|
|
|
// 总条数
|
|
// 总条数
|
|
|
total: 0,
|
|
total: 0,
|
|
|
// 用户表格数据
|
|
// 用户表格数据
|
|
@@ -227,6 +239,7 @@ export default {
|
|
|
title: "",
|
|
title: "",
|
|
|
// 部门树选项
|
|
// 部门树选项
|
|
|
deptOptions: undefined,
|
|
deptOptions: undefined,
|
|
|
|
|
+ rodeptOptions:undefined,
|
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
open: false,
|
|
|
openPassWord: false,
|
|
openPassWord: false,
|
|
@@ -323,7 +336,7 @@ export default {
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
|
message: "不能为空",
|
|
message: "不能为空",
|
|
|
- trigger: ["blur", "change"],
|
|
|
|
|
|
|
+ trigger: "blur",
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
userName: [
|
|
userName: [
|
|
@@ -417,9 +430,8 @@ export default {
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getCompanyList();
|
|
|
|
|
this.getList();
|
|
this.getList();
|
|
|
-
|
|
|
|
|
|
|
+ this.getNowUser();
|
|
|
this.getTreeselect();
|
|
this.getTreeselect();
|
|
|
this.getUserProfile();
|
|
this.getUserProfile();
|
|
|
this.getDicts("sys_normal_disable").then((response) => {
|
|
this.getDicts("sys_normal_disable").then((response) => {
|
|
@@ -462,12 +474,33 @@ export default {
|
|
|
}
|
|
}
|
|
|
columnfilter(this.selfDom);
|
|
columnfilter(this.selfDom);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- getCompanyList() {
|
|
|
|
|
- companyList().then((response) => {
|
|
|
|
|
- this.companyList = response.data;
|
|
|
|
|
|
|
+ //获取当前用户信息
|
|
|
|
|
+ getNowUser(){
|
|
|
|
|
+ getNowUser().then((response) => {
|
|
|
|
|
+ this.signCompanyId = response.data.companyId;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ //根据企业id查询部门和角色信息
|
|
|
|
|
+ getRodept(item){
|
|
|
|
|
+ this.$set(this.form, 'deptId', null);
|
|
|
|
|
+ this.$set(this.form, 'roleIds', null);
|
|
|
|
|
+ if(item){
|
|
|
|
|
+ this.rodeptShow = true;
|
|
|
|
|
+ const companyId = item;
|
|
|
|
|
+ getRoleDept(companyId).then((response) => {
|
|
|
|
|
+ if(response.deptList.length > 0){
|
|
|
|
|
+ this.rodeptOptions = response.deptList;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.rodeptOptions = undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(response.roleList.length > 0){
|
|
|
|
|
+ this.roleOptions = response.roleList;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.roleOptions = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
getUserProfile() {
|
|
getUserProfile() {
|
|
|
var sscDomain = document.location.hostname;
|
|
var sscDomain = document.location.hostname;
|
|
|
getUserProfile(sscDomain).then((response) => {
|
|
getUserProfile(sscDomain).then((response) => {
|
|
@@ -490,6 +523,12 @@ export default {
|
|
|
this.deptOptions = response.data;
|
|
this.deptOptions = response.data;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
|
|
+ getFormTreeselect() {
|
|
|
|
|
+ treeselect().then((response) => {
|
|
|
|
|
+ this.rodeptOptions = response.data;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
// 筛选节点
|
|
// 筛选节点
|
|
|
filterNode(value, data) {
|
|
filterNode(value, data) {
|
|
|
if (!value) return true;
|
|
if (!value) return true;
|
|
@@ -568,17 +607,22 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
- debugger;
|
|
|
|
|
this.ids = selection.map((item) => item.userId);
|
|
this.ids = selection.map((item) => item.userId);
|
|
|
this.single = selection.length != 1;
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
|
|
+ this.roleShow = true;
|
|
|
|
|
+ if(this.signCompanyId == '000000'){
|
|
|
|
|
+ this.rodeptShow = false;
|
|
|
|
|
+ }else if(this.signCompanyId != '000000'){
|
|
|
|
|
+ this.rodeptShow = true;
|
|
|
|
|
+ }
|
|
|
this.isUpdate = false;
|
|
this.isUpdate = false;
|
|
|
this.reset();
|
|
this.reset();
|
|
|
this.peoplpeName = false;
|
|
this.peoplpeName = false;
|
|
|
- this.getTreeselect();
|
|
|
|
|
|
|
+ this.getFormTreeselect();
|
|
|
getUser().then((response) => {
|
|
getUser().then((response) => {
|
|
|
this.postOptions = response.posts;
|
|
this.postOptions = response.posts;
|
|
|
this.roleOptions = response.roles;
|
|
this.roleOptions = response.roles;
|
|
@@ -590,15 +634,29 @@ export default {
|
|
|
},
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
|
|
|
+ if(this.signCompanyId == '000000'){
|
|
|
|
|
+ this.rodeptShow = false;
|
|
|
|
|
+ }else if(this.signCompanyId != '000000'){
|
|
|
|
|
+ this.rodeptShow = true;
|
|
|
|
|
+ }
|
|
|
this.isUpdate = true;
|
|
this.isUpdate = true;
|
|
|
- var self =this;
|
|
|
|
|
|
|
+ var self = this;
|
|
|
this.reset();
|
|
this.reset();
|
|
|
this.peoplpeName = true;
|
|
this.peoplpeName = true;
|
|
|
- this.getTreeselect();
|
|
|
|
|
|
|
+ this.getFormTreeselect();
|
|
|
const userId = row.userId || this.ids;
|
|
const userId = row.userId || this.ids;
|
|
|
getUser(userId).then((response) => {
|
|
getUser(userId).then((response) => {
|
|
|
this.uinParams.ssId = response.data.staffCode;
|
|
this.uinParams.ssId = response.data.staffCode;
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
|
|
+ if(this.signCompanyId == '000000'){
|
|
|
|
|
+ companyList(userId).then((response) => {
|
|
|
|
|
+ this.companyList = response.data;
|
|
|
|
|
+ if(response.data.length > 0){
|
|
|
|
|
+ this.$set(this.form, 'companyId', response.data[0].scyId)
|
|
|
|
|
+ this.getRodept(response.data[0].scyId);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
this.postOptions = response.posts;
|
|
this.postOptions = response.posts;
|
|
|
this.roleOptions = response.roles;
|
|
this.roleOptions = response.roles;
|
|
|
this.form.postIds = response.postIds;
|
|
this.form.postIds = response.postIds;
|
|
@@ -725,7 +783,6 @@ export default {
|
|
|
handleExport() {
|
|
handleExport() {
|
|
|
console.log(this.queryParams)
|
|
console.log(this.queryParams)
|
|
|
console.log(this.dateRange)
|
|
console.log(this.dateRange)
|
|
|
- debugger
|
|
|
|
|
const loading = this.$loading({
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: "Loading",
|
|
text: "Loading",
|