|
|
|
|
@ -62,7 +62,7 @@ |
|
|
|
|
<template #teamLeader-form="{ type }"> |
|
|
|
|
<span v-show="type == 'edit' || type == 'add'"> |
|
|
|
|
<el-select v-model="form.teamLeader" placeholder="请选择班组长" |
|
|
|
|
filterable remote :remote-method="getTeamUser"> |
|
|
|
|
filterable clearable> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in userData" |
|
|
|
|
:key="item.id" |
|
|
|
|
@ -75,7 +75,7 @@ |
|
|
|
|
<template #planner-form="{ type }"> |
|
|
|
|
<span v-show="type == 'edit' || type == 'add'"> |
|
|
|
|
<el-select v-model="form.planner" placeholder="请选择计划员" |
|
|
|
|
filterable remote :remote-method="getPlanner"> |
|
|
|
|
filterable clearable> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in plannerData" |
|
|
|
|
:key="item.id" |
|
|
|
|
@ -88,7 +88,7 @@ |
|
|
|
|
<template #dispatcher-form="{ type }"> |
|
|
|
|
<span v-show="type == 'edit' || type == 'add'"> |
|
|
|
|
<el-select v-model="form.dispatcher" placeholder="请选择调度员" |
|
|
|
|
filterable remote :remote-method="getDispatcher"> |
|
|
|
|
filterable clearable> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in dispatcherData" |
|
|
|
|
:key="item.id" |
|
|
|
|
@ -537,60 +537,6 @@ export default { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
getTeamUser(query){ |
|
|
|
|
if(query == ''){ |
|
|
|
|
getAllUser({ |
|
|
|
|
current:1, |
|
|
|
|
size:9999 |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.userData = res.data.data.records |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
getAllUser({ |
|
|
|
|
current:1, |
|
|
|
|
size:9999, |
|
|
|
|
realName:query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.userData = res.data.data.records |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getPlanner(query){ |
|
|
|
|
if(query == ''){ |
|
|
|
|
getAllUser({ |
|
|
|
|
current:1, |
|
|
|
|
size:9999 |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.plannerData = res.data.data.records |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
getAllUser({ |
|
|
|
|
current:1, |
|
|
|
|
size:9999, |
|
|
|
|
realName:query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.plannerData = res.data.data.records |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getDispatcher(query){ |
|
|
|
|
if(query == ''){ |
|
|
|
|
getAllUser({ |
|
|
|
|
current:1, |
|
|
|
|
size:9999 |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.dispatcherData = res.data.data.records |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
getAllUser({ |
|
|
|
|
current:1, |
|
|
|
|
size:9999, |
|
|
|
|
realName:query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.dispatcherData = res.data.data.records |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
updateTeam(row).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
@ -794,45 +740,20 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 打开前回调 |
|
|
|
|
async beforeOpen(done, type, loading) { |
|
|
|
|
// 加载用户下拉数据 |
|
|
|
|
const res = await getAllUser({current:1, size:9999}) |
|
|
|
|
const allUsers = res.data.data.records || [] |
|
|
|
|
this.userData = allUsers |
|
|
|
|
this.plannerData = allUsers |
|
|
|
|
this.dispatcherData = allUsers |
|
|
|
|
|
|
|
|
|
if(type == 'edit'){ |
|
|
|
|
this.form.csId = this.form.csId + '' |
|
|
|
|
this.form.teamLeader = this.form.teamLeader + '' |
|
|
|
|
this.form.planner = this.form.planner + '' |
|
|
|
|
this.form.dispatcher = this.form.dispatcher + '' |
|
|
|
|
const res = await getAllUser({current:1,size:9999 }) |
|
|
|
|
|
|
|
|
|
this.dispatcherData = res.data.data.records |
|
|
|
|
this.userData = res.data.data.records |
|
|
|
|
this.plannerData = res.data.data.records |
|
|
|
|
|
|
|
|
|
const dispatcherRes = await getAllUser({realName:this.form.dispatcherRealName}) |
|
|
|
|
// 合并数据并根据 id 去重 |
|
|
|
|
const mergedData = [...this.dispatcherData, ...dispatcherRes.data.data.records]; |
|
|
|
|
const uniqueData = Array.from( |
|
|
|
|
new Map(mergedData.map(item => [item.id, item])).values() |
|
|
|
|
); |
|
|
|
|
this.dispatcherData = uniqueData |
|
|
|
|
|
|
|
|
|
const plannerRes = await getAllUser({realName:this.form.plannerRealName}) |
|
|
|
|
// 合并数据并根据 id 去重 |
|
|
|
|
const mergedPlannerData = [...this.plannerData, ...plannerRes.data.data.records]; |
|
|
|
|
const uniquePlannerData = Array.from( |
|
|
|
|
new Map(mergedPlannerData.map(item => [item.id, item])).values() |
|
|
|
|
); |
|
|
|
|
this.plannerData = uniquePlannerData |
|
|
|
|
|
|
|
|
|
const teamRes = await getAllUser({realName:this.form.teamLeaderRealName}) |
|
|
|
|
// 合并数据并根据 id 去重 |
|
|
|
|
const mergedTeamData = [...this.userData, ...teamRes.data.data.records]; |
|
|
|
|
const uniqueTeeanData = Array.from( |
|
|
|
|
new Map(mergedTeamData.map(item => [item.id, item])).values() |
|
|
|
|
); |
|
|
|
|
this.userData = uniqueTeeanData |
|
|
|
|
done() |
|
|
|
|
}else { |
|
|
|
|
done() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
done() |
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
|