后台任务只能选中项目里面的成员
This commit is contained in:
@@ -181,7 +181,7 @@
|
|||||||
@pagination="getList" />
|
@pagination="getList" />
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" :close-on-click-modal="false" width="900px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="项目选择" prop="projectId">
|
<el-form-item label="项目选择" prop="projectId">
|
||||||
<el-select v-model="form.projectId" placeholder="请选择" @change="changeProject">
|
<el-select v-model="form.projectId" placeholder="请选择" @change="changeProject">
|
||||||
@@ -191,15 +191,15 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="负责人" prop="mainPerson">
|
<el-form-item label="负责人" prop="mainPerson">
|
||||||
<el-select v-model="form.mainPerson" filterable placeholder="请选择">
|
<el-select v-model="form.mainPerson" filterable placeholder="请先选择项目">
|
||||||
<el-option v-for="item in cpUserList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option v-for="item in selectCpUserList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="执行人" prop="executorPerson">
|
<el-form-item label="执行人" prop="executorPerson">
|
||||||
<el-select v-model="form.executorPerson" filterable multiple placeholder="请选择">
|
<el-select v-model="form.executorPerson" filterable multiple placeholder="请先选择项目">
|
||||||
<el-option v-for="item in cpUserList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option v-for="item in selectCpUserList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -361,6 +361,8 @@ export default {
|
|||||||
cpUserList: [],
|
cpUserList: [],
|
||||||
executorPerson: [],
|
executorPerson: [],
|
||||||
|
|
||||||
|
selectCpUserList: [], //新增修改 根据项目id 展示员工
|
||||||
|
|
||||||
taskCateAllList: [], //未组装的
|
taskCateAllList: [], //未组装的
|
||||||
taskCateList: [], //组装好的
|
taskCateList: [], //组装好的
|
||||||
|
|
||||||
@@ -485,7 +487,6 @@ export default {
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(111111111, res.data.list);
|
|
||||||
this.resourceList = res.data.list;
|
this.resourceList = res.data.list;
|
||||||
this.twoRescoure();
|
this.twoRescoure();
|
||||||
this.getList();
|
this.getList();
|
||||||
@@ -593,6 +594,9 @@ export default {
|
|||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改农场任务";
|
this.title = "修改农场任务";
|
||||||
|
let project = this.projectList.filter(project => project.id == response.data.projectId)[0];
|
||||||
|
this.changeCpUser(project);
|
||||||
|
this.selectCropList = this.cropList.filter(crop => crop.id == project.cropId);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
@@ -722,7 +726,24 @@ export default {
|
|||||||
this.form.cropId = null;
|
this.form.cropId = null;
|
||||||
this.selectCropList = this.cropList.filter(crop => crop.id == project.cropId);
|
this.selectCropList = this.cropList.filter(crop => crop.id == project.cropId);
|
||||||
|
|
||||||
|
//清楚 可选成员数量
|
||||||
|
this.selectCpUserList = [];
|
||||||
|
this.form.mainPerson = null;
|
||||||
|
this.form.executorPerson = null;
|
||||||
|
this.changeCpUser(project);
|
||||||
|
|
||||||
|
},
|
||||||
|
changeCpUser(project){
|
||||||
|
project.members.forEach(member =>{
|
||||||
|
this.cpUserList.forEach(user =>{
|
||||||
|
if(member == user.id){
|
||||||
|
this.selectCpUserList.push(user);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user