qinzhipeng_v 5 years ago
parent
commit
59f9448ea5

+ 82 - 82
src/views/projectManage/taskList/components/reportList.vue

@@ -6,7 +6,7 @@
           <div class="title-left-icon" />
           <div class="title-left-name">提测报告</div>
         </div>
-        <el-button class="task-report-btn" type="text" @click="getTest()">{{ dataStatus?'回到最新':"查看历史" }}</el-button>
+        <el-button class="task-report-btn" type="text" @click="dataStatus ? reportdelivertestGetByTaskId(1):launchTest(1) ">{{ dataStatus?'回到最新':"查看历史" }}</el-button>
       </div>
       <div class="detail-info">
         <el-table
@@ -84,13 +84,13 @@
           <div class="title-left-icon" />
           <div class="title-left-name">测试日报</div>
         </div>
-        <el-button class="task-report-btn" type="text" @click="getDaily(10011)">{{ dailyDataStatus?'查看历史':"回到最新" }}</el-button>
+        <el-button class="task-report-btn" type="text" @click="dailyDataStatus?dailyReportGetByTaskIdV2(1):dailyReport(1)">{{ dailyDataStatus?'回到最新':"查看历史" }}</el-button>
       </div>
       <div class="detail-info">
         <el-table :data="dailyData" size="small" :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500' }" show-overflow-tooltip="true">
           <el-table-column label="标题名称" min-width="120">
             <template slot-scope="scope">
-              <a href="javascript:void(0)" style="color:#20a0ff" @click="!dailyDataStatus ? OldDaily(scope.row ,'测试日报') :toReportView(scope.row, 0)">{{ scope.row.reportName }}</a>
+              <a href="javascript:void(0)" style="color:#20a0ff" @click="dailyDataStatus ? OldDaily(scope.row ,'测试日报') :toReportView(scope.row, 0)">{{ scope.row.reportName }}</a>
             </template>
           </el-table-column>
           <el-table-column label="状态" min-width="100" align="center">
@@ -98,14 +98,14 @@
           </el-table-column>
           <el-table-column label="报告人" min-width="100" align="center">
             <template slot-scope="scope">
-              <span v-if="dailyDataStatus">{{ !scope.row.reportorObject? '':scope.row.reportorObject.name }}</span>
-              <span v-if="!dailyDataStatus">{{ scope.row.createrObject.name }}</span>
+              <span v-if="!dailyDataStatus">{{ !scope.row.reportorObject? '':scope.row.reportorObject.name }}</span>
+              <span v-if="dailyDataStatus">{{ scope.row.createrObject.name }}</span>
             </template>
           </el-table-column>
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
-          <el-table-column v-if="dailyDataStatus" label="操作" width="200">
+          <el-table-column v-if="!dailyDataStatus" label="操作" width="200">
             <template slot-scope="scope">
               <div>
                 <span v-if="scope.row.status === 0 ? true : false" class="btn" @click="dailyButtom(5,scope.row.id, scope.row)">发送</span>
@@ -150,31 +150,31 @@
           <div class="title-left-icon" />
           <div class="title-left-name">准出报告</div>
         </div>
-        <el-button class="task-report-btn" type="text" @click="getClient(10000)">{{ releaseDataStatus?'查看历史':"回到最新" }}</el-button>
+        <el-button class="task-report-btn" type="text" @click="releaseDataStatus?reportreleaseGetByTaskId(1): projectTestReport(1)">{{ releaseDataStatus?'回到最新':"查看历史" }}</el-button>
       </div>
       <div class="detail-info">
         <el-table :data="clientData" size="small" :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500' }" show-overflow-tooltip="true">
           <el-table-column label="标题名称" min-width="120">
             <template slot-scope="scope">
-              <a href="javascript:void(0)" style="color:#20a0ff" @click="!releaseDataStatus ? OldDaily(scope.row ,'准出报告') : toReportView(scope.row, 1)">{{ scope.row.reportName }}</a>
+              <a href="javascript:void(0)" style="color:#20a0ff" @click="releaseDataStatus ? OldDaily(scope.row ,'准出报告') : toReportView(scope.row, 1)">{{ scope.row.reportName }}</a>
             </template>
           </el-table-column>
           <el-table-column label="状态" min-width="100" align="center">
             <template slot-scope="scope">
