Browse Source

签章流程修改

lizhenhao 2 years ago
parent
commit
c812f9cd81

+ 1 - 1
src/views/common/UpLoadComponentV2.1.vue

@@ -14,7 +14,7 @@
                :file-list="fileList">
       <el-button :loading="loading" type="primary" size="mini" :slot="auth==='view'&&uploadFlag===false?'tip':'trigger'" @click="clickHandel" :disabled="auth==='view'&&uploadFlag===false">点击上传</el-button>
     </el-upload>
-    <el-button v-if="showSign" type="info" size="mini" style="float: right;" @click="clickSign">签章</el-button>
+    <el-button v-if="showSign" :loading="loading" type="info" size="mini" style="float: right;" @click="clickSign">签章</el-button>
     <div style="height: calc(100% - 80px);margin-top: 10px">
       <!-- 进度条 -->
       <el-progress style="margin-left: 5em" v-if="progressFlag" :percentage="loadProgress"></el-progress>

+ 102 - 2
src/views/modules/cw/reportManagement/ReportManagementList.vue

@@ -190,9 +190,9 @@
                               scope.row.status === '5'&&
                               (scope.row.reviewStatus === '0' || scope.row.reviewStatus === '1' || scope.row.reviewStatus === '3'  || commonJS.isEmpty(scope.row.reviewStatus))"
                          type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
-              <!--              审核-->
+<!--              审核-->
               <el-button v-if="scope.row.reviewStatus==='2' && checkIsAuditReview(scope.row)" type="text"  size="small" @click="examineReview(scope.row)">审核</el-button>
-              <!--              被驳回后当前申请人重新调整-->
+<!--              被驳回后当前申请人重新调整-->
               <el-button v-if="hasPermission('cw:workContract:filed')&&scope.row.createById === $store.state.user.id&&scope.row.reviewStatus === '4'" type="text"  size="small" @click="adjustReview(scope.row)">驳回调整</el-button>
 <!--              复核流程-->
               <el-button v-if="hasPermission('cw:workContract:filed') && (scope.row.createById === $store.state.user.id||isAdmin||haveProjectIds.includes(scope.row.projectId)) && scope.row.status === '5'&& (scope.row.reviewStatus === '0' || scope.row.reviewStatus === '1' || scope.row.reviewStatus === '3' || scope.row.reviewStatus === undefined || scope.row.reviewStatus === '')" type="text" size="small" @click="pushF(scope.row)">复核</el-button>
@@ -214,6 +214,20 @@
                                 (scope.row.signatureType === '2' && scope.row.status2 === '5') ||
                                 (scope.row.signatureType === '3' && scope.row.status3 === '5')
                                 ) && isAdmin" type="text" size="small" @click="rebackSign(scope.row)">撤回签章</el-button>
+<!--              签章  审核-->
+              <el-button v-if="(
+                          (scope.row.signatureType === '1' && scope.row.status1 === '2') ||
+                          (scope.row.signatureType === '2' && scope.row.status2 === '2') ||
+                          (scope.row.signatureType === '3' && scope.row.status3 === '2')
+                          )
+                          && checkIsAuditSign(scope.row)" @click="examineSign(scope.row)"  type="text"  size="small" >审核</el-button>
+<!--              签章  被驳回后当前申请人重新调整-->
+              <el-button v-if="(
+                          (scope.row.signatureType === '1' && scope.row.status1 === '4') ||
+                          (scope.row.signatureType === '2' && scope.row.status2 === '4') ||
+                          (scope.row.signatureType === '3' && scope.row.status3 === '4')
+                          )
+                          && scope.row.createById === $store.state.user.id" @click="adjustSign(scope.row)"   type="text"  size="small">驳回调整</el-button>
 
             </template>
           </vxe-column>
@@ -988,6 +1002,92 @@
           }
         }
         return false
