소스 검색

报告归档修改、禁止报告重复归档

lizhenhao 2 년 전
부모
커밋
cc873ff982

+ 7 - 0
src/api/cw/projectRecords/ProjectReportArchiveService.js

@@ -58,4 +58,11 @@ export default class ProjectReportArchiveService {
       responseType: 'blob'
     })
   }
+  findReportUse (reportNo) {
+    return request({
+      url: '/cwProjectReportArchive/findReportUse',
+      method: 'get',
+      params: {reportNo: reportNo}
+    })
+  }
 }

+ 26 - 12
src/views/modules/cw/projectReportArchive/ProjectReportArchiveForm.vue

@@ -189,7 +189,8 @@
             <el-col :span="12">
               <el-form-item label="报告文号" prop="reportNo"
                             :rules="[
-                                {required: true, message:'报告文号不能为空', trigger:'blur'}
+                                {required: true, message:'报告文号不能为空', trigger:'blur'},
+                                {required: true, message:'报告文号不能为空', trigger:'change'}
                    ]">
                 <el-input :readonly="true" v-model="inputForm.reportNo" placeholder="请填写报告文号" clearable>
                   <el-button slot="append" :disabled="formReadOnly" @click="openReportChoose" icon="el-icon-search"></el-button>
@@ -333,7 +334,8 @@
           signatureAnnotator1Name: '',
           signatureAnnotator2: '',
           signatureAnnotator2Name: '',
-          reportCreateName: ''
+          reportCreateName: '',
+          reportId: ''
         },
         keyWatch: '',
         activeName: 'files',
@@ -442,7 +444,8 @@
           signatureAnnotator1Name: '',
           signatureAnnotator2: '',
           signatureAnnotator2Name: '',
-          reportCreateName: ''
+          reportCreateName: '',
+          reportId: ''
         }
         this.inputForm.id = id
         this.loading = false
@@ -644,7 +647,8 @@
           signatureAnnotator1Name: '',
           signatureAnnotator2: '',
           signatureAnnotator2Name: '',
-          reportCreateName: ''
+          reportCreateName: '',
+          reportId: ''
         }
         this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
@@ -704,14 +708,24 @@
       },
       // 审计报告选择结果获取
       getReport (row) {
-        this.inputForm.reportDate = row.reportDate
-        this.inputForm.reportNo = row.reportNo
-        this.inputForm.signatureAnnotator1 = row.signatureAnnotator1
-        this.inputForm.signatureAnnotator1Name = row.signatureAnnotator1Name
-        this.inputForm.signatureAnnotator2 = row.signatureAnnotator2
-        this.inputForm.signatureAnnotator2Name = row.signatureAnnotator2Name
-        // this.inputForm.createBy = row.createBy
-        this.inputForm.reportCreateName = row.createName
+        if (this.commonJS.isNotEmpty(row)) {
+          if (this.commonJS.isNotEmpty(row.reportId)) {
+            this.projectReportArchiveService.findReportUse(row.reportId).then(({data}) => {
+              if (data === false) {
+                this.inputForm.reportDate = row.reportDate
+                this.inputForm.reportNo = row.reportNo
+                this.inputForm.signatureAnnotator1 = row.signatureAnnotator1
+                this.inputForm.signatureAnnotator1Name = row.signatureAnnotator1Name
+                this.inputForm.signatureAnnotator2 = row.signatureAnnotator2
+                this.inputForm.signatureAnnotator2Name = row.signatureAnnotator2Name
+                this.inputForm.reportCreateName = row.createName
+                this.inputForm.reportId = row.reportId
+              } else {
+                this.$message.error('此报告正在归档中或已归档,请重新选择')
+              }
+            })
+          }
+        }
       }
     }
   }

+ 26 - 12
src/views/modules/cw/projectReportArchive/ProjectReportArchiveTaskForm.vue

@@ -180,7 +180,8 @@
               <el-col :span="12">
                 <el-form-item label="报告文号" prop="reportNo"
                               :rules="[
-                                {required: true, message:'报告文号不能为空', trigger:'blur'}
+                                {required: true, message:'报告文号不能为空', trigger:'blur'},
+                                {required: true, message:'报告文号不能为空', trigger:'change'}
                    ]">
                   <el-input :readonly="true" v-model="inputForm.reportNo" placeholder="请填写报告文号" clearable>
                     <el-button slot="append" :disabled="formReadOnly" @click="openReportChoose" icon="el-icon-search"></el-button>
@@ -319,7 +320,8 @@
           signatureAnnotator1Name: '',
           signatureAnnotator2: '',
           signatureAnnotator2Name: '',
-          reportCreateName: ''
+          reportCreateName: '',
+          reportId: ''
         },
         keyWatch: '',
         activeName: 'files',
@@ -420,7 +422,8 @@
           signatureAnnotator1Name: '',
           signatureAnnotator2: '',
           signatureAnnotator2Name: '',
-          reportCreateName: ''
+          reportCreateName: '',
+          reportId: ''
         }
         this.inputForm.id = id
         this.loading = false
@@ -655,7 +658,8 @@
           signatureAnnotator1Name: '',
           signatureAnnotator2: '',
           signatureAnnotator2Name: '',
-          reportCreateName: ''
+          reportCreateName: '',
+          reportId: ''
         }
         this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()
@@ -714,14 +718,24 @@
       },
       // 审计报告选择结果获取
       getReport (row) {
-        this.inputForm.reportDate = row.reportDate
-        this.inputForm.reportNo = row.reportNo
-        this.inputForm.signatureAnnotator1 = row.signatureAnnotator1
-        this.inputForm.signatureAnnotator1Name = row.signatureAnnotator1Name
-        this.inputForm.signatureAnnotator2 = row.signatureAnnotator2
-        this.inputForm.signatureAnnotator2Name = row.signatureAnnotator2Name
-        // this.inputForm.createBy = row.createBy
-        this.inputForm.reportCreateName = row.createName
+        if (this.commonJS.isNotEmpty(row)) {
+          if (this.commonJS.isNotEmpty(row.reportId)) {
+            this.projectReportArchiveService.findReportUse(row.reportId).then(({data}) => {
+              if (data === false) {
+                this.inputForm.reportDate = row.reportDate
+                this.inputForm.reportNo = row.reportNo
+                this.inputForm.signatureAnnotator1 = row.signatureAnnotator1
+                this.inputForm.signatureAnnotator1Name = row.signatureAnnotator1Name
+                this.inputForm.signatureAnnotator2 = row.signatureAnnotator2
+                this.inputForm.signatureAnnotator2Name = row.signatureAnnotator2Name
+                this.inputForm.reportCreateName = row.createName
+                this.inputForm.reportId = row.reportId
+              } else {
+                this.$message.error('此报告正在归档中或已归档,请重新选择')
+              }
+            })
+          }
+        }
       }
     }
   }

+ 12 - 2
src/views/modules/cw/projectReportArchive/ReportChooseByProjectCom.vue

@@ -110,8 +110,18 @@
           this.$message.error('请选择一条数据')
           return
         }
-        this.close()
-        this.$emit('getReport', row)
+        if (this.commonJS.isNotEmpty(row)) {
+          if (this.commonJS.isNotEmpty(row.reportId)) {
+            this.projectReportArchiveService.findReportUse(row.reportId).then(({data}) => {
+              if (data === false) {
+                this.close()
+                this.$emit('getReport', row)
+              } else {
+                this.$message.error('此报告正在归档中或已归档,请重新选择')
+              }
+            })
+          }
+        }
       },
       list () {
         this.loading = true