Преглед изворни кода

客户、合同、报告流程修改

lizhenhao пре 2 година
родитељ
комит
4720a2e0f2

+ 59 - 1
src/views/modules/cw/reportManagement/ReportManagementList.vue

@@ -190,7 +190,10 @@
                               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>
               <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 === '2'" type="text" size="small" @click="rebackF(scope.row)">撤回复核申请</el-button>
@@ -211,6 +214,7 @@
                                 (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>
+
             </template>
           </vxe-column>
         </vxe-table>
@@ -930,6 +934,60 @@
             this.$message.error('签章已撤回')
           })
         })
+      },
+      // 驳回后调整
+      adjustReview (row) {
+        this.projectReportService.queryById(row.id).then(({data}) => {
+          if (data.reviewStatus !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoReview(row)
+          }
+        })
+      },
+      // 审核
+      examineReview (row) {
+        this.projectReportService.queryById(row.id).then(({data}) => {
+          if (data.reviewStatus !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoReview(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todoReview (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.revTaskId
+        }).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'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAuditReview (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsRev)) {
+          for (const userId of row.auditUserIdsRev) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
       }
     }
   }

+ 31 - 1
src/views/modules/cw/reportManagement/reportReview/ReportReviewForm.vue

@@ -743,6 +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)
+          }
         }
       }
     },
@@ -926,11 +934,26 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
-        this.doSubmit('start', callback)
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.reviewStatus) && data.reviewStatus !== '0' && data.reviewStatus !== '1' && data.reviewStatus !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.doSubmit('start', callback)
+            }
+          })
+        } else {
+          this.doSubmit('start', callback)
+        }
       },
       async agreeForm (callback) {
+        this.loading = true
         await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
           if (data.reviewStatus !== '2') { // 审核状态不是“待审核”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -939,8 +962,10 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
           if (data.reviewStatus !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
@@ -1023,9 +1048,11 @@
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (type === 'reject' || type === 'reback') {
           await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
             if (data.reviewStatus !== '2') { // status的值不等于“审核中”就弹出提示
+              this.loading = false
               this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               throw new Error()
             } else {
@@ -1055,6 +1082,7 @@
                   details: this.inputForm.details
                 }
                 this.reportReviewService.updateReviewStatysByReportId(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }
@@ -1068,6 +1096,7 @@
         } else if (type === 'hold') {
           this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
             if (data.reviewStatus !== '4') { // status的值不等于“驳回”就弹出提示
+              this.loading = false
               this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               throw new Error()
             } else {
@@ -1075,6 +1104,7 @@
               let param = {reviewStatus: '1', id: this.inputForm.id}
               this.reportReviewService.updateReviewStatysByReportId(param).then(() => {
                 callback()
+                this.loading = false
               })
             }
           })

+ 0 - 3
src/views/modules/cw/workClientInfo/WorkClientAddForm.vue

@@ -1069,9 +1069,6 @@
         if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
           this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
             this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
-              console.log(123456789)
-              console.log(uscCode)
-              console.log(this.inputForm.uscCode)
               if (data.use === 'false' || uscCode.data.uscCode === this.inputForm.uscCode) {
                 this.uscCodeMessage = ''
                 this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {

+ 58 - 0
src/views/modules/cw/workClientInfo/WorkClientList.vue

@@ -172,6 +172,10 @@
               <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.updateUser === $store.state.user.id&&(scope.row.status==='0'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
 <!--              其他人修改-->
               <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.updateUser !== $store.state.user.id&&(scope.row.status==='0'||scope.row.status==='5')" type="text"  size="small" @click="push(scope.row)">申请修改</el-button>
+<!--              审核-->
+              <el-button v-if="scope.row.status==='2' && checkIsAudit(scope.row)" type="text"  size="small" @click="examine(scope.row)">审核</el-button>
+<!--              被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.requestUserId === $store.state.user.id&&scope.row.status === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
 <!--              当前申请人撤回-->
               <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.requestUserId === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
 <!--              当前申请人撤回后->申请修改-->
@@ -557,6 +561,60 @@
             console.log(err.response)
           }
         })
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.workClientService.queryById(row.id).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.workClientService.queryById(row.id).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todo (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.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/workClientInfo/WorkClientList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAudit (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIds)) {
+          for (const userId of row.auditUserIds) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
       }
     }
   }