-              <span v-if="!releaseDataStatus">{{ scope.row.reportStatusString }}</span>
-              <span v-if="releaseDataStatus">{{ scope.row.statusString }}</span>
+              <span v-if="releaseDataStatus">{{ scope.row.reportStatusString }}</span>
+              <span v-if="!releaseDataStatus">{{ scope.row.statusString }}</span>
             </template>
           </el-table-column>
           <el-table-column label="报告人" min-width="100" align="center">
             <template slot-scope="scope">
-              <span v-if="!releaseDataStatus">{{ scope.row.createrObject.name }}</span>
-              <span v-if="releaseDataStatus">{{ scope.row.reportorObject === null ? '' :scope.row.reportorObject.name }}</span>
+              <span v-if="releaseDataStatus">{{ scope.row.createrObject.name }}</span>
+              <span v-if="!releaseDataStatus">{{ scope.row.reportorObject === null ? '' :scope.row.reportorObject.name }}</span>
             </template>
           </el-table-column>
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
-          <el-table-column v-if="releaseDataStatus" label="操作" width="200">
+          <el-table-column v-if="!releaseDataStatus" label="操作" width="200">
             <template slot-scope="scope">
               <div v-if="scope.row.status === 3 ? false : true">
                 <span v-if="scope.row.status === 0 ? true : false" class="btn" @click="clientButtom(5,scope.row.id, scope.row)">发送</span>
