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 v-loading="loading" stripe :data="list">
<el-table-column label="讨论ID" align="center" prop="id" /> <el-table-column label="讨论ID" align="center" prop="id" />
<el-table-column label="项目名" align="center" prop="projectId" /> <el-table-column label="项目名" align="center" prop="projectId">
<el-table-column label="任务内容" align="center" prop="taskId" /> <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="recoveryNumber" />
<el-table-column label="工时" align="center" prop="workingHours" /> <el-table-column label="工时" align="center" prop="workingHours" />
<el-table-column label="参与人" align="center" prop="joinPerson" width="80" > <el-table-column label="参与人" align="center" prop="joinPerson" width="80" >
@ -248,7 +257,6 @@ export default {
getProjectPage({ getProjectPage({
pageNo: 1, pageNo: 1,
pageSize: 400, pageSize: 400,
state: 'STARTING' //
}).then(res=>{ }).then(res=>{
this.projectList = res.data.list; this.projectList = res.data.list;
this.getTask(); this.getTask();
@ -260,8 +268,6 @@ export default {
pageNo: 1, pageNo: 1,
pageSize: 400, pageSize: 400,
draft:false, draft:false,
status:'STARTED' //
}).then(res=>{ }).then(res=>{
this.taskList = res.data.list; this.taskList = res.data.list;
this.getList(); this.getList();
@ -275,19 +281,6 @@ export default {
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// //
getDiscussPage(params).then(response => { 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.list = response.data.list;
this.total = response.data.total; this.total = response.data.total;
this.loading = false; this.loading = false;
@ -306,7 +299,6 @@ export default {
taskId: undefined, taskId: undefined,
content: undefined, content: undefined,
images: undefined, images: undefined,
// resources: [],
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -325,6 +317,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
// this.twoRescoure(); // this.twoRescoure();
this.projectList = this.projectList.filter(item => item.state == 'STARTING');
this.open = true; this.open = true;
this.title = "添加农场任务讨论"; this.title = "添加农场任务讨论";
}, },
@ -408,9 +401,10 @@ export default {
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
}, },
///
changeProject(row){ changeProject(row){
this.form.taskId = null; 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); this.showCpUserList(row);
}, },
showCpUserList(projectId){ showCpUserList(projectId){
@ -442,6 +436,16 @@ export default {
// //
reco.setAttribute("disabled", true); 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>
<el-form-item label="状态" prop="state"> <el-form-item label="状态" prop="state">
<el-select v-model="queryParams.state" filterable placeholder="请单选"> <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 }} {{ item.name }}
</el-option> </el-option>
</el-select> </el-select>
@ -38,14 +38,14 @@
<el-form-item label="优先级" prop="weight"> <el-form-item label="优先级" prop="weight">
<el-input v-model="queryParams.weight" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.weight" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item> </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" <el-date-picker v-model="dateRangePlanStartTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item>
<el-form-item label="结束时间"> <el-form-item label="结束时间">
<el-date-picker v-model="dateRangePlanEndTime" style="width: 240px" value-format="yyyy-MM-dd" <el-date-picker v-model="dateRangePlanEndTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item> </el-form-item> -->
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
@ -298,6 +298,11 @@ export default {
planEndTime: [{ required: true, message: "不能为空", trigger: "blur" }], planEndTime: [{ required: true, message: "不能为空", trigger: "blur" }],
weight: [{ required: true, message: "不能为空", trigger: "blur" }], weight: [{ required: true, message: "不能为空", trigger: "blur" }],
}, },
searchState:[
{id:'PLAN', name:'计划中'},
{id:'STARTING', name:'进行中'},
{id:'FINISH', name:'已完成'}
],
areasList:[], areasList:[],
cropList:[], cropList:[],
membersList:[], membersList:[],
@ -317,13 +322,16 @@ export default {
}, },
membersConvert(members){ membersConvert(members){
let membersName = ""; let membersName = "";
this.membersList.forEach(item =>{ if(members != undefined){
this.membersList.forEach(item =>{
members.forEach(memberId =>{ members.forEach(memberId =>{
if (memberId == item.id) { if (memberId == item.id) {
membersName += item.name +"\n"; membersName += item.name +"\n";
} }
}) })
}) })
}
return membersName; return membersName;
}, },
areasConvert(areas){ areasConvert(areas){

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

@ -22,13 +22,6 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </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-form-item label="任务名" prop="taskCateId">
<el-select v-model="queryParams.taskCateId" filterable placeholder="请单选"> <el-select v-model="queryParams.taskCateId" filterable placeholder="请单选">
<el-option v-for="item in cateOneList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in cateOneList" :key="item.id" :label="item.name" :value="item.id">
@ -50,6 +43,13 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </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-form-item label="资源名" prop="areas">
<el-select v-model="queryParams.resourceId" filterable placeholder="请单选"> <el-select v-model="queryParams.resourceId" filterable placeholder="请单选">
<el-option v-for="item in resourceList" :key="item.id" :label="item.name" :value="item.id"> <el-option v-for="item in resourceList" :key="item.id" :label="item.name" :value="item.id">
@ -57,13 +57,9 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </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" <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" /> 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="优先级" prop="weight"> <el-form-item label="优先级" prop="weight">
<el-input v-model="queryParams.weight" placeholder="请输入优先级" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.weight" placeholder="请输入优先级" clearable @keyup.enter.native="handleQuery" />
@ -307,7 +303,7 @@ export default {
draft: false, draft: false,
areaId:null, areaId:null,
executorName:null // executorName:null
}, },
// //
form: { form: {
@ -360,6 +356,7 @@ export default {
this.getProjectList(); this.getProjectList();
this.getResource(); this.getResource();
this.getCpUserList(); this.getCpUserList();
this.getCropList();
}, },
methods: { methods: {
startMethod(){ startMethod(){

Loading…
Cancel
Save