Преглед на файлове

月报2.0改造(1.7)

洪海涛 преди 4 години
родител
ревизия
ef6666be05

+ 9 - 0
src/api/qualityMonthlyReport/edit.js

@@ -199,3 +199,12 @@ export function getDeptCharge(data) {
     data
   })
 }
+
+// 月报PDF下载 /monthlyReport/downloadMonthlyReport
+export function downloadMonthlyReport(reportId) {
+  return request({
+    url: projectManagementUrl + '/monthlyReport/downloadMonthlyReport?id=' + reportId,
+    timeout: '200000',
+    method: 'get'
+  })
+}

+ 6 - 4
src/store/modules/monthlyReport/edit/index.js

@@ -915,10 +915,10 @@ export default {
         }
       }
       if (title.search(/线下缺陷/) > -1) {
-        setTableHeader(res.data.content[0].tableHeaders)
-        res.data.content[0].tableRows = readOnlyTableArrToObj(
-          res.data.content[0].tableRows,
-          res.data.content[0].tableHeaders
+        setTableHeader(res.data.content[1].tableHeaders)
+        res.data.content[1].tableRows = readOnlyTableArrToObj(
+          res.data.content[1].tableRows,
+          res.data.content[1].tableHeaders
         )
       }
       if (title.search(/上月问题跟进|发布&回滚|线上问题|项目延期提测|项目提测打回/) > -1) {
@@ -953,6 +953,8 @@ export default {
                 //   tableRows: res.data.content[0].tableRows
                 // }]
               } else if (title.search(/线下缺陷/) > -1) {
+                // elm = _.cloneDeep(res.data)
+                // console.log(957, res.data)
                 elm.content = [...res.data.content]
                 elm.subTitles = [...res.data.subTitles]
               } else if (title.search(/发布&回滚/) > -1) {

+ 13 - 6
src/views/monthlyReport/childrenPage/editReport/components/ReadOnlyTable.vue

@@ -102,7 +102,7 @@ export default {
       requireList: {},
       bugPriority: ['全部', 'P0', 'P1', 'P1以上'],
       bugPrioritys: ['全部', 'P0&P1', 'P1以上'],
-      bugHour: ['全部修复', '24小时内修复', '修复时长超过24小时']
+      bugHour: ['全部修复', '24小时内修复', '修复时长超过24小时', '未修复']
     }
   },
   computed: {
@@ -205,8 +205,9 @@ export default {
       return false
     },
     // 半浮层逻辑
-    query({ row, column }, index) {
-      // console.log(row, column.property, itemIndex)
+    query({ row, column }, lIndex) {
+      const index = lIndex - 1 || 0
+      console.log(row, column, index)
       const data = row[column.property]
       // return
       if (index <= 2) {
@@ -221,8 +222,8 @@ export default {
         })
         this.requireList = { toType: '缺陷', title: '累计reopen', yaxis: yaxis, idList: yaxis }
       } else if (index === 4) {
-        let [one, tow, three] = [[], [], []]
-        const [a, s, d, f, g, h, j, k, l] = [[], [], [], [], [], [], [], [], []]
+        let [one, tow, three, four] = [[], [], [], []]
+        const [a, s, d, f, g, h, j, k, l, z, x, c] = [[], [], [], [], [], [], [], [], []]
         if (data.reportBugs[0]) {
           data.reportBugs.map(item => {
             if (item.isRepaired && item.repairTime < 24) { // 24小时内修复
@@ -245,6 +246,12 @@ export default {
               }
               three = [a, s, d]
             }
+            if (item.status === 0) { // 未修复
+              z.push(item.id)
+              if (item.priority < 2) { x.push(item.id) }
+              if (item.priority > 1) { c.push(item.id) }
+              four = [z, x, c]
+            }
             j.push(item.id)
             if (item.priority < 2) {
               k.push(item.id)
@@ -255,7 +262,7 @@ export default {
             tow = [j, k, l]
           })
         }
-        const yaxis = [tow, one, three]
+        const yaxis = [tow, one, three, four]
         this.requireList = {
           toType: '缺陷',
           xaxis: this.bugHour,

+ 2 - 2
src/views/monthlyReport/childrenPage/editReport/components/SubTitle.vue

@@ -76,7 +76,7 @@ export default {
         this.requireList = { toType: '缺陷', title: '累计reopen', yaxis: yaxis, idList: yaxis }
       } else if (index === 4) {
         let [one, tow, three, four] = [[], [], [], []]
-        const [a, s, d, f, g, h, j, k, l, z, x, c] = [[], [], [], [], [], [], [], [], []]
+        const [a, s, d, f, g, h, j, k, l, z, x, c] = [[], [], [], [], [], [], [], [], [], [], [], []]
         if (data.reportBugs[0]) {
           data.reportBugs.map(item => {
             if (item.isRepaired && item.repairTime < 24) { // 24小时内修复
@@ -91,7 +91,7 @@ export default {
               if (item.priority > 1) { d.push(item.id) }
               three = [a, s, d]
             }
-            if (item.isRepaired && item.status === 0) { // 未修复
+            if (item.status === 0) { // 未修复
               z.push(item.id)
               if (item.priority < 2) { x.push(item.id) }
               if (item.priority > 1) { c.push(item.id) }

+ 1 - 0
src/views/monthlyReport/childrenPage/editReport/components/core.vue

@@ -278,6 +278,7 @@ export default {
       // this.$store.commit('monthlyReportEdit/SUB_TABS_ACTIVE', this.baseData.children[0].domKey, this.activeName)
     },
     setHeader() {
+      console.log(281)
       let title = `${this.baseData.title}`
       // if (title === '发布&回滚') {
       //   this.pushAndBanckheadle()

+ 10 - 1
src/views/monthlyReport/index.vue

@@ -24,7 +24,8 @@
         {{ reportName }}
         <el-button v-if="reportStatus.status === 20" type="text" @click="jump('report_home_Publication', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 月报发布</el-button>
         <el-button v-if="reportStatus.status === 30" type="text" @click="jump('report_home_viewReport', '/monthlyReport/edit', { pageType: 'readAll', reportId: reportStatus.id })"> 查看完整报告</el-button>
-<!--        <a href="" style="margin-left: 10px;display: inline-block"><svg-icon v-if="reportStatus.status === 30" icon-class="monthlyReport下载" class="icon" /></a>-->
+        <!--    @click="downloadMonthlyReportFn"    -->
+<!--        <a target="blank" :href="`${projectManagementUrl}/monthlyReport/downloadMonthlyReport?id=${reportValue}`" :download="`${reportName}.pdf`" style="margin-left: 10px;display: inline-block"><svg-icon v-if="reportStatus.status === 30" icon-class="monthlyReport下载" class="icon" /></a>-->
         <el-button v-if="reportStatus.status === 0" type="text" @click="sendConfirm(reportData)"> 发送确认</el-button>
       </div>
       <div v-show="reportStatus.status === 30" class="report-bottom">
@@ -93,6 +94,8 @@ import normalDialog from '@/components/dialog/normalDialog'
 import headerCom from './components/header'
 import monthlyEards from './components/monthlyEards'
 import { getAvaliableInfo, monthlyReportIndex, getReportBizInfo, createMonthlyReport } from '@/api/qualityMonthlyReport'
+import { downloadMonthlyReport } from '@/api/qualityMonthlyReport/edit'
+import { projectManagementUrl } from '@/apiConfig/api'
 
 export default {
   name: '',
@@ -109,6 +112,7 @@ export default {
         }
       },
       reportStatus: {},
+      projectManagementUrl,
       tagData: {}, // tagData
       createReportDialog: false, // 新建月报
       loading: false,
@@ -198,6 +202,11 @@ export default {
     async sendConfirm() {
       this.$router.push({ path: '/monthlyReport/edit', query: { pageType: 'editAll', reportId: this.reportStatus.id }})
     },
+    downloadMonthlyReportFn() {
+      downloadMonthlyReport(this.reportValue).then(res => {
+        console.log(res)
+      })
+    },
     getReportStatus(e) {
       this.contentLoading = true
       this.monthlyReportIndex(e.id)