+ 53 - 16
src/views/modules/cw/workClientInfo/WorkClientTaskForm.vue

@@ -894,6 +894,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -1055,11 +1061,12 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
+        this.loading = true
         // 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
         if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
           this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
             this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
-              if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
+              if (data.use === 'false' || uscCode.data.uscCode === this.inputForm.uscCode) {
                 this.uscCodeMessage = ''
                 this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
                   this.workClientService.queryNameById(this.inputForm.id).then((name) => {
@@ -1068,12 +1075,14 @@
                       this.nameMessage = ''
                     } else {
                       this.nameMessage = '该客户已存在'
+                      this.loading = false
                       throw new Error()
                     }
                   })
                 })
               } else {
                 this.uscCodeMessage = '该客户已存在'
+                this.loading = false
                 throw new Error()
               }
             })
@@ -1085,6 +1094,7 @@
                 this.startFormTrue(callback)
                 this.nameMessage = ''
               } else {
+                this.loading = false
                 this.nameMessage = '该客户已存在'
                 throw new Error()
               }
@@ -1093,28 +1103,39 @@
         }
       },
       startFormTrue (callback) {
-        if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
-          this.$message.error('“开票信息”中至少有一条数据')
-          throw new Error('“开票信息”中至少有一条数据')
-        } else {
-          if (this.commonJS.isEmpty(this.inputForm.updateRequestId)) {
-            this.workClientService.pushUpdate(this.inputForm.id).then(({data}) => {
-              this.inputForm.updateRequestId = data.id
-              this.doSubmit('start', callback)
-            })
+        this.loading = true
+        this.workClientService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '0' && data.status !== '1' && data.status !== '3' && data.status !== '5') { // 审核状态不是“未发起”或“暂存”或“撤回”或“已完成”,就弹出提示
+            this.loading = false
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
-            this.workClientService.rebackPushUpdate(this.inputForm.id).then(() => {
-              this.doSubmit('start', callback)
-            })
+            if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
+              this.loading = false
+              this.$message.error('“开票信息”中至少有一条数据')
+              throw new Error('“开票信息”中至少有一条数据')
+            } else {
+              if (this.commonJS.isEmpty(this.inputForm.updateRequestId)) {
+                this.workClientService.pushUpdate(this.inputForm.id).then(({data}) => {
+                  this.inputForm.updateRequestId = data.id
+                  this.doSubmit('start', callback)
+                })
+              } else {
+                this.workClientService.rebackPushUpdate(this.inputForm.id).then(() => {
+                  this.doSubmit('start', callback)
+                })
+              }
+            }
           }
-        }
+        })
       },
       reapplyForm (callback) {
+        this.loading = true
         // 如果uscCode是空的或者uscCode的数据不存在,再执行保存方法
         if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
           this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
             this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
-              if (data.use === 'false' || uscCode.data === this.inputForm.uscCode) {
+              if (data.use === 'false' || uscCode.data.uscCode === this.inputForm.uscCode) {
                 this.uscCodeMessage = ''
                 this.workClientService.queryNameIsUse(this.inputForm.name).then((client) => {
                   this.workClientService.queryNameById(this.inputForm.id).then((name) => {
@@ -1122,12 +1143,14 @@
                       this.reapplyFormTrue(callback)
                       this.nameMessage = ''
                     } else {
+                      this.loading = false
                       this.nameMessage = '该客户已存在'
                       throw new Error()
                     }
                   })
                 })
               } else {
+                this.loading = false
                 this.uscCodeMessage = '该客户已存在'
                 throw new Error()
               }
@@ -1140,6 +1163,7 @@
                 this.reapplyFormTrue(callback)
                 this.nameMessage = ''
               } else {
+                this.loading = false
                 this.nameMessage = '该客户已存在'
                 throw new Error()
               }
@@ -1148,12 +1172,15 @@
         }
       },
       reapplyFormTrue (callback) {
+        this.loading = true
         this.workClientService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
             if (this.commonJS.isEmpty(this.inputForm.cwWorkClientBillingDTOList)) {
+              this.loading = false
               this.$message.error('“开票信息”中至少有一条数据')
               throw new Error('“开票信息”中至少有一条数据')
             } else {
@@ -1163,8 +1190,10 @@
         })
       },
       async agreeForm (callback) {
+        this.loading = true
         await this.workClientService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '2') { // 审核状态不是“待审核”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
@@ -1227,6 +1256,7 @@
               if (status === 'reapply') {
                 this.workClientService.reapplyUpdate(data.businessId)
               }
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
@@ -1236,6 +1266,7 @@
         })
       },
       updateStatusById (type, callback) {
+        this.loading = true
         if (this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1243,6 +1274,7 @@
           if (type === 'reject' || type === 'reback') {
             this.workClientService.queryById(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -1252,6 +1284,7 @@
                   let param = {status: '4', id: this.inputForm.id}
                   this.workClientService.updateStatusById(param).then(() => {
                     this.workClientService.rejectUpdate(this.inputForm.id)
+                    this.loading = false
                     callback()
                   })
                 }
@@ -1260,6 +1293,7 @@
                   let param = {status: '3', id: this.inputForm.id}
                   this.workClientService.updateStatusById(param).then(() => {
                     this.workClientService.rebackUpdate(this.inputForm.id)
+                    this.loading = false
                     callback()
                   })
                 }
@@ -1268,12 +1302,14 @@
           } else if (type === 'hold') {
             this.workClientService.queryById(this.inputForm.id).then(({data}) => {
               if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
                 // 终止
                 this.workClientService.stopUpdate(this.inputForm.id).then(() => {
                   callback()
+                  this.loading = false
                 })
               }
             })
@@ -1359,6 +1395,7 @@
         this.$refs.inputForm.resetFields()
         this.uscCodeMessage = ''
         this.nameMessage = ''
+        this.loading = false
       },
       tabHandleClick (event) {
         this.tableKeyBilling = Math.random()
@@ -1682,7 +1719,7 @@
         if (this.commonJS.isNotEmpty(this.inputForm.uscCode)) {
           this.workClientService.queryUscCodeIsUse(this.inputForm.uscCode).then(({data}) => {
             this.workClientService.queryUscCodeById(this.inputForm.id).then((uscCode) => {
-              if (data.use !== 'false' && this.commonJS.isNotEmpty(data.use) && this.commonJS.isNotEmpty(data.id) && this.inputForm.uscCode !== uscCode.data) {
+              if (data.use !== 'false' && this.commonJS.isNotEmpty(data.use) && this.commonJS.isNotEmpty(data.id) && this.inputForm.uscCode !== uscCode.data.uscCode) {
                 this.uscCodeMessage = '该客户已存在'
                 if (data.isUpdate === 'false') {
                   this.$message.error('该客户信息已存在并且数据正在修改中')

+ 45 - 1
src/views/modules/cw/workContract/ContractFilePaperForm.vue

@@ -514,6 +514,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadFile.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -762,11 +768,43 @@
         }
       },
       reapplyForm (callback) {
-        this.startForm(callback)
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.filedPaperType) && data.filedPaperType !== '4') { // // 审核状态不是“驳回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.startFormTrue(callback)
+            }
+          })
+        } else {
+          this.startFormTrue(callback)
+        }
       },
       // 送审
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.filedPaperType) && data.filedPaperType !== '0' && data.filedPaperType !== '1' && data.filedPaperType !== '3') { // // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.startFormTrue(callback)
+            }
+          })
+        } else {
+          this.startFormTrue(callback)
+        }
+      },
+      // 送审
+      startFormTrue (callback) {
+        this.loading = true
         if (this.commonJS.isEmpty(this.inputForm.actualContractAmount)) {
+          this.loading = false
           this.$message.error('请填写合同实际金额')
           throw new Error('请填写合同实际金额')
         } else if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadFile.checkProgress()) {
@@ -789,6 +827,7 @@
 
           this.contractFilePaperService.save(this.inputForm).then(({data}) => {
             // console.log('data', data)
+            this.inputForm.id = data.businessId
             callback(data.businessTable, data.businessId, this.inputForm)
             this.$refs.inputForm.resetFields()
             this.loading = false
@@ -804,6 +843,7 @@
       },
       // 通过
       agreeForm (callback) {
+        this.loading = true
         if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadFile.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -973,6 +1013,7 @@
         this.visable = false
       },
       updateStatusById (type, callback) {
+        this.loading = true
         if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadFile.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -988,6 +1029,7 @@
             this.inputForm.filedPaperType = '4'
             // this.contractFileService.updateStatusById(this.inputForm)
             this.contractFilePaperService.updateStatusById(this.inputForm).then(() => {
+              this.loading = false
               callback()
             })
           }
@@ -995,6 +1037,7 @@
             this.inputForm.filedPaperType = '3'
             // this.contractFileService.updateStatusById(this.inputForm)
             this.contractFilePaperService.updateStatusById(this.inputForm).then(() => {
+              this.loading = false
               callback()
             })
           }
@@ -1003,6 +1046,7 @@
             this.inputForm.filedPaperType = '1'
             // this.contractFileService.updateStatusById(this.inputForm)
             this.contractFilePaperService.updateStatusById(this.inputForm).then(() => {
+              this.loading = false
               callback()
             })
           }

