基础管理-班组

master
A0010407 1 year ago
parent 52f0da7945
commit 934045afe6

@ -9,6 +9,24 @@ export function listTeam(query) {
}); });
} }
// 查询班组列表
export function listTeamMembers(query) {
return request({
url: '/wms/teamUser/listTeamMembers',
method: 'get',
params: query
});
}
// 查询班组列表
export function getRightList(query) {
return request({
url: '/wms/teamUser/getRightList',
method: 'get',
params: query
});
}
// 查询班组详细 // 查询班组详细
export function getTeam(teamId) { export function getTeam(teamId) {
return request({ return request({

@ -216,7 +216,7 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<!-- <el-divider></el-divider> <el-divider></el-divider>
<el-card> <el-card>
<div style="text-align: center"> <div style="text-align: center">
<template> <template>
@ -224,6 +224,7 @@
filterable filterable
filter-placeholder="请输入班组人员名称" filter-placeholder="请输入班组人员名称"
:titles="['可选班组人员', '当前班组人员']" :titles="['可选班组人员', '当前班组人员']"
:button-texts="['解除添加', '添加']"
:data="leftList" :data="leftList"
v-model="rightList" v-model="rightList"
style="text-align: left" style="text-align: left"
@ -231,7 +232,7 @@
</el-transfer> </el-transfer>
</template> </template>
</div> </div>
</el-card> --> </el-card>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -241,7 +242,7 @@
</template> </template>
<script> <script>
import { listTeam, getTeam, delTeam, addTeam, updateTeam ,listTeamMembers} from "@/api/wms/team"; import { listTeam, getTeam, delTeam, addTeam, updateTeam ,listTeamMembers,getRightList} from "@/api/wms/team";
export default { export default {
name: "Team", name: "Team",
@ -263,10 +264,10 @@ export default {
// //
teamList: [], teamList: [],
teamMembersList:[], teamMembersList:[],
// // //
// leftList: [], leftList: [],
// // key // key
// rightList: [], rightList: [],
// //
title: "", title: "",
// //
@ -330,24 +331,24 @@ export default {
indexMethod(index) { indexMethod(index) {
return index + 1; return index + 1;
}, },
// getTeamMembers() { getTeamMembers() {
// // //
// listTeamMembers(this.queryParams).then(response => { listTeamMembers(this.queryParams).then(response => {
// for(let i in response.rows){ console.log(response.rows);
// // 穿 for(let i in response.rows){
// this.leftList.push({ // 穿
// key: response.rows[i].userId, this.leftList.push({
// label: response.rows[i].userName key: response.rows[i].userId,
// }) label: response.rows[i].userName
// } })
// for(let i in response.selected){ }
// // 穿 for(let i in response.selected){
// this.rightList.push(response.selected[i].key); this.rightList.push(response.selected[i].key);
// this.form.rightData = this.rightList; this.form.rightData = this.rightList;
// } }
// this.loading = false; this.loading = false;
// }); });
// }, },
/** 查询班组列表 */ /** 查询班组列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -388,7 +389,6 @@ export default {
teamProperties: null, teamProperties: null,
attendanceQuantity: null, attendanceQuantity: null,
assignedQuantity: null assignedQuantity: null
// rightData: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -411,18 +411,39 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.rightList = [];
this.open = true; this.open = true;
this.title = "添加班组"; this.title = "添加班组";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.rightList = [];
this.reset(); this.reset();
const teamId = row.teamId || this.ids const teamId = row.teamId || this.ids
// listTeamMembers(this.queryParams).then(response => {
// console.log(response.rows);
// for(let i in response.rows){
// // 穿
// this.leftList.push({
// id:response.rows[i].userId,
// key: response.rows[i].userId,
// label: response.rows[i].userName
// })
// }
// });
console.log('this.leftList',this.leftList);
getTeam(teamId).then(response => { getTeam(teamId).then(response => {
this.form = response.data; this.form = response.data;
for(let i in response.data.selectedData){
// 穿
this.rightList.push(
response.data.selectedData[i].userId
)
};
console.log('response.data.selectedData',response.data.selectedData);
})
this.open = true; this.open = true;
this.title = "修改班组"; this.title = "修改班组";
});
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {

Loading…
Cancel
Save