班组长修改

This commit is contained in:
zzyuan 2024-08-19 13:49:47 +08:00
parent eaf0e47060
commit d37fc87240
1 changed files with 27 additions and 12 deletions

View File

@ -274,7 +274,7 @@
<el-table-column label="电话" align="center" prop="phone" />
<el-table-column label="操作" align="center" >
<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>
</el-table-column>
</el-table>
@ -385,6 +385,7 @@
//
form: {},
teamUserList:[],//-
leaderData:{},//-
chosenUser:[],//-
peopleDataList:[],//-
peopleList:[],//-
@ -424,7 +425,7 @@
//
getPersonList(){
let param = {
type:1,//1. 2. 3. 4.
type:4,//1. 2. 3. 4.
roleCode: this.$store.getters.roleCode,
departId: this.$store.getters.departId,
teamId: this.$store.getters.teamId,
@ -440,8 +441,21 @@
if(item.id==val){
this.form.teamLeader = item.name;
this.form.leaderPhone = item.phone;
this.leaderData=item;
}
})
this.leaderData.isLeader=0;//01
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() {
@ -594,17 +608,10 @@
},
//-
submitPeople(){
// let arrs=[...this.chosenUser,...this.teamUserList];
// //id
// let map=new Map();
// for(let item of arrs){
// if(!map.has(item.id)){
// map.set(item.id,item)
// }
// }
// let newArr=[...map.values()];
// console.log(this.teamUserList)
// console.log(this.chosenUser)
this.teamUserList = this.chosenUser;
this.teamUserList.unshift(this.leaderData)
this.openPeople = false;
},
/** 新增按钮操作 */
@ -620,10 +627,18 @@
const teamId = row.teamId
getTeamInfo({id:teamId}).then(response => {
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.checkList = response.data.checkList;
// this.$set(this.form,'sex',response.data.sex+'')
this.teamUserList = response.data.checkList.slice();
this.teamUserList.unshift(this.leaderData)
this.open = true;
this.title = "修改班组";
});