Browse Source

优化

master
zhanyunjiu 3 years ago
parent
commit
8fbfd7c0cd
  1. 44
      src/views/farm/discuss/index.vue
  2. 16
      src/views/farm/project/index.vue
  3. 27
      src/views/farm/task/index.vue

44
src/views/farm/discuss/index.vue

@ -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;
}
}

16
src/views/farm/project/index.vue

@ -16,7 +16,7 @@
</el-form-item>
<el-form-item label="状态" prop="state">
<el-select v-model="queryParams.state" filterable placeholder="请单选">
<el-option v-for="item in areasList" :key="item.id" :label="item.name" :value="item.id">
<el-option v-for="item in searchState" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
@ -38,14 +38,14 @@
<el-form-item label="优先级" prop="weight">
<el-input v-model="queryParams.weight" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="开始时间">
<!-- <el-form-item label="开始时间">
<el-date-picker v-model="dateRangePlanStartTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="dateRangePlanEndTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
</el-form-item> -->
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
@ -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){

27
src/views/farm/task/index.vue

@ -22,13 +22,6 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="执行人" prop="executorName">
<el-select v-model="queryParams.executorName" filterable placeholder="请单选">
<el-option v-for="item in cpUserList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="任务名" prop="taskCateId">
<el-select v-model="queryParams.taskCateId" filterable placeholder="请单选">
<el-option v-for="item in cateOneList" :key="item.id" :label="item.name" :value="item.id">
@ -50,6 +43,13 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="作物名" prop="cropId">
<el-select v-model="queryParams.cropId" filterable placeholder="请单选">
<el-option v-for="item in cropList" :key="item.id" :label="item.name" :value="item.id">
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="资源名" prop="areas">
<el-select v-model="queryParams.resourceId" filterable placeholder="请单选">
<el-option v-for="item in resourceList" :key="item.id" :label="item.name" :value="item.id">
@ -57,13 +57,9 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker v-model="dateRangePlanStartTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="dateRangePlanEndTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="优先级" prop="weight">
<el-input v-model="queryParams.weight" placeholder="请输入优先级" clearable @keyup.enter.native="handleQuery" />
@ -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(){

Loading…
Cancel
Save