This commit is contained in:
zhanyunjiu
2022-07-20 14:31:48 +08:00
parent 1b2f164703
commit 8fbfd7c0cd
3 changed files with 48 additions and 39 deletions
+24 -20
View File
@@ -39,8 +39,17 @@
<!-- 列表 -->
<el-table v-loading="loading" stripe :data="list">
<el-table-column label="讨论ID" align="center" prop="id" />
<el-table-column label="项目名" align="center" prop="projectId" />
<el-table-column label="任务内容" align="center" prop="taskId" />
<el-table-column label="项目名" align="center" prop="projectId">
<template slot-scope="scope">
<span v-if="scope.row.projectId">{{convertProject(scope.row.projectId)}}</span>
</template>
</el-table-column>
<el-table-column label="任务ID" align="center" prop="taskId" />
<el-table-column label="任务内容" align="center" prop="taskId" width="120">
<template slot-scope="scope">
<span v-if="scope.row.taskId">{{convertTask(scope.row.taskId)}}</span>
</template>
</el-table-column>
<el-table-column label="采收数量" align="center" prop="recoveryNumber" />
<el-table-column label="工时" align="center" prop="workingHours" />
<el-table-column label="参与人" align="center" prop="joinPerson" width="80" >
@@ -248,7 +257,6 @@ export default {
getProjectPage({
pageNo: 1,
pageSize: 400,
state: 'STARTING' //只看进行中的项目
}).then(res=>{
this.projectList = res.data.list;
this.getTask();
@@ -260,8 +268,6 @@ export default {
pageNo: 1,
pageSize: 400,
draft:false,
status:'STARTED' //只能看已开始的任务
}).then(res=>{
this.taskList = res.data.list;
this.getList();
@@ -275,19 +281,6 @@ export default {
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getDiscussPage(params).then(response => {
response.data.list.forEach(discuss => {
this.projectList.forEach(project => {
if (project.id == discuss.projectId) {
discuss.projectId = project.name;
}
});
this.taskList.forEach(task =>{
if (task.id == discuss.taskId) {
discuss.taskId = task.taskMsg;
}
})
});
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
@@ -306,7 +299,6 @@ export default {
taskId: undefined,
content: undefined,
images: undefined,
// resources: [],
};
this.resetForm("form");
},
@@ -325,6 +317,7 @@ export default {
handleAdd() {
this.reset();
// this.twoRescoure();
this.projectList = this.projectList.filter(item => item.state == 'STARTING');
this.open = true;
this.title = "添加农场任务讨论";
},
@@ -408,9 +401,10 @@ export default {
this.exportLoading = false;
}).catch(() => {});
},
//新增/修改 选择项目时
changeProject(row){
this.form.taskId = null;
this.selectTaskList = this.taskList.filter(task => task.projectId == row);
this.selectTaskList = this.taskList.filter(task => task.status == 'STARTED' && task.projectId == row);
this.showCpUserList(row);
},
showCpUserList(projectId){
@@ -442,6 +436,16 @@ export default {
//采收数量不可编辑
reco.setAttribute("disabled", true);
}
},
//展示项目名
convertProject(projectId){
let project = this.projectList.filter(item => item.id == projectId)[0];
return project.name;
},
//展示任务类型 任务内容
convertTask(taskId){
let task = this.taskList.filter(item => item.id == taskId)[0];
return task.taskName +"/\n"+ task.taskMsg;
}
}