Selaa lähdekoodia

优化报告页面更新时没有表单验证

qinzhipeng_v 5 vuotta sitten
vanhempi
sitoutus
c0a1d2cbe0

+ 31 - 25
src/views/Platform/presentation/Acceptance.vue

@@ -477,32 +477,38 @@ export default {
     },
     // 更新准出报告
     getQueryData(ele, vel) {
-      this.ClientData = ele
-      typeof (this.editorElem) === 'string' ? this.ClientData.projectBackground = this.editorElem : ''
-      typeof (this.editorElems) === 'string' ? this.ClientData.moduleInfo = this.editorElems : ''
-      typeof (this.editorFrom) === 'string' ? this.ClientData.functionInfo = this.editorFrom : ''
-      typeof (this.editorF) === 'string' ? this.ClientData.onlineRisk = this.editorF : ''
-      typeof (this.editorEle) === 'string' ? this.ClientData.rqtInfo = this.editorEle : ''
-      typeof (this.editorEl) === 'string' ? this.ClientData.fctInfo = this.editorEl : ''
-      typeof (this.editorSix) === 'string' ? this.ClientData.pftInfo = this.editorSix : ''
-      typeof (this.editorEight) === 'string' ? this.ClientData.safeResultInfo = this.editorEight : ''
-      typeof (this.editorNine) === 'string' ? this.ClientData.moniterResultInfo = this.editorNine : ''
-      this.ClientData.fctResult = this.fctResult
-      this.ClientData.rqtResult = this.rqtResult
-      this.ClientData.pftResult = this.pftResult
-      this.ClientData.safeResult = this.safeResult
-      this.ClientData.moniterResult = this.moniterResult
-      this.ClientData.status = this.status
-      this.ClientData.id === undefined ? this.ClientData.id = this.accpId : ''
-      this.ClientData.taskLateStatus = this.taskLateStatus
-      this.userData = { id: '', ename: this.userInformation, name: this.userNames }
-      this.objData = { projectTestReport: this.ClientData, user: this.userData }
-      projectTestReportUpdate(this.objData).then(res => {
-        if (res.code === 200) {
-          this.$message({ type: 'success', message: '更新成功' })
-          this.$emit('QuasiReport', res.data)
+      this.$refs['ClientData'].validate((valid) => {
+        if (valid) {
+          this.ClientData = ele
+          typeof (this.editorElem) === 'string' ? this.ClientData.projectBackground = this.editorElem : ''
+          typeof (this.editorElems) === 'string' ? this.ClientData.moduleInfo = this.editorElems : ''
+          typeof (this.editorFrom) === 'string' ? this.ClientData.functionInfo = this.editorFrom : ''
+          typeof (this.editorF) === 'string' ? this.ClientData.onlineRisk = this.editorF : ''
+          typeof (this.editorEle) === 'string' ? this.ClientData.rqtInfo = this.editorEle : ''
+          typeof (this.editorEl) === 'string' ? this.ClientData.fctInfo = this.editorEl : ''
+          typeof (this.editorSix) === 'string' ? this.ClientData.pftInfo = this.editorSix : ''
+          typeof (this.editorEight) === 'string' ? this.ClientData.safeResultInfo = this.editorEight : ''
+          typeof (this.editorNine) === 'string' ? this.ClientData.moniterResultInfo = this.editorNine : ''
+          this.ClientData.fctResult = this.fctResult
+          this.ClientData.rqtResult = this.rqtResult
+          this.ClientData.pftResult = this.pftResult
+          this.ClientData.safeResult = this.safeResult
+          this.ClientData.moniterResult = this.moniterResult
+          this.ClientData.status = this.status
+          this.ClientData.id === undefined ? this.ClientData.id = this.accpId : ''
+          this.ClientData.taskLateStatus = this.taskLateStatus
+          this.userData = { id: '', ename: this.userInformation, name: this.userNames }
+          this.objData = { projectTestReport: this.ClientData, user: this.userData }
+          projectTestReportUpdate(this.objData).then(res => {
+            if (res.code === 200) {
+              this.$message({ type: 'success', message: '更新成功' })
+              this.$emit('QuasiReport', res.data)
+            } else {
+              this.$message.error('更新失败')
+            }
+          })
         } else {
-          this.$message.error('更新失败')
+          return false
         }
       })
     },

+ 24 - 18
src/views/Platform/presentation/ClientAcceptance.vue

@@ -361,25 +361,31 @@ export default {
       })
     },
     getQueryData(ele, vel) {
-      this.ClientData = ele
-      typeof (this.editorElem) === 'string' ? this.ClientData.projectBackground = this.editorElem : ''
-      typeof (this.editorElems) === 'string' ? this.ClientData.fctInfo = this.editorElems : ''
-      typeof (this.editorFrom) === 'string' ? this.ClientData.sctInfo = this.editorFrom : ''
-      typeof (this.editorFro) === 'string' ? this.ClientData.acceptanceResultInfo = this.editorFro : ''
-      this.ClientData.pftResult = this.pftResult
-      this.ClientData.sctResult = this.sctResult
-      this.ClientData.acceptanceResult = this.acceptanceResult
-      this.ClientData.status = this.status
-      this.ClientData.id === undefined ? this.ClientData.id = this.clienId : ''
-      this.ClientData.taskLateStatus = this.taskLateStatus
-      this.userData = { id: '', ename: this.userInformation, name: this.userNames }
-      this.objData = { projectTestReport: this.ClientData, user: this.userData }
-      projectTestReportUpdate(this.objData).then(res => {
-        if (res.code === 200) {
-          this.$message({ type: 'success', message: '更新成功' })
-          this.$emit('QuasiReport', res.data)
+      this.$refs['ClientData'].validate((valid) => {
+        if (valid) {
+          this.ClientData = ele
+          typeof (this.editorElem) === 'string' ? this.ClientData.projectBackground = this.editorElem : ''
+          typeof (this.editorElems) === 'string' ? this.ClientData.fctInfo = this.editorElems : ''
+          typeof (this.editorFrom) === 'string' ? this.ClientData.sctInfo = this.editorFrom : ''
+          typeof (this.editorFro) === 'string' ? this.ClientData.acceptanceResultInfo = this.editorFro : ''
+          this.ClientData.pftResult = this.pftResult
+          this.ClientData.sctResult = this.sctResult
+          this.ClientData.acceptanceResult = this.acceptanceResult
+          this.ClientData.status = this.status
+          this.ClientData.id === undefined ? this.ClientData.id = this.clienId : ''
+          this.ClientData.taskLateStatus = this.taskLateStatus
+          this.userData = { id: '', ename: this.userInformation, name: this.userNames }
+          this.objData = { projectTestReport: this.ClientData, user: this.userData }
+          projectTestReportUpdate(this.objData).then(res => {
+            if (res.code === 200) {
+              this.$message({ type: 'success', message: '更新成功' })
+              this.$emit('QuasiReport', res.data)
+            } else {
+              this.$message.error('更新失败')
+            }
+          })
         } else {
-          this.$message.error('更新失败')
+          return false
         }
       })
     },

+ 17 - 11
src/views/Platform/presentation/PresentReport.vue

@@ -220,18 +220,24 @@ export default {
       }
     },
     getQueryData(ele) {
-      this.dataChange = ele
-      this.dataChange.lateStatus = this.lateStatus
-      this.dataChange.id === undefined ? this.dataChange.id = this.clien : ''
-      typeof (this.DetailsOfProposal) === 'string' ? this.dataChange.joinTest = this.DetailsOfProposal : ''
-      this.userData = { ename: this.userInformation, name: this.userNames }
-      this.objData = { launchTestInfo: this.dataChange, user: this.userData }
-      launchTestUpdate(this.objData).then(res => {
-        if (res.code === 200) {
-          this.$message({ type: 'success', message: '更新成功' })
-          this.$emit('fatherMethod', res.data)
+      this.$refs['dataChange'].validate((valid) => {
+        if (valid) {
+          this.dataChange = ele
+          this.dataChange.lateStatus = this.lateStatus
+          this.dataChange.id === undefined ? this.dataChange.id = this.clien : ''
+          typeof (this.DetailsOfProposal) === 'string' ? this.dataChange.joinTest = this.DetailsOfProposal : ''
+          this.userData = { ename: this.userInformation, name: this.userNames }
+          this.objData = { launchTestInfo: this.dataChange, user: this.userData }
+          launchTestUpdate(this.objData).then(res => {
+            if (res.code === 200) {
+              this.$message({ type: 'success', message: '更新成功' })
+              this.$emit('fatherMethod', res.data)
+            } else {
+              this.$message.error('更新失败')
+            }
+          })
         } else {
-          this.$message.error('更新失败')
+          return false
         }
       })
     },

+ 18 - 12
src/views/Platform/presentation/presentationReport.vue

@@ -206,19 +206,25 @@ export default {
       }
     },
     getQueryData(ele) {
-      this.fromDev = ele
-      typeof (this.editorContent) === 'string' ? this.fromDev.joinTest = this.editorContent : ''
-      typeof (this.DetailsOfProposal) === 'string' ? this.fromDev.moduleInfo = this.DetailsOfProposal : ''
-      this.fromDev.lateStatus = this.lateStatus
-      this.fromDev.id === undefined ? this.fromDev.id = this.clien : ''
-      this.userData = { id: '', ename: this.userInformation, name: this.userNames }
-      this.objData = { launchTestInfo: this.fromDev, user: this.userData }
-      launchTestUpdate(this.objData).then(res => {
-        if (res.code === 200) {
-          this.$message({ type: 'success', message: '更新成功' })
-          this.$emit('fatherMethod', res.data)
+      this.$refs['fromDev'].validate((valid) => {
+        if (valid) {
+          this.fromDev = ele
+          typeof (this.editorContent) === 'string' ? this.fromDev.joinTest = this.editorContent : ''
+          typeof (this.DetailsOfProposal) === 'string' ? this.fromDev.moduleInfo = this.DetailsOfProposal : ''
+          this.fromDev.lateStatus = this.lateStatus
+          this.fromDev.id === undefined ? this.fromDev.id = this.clien : ''
+          this.userData = { id: '', ename: this.userInformation, name: this.userNames }
+          this.objData = { launchTestInfo: this.fromDev, user: this.userData }
+          launchTestUpdate(this.objData).then(res => {
+            if (res.code === 200) {
+              this.$message({ type: 'success', message: '更新成功' })
+              this.$emit('fatherMethod', res.data)
+            } else {
+              this.$message.error('更新失败')
+            }
+          })
         } else {
-          this.$message.error('更新失败')
+          return false
         }
       })
     },