From 8fbfd7c0cd74dd9f644be2ee938107088c32dfd4 Mon Sep 17 00:00:00 2001 From: zhanyunjiu <787952492@qq.com> Date: Wed, 20 Jul 2022 14:31:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/farm/discuss/index.vue | 44 +++++++++++++++++--------------- src/views/farm/project/index.vue | 16 +++++++++--- src/views/farm/task/index.vue | 27 +++++++++----------- 3 files changed, 48 insertions(+), 39 deletions(-) diff --git a/src/views/farm/discuss/index.vue b/src/views/farm/discuss/index.vue index b968f54..b53216e 100644 --- a/src/views/farm/discuss/index.vue +++ b/src/views/farm/discuss/index.vue @@ -39,8 +39,17 @@ - - + + + + + + + @@ -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; } } diff --git a/src/views/farm/project/index.vue b/src/views/farm/project/index.vue index 7ded941..767ba14 100644 --- a/src/views/farm/project/index.vue +++ b/src/views/farm/project/index.vue @@ -16,7 +16,7 @@ - + {{ item.name }} @@ -38,14 +38,14 @@ - + @@ -298,6 +298,11 @@ export default { planEndTime: [{ required: true, message: "不能为空", trigger: "blur" }], weight: [{ required: true, message: "不能为空", trigger: "blur" }], }, + searchState:[ + {id:'PLAN', name:'计划中'}, + {id:'STARTING', name:'进行中'}, + {id:'FINISH', name:'已完成'} + ], areasList:[], cropList:[], membersList:[], @@ -317,13 +322,16 @@ export default { }, membersConvert(members){ let membersName = ""; - this.membersList.forEach(item =>{ + if(members != undefined){ + this.membersList.forEach(item =>{ members.forEach(memberId =>{ if (memberId == item.id) { membersName += item.name +"\n"; } }) }) + } + return membersName; }, areasConvert(areas){ diff --git a/src/views/farm/task/index.vue b/src/views/farm/task/index.vue index 6fdd891..d03f4d0 100644 --- a/src/views/farm/task/index.vue +++ b/src/views/farm/task/index.vue @@ -22,13 +22,6 @@ - - - - {{ item.name }} - - - @@ -50,6 +43,13 @@ + + + + {{ item.name }} + + + @@ -57,13 +57,9 @@ - - - - - + + @@ -307,7 +303,7 @@ export default { draft: false, areaId:null, - executorName:null + // executorName:null }, // 表单参数 form: { @@ -360,6 +356,7 @@ export default { this.getProjectList(); this.getResource(); this.getCpUserList(); + this.getCropList(); }, methods: { startMethod(){