|
|
@@ -196,6 +196,18 @@
|
|
|
<el-input v-model="formData.referrerId" disabled></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="领导人" prop="leaderId">
|
|
|
+ <el-select style="width: 200px" clearable filterable v-model="formData.leaderId" placeholder="请选择">
|
|
|
+ <el-option v-for="val in leaderOptions" :label="val.name" :value="val.id" :key="val.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="领导人工号" prop="leaderName">
|
|
|
+ <el-input v-model="formData.leaderId" disabled></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="离职时间" prop="logoutTime">
|
|
|
<el-date-picker
|
|
|
@@ -471,6 +483,7 @@ export default {
|
|
|
mixins: [mixin],
|
|
|
data() {
|
|
|
return {
|
|
|
+ leaderOptions: [],
|
|
|
activeName: "1",
|
|
|
isShow: true,
|
|
|
//影像资料
|
|
|
@@ -506,6 +519,12 @@ export default {
|
|
|
type: "select",
|
|
|
options: JSON.parse(localStorage.getItem("user_statusoptions")),
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "领导人",
|
|
|
+ prop: "leaderId",
|
|
|
+ type: "select",
|
|
|
+ options: [],
|
|
|
+ },
|
|
|
],
|
|
|
btnGroup: [
|
|
|
{
|
|
|
@@ -621,8 +640,24 @@ export default {
|
|
|
// this.getDictItems("sex");
|
|
|
// this.getDictItems("user_status");
|
|
|
this.findPage();
|
|
|
+ this.searchLeaderFun()
|
|
|
},
|
|
|
methods: {
|
|
|
+ searchLeaderFun() {
|
|
|
+ this.$api.user
|
|
|
+ .findBackListByDeptId({ deptId: this.deptId })
|
|
|
+ .then((res) => {
|
|
|
+ res.data.forEach(e=>{
|
|
|
+ e.value= e.id
|
|
|
+ e.label= e.name
|
|
|
+ })
|
|
|
+ this.formList.forEach(val=>{
|
|
|
+ if(val.prop=="leaderId"){
|
|
|
+ val.options=res.data;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
//状态改变时
|
|
|
statusChange(e) {
|
|
|
if (e == 0) {
|
|
|
@@ -675,6 +710,7 @@ export default {
|
|
|
this.deptId = this.currentTreeNode.id;
|
|
|
this.pageData.pageNum = 1;
|
|
|
this.findPage();
|
|
|
+ this.searchLeaderFun()
|
|
|
// this.formData.deptId = [];
|
|
|
// this.platform(treeId);
|
|
|
},
|
|
|
@@ -690,12 +726,18 @@ export default {
|
|
|
handleChange(val) {
|
|
|
if (val && val.length !== 0) {
|
|
|
this.formData.referrerId = "";
|
|
|
+ this.formData.leaderId = "";
|
|
|
this.formData.deptId = val.at(-1);
|
|
|
this.$api.user
|
|
|
.selectfindByreferrerId({ deptId: this.formData.deptId })
|
|
|
.then((res) => {
|
|
|
this.recommenderOptions = res.data;
|
|
|
});
|
|
|
+ this.$api.user
|
|
|
+ .findListByDeptId({ deptId: this.formData.deptId, })
|
|
|
+ .then((res) => {
|
|
|
+ this.leaderOptions = res.data;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
// 右侧列表的方法Start
|
|
|
@@ -754,6 +796,11 @@ export default {
|
|
|
this.activeName = "1";
|
|
|
let res = await this.$api.user.getUserDatail(params.userId);
|
|
|
if (res.code == 200) {
|
|
|
+ this.$api.user
|
|
|
+ .findListByDeptId({ deptId: res.data.sysUser.deptId, id: params.userId })
|
|
|
+ .then((res) => {
|
|
|
+ this.leaderOptions = res.data;
|
|
|
+ });
|
|
|
this.$api.user
|
|
|
.selectfindByreferrerId({ deptId: res.data.sysUser.deptId })
|
|
|
.then((res) => {
|
|
|
@@ -811,6 +858,11 @@ export default {
|
|
|
.then((res) => {
|
|
|
this.recommenderOptions = res.data;
|
|
|
});
|
|
|
+ this.$api.user
|
|
|
+ .findListByDeptId({ deptId: this.formData.deptId })
|
|
|
+ .then((res) => {
|
|
|
+ this.leaderOptions = res.data;
|
|
|
+ });
|
|
|
if (this.currentTreeNode == null) {
|
|
|
this.$message.info("请选择所属公司或部门");
|
|
|
return;
|
|
|
@@ -859,6 +911,9 @@ export default {
|
|
|
if(this.formData.positionId){
|
|
|
this.formData.positionName=this.postOption.find(val=>val.postId==this.formData.positionId).postName
|
|
|
}
|
|
|
+ if (this.formData.leaderId) {
|
|
|
+ this.formData.leaderName = this.leaderOptions.find(val => val.id == this.formData.leaderId).name
|
|
|
+ }
|
|
|
if (this.dialogTitle == "新增代理人") {
|
|
|
if (!this.formDataDetail.password) {
|
|
|
this.formDataDetail.password =
|