Sfoglia il codice sorgente

报告文档增加校验,报告详情对比文件表格高度未铺满全屏修复

zhuhao 2 anni fa
parent
commit
2a56e335b1

+ 35 - 31
RMS-FrontEnd/src/views/report/components/File.vue

@@ -190,38 +190,42 @@ export default {
         this.$message.error('请选择文件')
         return false
       }
-      let formData = new FormData()
+      this.$refs.ruleForm.validate((valid) => { 
+        if (valid) { 
+          let formData = new FormData()
 
-      // formData.append('reportId', this.reportId)
-      // formData.append('name', this.ruleForm.name)
-      if (this.file) {
-        formData.append('files', this.file)
-      }
-      this.ruleForm.reportID = this.reportId
-      formData.append('jsons', JSON.stringify(this.ruleForm))
-      // formData.append('type', this.ruleForm.type)
-      this.btnLoading = true
-      if (this.ruleForm.id) {
-        // formData.append('id', this.ruleForm.id)
-        // formData.append('url', this.ruleForm.url)
-        this.$api.EditReportFileList(formData).then(response => {
-          this.$message.success('编辑成功')
-          this.btnLoading = false
-          this.getList()
-          this.cancel()
-        }).catch(error => {
-          this.btnLoading = false
-        })
-      } else {
-        this.$api.AddReportFileList(formData).then(response => {
-          this.$message.success('新增成功')
-          this.btnLoading = false
-          this.getList()
-          this.cancel()
-        }).catch(error => {
-          this.btnLoading = false
-        })
-      }
+          // formData.append('reportId', this.reportId)
+          // formData.append('name', this.ruleForm.name)
+          if (this.file) {
+            formData.append('files', this.file)
+          }
+          this.ruleForm.reportID = this.reportId
+          formData.append('jsons', JSON.stringify(this.ruleForm))
+          // formData.append('type', this.ruleForm.type)
+          this.btnLoading = true
+          if (this.ruleForm.id) {
+            // formData.append('id', this.ruleForm.id)
+            // formData.append('url', this.ruleForm.url)
+            this.$api.EditReportFileList(formData).then(response => {
+              this.$message.success('编辑成功')
+              this.btnLoading = false
+              this.getList()
+              this.cancel()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          } else {
+            this.$api.AddReportFileList(formData).then(response => {
+              this.$message.success('新增成功')
+              this.btnLoading = false
+              this.getList()
+              this.cancel()
+            }).catch(error => {
+              this.btnLoading = false
+            })
+          }
+        }
+      })
     },
     handleDelete(row) {
       this.$confirm('确认删除本条数据吗?', '提示', {

+ 3 - 0
RMS-FrontEnd/src/views/report/reportDetails/components/common/customTable.vue

@@ -131,6 +131,9 @@ export default {
       return JSON.stringify(this.formS)
     }
   },
+  updated(){
+    this.$refs.table.doLayout()
+  },
   methods: {
     //排序
     sortChange({ column, prop, order }) {

+ 34 - 30
RMS-FrontEnd/src/views/report/reportDetails/components/reportFile.vue

@@ -192,38 +192,42 @@ export default {
           this.$message.error('请选择文件')
           return false
         }
-        let formData = new FormData()
-  
+        
         // formData.append('reportId', this.reportId)
         // formData.append('name', this.ruleForm.name)
-        if (this.file) {
-          formData.append('files', this.file)
-        }
-        this.ruleForm.reportID = this.reportId
-        formData.append('jsons', JSON.stringify(this.ruleForm))
-        // formData.append('type', this.ruleForm.type)
-        this.btnLoading = true
-        if (this.ruleForm.id) {
-          // formData.append('id', this.ruleForm.id)
-          // formData.append('url', this.ruleForm.url)
-          this.$api.EditReportFileList(formData).then(response => {
-            this.$message.success('编辑成功')
-            this.btnLoading = false
-            this.getList()
-            this.cancel()
-          }).catch(error => {
-            this.btnLoading = false
-          })
-        } else {
-          this.$api.AddReportFileList(formData).then(response => {
-            this.$message.success('新增成功')
-            this.btnLoading = false
-            this.getList()
-            this.cancel()
-          }).catch(error => {
-            this.btnLoading = false
-          })
-        }
+        this.$refs.ruleForm.validate((valid) => { 
+          if (valid) {
+            let formData = new FormData()
+            if (this.file) {
+              formData.append('files', this.file)
+            }
+            this.ruleForm.reportID = this.reportId
+            formData.append('jsons', JSON.stringify(this.ruleForm))
+            // formData.append('type', this.ruleForm.type)
+            this.btnLoading = true
+            if (this.ruleForm.id) {
+              // formData.append('id', this.ruleForm.id)
+              // formData.append('url', this.ruleForm.url)
+              this.$api.EditReportFileList(formData).then(response => {
+                this.$message.success('编辑成功')
+                this.btnLoading = false
+                this.getList()
+                this.cancel()
+              }).catch(error => {
+                this.btnLoading = false
+              })
+            } else {
+              this.$api.AddReportFileList(formData).then(response => {
+                this.$message.success('新增成功')
+                this.btnLoading = false
+                this.getList()
+                this.cancel()
+              }).catch(error => {
+                this.btnLoading = false
+              })
+            }
+          }
+        })
       },
       handleDelete(row) {
         this.$confirm('确认删除本条数据吗?', '提示', {