fix:排版计划中班组添加后默认显示所有人员

This commit is contained in:
zhangxuanming 2024-12-25 17:44:42 +08:00
parent 978d6fb0bc
commit be787947c6
2 changed files with 31 additions and 15 deletions

View File

@ -33,3 +33,14 @@ export function delTeammember(memberId) {
method: 'delete' method: 'delete'
}) })
} }
// 根据班组IDS查询班组成员列表
export function getListByTeamId(ids) {
return request({
url: '/mes/cal/teammember/getListByTeamId',
method: 'get',
params: {
ids
}
})
}

View File

@ -21,20 +21,20 @@
v-hasPermi="['mes:cal:calplan:edit']" v-hasPermi="['mes:cal:calplan:edit']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<TeamSelect ref="teamSelect" @onSelected="onTeamSelected"></TeamSelect> <TeamSelect ref="teamSelect" @onSelected="onTeamSelected"></TeamSelect>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>成员</span> <span>成员</span>
</div> </div>
<el-table v-loading="loading" :data="teammemberList"> <el-table v-loading="loading" :data="teammemberList">
<el-table-column label="用户名" align="center" prop="userName" /> <el-table-column label="用户名" align="center" prop="userName" />
<el-table-column label="用户昵称" align="center" prop="nickName" /> <el-table-column label="用户昵称" align="center" prop="nickName" />
<el-table-column label="电话" align="center" prop="tel" /> <el-table-column label="电话" align="center" prop="tel" />
</el-table> </el-table>
</el-card> </el-card>
</el-col> </el-col>
@ -44,7 +44,7 @@
<script> <script>
import { listPlanteam, delPlanteam, addPlanteam } from "@/api/mes/cal/planteam"; import { listPlanteam, delPlanteam, addPlanteam } from "@/api/mes/cal/planteam";
import { listTeammember } from "@/api/mes/cal/teammember"; import {getListByTeamId, listTeammember} from "@/api/mes/cal/teammember";
import TeamSelect from "@/components/calTeamSelect/multi.vue" import TeamSelect from "@/components/calTeamSelect/multi.vue"
export default { export default {
name:"PlanTeam", name:"PlanTeam",
@ -75,23 +75,28 @@ export default {
} }
}, },
created() { created() {
this.getTeamList(); this.getTeamList();
}, },
methods:{ methods:{
getTeamList(){ getTeamList(){
this.loading = true; this.loading = true;
listPlanteam(this.queryParams).then(response => { listPlanteam(this.queryParams).then(response => {
this.teamList = response.rows; this.teamList = response.rows;
this.loading = false; this.loading = false;
let ids = []
this.teamList.forEach(irem => {
ids.push(irem.teamId)
})
getListByTeamId(ids.join(",")).then(res => {
this.teammemberList = res.data;
this.loading = false;
});
}); });
}, },
getMemberList(id){ getMemberList(id){
var param = {
teamId:id
}
this.loading = true; this.loading = true;
listTeammember(param).then(response => { getListByTeamId(id).then(res => {
this.teammemberList = response.rows; this.teammemberList = res.data;
this.loading = false; this.loading = false;
}); });
}, },
@ -110,7 +115,7 @@ export default {
this.form.planId = this.planId; this.form.planId = this.planId;
this.form.calendarType = this.calendarType; this.form.calendarType = this.calendarType;
addPlanteam(this.form).then(response => { addPlanteam(this.form).then(response => {
this.getTeamList(); this.getTeamList();
}); });
}); });
}, },
@ -130,4 +135,4 @@ export default {
<style> <style>
</style> </style>