瀏覽代碼

提测报告优化

qinzhipeng_v 5 年之前
父節點
當前提交
555ba20718

+ 42 - 45
src/views/Platform/presentation/PresentReport.vue

@@ -93,20 +93,23 @@
           <el-form-item label="其他"><el-input v-model="dataChange.others" size="small" style="width:85vw;margin-left:13px;" type="textarea" :rows="5" /></el-form-item>
           <el-form-item label="其他"><el-input v-model="dataChange.others" size="small" style="width:85vw;margin-left:13px;" type="textarea" :rows="5" /></el-form-item>
         </el-col>
         </el-col>
       </div>
       </div>
-      <div align="center">
-        <el-button v-show="showButton1" size="small" type="primary" @click="getQueryData(dataChange)">更新, 下一步 </el-button>
-      </div>
     </el-form>
     </el-form>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import { launchTestUpdate, launchTestCreate } from '@/api/InterfaceReport'
 import { launchTestUpdate, launchTestCreate } from '@/api/InterfaceReport'
-import { launchTest } from '@/api/testPresentetion'
+// import { launchTest } from '@/api/testPresentetion'
 import E from 'wangeditor'
 import E from 'wangeditor'
 
 
 export default {
 export default {
   name: 'PresentReport',
   name: 'PresentReport',
+  props: {
+    clienData: {
+      type: Object,
+      required: true
+    }
+  },
   data() {
   data() {
     return {
     return {
       priorityStrings: [{ name: 'p0', value: 0 }, { name: 'p1', value: 1 }, { name: 'p2', value: 2 }, { name: 'p3', value: 3 }],
       priorityStrings: [{ name: 'p0', value: 0 }, { name: 'p1', value: 1 }, { name: 'p2', value: 2 }, { name: 'p3', value: 3 }],
@@ -134,7 +137,6 @@ export default {
       showDelay: false,
       showDelay: false,
       showApollo: false,
       showApollo: false,
       showRelyOn: false,
       showRelyOn: false,
-      showButton1: false,
       userData: '',
       userData: '',
       objData: '',
       objData: '',
       userInformation: localStorage.getItem('username'),
       userInformation: localStorage.getItem('username'),
@@ -165,45 +167,40 @@ export default {
   },
   },
   methods: {
   methods: {
     getRouterData() {
     getRouterData() {
-      if (this.$route.query.data) { // 提测编辑
-        this.showButton1 = true
-        launchTest({ id: this.$route.query.id }).then((res) => {
-          this.dataChange = res.data
-          this.DetailsOfProposal.txt.html(this.dataChange.joinTest)
-          if (this.dataChange.lateStatus === 1) {
-            this.lateStatusBtn1 = 'success'
-            this.lateStatusBtn = 'info'
-            this.lateStatus = 1
-            this.showDelay = false
-          } else {
-            this.lateStatusBtn1 = 'info'
-            this.lateStatusBtn = 'danger'
-            this.lateStatus = 2
-            this.showDelay = true
-          }
-          if (this.dataChange.configInfo !== '') {
-            this.configInBtn = 'success'
-            this.configInBtn1 = 'info'
-            this.confidgIn = 1
-            this.showApollo = true
-          } else {
-            this.configInBtn = 'info'
-            this.configInBtn1 = 'danger'
-            this.configIn = 2
-            this.showApollo = false
-          }
-          if (this.dataChange.dependentComponents !== '') {
-            this.dependentBtn = 'success'
-            this.dependentBtn1 = 'info'
-            this.dependent = 1
-            this.showRelyOn = true
-          } else {
-            this.dependentBtn = 'info'
-            this.dependentBtn1 = 'danger'
-            this.dependent = 2
-            this.showRelyOn = false
-          }
-        })
+      this.dataChange = this.clienData
+      this.DetailsOfProposal.txt.html(this.dataChange.joinTest)
+      if (this.dataChange.lateStatus === 1) {
+        this.lateStatusBtn1 = 'success'
+        this.lateStatusBtn = 'info'
+        this.lateStatus = 1
+        this.showDelay = false
+      } else {
+        this.lateStatusBtn1 = 'info'
+        this.lateStatusBtn = 'danger'
+        this.lateStatus = 2
+        this.showDelay = true
+      }
+      if (this.dataChange.configInfo !== '') {
+        this.configInBtn = 'success'
+        this.configInBtn1 = 'info'
+        this.confidgIn = 1
+        this.showApollo = true
+      } else {
+        this.configInBtn = 'info'
+        this.configInBtn1 = 'danger'
+        this.configIn = 2
+        this.showApollo = false
+      }
+      if (this.dataChange.dependentComponents !== '') {
+        this.dependentBtn = 'success'
+        this.dependentBtn1 = 'info'
+        this.dependent = 1
+        this.showRelyOn = true
+      } else {
+        this.dependentBtn = 'info'
+        this.dependentBtn1 = 'danger'
+        this.dependent = 2
+        this.showRelyOn = false
       }
       }
     },
     },
     getQueryData(ele) {
     getQueryData(ele) {
@@ -215,7 +212,7 @@ export default {
       launchTestUpdate(this.objData).then(res => {
       launchTestUpdate(this.objData).then(res => {
         if (res.code === 200) {
         if (res.code === 200) {
           this.$message({ type: 'success', message: '更新成功' })
           this.$message({ type: 'success', message: '更新成功' })
-          this.$router.go(-1)
+          this.$emit('fatherMethod', res.data)
         } else {
         } else {
           this.$message.error('更新失败')
           this.$message.error('更新失败')
         }
         }

+ 44 - 11
src/views/Platform/presentation/Templates/TestReport.vue

@@ -11,7 +11,7 @@
         <el-step style="font-size: 16pt; color: #333B4A;" title="发送报告" />
         <el-step style="font-size: 16pt; color: #333B4A;" title="发送报告" />
       </el-steps>
       </el-steps>
     </div>
     </div>
-    <div v-show="showOne" style="margin: 0 4% 2%;">
+    <div v-if="showOne" style="margin: 0 4% 2%;">
       <div style="margin: 0% 14%;  height: 440px;" class="Layout">
       <div style="margin: 0% 14%;  height: 440px;" class="Layout">
         <div style="margin-right:2%;">
         <div style="margin-right:2%;">
           <el-radio v-model="radio" class="_radio" label="1">客户端模版</el-radio>
           <el-radio v-model="radio" class="_radio" label="1">客户端模版</el-radio>
@@ -26,10 +26,10 @@
         <el-button size="small" type="primary" @click="NextStep()">下一步</el-button>
         <el-button size="small" type="primary" @click="NextStep()">下一步</el-button>
       </div>
       </div>
     </div>
     </div>
-    <div v-show="showTow">
+    <div v-if="showTow">
       <div class="descr" style=" margin-bottom: 2%; height: 440px; overflow:scroll; overflow-x: hidden">
       <div class="descr" style=" margin-bottom: 2%; height: 440px; overflow:scroll; overflow-x: hidden">
-        <Present v-if="Present1" ref="Present" @fatherMethod="fatherMethod" />
-        <presentation v-if="presentation1" ref="presentationRef" @fatherMethod="fatherMethod" />
+        <Present v-if="Present1" ref="Present" :clien-data="clienData" @fatherMethod="fatherMethod" />
+        <presentation v-if="presentation1" ref="presentationRef" :clien-data="clienData" @fatherMethod="fatherMethod" />
       </div>
       </div>
       <div align="center">
       <div align="center">
         <el-button size="small" type="primary" @click="PreviousStep()">上一步</el-button>
         <el-button size="small" type="primary" @click="PreviousStep()">上一步</el-button>
@@ -86,18 +86,50 @@ export default {
       showClientYL: false,
       showClientYL: false,
       active: 1,
       active: 1,
       radio: '3',
       radio: '3',
+      clienData: {},
+      newNum: '',
       preview: '',
       preview: '',
       src: 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
       src: 'https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg',
       dialogVisible1: false
       dialogVisible1: false
     }
     }
   },
   },
   methods: {
   methods: {
-    init() {
+    init(index, newData) {
+      console.log(newData, '提测tan窗')
       this.dialogVisible1 = true
       this.dialogVisible1 = true
-      this.showOne = true
-      this.showTow = false
-      this.showThree = false
-      this.active = 1
+      switch (index) {
+        case 1:
+          this.showOne = true
+          this.showTow = false
+          this.showThree = false
+          this.active = 1
+          break
+        case 2:
+          this.clienData = newData
+          this.showOne = false
+          this.showThree = false
+          this.showTow = true
+          this.active = 2
+          this.newNum = 2
+          if (newData.type === 1) {
+            this.radio = '1'
+            this.Present1 = true
+            this.presentation1 = false
+          }
+          if (newData.type === 2) {
+            this.radio = '2'
+            this.Present1 = false
+            this.presentation1 = true
+          }
+          break
+        case 3:
+          this.showOne = false
+          this.showTow = false
+          this.showThree = true
+          this.preview = newData
+          this.active = 3
+          break
+      }
     },
     },
     PreviousStep() {
     PreviousStep() {
       this.showTow = false
       this.showTow = false
@@ -107,13 +139,14 @@ export default {
     gou_out() {
     gou_out() {
       this.showThree = false
       this.showThree = false
       this.showTow = true
       this.showTow = true
+      this.newNum = 1
     },
     },
     created_out() {
     created_out() {
       if (this.radio === '2') { // 服务端
       if (this.radio === '2') { // 服务端
-        this.$refs.presentationRef.parentHandleclick(1)
+        this.$refs.presentationRef.parentHandleclick(this.newNum)
       }
       }
       if (this.radio === '1') { // 客户端
       if (this.radio === '1') { // 客户端
-        this.$refs.Present.parentHandleclick(1)
+        this.$refs.Present.parentHandleclick(this.newNum)
       }
       }
     },
     },
     NextStep() {
     NextStep() {

+ 35 - 31
src/views/Platform/presentation/presentationReport.vue

@@ -99,10 +99,16 @@
 <script>
 <script>
 import { launchTestUpdate, launchTestCreate } from '@/api/InterfaceReport'
 import { launchTestUpdate, launchTestCreate } from '@/api/InterfaceReport'
 import E from 'wangeditor'
 import E from 'wangeditor'
-import { launchTest } from '@/api/testPresentetion'
+// import { launchTest } from '@/api/testPresentetion'
 
 
 export default {
 export default {
   name: 'PresentationReport',
   name: 'PresentationReport',
+  props: {
+    clienData: {
+      type: Object,
+      required: true
+    }
+  },
   data() {
   data() {
     return {
     return {
       userInformation: localStorage.getItem('username'),
       userInformation: localStorage.getItem('username'),
@@ -166,36 +172,34 @@ export default {
   },
   },
   methods: {
   methods: {
     getRouterData() {
     getRouterData() {
-      if (this.$route.query.data) {
-        launchTest({ id: this.$route.query.id }).then((res) => {
-          this.fromDev = res.data
-          if (this.fromDev.lateReason !== '') {
-            this.lateStatusBtn1 = 'info'
-            this.lateStatusBtn = 'danger'
-            this.lateStatus = 2
-            this.showDelay = true
-          } else {
-            this.lateStatusBtn1 = 'success'
-            this.lateStatusBtn = 'info'
-            this.lateStatus = 1
-            this.showDelay = false
-          }
-          if (this.fromDev.safeInfo !== '') {
-            this.getInfoBtn1 = 'info'
-            this.getInfoBtn = 'danger'
-            this.lateStatus = 2
-            this.showData = true
-          } else {
-            this.getInfoBtn1 = 'success'
-            this.getInfoBtn = 'info'
-            this.lateStatus = 1
-            this.showData = false
-            this.$set(this.fromDev, 'safeInfo', '')
-          }
-          this.editorContent.txt.html(this.fromDev.joinTest)
-          this.DetailsOfProposal.txt.html(this.fromDev.moduleInfo)
-        })
+      // if (this.$route.query.data) {
+      //   launchTest({ id: this.$route.query.id }).then((res) => {
+      this.fromDev = this.clienData
+      if (this.fromDev.lateReason !== '') {
+        this.lateStatusBtn1 = 'info'
+        this.lateStatusBtn = 'danger'
+        this.lateStatus = 2
+        this.showDelay = true
+      } else {
+        this.lateStatusBtn1 = 'success'
+        this.lateStatusBtn = 'info'
+        this.lateStatus = 1
+        this.showDelay = false
+      }
+      if (this.fromDev.safeInfo !== '') {
+        this.getInfoBtn1 = 'info'
+        this.getInfoBtn = 'danger'
+        this.lateStatus = 2
+        this.showData = true
+      } else {
+        this.getInfoBtn1 = 'success'
+        this.getInfoBtn = 'info'
+        this.lateStatus = 1
+        this.showData = false
+        this.$set(this.fromDev, 'safeInfo', '')
       }
       }
+      this.editorContent.txt.html(this.fromDev.joinTest)
+      this.DetailsOfProposal.txt.html(this.fromDev.moduleInfo)
     },
     },
     getQueryData(ele) {
     getQueryData(ele) {
       this.fromDev = ele
       this.fromDev = ele
@@ -207,7 +211,7 @@ export default {
       launchTestUpdate(this.objData).then(res => {
       launchTestUpdate(this.objData).then(res => {
         if (res.code === 200) {
         if (res.code === 200) {
           this.$message({ type: 'success', message: '更新成功' })
           this.$message({ type: 'success', message: '更新成功' })
-          this.$router.go(-1)
+          this.$emit('fatherMethod', res.data)
         } else {
         } else {
           this.$message.error('更新失败')
           this.$message.error('更新失败')
         }
         }

+ 8 - 9
src/views/Platform/presentation/testPresentation.vue

@@ -325,14 +325,10 @@ export default {
       })
       })
     },
     },
     queryPresentation2(data) { // 提测编辑
     queryPresentation2(data) { // 提测编辑
-      switch (data.type) {
-        case 1:// 客户端
-          this.$router.push({ path: '/Platform/presentation/PresentReport', query: { data: data, taskId: data.taskId, projectId: data.projectId, id: data.id }})
-          break
-        case 2:// 服务端
-          this.$router.push({ path: '/Platform/presentation/presentationReport', query: { data: data, taskId: data.taskId, projectId: data.projectId, id: data.id }})
-          break
-      }
+      this.dialogVisible1 = true
+      this.$nextTick(() => {
+        this.$refs.TestReport.init(2, data)
+      })
     },
     },
     selectionReport1(e) {
     selectionReport1(e) {
       if (this.states !== '') {
       if (this.states !== '') {
@@ -526,7 +522,10 @@ export default {
           })
           })
           break
           break
         case 2:
         case 2:
-          this.$router.push({ path: '/Platform/presentation/acceptTheReport', query: { id: ele }})
+          this.dialogVisible1 = true
+          this.$nextTick(() => {
+            this.$refs.TestReport.init(3, ele)
+          })
           break
           break
       }
       }
     },
     },