+      },
+      // 驳回后调整
+      adjustSign (row) {
+        this.projectReportService.queryById(row.id).then(({data}) => {
+          if (
+            (data.signatureType === '1' && data.status1 !== '4') ||
+            (data.signatureType === '2' && data.status2 !== '4') ||
+            (data.signatureType === '3' && data.status3 !== '4')
+          ) { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoSign(row)
+          }
+        })
+      },
+      // 审核
+      examineSign (row) {
+        this.projectReportService.queryById(row.id).then(({data}) => {
+          if (
+            (data.signatureType === '1' && data.status1 !== '2') ||
+            (data.signatureType === '2' && data.status2 !== '2') ||
+            (data.signatureType === '3' && data.status3 !== '2')
+          ) { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoSign(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todoSign (row) {
+        let cUser = false
+        let taskId = row.signatureType === '1' ? row.signTaskId1
+                    : row.signatureType === '2' ? row.signTaskId2
+                    : row.signatureType === '3' ? row.signTaskId3
+                    : 'error'
+        this.taskService.getTaskDefInfo({
+          taskId: taskId
+        }).then(({data}) => {
+          this.$router.push({
+            path: '/flowable/task/TaskForm',
+            query: {
+              ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId'),
+              isShow: false,
+              formReadOnly: true,
+              formTitle: `${data.taskName}`,
+              cUser: cUser,
+              title: `审批【${data.taskName || ''}】`,
+              routePath: '/cw/reportManagement/ReportManagementList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAuditSign (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (row.signatureType === '1') {
+          if (this.commonJS.isNotEmpty(row.auditUserIdsSign1)) {
+            for (const userId of row.auditUserIdsSign1) {
+              if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+                return true
+              }
+            }
+          }
+        }
+        if (row.signatureType === '2') {
+          if (this.commonJS.isNotEmpty(row.auditUserIdsSign2)) {
+            for (const userId of row.auditUserIdsSign2) {
+              if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+                return true
+              }
+            }
+          }
+        }
+        if (row.signatureType === '3') {
+          if (this.commonJS.isNotEmpty(row.auditUserIdsSign3)) {
+            for (const userId of row.auditUserIdsSign3) {
+              if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+                return true
+              }
+            }
+          }
+        }
+        return false
       }
     }
   }

+ 88 - 3
src/views/modules/cw/reportManagement/ReportManagementSignatureForm.vue

@@ -631,6 +631,13 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.archiveFile.changeLoading(newVal)
+          this.$refs.signatureFile.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -835,6 +842,45 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
+        this.loading = true
+        this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.signatureType === '1') {
+            this.projectReportService.findBySignatureId(this.inputForm.sid1).then(({data}) => {
+              if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+                this.loading = false
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              } else {
+                this.startFormTrue(callback)
+              }
+            })
+          }
+          if (data.signatureType === '2') {
+            this.projectReportService.findBySignatureId(this.inputForm.sid2).then(({data}) => {
+              if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+                this.loading = false
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              } else {
+                this.startFormTrue(callback)
+              }
+            })
+          }
+          if (data.signatureType === '3') {
+            this.projectReportService.findBySignatureId(this.inputForm.sid3).then(({data}) => {
+              if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+                this.loading = false
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              } else {
+                this.startFormTrue(callback)
+              }
+            })
+          }
+        })
+      },
+      startFormTrue (callback) {
+        this.loading = true
         console.log('form' + this.inputForm.signatureType)
         let title = `发起流程【会计-报告签章-电子公章】`
         let describe = `[会计-报告签章-电子公章`
@@ -880,11 +926,13 @@
               if (this.commonJS.isNotEmpty(list)) {
                 list.forEach((item, index) => {
                   if (this.commonJS.isEmpty(item.fileType)) {
+                    this.loading = false
                     this.$message.error('第' + (index + 1) + '条附件信息没有填写文件类型')
                     this.loading = false
                     throw new Error('第' + (index + 1) + '条附件信息没有填写文件类型')
                   }
                   if (this.commonJS.isEmpty(item.sealType)) {
+                    this.loading = false
                     this.$message.error('第' + (index + 1) + '条附件信息没有填写盖章类型')
                     this.loading = false
                     throw new Error('第' + (index + 1) + '条附件信息没有填写盖章类型')
@@ -909,43 +957,52 @@
                     this.loading = false
                     throw new Error('流程发起失败')
                   })
+                }).catch(() => {
+                  this.loading = false
+                  throw new Error('流程发起失败')
                 })
               })
             })
+          } else {
+            this.loading = false
           }
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         console.log(this.inputForm)
         this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
           console.log('info' + data)
           if (data.signatureType === '1') {
             this.projectReportService.findBySignatureId(this.inputForm.sid1).then(({data}) => {
               if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               } else {
-                this.startForm(callback)
+                this.startFormTrue(callback)
               }
             })
           }
           if (data.signatureType === '2') {
             this.projectReportService.findBySignatureId(this.inputForm.sid2).then(({data}) => {
               if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               } else {
-                this.startForm(callback)
+                this.startFormTrue(callback)
               }
             })
           }
           if (data.signatureType === '3') {
             this.projectReportService.findBySignatureId(this.inputForm.sid3).then(({data}) => {
               if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               } else {
-                this.startForm(callback)
+                this.startFormTrue(callback)
               }
             })
           }
@@ -986,11 +1043,14 @@
                           this.projectReportService.saveReportArchive(this.inputForm.id).then(() => {
                             let table = 'cw_project_report_signature'
                             callback(table, this.inputForm.sid1, this.inputForm)
+                            this.loading = false
                           })
                         })
                       })
                     })
                   })
+                } else {
+                  this.loading = false
                 }
               })
             }
@@ -1031,12 +1091,15 @@
                             this.projectReportService.saveReportArchive(this.inputForm.id).then(() => {
                               let table = 'cw_project_report_signature'
                               callback(table, this.inputForm.sid3, this.inputForm)
+                              this.loading = false
                             })
                           })
                         })
                       })
                     })
                   })
+                } else {
+                  this.loading = false
                 }
               })
             }
@@ -1078,17 +1141,20 @@
                             this.inputForm.assignee = this.inputForm.signatureAnnotator2
                             let table = 'cw_project_report_signature'
                             callback(table, this.inputForm.sid2, this.inputForm)
+                            this.loading = false
                           }
                           if (data.signatureType === '签字注师2审核') {
                             let param = {status: '7', id: this.inputForm.sid2}
                             this.projectReportService.updateSignatureStatusById(param)
                             callback()
+                            this.loading = false
                           }
                           if (data.signatureType === '签章管理人审核') {
                             let param = {status: '5', id: this.inputForm.sid2}
                             this.projectReportService.updateSignatureStatusById(param).then(() => {
                               this.projectReportService.saveReportArchive(this.inputForm.id).then(() => {
                                 callback()
+                                this.loading = false
                               })
                             })
                           }
@@ -1096,6 +1162,8 @@
                       })
                     })
                   })
+                } else {
+                  this.loading = false
                 }
               })
             }
@@ -1134,6 +1202,7 @@
                       if (this.inputForm.signatureType === '1') {
                         this.projectReportService.findBySignatureId(this.inputForm.sid1).then(({data}) => {
                           if (data.status !== this.inputForm.status1) { // status的值不等于“审核中”就弹出提示
+                            this.loading = false
                             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                             throw new Error()
                           } else {
@@ -1141,6 +1210,7 @@
                               // 驳回
                               let param = {status: '4', id: data.id}
                               this.projectReportService.updateSignatureStatusById(param).then(() => {
+                                this.loading = false
                                 callback()
                               })
                             }
@@ -1149,6 +1219,7 @@
                               let param = {status: '3', id: data.id}
                               this.projectReportService.updateSignatureStatusById(param).then(() => {
                                 callback()
+                                this.loading = false
                               })
                             }
                           }
@@ -1157,6 +1228,7 @@
                       if (this.inputForm.signatureType === '3') {
                         this.projectReportService.findBySignatureId(this.inputForm.sid3).then(({data}) => {
                           if (data.status !== this.inputForm.status3) { // status的值不等于“审核中”就弹出提示
+                            this.loading = false
                             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                             throw new Error()
                           } else {
@@ -1164,6 +1236,7 @@
                               // 驳回
                               let param = {status: '4', id: data.id}
                               this.projectReportService.updateSignatureStatusById(param).then(() => {
+                                this.loading = false
                                 callback()
                               })
                             }
@@ -1171,6 +1244,7 @@
                               // 撤回
                               let param = {status: '3', id: data.id}
                               this.projectReportService.updateSignatureStatusById(param).then(() => {
+                                this.loading = false
                                 callback()
                               })
                             }
@@ -1180,6 +1254,7 @@
                       if (this.inputForm.signatureType === '2') {
                         this.projectReportService.findBySignatureId(this.inputForm.sid2).then(({data}) => {
                           if (data.status !== this.inputForm.status2) { // status的值不等于“审核中”就弹出提示
+                            this.loading = false
                             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                             throw new Error()
                           } else {
@@ -1187,6 +1262,7 @@
                               // 驳回
                               let param = {status: '4', id: data.id}
                               this.projectReportService.updateSignatureStatusById(param).then(() => {
+                                this.loading = false
                                 callback()
                               })
                             }
@@ -1194,6 +1270,7 @@
                               // 撤回
                               let param = {status: '3', id: data.id}
                               this.projectReportService.updateSignatureStatusById(param).then(() => {
+                                this.loading = false
                                 callback()
                               })
                             }
@@ -1204,6 +1281,7 @@
                       if (this.inputForm.signatureType === '1') {
                         this.projectReportService.findBySignatureId(this.inputForm.sid1).then(({data}) => {
                           if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                            this.loading = false
                             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                             throw new Error()
                           } else {
@@ -1211,6 +1289,7 @@
                             let param = {status: '0', id: data.id}
                             this.projectReportService.updateSignatureStatusById(param).then(() => {
                               callback()
+                              this.loading = false
                             })
                           }
                         })
@@ -1218,6 +1297,7 @@
                       if (this.inputForm.signatureType === '3') {
                         this.projectReportService.findBySignatureId(this.inputForm.sid3).then(({data}) => {
                           if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                            this.loading = false
                             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                             throw new Error()
                           } else {
@@ -1225,6 +1305,7 @@
                             let param = {status: '0', id: data.id}
                             this.projectReportService.updateSignatureStatusById(param).then(() => {
                               callback()
+                              this.loading = false
                             })
                           }
                         })
@@ -1232,6 +1313,7 @@
                       if (this.inputForm.signatureType === '2') {
                         this.projectReportService.findBySignatureId(this.inputForm.sid2).then(({data}) => {
                           if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                            this.loading = false
                             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                             throw new Error()
                           } else {
@@ -1239,6 +1321,7 @@
                             let param = {status: '0', id: data.id}
                             this.projectReportService.updateSignatureStatusById(param).then(() => {
                               callback()
+                              this.loading = false
                             })
                           }
                         })
@@ -1247,6 +1330,8 @@
                   })
                 })
               })
