班组长修改
This commit is contained in:
parent
eaf0e47060
commit
d37fc87240
|
|
@ -274,7 +274,7 @@
|
||||||
<el-table-column label="电话" align="center" prop="phone" />
|
<el-table-column label="电话" align="center" prop="phone" />
|
||||||
<el-table-column label="操作" align="center" >
|
<el-table-column label="操作" align="center" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" @click="delUser(scope.row)">删除</el-button>
|
<el-button size="mini" type="text" @click="delUser(scope.row)" v-if="scope.row.isLeader!=0">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -385,6 +385,7 @@
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
teamUserList:[],//新增编辑弹窗-班组成员
|
teamUserList:[],//新增编辑弹窗-班组成员
|
||||||
|
leaderData:{},//新增编辑弹窗-班组长
|
||||||
chosenUser:[],//人员列表右侧-选中人员
|
chosenUser:[],//人员列表右侧-选中人员
|
||||||
peopleDataList:[],//接口获取-所有人员列表
|
peopleDataList:[],//接口获取-所有人员列表
|
||||||
peopleList:[],//人员列表左侧-表格渲染
|
peopleList:[],//人员列表左侧-表格渲染
|
||||||
|
|
@ -424,7 +425,7 @@
|
||||||
// 获取人员列表
|
// 获取人员列表
|
||||||
getPersonList(){
|
getPersonList(){
|
||||||
let param = {
|
let param = {
|
||||||
type:1,//1.全部人员 2.未分配人员 3.已分配人员 4.班组长
|
type:4,//1.全部人员 2.未分配人员 3.已分配人员 4.班组长
|
||||||
roleCode: this.$store.getters.roleCode,
|
roleCode: this.$store.getters.roleCode,
|
||||||
departId: this.$store.getters.departId,
|
departId: this.$store.getters.departId,
|
||||||
teamId: this.$store.getters.teamId,
|
teamId: this.$store.getters.teamId,
|
||||||
|
|
@ -440,8 +441,21 @@
|
||||||
if(item.id==val){
|
if(item.id==val){
|
||||||
this.form.teamLeader = item.name;
|
this.form.teamLeader = item.name;
|
||||||
this.form.leaderPhone = item.phone;
|
this.form.leaderPhone = item.phone;
|
||||||
|
this.leaderData=item;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.leaderData.isLeader=0;//是否班组长,0是1否
|
||||||
|
if(this.teamUserList.length==0){
|
||||||
|
this.teamUserList.push(this.leaderData)
|
||||||
|
}else{
|
||||||
|
var index = this.teamUserList.findIndex(uItem => {return uItem.isLeader == 0})
|
||||||
|
if(index>-1){
|
||||||
|
this.teamUserList.splice(index,1)
|
||||||
|
this.teamUserList.unshift(this.leaderData)
|
||||||
|
}else{
|
||||||
|
this.teamUserList.unshift(this.leaderData)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 查询班组列表 */
|
/** 查询班组列表 */
|
||||||
getList() {
|
getList() {
|
||||||
|
|
@ -594,17 +608,10 @@
|
||||||
},
|
},
|
||||||
//选择人员弹窗-确认
|
//选择人员弹窗-确认
|
||||||
submitPeople(){
|
submitPeople(){
|
||||||
// let arrs=[...this.chosenUser,...this.teamUserList];
|
// console.log(this.teamUserList)
|
||||||
// //根据id去重
|
// console.log(this.chosenUser)
|
||||||
// let map=new Map();
|
|
||||||
// for(let item of arrs){
|
|
||||||
// if(!map.has(item.id)){
|
|
||||||
// map.set(item.id,item)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// let newArr=[...map.values()];
|
|
||||||
this.teamUserList = this.chosenUser;
|
this.teamUserList = this.chosenUser;
|
||||||
|
this.teamUserList.unshift(this.leaderData)
|
||||||
this.openPeople = false;
|
this.openPeople = false;
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
|
|
@ -620,10 +627,18 @@
|
||||||
const teamId = row.teamId
|
const teamId = row.teamId
|
||||||
getTeamInfo({id:teamId}).then(response => {
|
getTeamInfo({id:teamId}).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.personList.forEach(item=>{
|
||||||
|
if(item.id==this.form.teamLeaderId){
|
||||||
|
this.leaderData=item;
|
||||||
|
this.leaderData.isLeader=0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
this.$set(this.form,'proId',response.data.proId+'')
|
this.$set(this.form,'proId',response.data.proId+'')
|
||||||
this.checkList = response.data.checkList;
|
this.checkList = response.data.checkList;
|
||||||
// this.$set(this.form,'sex',response.data.sex+'')
|
// this.$set(this.form,'sex',response.data.sex+'')
|
||||||
this.teamUserList = response.data.checkList.slice();
|
this.teamUserList = response.data.checkList.slice();
|
||||||
|
this.teamUserList.unshift(this.leaderData)
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改班组";
|
this.title = "修改班组";
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue