Эх сурвалжийг харах

添加排期增加人力统计和中台需求任务望岳接入质惠

qinzhipeng_v@didiglobal.com 4 жил өмнө
parent
commit
09a45d81ee

+ 18 - 0
src/api/statisticsApi/requireStatistics.js

@@ -89,3 +89,21 @@ export function getBugStatisticData(data) {
     data
   })
 }
+
+// 需求人力统计
+export function getManpowerStatistics(data) {
+  return request({
+    url: TeamManagement + '/requirement/getManpowerStatistics',
+    method: 'post',
+    data
+  })
+}
+
+// 需求人力分布图
+export function getManpowerDistributedData(data) {
+  return request({
+    url: TeamManagement + '/requirement/getManpowerDistributedData',
+    method: 'post',
+    data
+  })
+}

+ 18 - 0
src/api/statisticsApi/taskStatistics.js

@@ -97,3 +97,21 @@ export function getBugStatisticData(data) {
     data
   })
 }
+
+// 人力统计
+export function getManpowerStatistics(data) {
+  return request({
+    url: TeamManagement + '/task/getManpowerStatistics',
+    method: 'post',
+    data
+  })
+}
+
+// 人力分布图
+export function getManpowerDistributedData(data) {
+  return request({
+    url: TeamManagement + '/task/getManpowerDistributedData',
+    method: 'post',
+    data
+  })
+}

+ 19 - 3
src/views/projectManage/components/demand.vue

@@ -8,8 +8,9 @@
       <el-table-column prop="type" label="类型" min-width="70" />
       <el-table-column prop="desc" label="描述" min-width="140" />
       <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="160" />
-      <el-table-column prop="dayLength" label="时长" min-width="50" />
+      <el-table-column prop="dayLength" label="使用天数" min-width="80" />
       <el-table-column prop="peopleList" label="参与人员" min-width="150" />
+      <el-table-column prop="manpower" label="使用人力(人日)" min-width="150" />
       <el-table-column prop="dayLength" label="关联任务" min-width="80" />
       <el-table-column label="操作" width="120" />
     </el-table>
@@ -154,9 +155,23 @@
 
     <!-- 日期详情 -->
     <el-row><span class="demandLayout">交付日期:</span><span class="demandeta">{{ dataList.endTime }}</span></el-row>
-    <el-row><span class="demandLayout">排期:</span><span class="demandeta">{{ dataList.startTime || '' }} ~ {{ dataList.endTime }}</span></el-row>
+    <el-row>
+      <span class="demandLayout">排期:</span>
+      <span class="demandeta">{{ dataList.startTime || '' }} ~ {{ dataList.endTime }}</span>
+      <span style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[-1] + ')' }}</span>
+    </el-row>
     <el-row :gutter="20">
-      <el-col v-for="(item, index) in scheduleDetail" :key="index" :span="6"><span class="demandLayout">{{ index }}:</span><span class="demandeta">{{ item.startTime }} ~ {{ item.endTime }}</span></el-col>
+      <el-col v-for="(item, index) in scheduleDetail" :key="index" :span="12">
+        <span class="demandLayout">{{ index }}:</span>
+        <span class="demandeta">{{ item.startTime }} ~ {{ item.endTime }}</span>
+        <span v-show="index === '开发'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[0] + ')' }}</span>
+        <span v-show="index === '用例'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[1] + ')' }}</span>
+        <span v-show="index === '联调'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[2] + ')' }}</span>
+        <span v-show="index === '提测'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[3] + ')' }}</span>
+        <span v-show="index === '测试'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[4] + ')' }}</span>
+        <span v-show="index === '准出'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[5] + ')' }}</span>
+        <span v-show="index === '上线'" style="color: #cccccc">{{ '(' + dataList.scheduleTimeAnnotation[6] + ')' }}</span>
+      </el-col>
     </el-row>
     <el-row>
       <span class="demandLayout">预计上线版本:</span>
@@ -570,6 +585,7 @@ export default {
   line-height:14px;
   color:rgba(51,51,51,1);
   opacity:1;
+  margin-right: 10px;
 }
 .iconEdit {
   width:100px;

+ 4 - 3
src/views/projectManage/components/scheduleList.vue

@@ -20,12 +20,13 @@
       </el-table-column>
       <el-table-column prop="desc" label="描述" min-width="140" align="left" />
       <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="160" show-overflow-tooltip />
-      <el-table-column prop="dayLength" label="时长" min-width="50" />
+      <el-table-column prop="dayLength" label="使用天数" min-width="80" />
       <el-table-column prop="peopleList" label="参与人员" min-width="150" show-overflow-tooltip>
         <template slot-scope="scope">
           <span v-for="(item, index) in scope.row.peopleObjectList" :key="index">{{ item.name }} {{ ' ' }}</span>
         </template>
       </el-table-column>
+      <el-table-column prop="manpower" label="使用人力(人日)" min-width="150" />
       <el-table-column prop="dayLength" class="popover-blue" label="关联任务" min-width="80">
         <template slot-scope="scope">
           <el-popover placement="bottom" title="关联任务" width="500" trigger="click">
@@ -170,8 +171,8 @@ export default {
     async listByTask(id) { // 获取排期列表
       this.$emit('listByTask')
     },
-    Task_Jump(id) {
-      const bizId_id = EncryptId(`${this.bizId}_${id}`)
+    Task_Jump(val) {
+      const bizId_id = EncryptId(`${val.bizId}_${val.id}`)
       const routeData = this.$router.push({ name: '任务详情', query: { bizId_id: bizId_id }})
       window.open(routeData.href, '_blank')
     },

+ 54 - 50
src/views/projectManage/dialog_vue.vue

@@ -33,8 +33,10 @@
               </el-select>
             </el-form-item>
             <el-form-item label="业务线" prop="bizId">
-              <el-select v-model="task_form.bizId" :disabled="tit_Name === '编辑任务'" filterable placeholder="请选择" style="width:20vw">
-                <el-option v-for="item in all_bizId" :key="item.code" :label="item.name" :value="item.code" />
+              <el-select v-model="task_form.bizId" :disabled="task_form.source !== 2" placeholder="请选择" style="width:100%" filterable @change="task_change_bizId(task_form.bizId)">
+                <el-option-group v-for="group in bizList" :key="group.code" :label="group.name">
+                  <el-option v-for="item in group.options" :key="item.code" :label="item.name" :value="item.code" />
+                </el-option-group>
               </el-select>
             </el-form-item>
             <el-form-item label="开发负责人">
@@ -103,7 +105,7 @@ import { mapGetters } from 'vuex'
 import { analysisBizId_id, EncryptId } from '@/utils/crypto-js.js'
 const _ = require('lodash')
 import { taskCreate, memberQueryMemberInfoByIDAPorName, configShowTaskEnum, configShowRequirementVersionEnum, taskGet, taskUpdate, projectListProject } from '@/api/taskIndex' // ajax
-import { projectList, settingGetBizList } from '@/api/projectIndex'
+import { projectList, settingGetBizList, settingGetMyAndOtherBizList } from '@/api/projectIndex'
 import { settingQueryBizModuleList } from '@/api/defectManage'
 export default {
   props: {
@@ -122,6 +124,7 @@ export default {
       ascription_project: false, // 归属项目(隐藏)
       ascription_demand: false, // 归属需求(隐藏)
       test: {},
+      bizList: [],
       loading: false,
       tit: '', // 跳转
       tit_Name: '', // 新建(编辑)
@@ -139,6 +142,7 @@ export default {
       demandList: [], // 需求list
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
+      requirementIdList: {},
       task_rulesForm: {
         name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
         // moduleIds: [{ required: true, message: '请选择模块', trigger: 'blur' }],
@@ -159,6 +163,7 @@ export default {
   },
   created() {
     this.analysisBizId_id()
+    this.settingGetBizList()
   },
   mounted() {
     this.get_taskSelect()
@@ -175,38 +180,27 @@ export default {
       this.tit_Name = '新建任务'
       switch (e) {
         case 1: // 新建任务(任务主页)
-          this.task_form = {
-            followVersion: 2
-          }
           this.dialogFormVisible = true
           this.ascription_demand = false
           this.ascription_project = false
-          this.$set(this.task_form, 'notest', 0)
-          this.$set(this.task_form, 'followVersion', 2)
-          this.$set(this.task_form, 'source', 1)
-          this.$set(this.task_form, 'bizId', this.bizId)
+          this.task_form = { 'notest': 0, 'followVersion': 2, 'source': 1, 'bizId': this.bizId }
+          this.requirementIdList = { 'name': '主页' }
           this.show_Client = false
           this.$nextTick(() => {
             this.$refs['task_form'].clearValidate()
           })
+          this.task_change_bizId(this.bizId)
           break
         case 2: // 新建任务(项目详情)
           this.tit = '新建任务'
           projectList({ id: this.projectId, curIndex: 1, pageSize: 15 }).then(res => {
             this.dialogFormVisible = true
-            var that = this
-            setTimeout(function() {
-              that.task_form = {}
-              that.ascription_demand = false
-              that.ascription_project = true
-              that.$set(that.task_form, 'bizId', that.bizId)
-              that.$set(that.task_form, 'source', 3)
-              that.$set(that.task_form, 'notest', 0)
-              that.$set(that.task_form, 'followVersion', 2)
-              that.$set(that.task_form, 'requireId', res.data[0].id)
-              that.$set(that.task_form, 'projectId', res.data[0].id)
-              that.task_form.followVersion === 2 ? that.show_Client = false : ''
-            }, 300)
+            this.task_form = { 'followVersion': 2, 'notest': 0, 'source': 3, 'projectId': res.data[0].id, 'requireId': res.data[0].id, 'bizId': this.bizId }
+            this.requirementIdList = { 'name': '项目', 'data': res.data[0].id }
+            this.ascription_demand = false
+            this.ascription_project = true
+            this.show_Client = false
+            this.task_change_bizId(this.bizId)
           })
           break
         case 3: // 编辑任务(任务详情)
@@ -238,9 +232,10 @@ export default {
                 return item
               }, [])
             }, 100)
+            this.task_change_bizId(res.data.bizId, res.data.id)
           })
           break
-        case 4: // 新建任务(项目详情)
+        case 4: // 新建任务(需求详情)
           this.tit = '新建任务'
           var ss = {}
           configShowRequirementVersionEnum({ bizId: this.bizId }).then(res => {
@@ -248,36 +243,21 @@ export default {
               item.id === this.requireId ? ss = item : ''
             })
             this.dialogFormVisible = true
-            const that = this
-            setTimeout(function() {
-              that.task_form = {}
-              that.ascription_demand = true
-              that.ascription_project = false
-              that.$set(that.task_form, 'source', 2)
-              that.$set(that.task_form, 'notest', 0)
-              that.$set(that.task_form, 'followVersion', 2)
-              that.$set(that.task_form, 'requireId', ss.id)
-              that.$set(that.task_form, 'projectId', '')
-              that.$set(that.task_form, 'bizId', that.bizId)
-              that.task_form.followVersion === 2 ? that.show_Client = false : ''
-              if (data) {
-                that.$set(that.task_form, 'requireId', data.requirementId)
-                that.$set(that.task_form, 'name', data.name)
-                that.$set(that.task_form, 'priority', data.priority)
-              }
-              console.log(that.task_form)
-            }, 300)
+            this.ascription_demand = true
+            this.ascription_project = false
+            this.task_form = { 'followVersion': 2, 'notest': 0, 'source': 2, 'projectId': '', 'requireId': ss.id, 'bizId': this.bizId }
+            this.show_Client = false
+            if (data) {
+              this.task_form = { ...this.task_form, 'requireId': data.requirementId, 'name': data.name, 'priority': data.priority }
+              this.requirementIdList = { 'name': '需求', 'data': data.requirementId }
+            }
+            this.task_change_bizId(this.bizId)
           })
           break
       }
       projectListProject({ bizId: this.bizId }).then(res => { // 获取项目(查询)
         this.projectList = res.data.filter(item => item.id !== -1)
       })
-      const res = await configShowRequirementVersionEnum({ bizId: this.bizId, taskId: 2060 }) // 获取需求(查询)
-      // if (res.code === 200) {
-      console.log(res, id, '你才看见的是')
-      // this.demandList = res.data.filter(item => item.id !== -1)
-      // }
     },
     test2(item, e) { // 获取团队人员信息
       if (typeof this.test[item.idap] === 'undefined') {
@@ -292,6 +272,26 @@ export default {
       leading: true,
       trailing: false
     }),
+    async settingGetBizList() { // 获取业务线列表
+      const res = await settingGetMyAndOtherBizList()
+      if (res.code === 200) {
+        this.bizList = [{
+          name: '我的业务线',
+          options: res.data[0] || []
+        }, {
+          name: '其他业务线',
+          options: res.data[1] ? res.data[1].filter(item => item.isSecret !== 1) : []
+        }]
+      }
+    },
+    async task_change_bizId(biz, id) { // 获取业务线需求
+      const data = { bizId: biz }
+      id ? data.taskId = id : ''
+      const res = await configShowRequirementVersionEnum(data) // 获取需求(查询)
+      if (res.code === 200) {
+        this.demandList = res.data.filter(item => item.id !== -1)
+      }
+    },
     create_task(e) { // 创建任务(保存)
       this.$refs['task_form'].validate((valid) => {
         if (valid) {
@@ -393,18 +393,22 @@ export default {
         case 1:
           this.ascription_demand = false
           this.ascription_project = false
+          this.$set(this.task_form, 'bizId', this.bizId)
           this.$set(this.task_form, 'requireId', '')
           this.$set(this.task_form, 'projectId', '')
           break
         case 2:
           this.ascription_demand = true
           this.ascription_project = false
-          this.$set(this.task_form, 'requireId', '')
+          this.requirementIdList.name === '需求' ? this.$set(this.task_form, 'requireId', this.requirementIdList.data) : this.$set(this.task_form, 'requireId', '')
+          this.$set(this.task_form, 'projectId', '')
           break
         case 3:
           this.ascription_demand = false
           this.ascription_project = true
-          this.$set(this.task_form, 'projectId', '')
+          this.$set(this.task_form, 'bizId', this.bizId)
+          this.requirementIdList.name === '项目' ? this.$set(this.task_form, 'projectId', this.requirementIdList.data) : this.$set(this.task_form, 'projectId', '')
+          this.$set(this.task_form, 'requireId', '')
           break
       }
     },

+ 2 - 1
src/views/projectManage/iteration/components/demand.vue

@@ -7,7 +7,8 @@
       <el-table-column prop="type" label="类型" min-width="70" />
       <el-table-column prop="desc" label="描述" min-width="150" />
       <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="160" />
-      <el-table-column prop="dayLength" label="时长" min-width="50" />
+      <el-table-column prop="dayLength" label="使用天数" min-width="80" />
+      <el-table-column prop="manpower" label="使用人力(人日)" width="80" />
       <el-table-column prop="peopleList" label="参与人员" min-width="150" />
       <el-table-column label="操作" width="120" />
     </el-table>

+ 8 - 3
src/views/projectManage/projectList/components/scheduleList.vue

@@ -46,14 +46,19 @@
       />
       <el-table-column
         prop="dayLength"
-        label="时长"
-        width="50"
+        label="使用天数"
+        width="80"
       />
       <el-table-column
         prop="peopleList"
         label="参与人员"
         min-width="100"
       />
+      <el-table-column
+        prop="manpower"
+        label="使用人力(人日)"
+        width="80"
+      />
       <el-table-column
         label="操作"
         width="200"
@@ -68,7 +73,7 @@
     </el-table>
     <div class="bottom-detail">
       <el-row>交付日期:{{ scheduleDetail.endTime }}</el-row>
-      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }}</el-row>
+      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }} <span style="color: #cccccc">{{ '(' + scheduleDetail.scheduleTimeAnnotation[-1] + ')' }}</span></el-row>
       <el-row v-if="scheduleDetail.preOnlineVersion && scheduleDetail.preOnlineVersion.length>0">
         <el-col :span="2">预计上线版本:</el-col>
         <el-col :span="6">

+ 3 - 2
src/views/projectManage/requirement/components/scheduleList.vue

@@ -28,8 +28,9 @@
       </el-table-column>
       <el-table-column prop="desc" label="描述" min-width="150" align="left" show-overflow-tooltip />
       <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="200" show-overflow-tooltip />
-      <el-table-column prop="dayLength" label="时长" min-width="50" />
+      <el-table-column prop="dayLength" label="使用天数" min-width="80" />
       <el-table-column prop="peopleList" label="参与人员" min-width="150" />
+      <el-table-column prop="manpower" label="使用人力(人日)" width="80" />
       <el-table-column label="操作" width="200">
         <template slot-scope="scope">
           <div v-if="showunlock">
@@ -42,7 +43,7 @@
     </el-table>
     <div class="bottom-detail">
       <el-row>交付日期:{{ scheduleDetail.endTime }}</el-row>
-      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }}</el-row>
+      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }} <span style="color: #cccccc">{{ '(' + scheduleDetail.scheduleTimeAnnotation[-1] + ')' }}</span></el-row>
       <el-row v-if="scheduleDetail.preOnlineVersion && scheduleDetail.preOnlineVersion.length>0">
         <el-col :span="2" style="width: 100px">预计上线版本:</el-col>
         <el-col :span="6">

+ 8 - 3
src/views/projectManage/taskList/components/scheduleList.vue

@@ -48,14 +48,19 @@
       />
       <el-table-column
         prop="dayLength"
-        label="时长"
-        width="50"
+        label="使用天数"
+        width="80"
       />
       <el-table-column
         prop="peopleList"
         label="参与人员"
         min-width="100"
       />
+      <el-table-column
+        prop="manpower"
+        label="使用人力(人日)"
+        width="80"
+      />
       <el-table-column
         label="关联任务"
         min-width="100"
@@ -99,7 +104,7 @@
     </el-table>
     <div class="bottom-detail">
       <el-row>交付日期:{{ scheduleDetail.endTime }}</el-row>
-      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }}</el-row>
+      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }} <span style="color: #cccccc">{{ '(' + scheduleDetail.scheduleTimeAnnotation[-1] + ')' }}</span></el-row>
       <el-row>预计上线版本:
         <span v-if="scheduleDetail.preOnlineVersion && scheduleDetail.preOnlineVersion.length > 0">
           <span v-for="item in scheduleDetail.preOnlineVersion" :key="item">{{ item }}</span>

+ 8 - 3
src/views/projectManage/taskList/taskViewDetail.vue

@@ -132,11 +132,11 @@
           <div class="detail-info">
             <el-form :inline="true" :model="form_query" class="demo-form-inline" label-position="left" label-width="100px">
               <el-form-item label="所属项目:" class="module">
-                <div v-if="form_query.projectId !== -1" @click="jump('项目详情',form_query.projectId)">{{ form_query.projectName }}</div>
+                <div v-if="form_query.projectId !== -1" @click="jump('项目详情',form_query)">{{ form_query.projectName }}</div>
                 <template v-else>{{ form_query.projectName }}</template>
               </el-form-item>
               <el-form-item label="所属需求:" class="module">
-                <div v-if="form_query.requireId !== -1" @click="jump('需求详情',form_query.requireId)">{{ form_query.requireName }}</div>
+                <div v-if="form_query.requireId !== -1" @click="jumps('需求详情',form_query)">{{ form_query.requireName }}</div>
                 <template v-else>{{ form_query.requireName }}</template>
               </el-form-item>
               <el-form-item label="所属模块:" class="module">
@@ -206,6 +206,7 @@
                 .每个任务仅支持一次提测和一次准出,请合理拆解任务后再排期。<br>
                 .任务状态未变更【已排期】前,排期不可锁定;状态变更为【已排期】时,任务排期将被系统自动锁定。<br>
                 .需求排期锁定时,任务排期将全部被锁定;所有任务锁定时,需求排期将被系统自动锁定。<br>
+                .任务排期锁定后,如果解锁了排期,排期将在24小时后再次自动锁定。请解锁后,及时进行排期调整。<br>
                 .任务锁定时,系统会自动将任务排期及交付时间同步至望岳。若多个任务关联同一个望岳任务,同步时排期会汇总一并同步到望岳,交付时间则按最晚日期同步至望岳。<br>
               </div>
             </div>
@@ -810,7 +811,11 @@ export default {
       }
     },
     jump(page, id) { // 跳转
-      const bizId_id = EncryptId(`${this.bizId}_${id}`)
+      const bizId_id = EncryptId(`${id.requireProjectBizId}_${id.projectId}`)
+      this.$router.push({ name: page, query: { bizId_id: bizId_id }})
+    },
+    jumps(page, id) { // 跳转
+      const bizId_id = EncryptId(`${id.requireIdBizId}_${id.requireId}`)
       this.$router.push({ name: page, query: { bizId_id: bizId_id }})
     },
     reloadList() {

+ 8 - 3
src/views/projectManage/version/components/scheduleList.vue

@@ -48,14 +48,19 @@
       />
       <el-table-column
         prop="dayLength"
-        label="时长"
-        width="50"
+        label="使用天数"
+        width="80"
       />
       <el-table-column
         prop="peopleList"
         label="参与人员"
         min-width="100"
       />
+      <el-table-column
+        prop="manpower"
+        label="使用人力(人日)"
+        width="80"
+      />
       <el-table-column
         label="操作"
         width="200"
@@ -71,7 +76,7 @@
     </el-table>
     <div class="bottom-detail">
       <el-row>交付日期:{{ scheduleDetail.endTime }}</el-row>
-      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }}</el-row>
+      <el-row>排期:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }} <span style="color: #cccccc">{{ '(' + scheduleDetail.scheduleTimeAnnotation[-1] + ')' }}</span></el-row>
       <el-row v-if="scheduleDetail.preOnlineVersion && scheduleDetail.preOnlineVersion.length>0">
         <el-col :span="2">预计上线版本:</el-col>
         <el-col :span="6">