@@ -266,9 +266,9 @@ export default {
       userNames: localStorage.getItem('realname'),
       taskId: Number(this.$route.query.id), // 任务id
       stColors: ['#409EFF', '#07BCA4', '#F56C6C', '#07BCA4'],
-      dataStatus: true, // 数据状态
-      releaseDataStatus: true, // 准出
-      dailyDataStatus: true, // 日报
+      dataStatus: false, // 数据状态
+      releaseDataStatus: false, // 准出
+      dailyDataStatus: false, // 日报
       dialog_testData: false, // 打回弹窗
       dialog_daily: false, // 测试报告dialog
       dialog_client: false, // 准出报告dialog
@@ -303,91 +303,91 @@ export default {
     }
   },
   created() {
-    this.getTest()
-    this.getDaily()
-    this.getClient()
+    this.reportdelivertestGetByTaskId()
+    this.dailyReportGetByTaskIdV2()
+    this.reportreleaseGetByTaskId()
   },
   methods: {
-    async getTest(val) { // 获取提测
-      if (this.dataStatus) {
-        this.dataStatus = false
-        const data = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
-        const res = await reportdelivertestGetByTaskId(data)
-        if (res.code === 200) {
-          this.testData = res.data.list
-          this.testPages.total = res.data.total
-        }
-        return false
-      }
-      if (!this.dataStatus) {
-        this.dataStatus = true
-        const params = { taskId: this.taskId, curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
-        const res = await launchTest(params)
-        if (res.code === 200) {
-          this.testData = res.data.list
-          this.testPages.total = res.data.total
-        }
-      }
-    },
-    async getDaily(val) { // 获取日报
-      val === 10011 ? this.dailyDataStatus = !this.dailyDataStatus : ''
-      if (this.dailyDataStatus) {
-        const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
-        const res = await dailyReportGetByTaskIdV2(indexPage)
-        if (res.code === 200) {
-          this.dailyData = res.data.list
-          this.dailyPages.total = res.data.total
-        }
-      } else {
-        const params = { taskId: this.taskId, curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
-        const res = await dailyReport(params)
-        if (res.code === 200) {
-          this.dailyData = res.data.list
-          this.dailyPages.total = res.data.total
-        }
+    async reportdelivertestGetByTaskId(e) { // 获取新提测
+      e ? this.dataStatus = false : ''
+      const data = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
+      const res = await reportdelivertestGetByTaskId(data)
+      if (res.code === 200) {
+        this.testData = res.data.list
+        this.testPages.total = res.data.total
       }
     },
-    async getClient(val) { // 获取准出
-      val === 10000 ? this.releaseDataStatus = !this.releaseDataStatus : ''
-      if (this.releaseDataStatus) {
-        const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
-        const res = await reportreleaseGetByTaskId(indexPage)
-        if (res.code === 200) {
-          this.clientData = res.data.list
-          this.clientPages.total = res.data.total
-        }
-      } else {
-        const params = { taskId: this.taskId, curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
-        const res = await projectTestReport(params)
-        if (res.code === 200) {
-          this.clientData = res.data.list
-          this.clientPages.total = res.data.total
-        }
+    async launchTest(e) { // 获取老提测
+      e ? this.dataStatus = true : ''
+      const params = { taskId: this.taskId, curIndex: this.testPages.curIndex, pageSize: this.testPages.pageSize }
+      const res = await launchTest(params)
+      if (res.code === 200) {
+        this.testData = res.data.list
+        this.testPages.total = res.data.total
       }
     },
     testSizeChange(e) { // 提测分页
       this.testPages.pageSize = e
-      this.getTest()
+      !this.dataStatus ? this.reportdelivertestGetByTaskId() : this.launchTest()
     },
     testCurrentChange(e) { // 提测分页
       this.testPages.curIndex = e
-      this.getTest()
+      !this.dataStatus ? this.reportdelivertestGetByTaskId() : this.launchTest()
+    },
+
+    async dailyReportGetByTaskIdV2(e) {
+      e ? this.dailyDataStatus = false : ''
+      const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
+      const res = await dailyReportGetByTaskIdV2(indexPage)
+      if (res.code === 200) {
+        this.dailyData = res.data.list
+        this.dailyPages.total = res.data.total
+      }
+    },
+    async dailyReport(e) {
+      e ? this.dailyDataStatus = true : ''
+      const params = { taskId: this.taskId, curIndex: this.dailyPages.curIndex, pageSize: this.dailyPages.pageSize }
+      const res = await dailyReport(params)
+      if (res.code === 200) {
+        this.dailyData = res.data.list
+        this.dailyPages.total = res.data.total
+      }
     },
     dailySizeChange(e) { // 日报分页
       this.dailyPages.pageSize = e
-      this.getDaily()
+      !this.dailyDataStatus ? this.dailyReportGetByTaskIdV2() : this.dailyReport()
     },
     dailyCurrentChange(e) { // 日报分页
       this.dailyPages.curIndex = e
-      this.getDaily()
+      !this.dailyDataStatus ? this.dailyReportGetByTaskIdV2() : this.dailyReport()
     },
+
+    async reportreleaseGetByTaskId(e) {
+      e ? this.releaseDataStatus = false : ''
+      const indexPage = { taskId: this.taskId, bizId: localStorage.getItem('bizId'), curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
+      const res = await reportreleaseGetByTaskId(indexPage)
+      if (res.code === 200) {
+        this.clientData = res.data.list
+        this.clientPages.total = res.data.total
+      }
+    },
+    async projectTestReport(e) {
+      e ? this.releaseDataStatus = true : ''
+      const params = { taskId: this.taskId, curIndex: this.clientPages.curIndex, pageSize: this.clientPages.pageSize }
+      const res = await projectTestReport(params)
+      if (res.code === 200) {
+        this.clientData = res.data.list
+        this.clientPages.total = res.data.total
+      }
+    },
+
     clientSizeChange(e) { // 准出分页
       this.clientPages.pageSize = e
-      this.getClient()
+      !this.releaseDataStatus ? this.reportreleaseGetByTaskId() : this.projectTestReport()
     },
     clientCurrentChange(e) { // 准出分页
       this.clientPages.curIndex = e
-      this.getClient()
+      !this.releaseDataStatus ? this.reportreleaseGetByTaskId() : this.projectTestReport()
     },
     async passOrBackSend() { // 提测打回
       this.dialog_testData = false
@@ -404,13 +404,13 @@ export default {
         const res = await reportdelivertestUpdate(data)
         if (res.code === 200) {
           this.dataStatus = true
-          this.getTest()
+          this.reportdelivertestGetByTaskId()
           this.$message({ message: res.msg, type: 'success', offset: 150 })
         }
       } else if (this.Str === '删除') {
         const res = await reportdelivertestDelete({}, this.reportData.id)
         if (res.code === 200) {
-          this.getTest()
+          this.reportdelivertestGetByTaskId()
           this.$message({ type: 'success', message: '删除成功' })
         }
       }
@@ -439,7 +439,7 @@ export default {
       const res = await dailyReportDelete({}, this.CallBackId)
       if (res.code === 200) {
         this.dialog_daily = false
-        this.getDaily()
+        this.dailyReportGetByTaskIdV2()
         this.$message({ type: 'success', message: '删除成功' })
       }
     },
@@ -448,7 +448,7 @@ export default {
       const res = await reportreleaseDelete({}, this.CallBackId)
       if (res.code === 200) {
         this.dialog_client = false
-        this.getClient()
+        this.reportreleaseGetByTaskId()
         this.$message({ type: 'success', message: '删除成功' })
       }
     },

+ 1 - 0
src/views/reportManagement/components/DailyReport.vue

@@ -269,6 +269,7 @@ export default {
 
     sendReport() { // 截图
       this.$refs.dailyPreview.sendReport()
+      this.handleClose()
     },
 
     handleClose() {

+ 8 - 8
src/views/reportManagement/daily/components/iconDisplay.vue

@@ -16,18 +16,18 @@
       <div :id="'barShow' + randomId" class="backTop" />
     </div>
     <div class="backStyle">P0&P1缺陷列表( {{ PriData || 0 }} 个)</div>
-    <el-table :data="report_bugList" border size="mini" style="width: 100%" show-overflow-tooltip="true" :header-cell-style="{ backgroundColor: 'rgba(241,241,241,1)', color: 'rgba(51,59,74,1)', fontSize: '14px', fontWeight: '400'}">
-      <el-table-column prop="bugId" label="缺陷ID" align="center" min-width="80" show-overflow-tooltip />
-      <el-table-column prop="bugName" label="缺陷标题" align="center" min-width="100" show-overflow-tooltip>
+    <el-table :data="report_bugList" border size="mini" style="width: 100%" :header-cell-style="{ backgroundColor: 'rgba(241,241,241,1)', color: 'rgba(51,59,74,1)', fontSize: '14px', fontWeight: '400'}">
+      <el-table-column prop="bugId" label="缺陷ID" align="center" min-width="80" />
+      <el-table-column prop="bugName" label="缺陷标题" align="center" min-width="100">
         <template slot-scope="scope">
           <span class="didi-hover" @click.stop="click_bugName(scope.row.id)">{{ scope.row.bugName }}</span>
         </template>
       </el-table-column>
-      <el-table-column prop="bugStatusName" label="状态" align="center" min-width="100" show-overflow-tooltip />
-      <el-table-column prop="priorityName" label="缺陷等级" align="center" min-width="100" show-overflow-tooltip />
-      <el-table-column prop="creatorList" label="提报人" align="center" min-width="90" show-overflow-tooltip />
-      <el-table-column prop="assignerList" label="责任人" align="center" min-width="90" show-overflow-tooltip />
-      <el-table-column prop="currentHandlerList" label="修复人" align="center" min-width="90" show-overflow-tooltip />
+      <el-table-column prop="bugStatusName" label="状态" align="center" min-width="100" />
+      <el-table-column prop="priorityName" label="缺陷等级" align="center" min-width="100" />
+      <el-table-column prop="creatorList" label="提报人" align="center" min-width="90" />
+      <el-table-column prop="assignerList" label="责任人" align="center" min-width="90" />
+      <el-table-column prop="currentHandlerList" label="修复人" align="center" min-width="90" />
     </el-table>
   </div>
 </template>