Ver código fonte

报告复核修改

lizhenhao 2 anos atrás
pai
commit
d7aa17959c

+ 80 - 17
src/views/modules/cw/reportManagement/reportReview/ReportReviewForm.vue

@@ -65,7 +65,6 @@
                   :value="inputForm.officeId"
                   size="medium"
                   :accordion="true"
-                  :disabled="true"
                   @getValue="(value) => {inputForm.officeId=value}"/>
               </el-form-item>
             </el-col>
@@ -74,7 +73,7 @@
                             :rules="[
                    ]">
                 <!--                <el-input v-model="inputForm.signatureType" placeholder="请填写盖章类型" clearable></el-input>-->
-                <el-select :disabled="true" v-model="inputForm.signatureType" placeholder="请选择盖章类型" clearable style="width: 100%;">
+                <el-select  v-model="inputForm.signatureType" placeholder="请选择盖章类型" clearable style="width: 100%;">
                   <el-option
                     v-for="item in $dictUtils.getDictList('cw_signature_type')"
                     :key="item.value"
@@ -90,7 +89,7 @@
                             :rules="[
                    ]">
                 <!--                <el-input v-model="inputForm.signatureAnnotator1" placeholder="请填写签字注师1" clearable></el-input>-->
-                <UserSelect size="medium" ref="userSelect1" :disabled="true" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator1" @getValue='(value) => {changeSignatory1(value)}'></UserSelect>
+                <UserSelect size="medium" ref="userSelect1" :disabled="status === 'audit' || status === 'taskFormDetail'" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator1" @getValue='(value) => {changeSignatory1(value)}'></UserSelect>
               </el-form-item>
             </el-col>
 
@@ -99,7 +98,7 @@
                             :rules="[
                    ]">
                 <!--                <el-input v-model="inputForm.signatureAnnotator2" placeholder="请填写签字注师2" clearable></el-input>-->
-                <UserSelect size="medium" ref="userSelect2" :disabled="true" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator2" @getValue='(value) => {changeSignatory2(value)}'></UserSelect>
+                <UserSelect size="medium" ref="userSelect2" :disabled="status === 'audit' || status === 'taskFormDetail'" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator2" @getValue='(value) => {changeSignatory2(value)}'></UserSelect>
               </el-form-item>
             </el-col>
 
@@ -108,7 +107,7 @@
                             :rules="[
                    ]">
                 <!--                <el-input v-model="inputForm.signatureAnnotator1" placeholder="请填写签字注师1" clearable></el-input>-->
-                <UserSelect  size="medium" ref="userSelect1" :disabled="true" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator1" @getValue='(value) => {changeSignatory1(value)}'></UserSelect>
+                <UserSelect  size="medium" ref="userSelect1" :disabled="status === 'audit' || status === 'taskFormDetail'" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator1" @getValue='(value) => {changeSignatory1(value)}'></UserSelect>
               </el-form-item>
             </el-col>
 
@@ -117,14 +116,14 @@
                             :rules="[
                    ]">
                 <!--                <el-input v-model="inputForm.signatureAnnotator2" placeholder="请填写签字注师2" clearable></el-input>-->
-                <UserSelect  size="medium" ref="userSelect2" :disabled="true" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator2" @getValue='(value) => {changeSignatory2(value)}'></UserSelect>
+                <UserSelect  size="medium" ref="userSelect2" :disabled="status === 'audit' || status === 'taskFormDetail'" :readonly="true" :limit='1' :value="inputForm.signatureAnnotator2" @getValue='(value) => {changeSignatory2(value)}'></UserSelect>
               </el-form-item>
             </el-col>
             <el-col :span="12">
               <el-form-item label="审计意见类型" prop="opinionType"
                             :rules="[
                      ]">
-                <el-select :disabled="true" v-model="inputForm.opinionType" placeholder="请选择审计意见类型" style="width:100%;">
+                <el-select  v-model="inputForm.opinionType" placeholder="请选择审计意见类型" style="width:100%;">
                   <el-option
                     v-for="item in $dictUtils.getDictList('cw_opinion_type')"
                     :key="item.value"
@@ -138,7 +137,7 @@
               <el-form-item label="审计收费(税前、元)" prop="auditFees"
                             :rules="[
                    ]">
-                <el-input :disabled="true" v-model="inputForm.auditFees" placeholder="请填写审计收费(税前、元)" clearable
+                <el-input  v-model="inputForm.auditFees" placeholder="请填写审计收费(税前、元)" clearable
                           @keyup.native="inputForm.auditFees = twoDecimalPlaces(inputForm.auditFees)"
                 ></el-input>
               </el-form-item>
@@ -148,7 +147,7 @@
               <el-form-item label="报告实际制作人" prop="realCreate"
                             :rules="[
                    ]">
-                <UserSelect size="medium" :readonly="true" :disabled="true" :limit='1' :value="inputForm.realCreate" @getValue='(value) => {inputForm.realCreate = value}'></UserSelect>
+                <UserSelect size="medium" :readonly="true" :disabled="status === 'audit' || status === 'taskFormDetail'" :limit='1' :value="inputForm.realCreate" @getValue='(value) => {inputForm.realCreate = value}'></UserSelect>
               </el-form-item>
             </el-col>
             <el-col :span="12">
@@ -302,7 +301,6 @@
                             :rules="[
                    ]">
                 <el-date-picker
