From 509bc328da18e9831b364b6a736a39c8fd3b09cf Mon Sep 17 00:00:00 2001
From: zhanyunjiu <787952492@qq.com>
Date: Wed, 6 Jul 2022 15:48:14 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=20=E5=B7=A5=E6=97=B6?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=20=E7=88=86=E7=BA=A2=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/farm/workHour/index.vue | 72 ++++++++++++++++++++-----------
1 file changed, 47 insertions(+), 25 deletions(-)
diff --git a/src/views/farm/workHour/index.vue b/src/views/farm/workHour/index.vue
index f8ffec5..1431c07 100644
--- a/src/views/farm/workHour/index.vue
+++ b/src/views/farm/workHour/index.vue
@@ -43,7 +43,7 @@
- {{cpUserList.find(t=>t.id == scope.row.userId).name}}
+ {{userConvert(scope.row.userId)}}
@@ -53,7 +53,7 @@
- {{taskList.find(t=>t.id == scope.row.taskId).name}}
+ {{taskConvert(scope.row.taskId)}}
@@ -94,10 +94,10 @@
- {{item.name}}
+ {{item.taskName +"/"+ item.taskMsg}}
@@ -129,6 +129,7 @@ import { createWorkHour, updateWorkHour, deleteWorkHour, getWorkHour, getWorkHou
import { getProjectPage} from "@/api/farm/project";
import { getTaskPage} from "@/api/farm/task";
import { getCpUserPage} from "@/api/system/cpUser"
+import { getTaskCatePage} from "@/api/farm/taskCate"
export default {
@@ -172,24 +173,31 @@ export default {
taskList:[],
selectTaskList:[],
cpUserList:[],
- selectCpUserList:[]
-
+ selectCpUserList:[],
+ taskCateList:[]
};
},
created() {
- this.getProjectPageList();
- this.getTaskPageList();
- this.getCpUserPageList();
- this.getList();
+ this.getTaskCateList();
},
methods: {
+ getTaskCateList(){
+ getTaskCatePage({
+ pageNo : 1,
+ pageSize : 100
+ }).then(res =>{
+ this.taskCateList = res.data.list;
+ this.getProjectPageList();
+ })
+ },
getProjectPageList(){
getProjectPage({
pageNo:1,
pageSize:100
}).then(res => {
this.projectList = res.data.list;
+ this.getTaskPageList();
})
},
getTaskPageList(){
@@ -198,6 +206,7 @@ export default {
pageSize:100
}).then(res => {
this.taskList = res.data.list;
+ this.getCpUserPageList();
})
},
getCpUserPageList(){
@@ -206,6 +215,7 @@ export default {
pageSize:400
}).then(res => {
this.cpUserList = res.data.list;
+ this.getList()
})
},
/** 查询列表 */
@@ -354,26 +364,38 @@ export default {
},
chooseTask(row){
- this.form.userId = undefined;
- this.selectCpUserList = [];
- let arr = this.selectTaskList.filter(t => t.id == row)
- let userIdArr = [];
- arr.forEach(item =>{
- userIdArr = JSON.parse(item.executorPerson);
- userIdArr.push(item.mainPerson);
- })
- let userArr = [];
- userIdArr.forEach(item =>{
- this.cpUserList.forEach(u =>{
- if(u.id == item){
- userArr.push(u);
+ this.form.userId = undefined;
+ this.selectCpUserList = [];
+ let arr = this.selectTaskList.filter(t => t.id == row)[0];
+ let userIdList = [];
+ userIdList.push(arr.mainPerson);
+ arr.executorPerson.forEach(exe =>{
+ userIdList.push(exe);
+ })
+
+ let userList = [];
+ this.cpUserList.forEach(user =>{
+ userIdList.forEach(id =>{
+ if(user.id == id){
+ userList.push(user);
}
})
})
- let mapp = new Set(userArr);
+
+ let mapp = new Set(userList);
let quchong = Array.from(mapp);
this.selectCpUserList = quchong;
- }
+ },
+
+ userConvert(userId){
+ return this.cpUserList.filter(user => user.id == userId)[0].name;
+ },
+ taskConvert(taskId){
+ let task = this.taskList.filter(item => item.id == taskId)[0];
+ let cate = this.taskCateList.filter(cate => cate.id == task.taskCateId)[0].name;
+ let cateName = this.taskCateList.filter(cate => cate.id == task.taskCateName)[0].name;
+ return cate +"/"+ cateName;
+ },
}
};