+            } else {
+              this.loading = false
             }
           })
         }

+ 10 - 8
src/views/modules/cw/reportManagement/reportReview/ReportReviewForm.vue

@@ -743,14 +743,14 @@
               // this.$refs.inputForm.resetFields()
             })
           }
-        },
-        'loading': {
-          handler (newVal) {
-            this.$emit('changeLoading', newVal)
-            this.$refs.signatureFile.changeLoading(newVal)
-            this.$refs.archiveFile.changeLoading(newVal)
-            this.$refs.enclosure.changeLoading(newVal)
-          }
+        }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.signatureFile.changeLoading(newVal)
+          this.$refs.archiveFile.changeLoading(newVal)
+          this.$refs.enclosure.changeLoading(newVal)
         }
       }
     },
@@ -1044,6 +1044,8 @@
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },

+ 2 - 0
src/views/modules/cw/workClientInfo/WorkClientTaskForm.vue

@@ -1262,6 +1262,8 @@
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },

+ 4 - 0
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -829,6 +829,8 @@
                 this.$refs.inputForm.resetFields()
                 this.loading = false
               })
+            } else {
+              this.loading = false
             }
           })
         }
@@ -854,6 +856,8 @@
                 this.$refs.inputForm.resetFields()
                 this.loading = false
               })
+            } else {
+              this.loading = false
             }
           })
         }

+ 2 - 2
src/views/modules/flowable/task/TaskForm.vue

@@ -490,7 +490,7 @@
       // Process_1665458731435 评估-发票申请
       // Process_1669961023358 物资管理-采购申请
       // Process_1672729521837 物资管理-领用申请
-      // Process_1673332958749 财务-报告签章-实体章
+      // Process_1673332958749 财务-报告签章-实体章  Process_1673513595904
       // Process_1673514092406 物资管理-入库修改
       // Process_1673600899831 物资管理-合同
       // Process_1673924346231 中审-报销审批
@@ -524,7 +524,7 @@
           this.procDefId.includes('Process_1665458731435') ||
           this.procDefId.includes('Process_1669961023358') ||
           this.procDefId.includes('Process_1672729521837') ||
-          this.procDefId.includes('Process_1673332958749') ||
+          this.procDefId.includes('Process_1673513595904') ||
           this.procDefId.includes('Process_1673514092406') ||
           this.procDefId.includes('Process_1673600899831') ||
           this.procDefId.includes('Process_1673924346231') ||