+ 117 - 1
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -167,7 +167,10 @@
               <el-button v-if="hasPermission('cw:workContract:edit') && scope.row.status !== '2' && scope.row.status !== '4' && scope.row.status !== '5' && scope.row.createId === $store.state.user.id" type="text" size="small" @click="edit(scope.row)">修改</el-button>
               <el-button v-if="hasPermission('cw:workContract:edit') && scope.row.status === '5' && isAdmin && (scope.row.filedPaperType === '0' || scope.row.filedPaperType === '1' || scope.row.filedPaperType === '3')" type="text" size="small" @click="editForm(scope.row.id)">修改</el-button>
               <!--<el-button v-else-if="hasPermission('cw:workContract:edit') && scope.row.status === '5' && scope.row.createId === $store.state.user.id && (scope.row.filedPaperType === '0' || scope.row.filedPaperType === '1' || scope.row.filedPaperType === '3' || commonJS.isEmpty(scope.row.filedPaperType))" type="text" size="small" @click="editForm(scope.row.id)">修改</el-button>-->
-
+              <!--              审核-->
+              <el-button v-if="scope.row.status==='2' && checkIsAudit(scope.row)" type="text"  size="small" @click="examine(scope.row)">审核</el-button>
+              <!--              被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('cw:workContract:edit')&&scope.row.createId === $store.state.user.id&&scope.row.status === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
               <!--              <el-button v-if="hasPermission('cw:workContract:edit') && scope.row.status === '5' && scope.row.filedType === '5' && scope.row.filedPaperType === '5' && isAdmin" type="text" size="small" @click="editForm(scope.row.id)">修改</el-button>-->
               <el-button v-if="hasPermission('cw:workContract:del') && (scope.row.status === '1' || scope.row.status === '3')  && scope.row.createId === $store.state.user.id" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
               <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '2' && scope.row.createId === $store.state.user.id" type="text" size="small" @click="reback(scope.row)">撤回</el-button>