-                  :disabled="true"
                   placement="bottom-start"
                   value-format="yyyy-MM-dd"
                   v-model="inputForm.reportDate"
@@ -691,7 +689,9 @@
           servedUnitId: '',
           reviewStatus: '',
           taskName: '',
-          realHeaderName: ''
+          realHeaderName: '',
+          projectMasterId1: '',
+          projectMasterId2: ''
         },
         keyWatch: '',
         activeName: 'enclosure',
@@ -818,7 +818,9 @@
           servedUnitId: '',
           reviewStatus: '',
           taskName: '',
-          realHeaderName: ''
+          realHeaderName: '',
+          projectMasterId1: '',
+          projectMasterId2: ''
         }
         this.inputForm.id = id
         this.loading = false
@@ -941,8 +943,12 @@
           this.inputForm.detailFor1020.forEach(item => { this.inputForm.details.push(item) })
           this.inputForm.detailFor1030.forEach(item => { this.inputForm.details.push(item) })
           this.reportReviewService.save(this.inputForm).then(({data}) => {
-            callback(data.businessTable, data.businessId, this.inputForm)
-            this.loading = false
+            this.projectReportService.saveForm(this.inputForm).then((da) => {
+              callback(data.businessTable, data.businessId, this.inputForm)
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
           }).catch(() => {
             this.loading = false
           })
@@ -980,8 +986,12 @@
             this.inputForm.detailFor1020.forEach(item => { this.inputForm.details.push(item) })
             this.inputForm.detailFor1030.forEach(item => { this.inputForm.details.push(item) })
             this.reportReviewService.save(this.inputForm).then(({data}) => {
-              callback(data.businessTable, data.businessId, this.inputForm)
-              this.loading = false
+              this.projectReportService.saveForm(this.inputForm).then((da) => {
+                callback(data.businessTable, data.businessId, this.inputForm)
+                this.loading = false
+              }).catch(() => {
+                this.loading = false
+              })
             }).catch(() => {
               this.loading = false
             })
@@ -1070,7 +1080,9 @@
           reportSponsor: '',
           projectMasterName: '',
           tableKeyClient: '1',
-          realHeaderName: ''
+          realHeaderName: '',
+          projectMasterId1: '',
+          projectMasterId2: ''
         }
         this.reviewBys = []
         // this.$refs.uploadComponent.clearUpload()
@@ -1117,6 +1129,57 @@
       changeBusinessType () {
         // 切换业务类型的时候,审计业务类型清空
         this.inputForm.auditBusinessType = ''
+      },
+      changeSignatory1 (value) {
+        if (this.inputForm.signatureAnnotator2 === value && this.commonJS.isNotEmpty(value)) {
+          this.$message.warning('首次发行签字注师1和首次发行签字注师2不可以相同')
+          this.$nextTick(() => {
+            this.inputForm.signatureAnnotator1 = ''
+            this.$refs.userSelect1.changeNameValue('')
+            this.$refs.userSelect1.clearSelectData()
+            this.$forceUpdate()
+          })
+        } else if (this.commonJS.isNotEmpty(this.inputForm.signatureAnnotator2) &&
+          this.inputForm.projectMasterId1 !== this.inputForm.signatureAnnotator2 &&
+          this.inputForm.projectMasterId2 !== this.inputForm.signatureAnnotator2 &&
+          this.inputForm.projectMasterId1 !== value &&
+          this.inputForm.projectMasterId2 !== value &&
+          this.commonJS.isNotEmpty(value)) {
+          this.$message.warning('签字注师1和签字注师2至少有一个与项目经理相同')
+          this.$nextTick(() => {
+            this.inputForm.signatureAnnotator1 = ''
+            this.$refs.userSelect1.changeNameValue('')
+            this.$refs.userSelect1.clearSelectData()
+            this.$forceUpdate()
+          })
+        } else {
+          this.inputForm.signatureAnnotator1 = value
+        }
+      },
+      changeSignatory2 (value) {
+        if (this.inputForm.signatureAnnotator1 === value && this.commonJS.isNotEmpty(value)) {
+          this.$message.warning('首次发行签字注师1和首次发行签字注师2不可以相同')
+          this.$nextTick(() => {
+            this.inputForm.signatureAnnotator2 = ''
+            this.$refs.userSelect2.changeNameValue('')
+            this.$refs.userSelect2.clearSelectData()
+            this.$forceUpdate()
+          })
+        } else if (this.commonJS.isNotEmpty(this.inputForm.signatureAnnotator1) &&
+          this.inputForm.projectMasterId1 !== this.inputForm.signatureAnnotator1 &&
+          this.inputForm.projectMasterId2 !== this.inputForm.signatureAnnotator1 &&
+          this.inputForm.projectMasterId1 !== value && this.commonJS.isNotEmpty(value) &&
+          this.inputForm.projectMasterId2 !== value) {
+          this.$message.warning('签字注师1和签字注师2至少有一个与项目经理相同')
+          this.$nextTick(() => {
+            this.inputForm.signatureAnnotator2 = ''
+            this.$refs.userSelect2.changeNameValue('')
+            this.$refs.userSelect2.clearSelectData()
+            this.$forceUpdate()
+          })
+        } else {
+          this.inputForm.signatureAnnotator2 = value
+        }
       }
     }
   }