Browse Source

测试报告添加复制功能

qinzhipeng_v 5 years ago
parent
commit
88c9beaab7

+ 2 - 0
src/views/Platform/presentation/DailyNewsAdded.vue

@@ -140,8 +140,10 @@ export default {
       })
     },
     parentHandleclick(e, task, id) {
+      console.log(this.fromCreateData, 'cdcdscdcd')
       if (e === 1) {
         this.ids = task
+        delete this.fromCreateData.id
         this.getCreateData(this.fromCreateData)
       } else {
         this.dailys = id

+ 11 - 1
src/views/Platform/presentation/Templates/DailyReport.vue

@@ -79,7 +79,7 @@ export default {
       active: 1,
       daily_task: [],
       src: daily,
-      dailys: ''
+      dailys: this.$route.query.id
     }
   },
   destroyed() {
@@ -114,6 +114,16 @@ export default {
           this.preview = newData
           this.active = 3
           break
+        case 4:
+          this.daily_task = [Number(arr[1])]
+          this.dailyNewData = newData
+          this.dailyNewData.creatask = '复制'
+          this.newIndex = 1
+          this.showOne = false
+          this.showTow = true
+          this.showThree = false
+          this.active = 2
+          break
         case 7:
           this.daily_task = newData
           this.dailyNewData.taskIds = newData

+ 114 - 1
src/views/projectManage/taskList/components/reportList.vue

@@ -91,6 +91,28 @@
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
+          <el-table-column 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>
+                <span v-if="scope.row.status === 0 ? true : false" style="margin: 0 30px;" class="btn" @click="dailyButtom(6,scope.row.id, scope.row)">编辑</span>
+                <span v-if="scope.row.status === 0 ? true : false" class="btn" @click="dailyButtom(4,scope.row.id, scope.row )">删除</span>
+                <span v-if="scope.row.status === 1 ? true : false" class="btn" @click="dailyButtom(3,scope.row.id, scope.row)">复制</span>
+                <el-dialog :title="titName" :visible.sync="dialog_daily" width="30%" :close-on-click-modal="false">
+                  <div style="position: absolute; top: 23px; left: 12px;width:4px;height:17px;background:#409EFF;border-radius:1px;" />
+                  <div align="center">
+                    <div>是否{{ Str }}以下测试日报?</div>
+                    <div style="color: #f79232;">{{ requireName }}</div>
+                  </div>
+                  <el-input v-show="Str === '打回'" v-model="CallBackTheReason" type="textarea" placeholder="请输入打回原因..." :rows="3" />
+                  <span slot="footer" class="dialog-footer">
+                    <el-button type="primary" size="mini" @click="dailySend()">确 定</el-button>
+                    <el-button type="danger" size="mini" @click="dialog_daily = false">取 消</el-button>
+                  </span>
+                </el-dialog>
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
         <el-col :span="24">
           <div align="right">
@@ -129,6 +151,27 @@
           <el-table-column label="创建日期" min-width="100" align="center">
             <template slot-scope="scope">{{ scope.row.gmtCreate }}</template>
           </el-table-column>
+          <el-table-column label="操作" width="200">
+            <template slot-scope="scope">
+              <div v-if="scope.row.status === 1 ? false : true">
+                <span v-if="scope.row.status === 2 ? true : false" class="btn" @click="clientButtom(5,scope.row.id, scope.row)">发送</span>
+                <span v-if="scope.row.status === 2 ? true : false" style="margin: 0 30px;" class="btn" @click="clientButtom(6,scope.row.id, scope.row)">编辑</span>
+                <span v-if="scope.row.status === 2 ? true : false" class="btn" @click="clientButtom(4,scope.row.id, scope.row )">删除</span>
+                <el-dialog :title="titName" :visible.sync="dialog_client" width="30%" :close-on-click-modal="false">
+                  <div style="position: absolute; top: 23px; left: 12px;width:4px;height:17px;background:#409EFF;border-radius:1px;" />
+                  <div align="center">
+                    <div>是否{{ Str }}以下准出?</div>
+                    <div style="color: #f79232;">{{ requireName }}</div>
+                  </div>
+                  <el-input v-show="Str === '打回'" v-model="CallBackTheReason" type="textarea" placeholder="请输入打回原因..." :rows="3" />
+                  <span slot="footer" class="dialog-footer">
+                    <el-button type="primary" size="mini" @click="clientSend()">确 定</el-button>
+                    <el-button type="danger" size="mini" @click="dialog_client = false">取 消</el-button>
+                  </span>
+                </el-dialog>
+              </div>
+            </template>
+          </el-table-column>
         </el-table>
         <el-col :span="24">
           <div align="right">
@@ -163,6 +206,7 @@ import {
 import TestReport from '@/views/Platform/presentation/Templates/TestReport' // 提测
 import DailyReport from '@/views/Platform/presentation/Templates/DailyReport' // 日报
 import ClientReport from '@/views/Platform/presentation/Templates/ClientReport' // 准出
+import { dailyReportDelete, projectTestReportDelete } from '@/api/testPresentetion' // 日报
 export default {
   components: {
     TestReport,
@@ -176,6 +220,8 @@ export default {
       taskId: Number(this.$route.query.id), // 任务id
       stColors: ['#409EFF', '#07BCA4', '#F56C6C', '#07BCA4'],
       dialog_testData: false, // 打回弹窗
+      dialog_daily: false, // 测试报告dialog
+      dialog_client: false, // 准出报告dialog
       CallBackTheReason: '', // 打回原因
       CallBackStatus: '', // 打回状态
       CallBackId: '', // 打回id
@@ -279,6 +325,18 @@ export default {
         }
       }
     },
+    async dailySend() { // 测试日报删除
+      const res = await dailyReportDelete(this.CallBackId)
+      if (res.code === 200) {
+        this.$message({ type: 'success', message: '删除成功' })
+      }
+    },
+    async clientSend() { // 准出报告删除
+      const res = await projectTestReportDelete(this.CallBackId)
+      if (res.code === 200) {
+        this.$message({ type: 'success', message: '删除成功' })
+      }
+    },
     endDialog() { // 结束对话框
       this.dialog_testData = false
       this.$message({ type: 'warning', message: '已取消' })
@@ -305,7 +363,7 @@ export default {
           break
       }
     },
-    back(e, ele, data) { // 打回
+    back(e, ele, data) { // 提测报告
       this.requireName = data.name
       this.CallBackStatus = e
       this.CallBackId = ele
@@ -345,6 +403,61 @@ export default {
           })
           break
       }
+    },
+    dailyButtom(e, ele, data) { // 测试报告
+      console.log(e, ele, data)
+      this.requireName = data.reportName
+      this.CallBackStatus = e
+      this.CallBackId = ele
+      switch (e) {
+        case 3:
+          this.dialogDaily = true
+          this.$nextTick(() => {
+            this.$refs.DailyReport.init(4, data)
+          })
+          break
+        case 4:
+          this.dialog_daily = true
+          this.titName = '删除确认'
+          this.Str = '删除'
+          break
+        case 5:
+          this.dialogDaily = true
+          this.$nextTick(() => {
+            this.$refs.DailyReport.init(3, data)
+          })
+          break
+        case 6:
+          this.dialogDaily = true
+          this.$nextTick(() => {
+            this.$refs.DailyReport.init(2, data)
+          })
+          break
+      }
+    },
+    clientButtom(e, ele, data) { // 准出报告
+      this.requireName = data.reportName
+      this.CallBackStatus = e
+      this.CallBackId = ele
+      switch (e) {
+        case 4:
+          this.dialog_client = true
+          this.titName = '删除确认'
+          this.Str = '删除'
+          break
+        case 5:
+          this.dialogClient = true
+          this.$nextTick(() => {
+            this.$refs.ClientReport.init(3, data)
+          })
+          break
+        case 6:
+          this.dialogClient = true
+          this.$nextTick(() => {
+            this.$refs.ClientReport.init(2, data)
+          })
+          break
+      }
     }
   }
 }