@@ -192,6 +195,10 @@
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5'  && scope.row.createId === $store.state.user.id && (scope.row.filedPaperType === '3')" type="text" size="small" @click="paperFiledAndClose(scope.row.id)">纸质归档</el-button>
               <!--纸质归档撤回-->
               <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '5'  && scope.row.filedPaperType === '2'" type="text"  size="small" @click="rebackPaperFiled(scope.row)">撤回纸质归档</el-button>
+              <!--              审核-->
+              <el-button v-if="scope.row.filedPaperType === '2' && checkIsAuditFiledPaper(scope.row)" type="text"  size="small" @click="examineFiledPaper(scope.row)">审核</el-button>
+              <!--              被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('cw:workContract:edit')&&scope.row.createId === $store.state.user.id&&scope.row.filedPaperType === '4'" type="text"  size="small" @click="adjustFiledPaper(scope.row)">驳回调整</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -869,6 +876,115 @@
             }
           })
         }
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.contractInfoService.findById(row.id).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.contractInfoService.findById(row.id).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todo (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskId
+        }).then(({data}) => {
+          console.log(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/workContract/ContractRegistration'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAudit (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIds)) {
+          for (const userId of row.auditUserIds) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
+      },
+      // 驳回后调整
+      adjustFiledPaper (row) {
+        this.contractInfoService.findById(row.id).then(({data}) => {
+          if (data.filedPaperType !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoFiledPaper(row)
+          }
+        })
+      },
+      // 审核
+      examineFiledPaper (row) {
+        this.contractInfoService.findById(row.id).then(({data}) => {
+          if (data.filedPaperType !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoFiledPaper(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todoFiledPaper (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.filePaperTaskId
+        }).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/workContract/ContractRegistration'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAuditFiledPaper (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsFP)) {
+          for (const userId of row.auditUserIdsFP) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
       }
     }
   }

+ 35 - 1
src/views/modules/cw/workContract/ContractRegistrationForm.vue

@@ -499,6 +499,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -782,7 +788,25 @@
       },
       // 送审
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.contractInfoService.findById(this.inputForm.id).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)
+            }
+          })
+        } else {
+          this.startFormTrue(callback)
+        }
+      },
+      startFormTrue (callback) {
+        this.loading = true
         if (this.commonJS.isEmpty(this.inputForm.cwWorkClientContactDTOList)) {
+          this.loading = false
           this.$message.error('“参与签约方”中至少有一条数据')
           throw new Error('“参与签约方”中至少有一条数据')
         } else if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadComponent.checkProgress()) {
@@ -797,6 +821,7 @@
               this.inputForm.fees = this.inputForm.contractFees.join(',')
               await this.contractInfoService.save(this.inputForm).then(({data}) => {
                 // this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
+                this.inputForm.id = data.businessId
                 callback(data.businessTable, data.businessId, this.inputForm)
                 this.$refs.inputForm.resetFields()
                 this.loading = false
@@ -810,6 +835,7 @@
       },
       // 通过
       agreeForm (callback) {
+        this.loading = true
         if (/* this.$refs.archiveFile.checkProgress() || */ this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -990,6 +1016,7 @@
       //   }
       // },
       async updateStatusById (type, callback) {
+        this.loading = true
         console.log('进入会计-合同登记 updateStatusById 方法')
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
@@ -998,6 +1025,7 @@
           if (type === 'reject' || type === 'reback') {
             this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -1016,20 +1044,24 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {status: this.inputForm.status, id: this.inputForm.id}
                   this.contractInfoService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
               }
             })
           } else if (type === 'hold') {
+            this.loading = true
             this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
               if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
                 // 终止
                 let param = {status: '1', id: this.inputForm.id}
                 this.contractInfoService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }
@@ -1038,12 +1070,14 @@
         }
       },
       reapplyForm (callback) {
+        this.loading = true
         this.contractInfoService.findById(this.inputForm.id).then(({data}) => {
           if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
-            this.startForm(callback)
+            this.startFormTrue(callback)
           }
         })
       },