+ 1 - 1
src/views/quality/components/developmentCycle.vue

@@ -28,7 +28,7 @@ export default {
   props: {
     id: {
       type: String,
-      default: 'develop-cycle-chart',
+      default: 'develop-cycle-charts',
       required: false
     },
     chartData: {

+ 57 - 2
src/views/quality/requireStatistics.vue

@@ -140,6 +140,21 @@
             @change="getDevelopmentCycle()"
           />
         </div>
+        <div class="chart-item">
+          <h3>人力统计<span>(根据排期计算)</span></h3>
+          <cycle-statistic :chart-data="peopleData" />
+        </div>
+        <div class="chart-item">
+          <h3>人力分布图<span>(根据排期计算)</span></h3>
+          <development-cycle
+            id="101"
+            :chart-data="developmentPeopleData"
+            type="require"
+            :graph-type.sync="peopleType"
+            :graph-type-list="peopleTypeList"
+            @change="getDevelopeopleData()"
+          />
+        </div>
         <div class="chart-item">
           <h3>需求分布图</h3>
           <distribution-chart
@@ -190,7 +205,9 @@ import {
   getStatusStayData,
   getOrntDistributeData,
   getReqUnlockData,
-  getBugStatisticData
+  getBugStatisticData,
+  getManpowerStatistics,
+  getManpowerDistributedData
 } from '@/api/statisticsApi/requireStatistics'
 import requireDrawer from './components/requireDrawer'
 import statusChart from './components/statusChart'
@@ -236,8 +253,9 @@ export default {
       cumulativeData: null, // 需求状态累计流数据
       tendencyData: null, // 趋势图数据
       cycleData: [], // 周期统计数据
+      peopleData: [], // 人力统计数据
       graphType: 1, // 周期分布图选项
-      graphTypeList: [// 周期分布图选项列表
+      graphTypeList: [ // 周期分布图选项列表
         { code: 1, label: '产品技术侧总周期' },
         { code: 2, label: '产品侧总周期' },
         { code: 3, label: '技术侧总周期' },
@@ -245,7 +263,20 @@ export default {
         { code: 5, label: '研发周期' },
         { code: 6, label: '测试周期 ' }
       ],
+      peopleType: -1, // 周期分布图选项
+      peopleTypeList: [ // 人力分布图选项列表
+        { code: -1, label: '排期使用人力' },
+        { code: 0, label: '开发类型排期使用人力' },
+        { code: 1, label: '用例类型排期使用人力' },
+        { code: 2, label: '联调类型排期使用人力' },
+        { code: 3, label: '提测类型排期使用人力' },
+        { code: 4, label: '测试类型排期使用人力 ' },
+        { code: 5, label: '准出类型排期使用人力 ' },
+        { code: 6, label: '上线类型排期使用人力 ' },
+        { code: 7, label: '其他 ' }
+      ],
       developmentCycleData: [], // 研发交付周期分布数据
+      developmentPeopleData: [], // 人力分布图
       distributeStatus: 1, // 需求分布图需求状态
       distributeStatusList: [
         { code: 1, label: '需求状态' },
@@ -328,6 +359,8 @@ export default {
       this.getRequireCountTrend()
       this.getCycleData()
       this.getDevelopmentCycle()
+      this.getPeopleData()
+      this.getDevelopeopleData()
       this.getOrntDistributeData()
       this.getDistributeData()
       this.getStatusStayData()
@@ -406,6 +439,28 @@ export default {
       const res = await getCumulativeFlowDiagram(params)
       if (res.code === 200) this.cumulativeData = res.data
     },
+    async getPeopleData() { // 人力统计数据
+      const params = {
+        ...this.globalParams,
+        timeType: this.timeType,
+        type: Number(this.activeTab)
+      }
+      const res = await getManpowerStatistics(params)
+      if (res.code === 200) this.peopleData = res.data
+    },
+    async getDevelopeopleData() { // 需求人力分布图
+      const params = {
+        ...this.globalParams,
+        type: Number(this.activeTab),
+        graphType: this.peopleType
+      }
+      const res = await getManpowerDistributedData(params)
+      if (res.code === 200) {
+        res.data.length > 0
+          ? this.developmentPeopleData = res.data
+          : this.developmentPeopleData = [moment().format('YYYY-MM-DD'), '0']
+      }
+    },
     async getCycleData() { // 周期统计数据
       const params = {
         ...this.globalParams,

+ 57 - 1
src/views/quality/taskStatistics.vue

@@ -130,6 +130,7 @@
             <span>仅统计状态已变更“已排期”且排期不为空的任务;横坐标表示任务交付日期,纵坐标代表研发交付周期(研发、联调、上线类型排期的总周期)</span>
           </div> -->
           <development-cycle
+            id="102"
             :chart-data="developmentCycleData"
             type="task"
             :graph-type.sync="graphType"
@@ -137,6 +138,21 @@
             @change="getDevelopmentCycle()"
           />
         </div>
+        <div class="chart-item">
+          <h3>人力统计<span>(根据排期计算)</span></h3>
+          <cycle-statistic :chart-data="taskPeoplecData" type="task_a" />
+        </div>
+        <div class="chart-item">
+          <h3>人力分布图<span>(根据排期计算)</span></h3>
+          <development-cycle
+            id="105"
+            :chart-data="developmentTaskPeopleData"
+            type="task"
+            :graph-type.sync="graphTypes"
+            :graph-type-list="peopleTypeList"
+            @change="getManpowerDistributedData()"
+          />
+        </div>
         <div class="chart-item">
           <h3>任务分布图</h3>
           <distribution-chart
@@ -193,7 +209,9 @@ import {
   getModuleDistributeData,
   getTaskUnlockData,
   getReportSummary,
-  getBugStatisticData
+  getBugStatisticData,
+  getManpowerStatistics,
+  getManpowerDistributedData
 } from '@/api/statisticsApi/taskStatistics'
 import statusChart from './components/statusChart'
 import tendencyChart from './components/tendencyChart'
@@ -240,6 +258,8 @@ export default {
       tendencyData: null, // 趋势图数据
       belongRequirementData: null, // 所属需求方向分布图
       cycleData: [], // 周期统计数据
+      taskPeoplecData: [], // 任务人力统计
+      graphTypes: -1, // 任务人力分布图默认
       graphType: 4, // 周期分布图选项
       graphTypeList: [// 周期分布图选项列表
         { code: 4, label: '研发交付周期' },
@@ -248,6 +268,7 @@ export default {
         { code: 7, label: '提测等待测试时长' }
       ],
       developmentCycleData: [], // 研发交付周期分布数据
+      developmentTaskPeopleData: [], // 人力分布图
       distributeStatus: 1, // 任务分布图任务状态
       distributeStatusList: [
         { code: 1, label: '任务状态' },
@@ -257,6 +278,17 @@ export default {
         { code: 5, label: '跟版客户端' },
         { code: 6, label: '直接归属' }
       ], // 任务分布图任务状态列表
+      peopleTypeList: [ // 人力分布图选项列表
+        { code: -1, label: '排期使用人力' },
+        { code: 0, label: '开发类型排期使用人力' },
+        { code: 1, label: '用例类型排期使用人力' },
+        { code: 2, label: '联调类型排期使用人力' },
+        { code: 3, label: '提测类型排期使用人力' },
+        { code: 4, label: '测试类型排期使用人力 ' },
+        { code: 5, label: '准出类型排期使用人力 ' },
+        { code: 6, label: '上线类型排期使用人力 ' },
+        { code: 7, label: '其他 ' }
+      ],
       moduleDistributeData: null, // 任务模块分布
       distributeData: null, // 任务分布图数据
       statusStayData: null, // 状态停留图数据
@@ -331,7 +363,9 @@ export default {
       this.getTaskCountTrend()
       this.getBelongRequirementData()
       this.getCycleData()
+      this.getManpowerStatistics()
       this.getDevelopmentCycle()
+      this.getManpowerDistributedData()
       this.getModuleDistributeData()
       this.getDistributeData()
       this.getStatusStayData()
@@ -414,6 +448,28 @@ export default {
       const res = await getCumulativeFlowDiagram(params)
       if (res.code === 200) this.cumulativeData = res.data
     },
+    async getManpowerStatistics() { // 获取任务人力统计
+      const params = {
+        ...this.globalParams,
+        type: Number(this.activeTab)
+      }
+      const res = await getManpowerStatistics(params)
+      if (res.code === 200) this.taskPeoplecData = res.data
+    },
+    async getManpowerDistributedData() { // 人力分布图
+      const params = {
+        ...this.globalParams,
+        type: Number(this.activeTab),
+        graphType: this.graphTypes,
+        timeType: this.timeType
+      }
+      const res = await getManpowerDistributedData(params)
+      if (res.code === 200) {
+        res.data.length > 0
+          ? this.developmentTaskPeopleData = res.data
+          : this.developmentTaskPeopleData = [moment().format('YYYY-MM-DD'), '0']
+      }
+    },
     async getCycleData() { // 周期统计数据
       const params = {
         ...this.globalParams,