From 8a1c5a8c4978a8a6571c505e750abd76d1c72647 Mon Sep 17 00:00:00 2001
From: churf <123456>
Date: Mon, 14 Aug 2023 10:01:47 +0000
Subject: [PATCH] TaskDaily process with 85%
---
eladmin-web-master/src/views/task/taskDaliy/index.vue | 97 +++++++++++++++++++++++++++++++-----------------
1 files changed, 63 insertions(+), 34 deletions(-)
diff --git a/eladmin-web-master/src/views/task/taskDaliy/index.vue b/eladmin-web-master/src/views/task/taskDaliy/index.vue
index e0ef136..2b4d223 100644
--- a/eladmin-web-master/src/views/task/taskDaliy/index.vue
+++ b/eladmin-web-master/src/views/task/taskDaliy/index.vue
@@ -5,7 +5,14 @@
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="7">
<el-card class="box-card" shadow="never">
<el-tabs v-model="tobeOver" style="height: 200px;" @tab-click="handleClickTobeTasked">
- <el-tab-pane :label="tobeTasked" name="first" />
+ <el-tab-pane v-loading="crud.loading" :label="tobeTasked" name="first">
+ <el-card class="box-card">
+ <div v-for="o in adventTasks" :key="o.id" style="height: 70px">
+ {{ o.name }}      {{ o.taskEndDate }}
+ <el-button type="primary" size="mini" style="float: right" @click="quickFilling(o)">填写日报</el-button>
+ </div>
+ </el-card>
+ </el-tab-pane>
</el-tabs>
</el-card>
</el-col>
@@ -13,10 +20,18 @@
<el-card class="box-card" shadow="never">
<el-tabs v-model="activeName" style="height: 200px;" @tab-click="handleClick">
<el-tab-pane :label="tasking" name="first">
- 111
+ <el-card class="box-card">
+ <div v-for="o in 5" :key="o" class="text item" style="height: 35px">
+ {{ '列表内容 ' + o }}
+ </div>
+ </el-card>
</el-tab-pane>
<el-tab-pane :label="tobeTask" name="second">
- 222
+ <el-card class="box-card">
+ <div v-for="o in 5" :key="o" class="text item" style="height: 35px">
+ {{ '列表内容 ' + o }}
+ </div>
+ </el-card>
</el-tab-pane>
<!--<el-tab-pane label="未分配任务" name="third" style=":display: false">未分配任务</el-tab-pane>-->
</el-tabs>
@@ -89,7 +104,7 @@
/>
</el-select>
</el-form-item>
- <el-form-item label="分配任务" prop="taskUserMongo.id">
+ <el-form-item label="分配任务" prop="taskUserMongo">
<el-select v-model="form.taskUserMongo.id" filterable clearable placeholder="请选择" style="width: 340px;" @change="formTaskUserChange">
<el-option
v-for="item in formTaskUserIds"
@@ -235,7 +250,7 @@
fillDate: [
{ required: true, message: '填写日期不能为空', trigger: 'change' }
],
- userId: [
+ userNickName: [
{ required: true, message: '所属员工不能为空', trigger: 'change' }
],
projectId: [
@@ -244,7 +259,7 @@
taskId: [
{ required: true, message: '所属任务不能为空', trigger: 'blur' }
],
- taskUserId: [
+ taskUserMongo: [
{ required: true, message: '分配任务不能为空', trigger: 'blur' }
],
consumedHours: [
@@ -285,6 +300,7 @@
users: [],
// 检索项目列表
queryProjects: [],
+ adventTasks: [],
// 检索任务列表
queryTasks: [],
// 表单项目列表
@@ -302,7 +318,9 @@
tobeOver: 'first',
tasking: '进行中任务',
tobeTask: '未着手任务',
- tobeTasked: '临期任务'
+ tobeTasked: '临期任务',
+ currentTask: null,
+ pane_loading: true
}
},
computed: {
@@ -318,7 +336,7 @@
// 检索条件赋值
this.$set(this.crud.query, 'projectId', Number(this.$route.params.projectId))
// 获取任务列表
- crudTask.getAll({ projectId: this.query.projectId }).then(res => {
+ crudTask.getAllOfDaily({ projectId: this.query.projectId }).then(res => {
// 检索任务列表
this.queryTasks = res
})
@@ -339,7 +357,7 @@
},
getAdventTasks() {
crudTaskUser.getAdventTasks().then(res => {
- console.log(res)
+ this.adventTasks = res
})
},
handleClick(tab, event) {
@@ -351,7 +369,7 @@
// 获取检索项目
getQueryProject() {
// 获取项目
- crudProject.getRelevant().then(res => {
+ crudProject.getRelevantOfDaily().then(res => {
// 检索项目列表
this.queryProjects = res
this.formProjects = res
@@ -367,7 +385,7 @@
this.queryTasks = []
} else {
// 获取任务
- crudTask.getAll({ projectId: this.query.projectId }).then(res => {
+ crudTask.getAllOfDaily({ projectId: this.query.projectId }).then(res => {
// 检索任务列表
this.queryTasks = res
})
@@ -386,6 +404,15 @@
// 随机数
this.random = Math.random()
},
+ [CRUD.HOOK.afterSubmit]() {
+ this.currentTask = null
+ },
+ [CRUD.HOOK.afterEditError]() {
+ this.currentTask = null
+ },
+ [CRUD.HOOK.afterEditCancel]() {
+ this.currentTask = null
+ },
// 钩子:新建 - 之前
[CRUD.HOOK.beforeToAdd]() {
// 判断用户最大角色级别是否是角色级别:超级管理员或角色级别:总经理
@@ -393,14 +420,26 @@
// 表单赋值
this.form.userId = this.user.id
this.form.userNickName = this.user.nickName
+
// 表单用户变更
this.formUserChange()
this.formTaskChange()
}
+ if (this.currentTask) {
+ this.form.projectId = this.currentTask.projectId
+ this.formProjectChange(() => {
+ this.form.taskId = this.currentTask.taskId
+ this.formTaskChange(() => { this.form.taskUserMongo.id = this.currentTask.id })
+ })
+ this.form.taskHours = this.currentTask.performanceHours
+ this.form.alreadyConsumedHours = this.currentTask.alreadyConsumedHours
+ this.form.taskProgress = this.currentTask.maxTaskProgress
+ this.form.flag = true
+ }
},
// 钩子:编辑 - 之前
[CRUD.HOOK.beforeToEdit]() {
- crudTask.getAll({ projectId: this.form.projectId }).then(res => {
+ crudTask.getAllOfDaily({ projectId: this.form.projectId }).then(res => {
// 检索任务列表
this.formTasks = res
})
@@ -440,7 +479,7 @@
}
},
// 表单项目变更
- formProjectChange() {
+ formProjectChange(cb) {
// 表单赋值
this.form.taskId = null
this.form.taskUserMongo = {}
@@ -452,14 +491,17 @@
this.formTasks = []
} else {
// 获取任务
- crudTask.getAll({ projectId: this.form.projectId }).then(res => {
+ crudTask.getAllOfDaily({ projectId: this.form.projectId }).then(res => {
// 检索任务列表
this.formTasks = res
+ if (cb) {
+ cb()
+ }
})
}
},
// 表单任务变更
- formTaskChange() {
+ formTaskChange(cb) {
form.taskUserMongo = {}
// 循环表单任务列表
for (let i = 0; i < this.formTasks.length; i++) {
@@ -470,6 +512,9 @@
this.formTaskUserIds = []
}
this.formTaskUserIds = res
+ if (cb) {
+ cb()
+ }
})
}
}
@@ -484,25 +529,9 @@
}
}
},
- unPick(e) {
- crudTaskUser.addTaskUser({ 'TaskId': e.id }).then(res => {
- this.pickFlg = false
- if (res === 1) {
- this.$notify({
- title: '获取成功',
- type: 'success',
- duration: 2500
- })
-
- this.crud.toQuery()
- } else {
- this.$notify({
- title: '获取失败',
- type: 'error',
- duration: 2500
- })
- }
- })
+ quickFilling(object) {
+ this.currentTask = object
+ this.crud.toAdd()
}
}
}
--
Gitblit v1.9.3