|
@@ -178,6 +178,7 @@
|
|
<template v-slot="scope">{{ getQaOrRdNameList(scope.row.qaList) }}</template>
|
|
<template v-slot="scope">{{ getQaOrRdNameList(scope.row.qaList) }}</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <gantt v-else :versions="ganttVersions" :table-data="ganttTableData" :string-type="'任务'" />
|
|
<div style="margin:0 2%;padding: 2% 0;border-bottom: 1px solid #D8D8D8;font-size: 14px;color: #333333">排期汇总:{{ getScheduleCollect() }}</div>
|
|
<div style="margin:0 2%;padding: 2% 0;border-bottom: 1px solid #D8D8D8;font-size: 14px;color: #333333">排期汇总:{{ getScheduleCollect() }}</div>
|
|
<el-row style="margin: 2%;font-size: 14px;color: #333333">
|
|
<el-row style="margin: 2%;font-size: 14px;color: #333333">
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
@@ -240,13 +241,17 @@ import {
|
|
getCommentList,
|
|
getCommentList,
|
|
addComment
|
|
addComment
|
|
} from '@/api/requirement.js'
|
|
} from '@/api/requirement.js'
|
|
|
|
+import { listByVersionTypeWithTime } from '@/api/version.js'
|
|
import RequirementChart from '@/components/chart/index.vue'
|
|
import RequirementChart from '@/components/chart/index.vue'
|
|
import RequirementUpdate from '@/views/projectManage/requirement/list/create.vue'
|
|
import RequirementUpdate from '@/views/projectManage/requirement/list/create.vue'
|
|
|
|
+import Gantt from '@/views/gantta/gantta'
|
|
|
|
+import dateUtil from '@/utils/dateUtil.js'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
RequirementChart,
|
|
RequirementChart,
|
|
- RequirementUpdate
|
|
|
|
|
|
+ RequirementUpdate,
|
|
|
|
+ Gantt
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
id: {
|
|
id: {
|
|
@@ -256,6 +261,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ ganttVersions: {},
|
|
|
|
+ ganttTableData: null,
|
|
loading: {
|
|
loading: {
|
|
table: true,
|
|
table: true,
|
|
info: true,
|
|
info: true,
|
|
@@ -432,12 +439,11 @@ export default {
|
|
})
|
|
})
|
|
this.getTaskStatusMapInfo()
|
|
this.getTaskStatusMapInfo()
|
|
this.getBugStatusMapInfo()
|
|
this.getBugStatusMapInfo()
|
|
- this.getTaskByRequireId()
|
|
|
|
this.getCommentList()
|
|
this.getCommentList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getScheduleCollect() {
|
|
getScheduleCollect() {
|
|
- if (this.task.reqStartTime && this.task.reqEndTime) {
|
|
|
|
|
|
+ if (this.task && this.task.reqStartTime && this.task.reqEndTime) {
|
|
return this.task.reqStartTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日' + ' ~ ' + this.task.reqEndTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日'
|
|
return this.task.reqStartTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日' + ' ~ ' + this.task.reqEndTime.substring(0, 10).replace(/-/, '年').replace(/-/, '月') + '日'
|
|
}
|
|
}
|
|
return ''
|
|
return ''
|
|
@@ -476,11 +482,12 @@ export default {
|
|
},
|
|
},
|
|
getRequirementById() {
|
|
getRequirementById() {
|
|
this.loading.info = true
|
|
this.loading.info = true
|
|
- getRequirementById({
|
|
|
|
|
|
+ return getRequirementById({
|
|
id: this.id
|
|
id: this.id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
this.requirement = res.data
|
|
this.requirement = res.data
|
|
this.loading.info = false
|
|
this.loading.info = false
|
|
|
|
+ this.getTaskByRequireId()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
getTaskStatusMapInfo() {
|
|
getTaskStatusMapInfo() {
|
|
@@ -521,11 +528,91 @@ export default {
|
|
getTaskByRequireId({
|
|
getTaskByRequireId({
|
|
id: this.id
|
|
id: this.id
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- this.task = res.data
|
|
|
|
- this.tableData = res.data.taskDetails
|
|
|
|
- this.loading.table = false
|
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ this.task = res.data
|
|
|
|
+ this.tableData = res.data.taskDetails
|
|
|
|
+ if (res.data.reqStartTime && res.data.reqEndTime) {
|
|
|
|
+ for (const i in this.requirement.referredClientType) {
|
|
|
|
+ this.listByVersionTypeWithTime({
|
|
|
|
+ type: this.requirement.referredClientType[i],
|
|
|
|
+ startTime: this.tableData.reqStartTime,
|
|
|
|
+ endTime: this.tableData.reqEndTime
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.ganttTableData = this.parseGanttTableData(this.tableData)
|
|
|
|
+ }
|
|
|
|
+ this.loading.table = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning(res.msg)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ listByVersionTypeWithTime(data) {
|
|
|
|
+ listByVersionTypeWithTime(data)
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ for (const i in res.data) {
|
|
|
|
+ const startStr = res.data[i].startTime.substring(0, 10)
|
|
|
|
+ const endStr = res.data[i].endTime.substring(0, 10)
|
|
|
|
+ const startDate = new Date(startStr)
|
|
|
|
+ const endDate = new Date(endStr)
|
|
|
|
+ const length = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000)
|
|
|
|
+ for (let j = 0; j <= length; j++) {
|
|
|
|
+ const dateStr = dateUtil.dateAddDays(startStr, j)
|
|
|
|
+ const name = this.appClientOb[data.type] + res.data[i].version + res.data[i].name
|
|
|
|
+ if (typeof this.ganttVersions[dateStr] === 'undefined') {
|
|
|
|
+ this.ganttVersions[dateStr] = name
|
|
|
|
+ } else if (this.ganttVersions[dateStr].indexOf(name) < 0) {
|
|
|
|
+ this.ganttVersions[dateStr] = this.ganttVersions[dateStr] + '\n' + name
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ parseGanttTableData(data) {
|
|
|
|
+ const arr = []
|
|
|
|
+ for (const i in data) {
|
|
|
|
+ if (!(data[i].beginTime && data[i].endTime)) {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ const task = {
|
|
|
|
+ task: {
|
|
|
|
+ description: data[i].name
|
|
|
|
+ },
|
|
|
|
+ schedules: []
|
|
|
|
+ }
|
|
|
|
+ const schedule = {
|
|
|
|
+ taskId: null,
|
|
|
|
+ taskName: null,
|
|
|
|
+ event: null,
|
|
|
|
+ schedule: null,
|
|
|
|
+ startDate: null,
|
|
|
|
+ length: null,
|
|
|
|
+ owners: []
|
|
|
|
+ }
|
|
|
|
+ schedule.taskId = data[i].id
|
|
|
|
+ schedule.taskName = data[i].name
|
|
|
|
+ const startStr = data[i].beginTime.substring(0, 10)
|
|
|
|
+ const endStr = data[i].endTime.substring(0, 10)
|
|
|
|
+ const startDate = new Date(data[i].beginTime.substring(0, 10))
|
|
|
|
+ const endDate = new Date(data[i].endTime.substring(0, 10))
|
|
|
|
+ schedule.startDate = startStr
|
|
|
|
+ schedule.schedule = startStr.replace(/-/g, '.') + ' - ' + endStr.replace(/-/g, '.')
|
|
|
|
+ schedule.length = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000) + 1
|
|
|
|
+ for (const j in data[i].rdList) {
|
|
|
|
+ schedule.owners.push(data[i].rdList[j].name)
|
|
|
|
+ }
|
|
|
|
+ for (const j in data[i].qaList) {
|
|
|
|
+ schedule.owners.push(data[i].qaList[j].name)
|
|
|
|
+ }
|
|
|
|
+ task.schedules.push(schedule)
|
|
|
|
+ arr.push(task)
|
|
|
|
+ }
|
|
|
|
+ return arr
|
|
|
|
+ },
|
|
getPmName() {
|
|
getPmName() {
|
|
const names = []
|
|
const names = []
|
|
for (const i in this.requirement.pm) {
|
|
for (const i in this.requirement.pm) {
|