|
@@ -0,0 +1,198 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-table
|
|
|
+ ref="planTable"
|
|
|
+ :data="all_task"
|
|
|
+ style="width: 100%;"
|
|
|
+ size="mini"
|
|
|
+ row-key="id"
|
|
|
+ :expand-row-keys="expandArr"
|
|
|
+ :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}"
|
|
|
+ :row-style="{ fontSize: '14px' }"
|
|
|
+ show-overflow-tooltip="true"
|
|
|
+ :header-row-style="{height: '50px'}"
|
|
|
+ >
|
|
|
+ <el-table-column label="任务名称" width="200" align="left" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div class="task-main">
|
|
|
+ <span class="task-id">TASK-{{ scope.row.id }}</span>
|
|
|
+ <span class="task-title" @click="link_task(scope.row.id)">{{ scope.row.name }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" width="105" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.status"
|
|
|
+ :class="'status'+scope.row.status"
|
|
|
+ class="btns"
|
|
|
+ size="mini"
|
|
|
+ @change="changeStatus(scope.row)"
|
|
|
+ >
|
|
|
+ <el-option v-for="item in allStatus" :key="item.code" :label="item.msg" :value="item.code" />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="开发负责人" width="100" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">{{ scope.row.rdObject ? scope.row.rdObject.name : '' }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="测试负责人" width="100" align="center" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">{{ scope.row.qaObject ? scope.row.qaObject.name : '' }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="任务进度" min-width="150" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-progress :percentage="Number(scope.row.rate && scope.row.rate.substring(0,4))" color="#409eff" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <taskDialog v-if="showTaskDialog" :show.sync="showTaskDialog" :task-id="taskId.id" :status-name="taskId.statusString" @getList="get_allTask" />
|
|
|
+ <normal-dialog :show-dialog.sync="statusDialog" :title="'状态变更:已上线'" :width="'50%'" @confirm="confirmStatus()">
|
|
|
+ <div class="dialog-change-status">
|
|
|
+ <span>实际上线时间:</span>
|
|
|
+ <el-date-picker v-model="changeStatusDate" type="date" style="width:100%;" placeholder="选择日期" format="yyyy-MM-dd HH:mm:ss" />
|
|
|
+ </div>
|
|
|
+ </normal-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { taskList } from '@/api/projectIndex'
|
|
|
+import { taskUpdate } from '@/api/projectViewDetails'
|
|
|
+import { configShowTaskEnum } from '@/api/taskIndex'
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ all_task: [], // 任务列表
|
|
|
+ allStatus: [] // 任务所有状态
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getTaskStatus()
|
|
|
+ this.get_allTask()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async get_allTask() { // 获取全部任务
|
|
|
+ const res = await taskList({
|
|
|
+ projectId: this.$route.query.id
|
|
|
+ })
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.all_task = res.data
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getTaskStatus() { // 获取任务状态列表
|
|
|
+ const res = await configShowTaskEnum()
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.allStatus = res.data.taskStatus
|
|
|
+ this.taskScheduleEvent = res.data.taskScheduleEvent || []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async changeStatus(e) { // 状态改变
|
|
|
+ if (e.status === 2 || e.status === 4 || e.status === 5) {
|
|
|
+ this.taskId = e
|
|
|
+ this.allStatus.map(item => {
|
|
|
+ item.code === e.status ? this.taskId.statusString = item.msg : ''
|
|
|
+ })
|
|
|
+ this.showTaskDialog = true
|
|
|
+ this.nowChangeTask = e
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ const user = {
|
|
|
+ name: localStorage.getItem('username'),
|
|
|
+ ename: localStorage.getItem('realname'),
|
|
|
+ id: ''
|
|
|
+ }
|
|
|
+ const taskInfoDO = e
|
|
|
+ const resTask = await taskUpdate({ taskInfoDO, user })
|
|
|
+ if (resTask.code === 200) {
|
|
|
+ this.$message({ message: resTask.msg, type: 'success', offset: 150 })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async confirmStatus() { // 确认更改状态
|
|
|
+ const user = { name: localStorage.getItem('username'), ename: localStorage.getItem('realname'), id: '' }
|
|
|
+ const taskInfoDO = this.nowChangeTask
|
|
|
+ taskInfoDO.onlineRealTime = this.changeStatusDate
|
|
|
+ const resTask = await taskUpdate({ taskInfoDO, user })
|
|
|
+ if (resTask.code === 200) {
|
|
|
+ this.$message({ message: resTask.msg, type: 'success', offset: 150 })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ link_task(id) { // 跳转到任务详情页
|
|
|
+ this.$router.push({ name: '任务详情', query: { id: id }})
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+@mixin setStatus($color) {
|
|
|
+ input {
|
|
|
+ color:$color;
|
|
|
+ border: 1px solid $color;
|
|
|
+ }
|
|
|
+ >>> .el-select__caret{
|
|
|
+ color:$color;
|
|
|
+ }
|
|
|
+ >>> .el-input__inner{
|
|
|
+ color:$color;
|
|
|
+ border-color: $color;
|
|
|
+ }
|
|
|
+ >>> .el-input__inner:focus {
|
|
|
+ border-color: $color;
|
|
|
+ }
|
|
|
+}
|
|
|
+>>>.el-row .el-col {
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+.task-main {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .task-title {
|
|
|
+ cursor: pointer;
|
|
|
+ color: #666666;
|
|
|
+ font-size: 14px;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ .task-id {
|
|
|
+ color: #A7AEBC;
|
|
|
+ font-size: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
+.P0 {
|
|
|
+ background-color: #F56C6C;
|
|
|
+}
|
|
|
+.P1 {
|
|
|
+ background-color: #FF8952;
|
|
|
+}
|
|
|
+.P2 {
|
|
|
+ background-color: #F5E300;
|
|
|
+}
|
|
|
+.P3 {
|
|
|
+ background-color: #7ED321;
|
|
|
+}
|
|
|
+.P4 {
|
|
|
+ background-color: #61D3B8;
|
|
|
+}
|
|
|
+.P5 {
|
|
|
+ background-color: #69B3FF;
|
|
|
+}
|
|
|
+.P6 {
|
|
|
+ background-color: #BDBDBD;
|
|
|
+}
|
|
|
+.status0 {
|
|
|
+ @include setStatus(#409EFF)
|
|
|
+}
|
|
|
+.status1, .status2, .status3, .status4{
|
|
|
+ @include setStatus(#FF8952)
|
|
|
+}
|
|
|
+.status5 {
|
|
|
+ @include setStatus(#7ED321)
|
|
|
+}
|
|
|
+.expand i {
|
|
|
+ border:1px solid #DCDFE6;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|