|
|
@ -49,49 +49,50 @@ |
|
|
|
<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="projectName"> |
|
|
|
<el-table-column label="项目名" align="center" prop="projectName"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span> {{ projectList.find(t => t.id == scope.row.projectId).name }} </span> |
|
|
|
<span>{{scope.row.projectName}}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="负责人" align="center" prop="mainPerson"> |
|
|
|
<el-table-column label="负责人" align="center" prop="mainPerson"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span> {{ cpUserList.find(t => t.id == scope.row.mainPerson).name }} </span> |
|
|
|
<span>{{scope.row.mainPersonName}}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="执行人" align="center" prop="executorPerson" width="80" > |
|
|
|
<el-table-column label="执行人" align="center" prop="executorPerson" width="80" > |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{executorPersonConvert(scope.row.executorPerson)}}</span> |
|
|
|
<span>{{executorPersonConvert(scope.row.executorNameList)}}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="区域" align="center" prop="areas" width="180" > |
|
|
|
<el-table-column label="区域" align="center" prop="areas" width="180" > |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{areaConvert(scope.row.areas)}}</span> |
|
|
|
<span>{{areaConvert(scope.row.areaNameList)}}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="作物名" align="center" prop="cropName"> |
|
|
|
<el-table-column label="作物名" align="center" prop="cropName"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span> {{ cropList.find(t => t.id == scope.row.cropId).name }} </span> |
|
|
|
<span> {{scope.row.cropName}} </span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="作物数量" align="center" prop="cropNum" /> |
|
|
|
<el-table-column label="作物数量" align="center" prop="cropNum" /> |
|
|
|
<el-table-column label="任务名" align="center" prop="taskCateId"> |
|
|
|
<el-table-column label="任务名" align="center" prop="taskCateId"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span> {{ cateOneList.find(t => t.id == scope.row.taskCateId).name }} </span> |
|
|
|
<span> {{scope.row.taskName}} </span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="任务内容" align="center" prop="taskCateName"> |
|
|
|
<el-table-column label="任务内容" align="center" prop="taskCateName"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span> {{ cateTwoList.find(t => t.id == scope.row.taskCateName).name }} </span> |
|
|
|
<span> {{scope.row.taskMsg}} </span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="需要的资源" align="center" prop="resources" width="180"> |
|
|
|
<el-table-column label="需要的资源" align="center" prop="resources" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{resouceConvert(scope.row.resources)}}</span> |
|
|
|
<span>{{resouceConvert(scope.row.taskResourceList)}}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="工时" align="center" prop="workingHours" /> |
|
|
|
<el-table-column label="工时" align="center" prop="workingHours" /> |
|
|
|
<el-table-column label="图片" align="center" prop="images"> |
|
|
|
<el-table-column label="图片" align="center" prop="images"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-image v-if="scope.row.images[0] != null" style="" :src="scope.row.images[0]" |
|
|
|
<el-image v-if="scope.row.images != null && scope.row.images[0] != null" style="" :src="scope.row.images[0]" |
|
|
|
:preview-src-list="scope.row.images"> |
|
|
|
:preview-src-list="scope.row.images"> |
|
|
|
</el-image> |
|
|
|
</el-image> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -211,7 +212,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { createTask, updateTask, deleteTask, getTask, getTaskPage, getTaskSearchPage, exportTaskExcel } from "@/api/farm/task"; |
|
|
|
import { createTask, updateTask, deleteTask, getTask, getTaskPage, getTaskSearchPage, exportTaskExcel, getAdminTaskPage} from "@/api/farm/task"; |
|
|
|
import ImageUpload from '@/components/ImageUpload'; |
|
|
|
import ImageUpload from '@/components/ImageUpload'; |
|
|
|
import Editor from '@/components/Editor'; |
|
|
|
import Editor from '@/components/Editor'; |
|
|
|
import { getResourcePage } from "@/api/farm/resource"; |
|
|
|
import { getResourcePage } from "@/api/farm/resource"; |
|
|
@ -306,48 +307,40 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
this.getResource(); |
|
|
|
this.getList() |
|
|
|
this.getResourceTypeList(); |
|
|
|
|
|
|
|
this.getProjectList(); |
|
|
|
|
|
|
|
this.getCpUserList(); |
|
|
|
|
|
|
|
this.getCropList(); |
|
|
|
|
|
|
|
this.getTaskCateList(); |
|
|
|
|
|
|
|
this.getAreasList(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
startMethod(){ |
|
|
|
|
|
|
|
this.getResource(); |
|
|
|
|
|
|
|
this.getResourceTypeList(); |
|
|
|
|
|
|
|
this.getProjectList(); |
|
|
|
|
|
|
|
this.getCpUserList(); |
|
|
|
|
|
|
|
this.getCropList(); |
|
|
|
|
|
|
|
this.getTaskCateList(); |
|
|
|
|
|
|
|
this.getAreasList(); |
|
|
|
|
|
|
|
this.twoRescoure(); |
|
|
|
|
|
|
|
}, |
|
|
|
executorPersonConvert(executorPerson){ |
|
|
|
executorPersonConvert(executorPerson){ |
|
|
|
let executorPersonName = ""; |
|
|
|
let executorPersonName = ""; |
|
|
|
if (executorPerson != null) { |
|
|
|
executorPerson.forEach(person => { |
|
|
|
executorPerson.forEach(person => { |
|
|
|
executorPersonName += person + "\n"; |
|
|
|
this.cpUserList.forEach( user => { |
|
|
|
}) |
|
|
|
if (person == user.id) { |
|
|
|
|
|
|
|
executorPersonName += user.name + "\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return executorPersonName; |
|
|
|
return executorPersonName; |
|
|
|
}, |
|
|
|
}, |
|
|
|
areaConvert(area){ |
|
|
|
areaConvert(area){ |
|
|
|
if (area != null) { |
|
|
|
|
|
|
|
let areaMsg = ""; |
|
|
|
let areaMsg = ""; |
|
|
|
let parentLsit = this.areasList.filter(t => t.parentId == 0); |
|
|
|
|
|
|
|
let sonList = this.areasList.filter(s => s.parentId != 0); |
|
|
|
|
|
|
|
area.forEach(item =>{ |
|
|
|
area.forEach(item =>{ |
|
|
|
let parentName = parentLsit.filter(parent => parent.id == item[0])[0].name; |
|
|
|
areaMsg += item +"\n"; |
|
|
|
let sonName = sonList.filter(son => son.id == item[1])[0].name; |
|
|
|
|
|
|
|
areaMsg += parentName +"/"+ sonName +"\n"; |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
return areaMsg; |
|
|
|
return areaMsg; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
resouceConvert(resources){ |
|
|
|
resouceConvert(resources){ |
|
|
|
let resouceMsg = ""; |
|
|
|
let resouceMsg = ""; |
|
|
|
resources.forEach(item =>{ |
|
|
|
if(resources != null){ |
|
|
|
let typeName = this.resourceTypeList.filter(type => type.id == item.resourceId[0])[0].name; |
|
|
|
resources.forEach(item =>{ |
|
|
|
let resouceName = this.resourceList.filter(type => type.id == item.resourceId[1])[0].name; |
|
|
|
resouceMsg += item.resourceType +"/" + item.resourceName +":" + item.num +"\n"; |
|
|
|
resouceMsg += typeName +"/" + resouceName +":" + item.num +"\n"; |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
return resouceMsg; |
|
|
|
return resouceMsg; |
|
|
|
}, |
|
|
|
}, |
|
|
|
ziyuanxuanze(item,index,obj){ |
|
|
|
ziyuanxuanze(item,index,obj){ |
|
|
@ -392,7 +385,7 @@ export default { |
|
|
|
getCpUserList() { |
|
|
|
getCpUserList() { |
|
|
|
getCpUserPage({ |
|
|
|
getCpUserPage({ |
|
|
|
pageNo: 1, |
|
|
|
pageNo: 1, |
|
|
|
pageSize: 100 |
|
|
|
pageSize: 400 |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.cpUserList = res.data.list; |
|
|
|
this.cpUserList = res.data.list; |
|
|
|
}) |
|
|
|
}) |
|
|
@ -440,13 +433,13 @@ export default { |
|
|
|
this.addBeginAndEndTime(params, this.dateRangePlanStartTime, 'planStartTime'); |
|
|
|
this.addBeginAndEndTime(params, this.dateRangePlanStartTime, 'planStartTime'); |
|
|
|
this.addBeginAndEndTime(params, this.dateRangePlanEndTime, 'planEndTime'); |
|
|
|
this.addBeginAndEndTime(params, this.dateRangePlanEndTime, 'planEndTime'); |
|
|
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); |
|
|
|
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime'); |
|
|
|
// 执行查询 |
|
|
|
|
|
|
|
getTaskPage(params).then(response => { |
|
|
|
getAdminTaskPage(params).then(response =>{ |
|
|
|
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; |
|
|
|
}); |
|
|
|
}) |
|
|
|
this.twoRescoure(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 搜索条件查询任务列表 */ |
|
|
|
/** 搜索条件查询任务列表 */ |
|
|
|
getSearchList() { |
|
|
|
getSearchList() { |
|
|
@ -504,6 +497,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 新增按钮操作 */ |
|
|
|
/** 新增按钮操作 */ |
|
|
|
handleAdd() { |
|
|
|
handleAdd() { |
|
|
|
|
|
|
|
this.startMethod(); |
|
|
|
this.reset(); |
|
|
|
this.reset(); |
|
|
|
this.twoRescoure(); |
|
|
|
this.twoRescoure(); |
|
|
|
this.assemArea(); |
|
|
|
this.assemArea(); |
|
|
@ -513,6 +507,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** 修改按钮操作 */ |
|
|
|
/** 修改按钮操作 */ |
|
|
|
handleUpdate(row) { |
|
|
|
handleUpdate(row) { |
|
|
|
|
|
|
|
this.startMethod(); |
|
|
|
this.reset(); |
|
|
|
this.reset(); |
|
|
|
this.assemArea(); |
|
|
|
this.assemArea(); |
|
|
|
const id = row.id; |
|
|
|
const id = row.id; |
|
|
|