Browse Source

评估模块流程调整

lizhenhao 2 years ago
parent
commit
87d88051ea

+ 45 - 3
src/views/modules/finance/invoice/InvoiceFormTask.vue

@@ -706,6 +706,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -816,11 +822,26 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
-        this.doSubmit('start', callback)
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.doSubmit('start', callback)
+            }
+          })
+        } else {
+          this.doSubmit('start', callback)
+        }
       },
-      async agreeForm (callback) {
-        await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+      agreeForm (callback) {
+        this.loading = true
+        this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -829,8 +850,10 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
@@ -840,6 +863,7 @@
       },
       // 表单提交
       async doSubmit (status, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -866,10 +890,12 @@
           this.inputForm.status = '2'
         }
         if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
+          this.loading = false
           this.$message.error('至少新增一条基本信息')
           throw new Error()
         } else {
           if (this.inputForm.financeInvoiceBaseDTOList.length === 0) {
+            this.loading = false
             this.$message.error('至少新增一条基本信息')
             throw new Error()
           }
@@ -878,6 +904,7 @@
           let i = this.inputForm.financeInvoiceBaseDTOList.length
           for (let j = 0; j < i; j++) {
             if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList[j].programName)) {
+              this.loading = false
               this.$message.error('第' + (j + 1) + '行的基本信息不能为空')
               throw new Error()
             }
@@ -887,16 +914,19 @@
           let acc = 0
           this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
             if (this.commonJS.isEmpty(item.number)) {
+              this.loading = false
               this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
               throw new Error()
             }
             if (this.commonJS.isEmpty(item.account)) {
+              this.loading = false
               this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
               throw new Error()
             }
             acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
           })
           if (acc !== this.inputForm.account) {
+            this.loading = false
             this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
             throw new Error()
           }
@@ -904,6 +934,7 @@
             this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
               if (index !== index2) {
                 if (item.number === item2.number) {
+                  this.loading = false
                   this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
                   throw new Error()
                 }
@@ -912,17 +943,20 @@
           })
           for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
             if (this.commonJS.isEmpty(item.number)) {
+              this.loading = false
               this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
               this.err = true
             }
             await this.financeInvoiceService.queryByNumber(item.number, item.id).then(({data}) => {
               if (data === true) {
+                this.loading = false
                 this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
                 this.err = data
               }
             })
           }
           if (this.err === true) {
+            this.loading = false
             this.err = ''
             throw new Error()
           }
@@ -939,11 +973,14 @@
             this.loading = true
             this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
             this.financeInvoiceService.saveForm(this.inputForm).then(({data}) => {
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
@@ -1184,6 +1221,7 @@
         }
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1191,6 +1229,7 @@
           if (type === 'reject' || type === 'reback') {
             this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -1209,6 +1248,7 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {status: this.inputForm.status, id: this.inputForm.id}
                   this.financeInvoiceService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -1217,12 +1257,14 @@
           } else if (type === 'hold') {
             this.financeInvoiceService.queryById(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.financeInvoiceService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 48 - 1
src/views/modules/finance/invoice/InvoiceFormTaskInvalid.vue

@@ -662,6 +662,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -769,11 +775,26 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
-        this.doSubmit('start', callback)
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && data.status !== '5' && data.status !== '7') { // 审核状态不是“发票申请审核完成”或“作废撤回”,就弹出提示
+              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.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -782,8 +803,10 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '8') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
@@ -793,6 +816,7 @@
       },
       // 表单提交
       async doSubmit (status, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -821,10 +845,12 @@
           this.inputForm.status = '6'
         }
         if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
+          this.loading = false
           this.$message.error('至少新增一条基本信息')
           return
         } else {
           if (this.inputForm.financeInvoiceBaseDTOList.length === 0) {
+            this.loading = false
             this.$message.error('至少新增一条基本信息')
             return
           }
@@ -833,16 +859,19 @@
           let acc = 0
           this.inputForm.financeInvoiceDetailDTOList.forEach((item, index) => {
             if (this.commonJS.isEmpty(item.number)) {
+              this.loading = false
               this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
               throw new Error()
             }
             if (this.commonJS.isEmpty(item.account)) {
+              this.loading = false
               this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
               throw new Error()
             }
             acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
           })
           if (acc !== this.inputForm.account) {
+            this.loading = false
             this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
             return
           }
@@ -850,6 +879,7 @@
             this.inputForm.financeInvoiceDetailDTOList.forEach((item2, index2) => {
               if (index !== index2) {
                 if (item.number === item2.number) {
+                  this.loading = false
                   this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
                   throw new Error()
                 }
@@ -858,21 +888,31 @@
           })
           for await (let [index, item] of this.inputForm.financeInvoiceDetailDTOList.entries()) {
             if (this.commonJS.isEmpty(item.number)) {
+              this.loading = false
               this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
               this.err = true
             }
             await this.financeInvoiceService.queryByNumber(item.number, item.id).then(({data}) => {
               if (data === true) {
+                this.loading = false
                 this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
                 this.err = data
               }
             })
           }
           if (this.err === true) {
+            this.loading = false
             this.err = ''
             return
           }
         }
+        if (status === 'start') {
+          if (this.commonJS.isEmpty(this.inputForm.financeInvoiceInvalidDTO.remarks)) {
+            this.loading = false
+            this.$message.warning('作废原因未填写')
+            throw new Error('作废原因未填写')
+          }
+        }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
@@ -883,6 +923,8 @@
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
@@ -1124,6 +1166,7 @@
         }
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1131,6 +1174,7 @@
           if (type === 'reject' || type === 'reback') {
             this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
               if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -1151,6 +1195,7 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {status: this.inputForm.status, id: this.inputForm.id}
                   this.financeInvoiceService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -1159,12 +1204,14 @@
           } else if (type === 'hold') {
             this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
               if (data.status !== '8') { // status的值不等于“驳回”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
                 // 终止
                 let param = {status: '5', id: this.inputForm.id}
                 this.financeInvoiceService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 114 - 0
src/views/modules/finance/invoice/InvoiceList.vue

@@ -244,12 +244,18 @@
             <template  slot-scope="scope">
               <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'" type="text"  size="small" @click="invoicePush(scope.row)">修改</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '2'" type="text"  size="small" @click="invoiceReback(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('finance:invoice:edit')&&scope.row.status === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
+
               <el-button v-if="hasPermission('finance:invoice:edit:detail')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"  size="small" @click="editDetail(scope.row.id)">修改发票明细</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:receivables')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"   size="small" @click="view(true, scope.row.id)">收款</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:is_receivables')&&scope.row.status === '5'&&scope.row.receivablesStatus !== '1'" type="text"   size="small" @click="isReceivables(scope.row)">确认收款</el-button>
               <el-button v-if="hasPermission('cw_finance:invoice:edit:is_receivables')&&scope.row.status === '5'&&scope.row.receivablesStatus === '1'" type="text"   size="small" @click="recallReceivables(scope.row)">撤回收款</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:invalid')&&scope.row.status === '5'||scope.row.status === '7'" type="text"  size="small" @click="invoiceInvalidPush(scope.row)">作废</el-button>
               <el-button v-if="hasPermission('finance:invoice:edit:invalid')&&scope.row.status === '6'" type="text"  size="small" @click="invoiceInvalidReBack(scope.row)">作废撤回</el-button>
+              <el-button v-if="scope.row.status==='6' && checkIsAuditInvalid(scope.row)" type="text"  size="small" @click="examineInvalid(scope.row)">作废审核</el-button>
+              <el-button v-if="hasPermission('finance:invoice:edit:invalid')&&scope.row.status === '8'" type="text"  size="small" @click="adjustInvalid(scope.row)">驳回调整</el-button>
+
               <el-button v-if="hasPermission('finance:invoice:edit')&&scope.row.status === '1'||scope.row.status === '3'" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
@@ -764,6 +770,114 @@
             this.refreshList()
           })
         })
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.financeInvoiceService.queryById(row.id).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.financeInvoiceService.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: '/finance/invoice/InvoiceList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      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
+      },
+      // 驳回后调整
+      adjustInvalid (row) {
+        this.financeInvoiceService.queryById(row.id).then(({data}) => {
+          if (data.status !== '8') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoInvalid(row)
+          }
+        })
+      },
+      // 审核
+      examineInvalid (row) {
+        this.financeInvoiceService.queryById(row.id).then(({data}) => {
+          if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoInvalid(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todoInvalid (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskIdInvalid
+        }).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: '/finance/invoice/InvoiceList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAuditInvalid (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsInvalid)) {
+          for (const userId of row.auditUserIdsInvalid) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
       }
     }
   }

+ 41 - 3
src/views/modules/program/registered/ProjectArchiveForm.vue

@@ -592,6 +592,16 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponentReport.changeLoading(newVal)
+          this.$refs.uploadComponentExplain.changeLoading(newVal)
+          this.$refs.uploadComponentDetail.changeLoading(newVal)
+          this.$refs.uploadComponentPapers.changeLoading(newVal)
+          this.$refs.uploadComponentOther.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -606,7 +616,6 @@
         this.keyWatch = keyWatch
       },
       init (method, id) {
-        console.log('isid', id)
         if (method === 'formReadOnly') {
           this.formReadOnly = true
         }
@@ -749,12 +758,14 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.programProjectListInfoService.findByIdArchive(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)
           }
         })
       },
@@ -762,11 +773,29 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.programProjectListInfoService.findByIdArchive(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && 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.doSubmit('start', callback)
       },
       async agreeForm (callback) {
+        this.loading = true
         await this.programProjectListInfoService.findByIdArchive(this.inputForm.id).then(({data}) => {
           if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -776,6 +805,7 @@
       },
       // 表单提交
       async doSubmit (status, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponentReport.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -822,11 +852,11 @@
           this.inputForm.auditDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
         }
         this.$refs['inputForm'].validate((valid) => {
-          console.log('')
           if (valid) {
             if (this.commonJS.isEmpty(this.inputForm.waystEvaluation) &&
               this.commonJS.isEmpty(this.inputForm.fixedAssetsEvaluation) &&
               this.commonJS.isEmpty(this.inputForm.netAssetsEvaluation)) {
+              this.loading = false
               this.$message.error('废旧物资评估值(万元)、固定资产评估值(万元)、净资产评估值,至少要填写一个!')
               throw new Error()
             }
@@ -837,15 +867,19 @@
             this.inputForm.papersFileList = this.$refs.uploadComponentPapers.getDataList()
             this.inputForm.otherFileList = this.$refs.uploadComponentOther.getDataList()
             this.programProjectListInfoService.saveFormArchive(this.inputForm).then(({data}) => {
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponentReport.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -869,6 +903,7 @@
         if (type === 'reject' || type === 'reback') {
           await this.programProjectListInfoService.findByIdArchive(this.inputForm.id).then(({data}) => {
             if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.loading = false
               this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               throw new Error()
             } else {
@@ -883,6 +918,7 @@
               if (type === 'reback' || type === 'reject') {
                 let param = {status: this.inputForm.status, id: this.inputForm.id}
                 this.programProjectListInfoService.updateStatusByArchiveId(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }
@@ -891,12 +927,14 @@
         } else if (type === 'hold') {
           this.programProjectListInfoService.findByIdArchive(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.programProjectListInfoService.updateStatusByArchiveId(param).then(() => {
+                this.loading = false
                 callback()
               })
             }

+ 358 - 0
src/views/modules/program/registered/ProjectList.vue

@@ -148,20 +148,43 @@
               <!--项目负责人修改-->
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' &&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id)) && (scope.row.archiveStatus === null ||scope.row.archiveStatus === undefined ||scope.row.archiveStatus === '' ||scope.row.archiveStatus === '0')" type="text" size="small" @click="edit(scope.row.id)">修改</el-button>
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '2'&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="registeredReback(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('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
+
               <el-button v-if="hasPermission('program:registered:del')&&(scope.row.status === '1' || scope.row.status === '3')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
               <!--管理员角色登记完成后可删除-->
               <el-button v-if="hasPermission('program:registered:del')&&scope.row.status === '5' && isAdmin" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
 
 <!--              <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' && commonJS.isEmpty(scope.row.reportNo) && scope.row.createBy === createName" type="text" size="small" @click="saveReportNo(scope.row.id)">生成报告号</el-button>-->
 
+              <!-- 一级校审  发起-->
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status === '5' &&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&(scope.row.status1 === '0'||scope.row.status1 === '1'||scope.row.status1 === '3')" type="text" size="small" @click="firstAuditPush(scope.row)">一级校审</el-button>
+              <!-- 一级校审  撤回-->
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status1 === '2' &&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="firstAuditReback(scope.row)">校审撤回</el-button>
+              <!-- 一级校审  审核-->
+              <el-button v-if="scope.row.status1==='2' && checkIsAuditFirst(scope.row)" type="text"  size="small" @click="examineFirst(scope.row)">一级校审审核</el-button>
+              <!-- 一级校审  被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status1 === '4'" type="text"  size="small" @click="adjustFirst(scope.row)">驳回调整</el-button>
 
+              <!-- 二级校审  发起-->
               <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status1 === '5'&&(scope.row.status2 === '0'||scope.row.status2 === '1'||scope.row.status2 === '3')" type="text" size="small" @click="secondAuditPush(scope.row)">二级校审</el-button>
+              <!-- 二级校审  撤回-->
               <el-button v-if="hasPermission('program:registered:edit')&&scope.row.status2 === '2'&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))" type="text" size="small" @click="secondAuditReback(scope.row)">校审撤回</el-button>
+              <!-- 二级校审  审核-->
+              <el-button v-if="scope.row.status2==='2' && checkIsAuditSecond(scope.row)" type="text"  size="small" @click="examineSecond(scope.row)">二级校审审核</el-button>
+              <!-- 二级校审  被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status2 === '4'" type="text"  size="small" @click="adjustSecond(scope.row)">驳回调整</el-button>
 
+              <!-- 三级校审  发起-->
               <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status2 === '5' &&(scope.row.status3 === '0'||scope.row.status3 === '1'||scope.row.status3 === '3')" type="text" size="small" @click="thirdAuditPush(scope.row)">三级校审</el-button>
+              <!-- 三级校审  撤回-->
               <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status3 === '2'" type="text" size="small" @click="thirdAuditReback(scope.row)">校审撤回</el-button>
+              <!-- 三级校审  审核-->
+              <el-button v-if="scope.row.status3==='2' && checkIsAuditThird(scope.row)" type="text"  size="small" @click="examineThird(scope.row)">三级校审审核</el-button>
+              <!-- 三级校审  被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status3 === '4'" type="text"  size="small" @click="adjustThird(scope.row)">驳回调整</el-button>
 
               <!--三神结束后,评估报告签发前进行资产评估项目(校对)-->
               <el-button v-if="hasPermission('program:registered:proo')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.status3 === '5'&&commonJS.isEmpty(scope.row.issuedStatus)" type="text" size="small" @click="proofread(scope.row.id)">校对</el-button>
@@ -169,11 +192,22 @@
               <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id)) &&scope.row.status3 === '5' && (scope.row.issuedStatus === null ||scope.row.issuedStatus === undefined ||scope.row.issuedStatus === '' ||scope.row.issuedStatus === '0' || scope.row.issuedStatus === '1' || scope.row.issuedStatus === '3')" type="text" size="small" @click="issued(scope.row)">签发</el-button>
               <!--报告签发撤回-->
               <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id)) && scope.row.issuedStatus === '2'" type="text" size="small" @click="issuedReback(scope.row)">签发撤回</el-button>
+              <!-- 报告签发  审核-->
+              <el-button v-if="scope.row.issuedStatus==='2' && checkIsAuditIssued(scope.row)" type="text"  size="small" @click="examineIssued(scope.row)">签发审核</el-button>
+              <!-- 报告签发  被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '4'" type="text"  size="small" @click="adjustIssued(scope.row)">驳回调整</el-button>
+
               <!--评估报告装订后的审核-->
               <el-button v-if="hasPermission('program:registered:browse')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '5'&&scope.row.archiveStatus === '0'" type="text" size="small" @click="browse(scope.row.id)">装订自校</el-button>
 
+              <!-- 项目归档-->
               <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.issuedStatus === '5' &&(scope.row.archiveStatus === '0'||scope.row.archiveStatus === '1'||scope.row.archiveStatus === '3')" type="text" size="small" @click="archivePush(scope.row)">项目归档</el-button>
+              <!-- 项目归档撤回-->
               <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.archiveStatus === '2'" type="text" size="small" @click="archiveReback(scope.row)">项目归档撤回</el-button>
+              <!-- 项目归档  审核-->
+              <el-button v-if="scope.row.archiveStatus==='2' && checkIsAuditArchive(scope.row)" type="text"  size="small" @click="examineArchive(scope.row)">归档审核</el-button>
+              <!-- 项目归档  被驳回后当前申请人重新调整-->
+              <el-button v-if="hasPermission('program:registered:edit')&&(scope.row.createBy === createName||haveProjectIds.includes(scope.row.id))&&scope.row.archiveStatus === '4'" type="text"  size="small" @click="adjustArchive(scope.row)">驳回调整</el-button>
 
               <!--一级校审ftl文件下载-->
 <!--              <el-button v-if="hasPermission('program:registered:edit')" type="text"  icon="el-icon-circle-check" size="small" @click="downloadFirstAuditTpl(scope.row)">一级校审下载</el-button>-->
@@ -1073,6 +1107,330 @@
             }
           })
         })
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.programProjectListInfoService.queryById(row.id).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.programProjectListInfoService.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: '/program/registered/ProjectList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      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
+      },
+      // 驳回后调整  一级校审
+      adjustFirst (row) {
+        this.programProjectListInfoService.findByIdAudit(row.auditId1).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoFirst(row)
+          }
+        })
+      },
+      // 审核  一级校审
+      examineFirst (row) {
+        this.programProjectListInfoService.findByIdAudit(row.auditId1).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoFirst(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转  一级校审
+      todoFirst (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskIdAudit1
+        }).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: '/program/registered/ProjectList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人  一级校审
+      checkIsAuditFirst (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIds1)) {
+          for (const userId of row.auditUserIds1) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
+      },
+      // 驳回后调整  二级校审
+      adjustSecond (row) {
+        this.programProjectListInfoService.findByIdAudit(row.auditId2).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoSecond(row)
+          }
+        })
+      },
+      // 审核  二级校审
+      examineSecond (row) {
+        this.programProjectListInfoService.findByIdAudit(row.auditId2).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoSecond(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转  二级校审
+      todoSecond (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskIdAudit2
+        }).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: '/program/registered/ProjectList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人  二级校审
+      checkIsAuditSecond (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIds2)) {
+          for (const userId of row.auditUserIds2) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
+      },
+      // 驳回后调整  三级校审
+      adjustThird (row) {
+        this.programProjectListInfoService.findByIdAudit(row.auditId3).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoThird(row)
+          }
+        })
+      },
+      // 审核  三级校审
+      examineThird (row) {
+        this.programProjectListInfoService.findByIdAudit(row.auditId3).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoThird(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转  三级校审
+      todoThird (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskIdAudit3
+        }).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: '/program/registered/ProjectList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人  三级校审
+      checkIsAuditThird (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIds3)) {
+          for (const userId of row.auditUserIds3) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
+      },
+      // 驳回后调整  签发
+      adjustIssued (row) {
+        this.proofreadIssuedService.findById(row.id).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoIssued(row)
+          }
+        })
+      },
+      // 审核  签发
+      examineIssued (row) {
+        this.proofreadIssuedService.findById(row.id).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoIssued(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转  签发
+      todoIssued (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskIdIssued
+        }).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: '/program/registered/ProjectList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人  签发
+      checkIsAuditIssued (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsIssued)) {
+          for (const userId of row.auditUserIdsIssued) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
+      },
+      // 驳回后调整  归档
+      adjustArchive (row) {
+        this.programProjectListInfoService.findByIdArchive(row.archiveId).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoArchive(row)
+          }
+        })
+      },
+      // 审核  归档
+      examineArchive (row) {
+        this.programProjectListInfoService.findByIdArchive(row.archiveId).then(({data}) => {
+          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoArchive(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转  归档
+      todoArchive (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskIdArchive
+        }).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: '/program/registered/ProjectList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人  归档
+      checkIsAuditArchive (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsArchive)) {
+          for (const userId of row.auditUserIdsArchive) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
       }
     }
   }

+ 37 - 1
src/views/modules/program/registered/ProjectThreeAuditForm.vue

@@ -209,6 +209,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -305,12 +311,14 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.programProjectListInfoService.findByIdAudit(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)
           }
         })
       },
@@ -318,11 +326,29 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.programProjectListInfoService.findByIdAudit(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && 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.doSubmit('start', callback)
       },
       async agreeForm (callback) {
+        this.loading = true
         await this.programProjectListInfoService.findByIdAudit(this.inputForm.id).then(({data}) => {
           if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -332,6 +358,7 @@
       },
       // 表单提交
       async doSubmit (status, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -381,15 +408,19 @@
             this.inputForm.workAttachmentDtoList = this.$refs.uploadComponent.getDataList()
             this.programProjectListInfoService.saveFormThree(this.inputForm).then(({data}) => {
               this.inputForm.assignee = this.inputForm.auditPeople
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -397,6 +428,7 @@
           if (type === 'reject' || type === 'reback') {
             this.programProjectListInfoService.findByIdAudit(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -431,7 +463,9 @@
                 }
                 if (type === 'reject' || type === 'reback') {
                   let param = {status: this.inputForm.status, id: this.inputForm.id}
+                  this.loading = true
                   this.programProjectListInfoService.updateStatusByAuditId(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -440,12 +474,14 @@
           } else if (type === 'hold') {
             this.programProjectListInfoService.findByIdAudit(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.programProjectListInfoService.updateStatusByAuditId(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 55 - 17
src/views/modules/program/registered/ProofreadIssuedForm.vue

@@ -229,7 +229,7 @@
         this.inputForm = this.recover(this.inputForm, data)
         this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
       })
-      this.getTypeList() // 获取业务类型数据
+      // this.getTypeList() // 获取业务类型数据
     },
     computed: {
       bus: {
@@ -254,6 +254,11 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+        }
       }
     },
     components: {
@@ -295,24 +300,27 @@
         this.inputForm.projectId = id
         this.visible = true
         this.loading = false
-        this.getTypeList()  // 获取业务类型数据
+        // this.getTypeList()  // 获取业务类型数据
         this.$nextTick(() => {
           this.loading = true
-          this.proofreadIssuedService.findById(this.inputForm.projectId).then(({data}) => {
-            if (!this.commonJS.isEmpty(data.id)) {
-              this.$refs.inputForm.resetFields()
-              this.inputForm = this.recover(this.inputForm, data)
-              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
-              this.chooseRow() // 选中行
-              this.loading = false
-            } else {
-              this.proofreadIssuedService.findProjectInfoById(this.inputForm.projectId).then(({data}) => {
+          this.programServiceTypeService.getList().then(({data}) => {
+            this.typeList = data
+            this.proofreadIssuedService.findById(this.inputForm.projectId).then(({data}) => {
+              if (!this.commonJS.isEmpty(data.id)) {
+                this.$refs.inputForm.resetFields()
                 this.inputForm = this.recover(this.inputForm, data)
                 this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
                 this.chooseRow() // 选中行
                 this.loading = false
-              })
-            }
+              } else {
+                this.proofreadIssuedService.findProjectInfoById(this.inputForm.projectId).then(({data}) => {
+                  this.inputForm = this.recover(this.inputForm, data)
+                  this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+                  this.chooseRow() // 选中行
+                  this.loading = false
+                })
+              }
+            })
           })
         })
       },
@@ -323,15 +331,33 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.proofreadIssuedService.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)
           }
         })
       },
+      startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.proofreadIssuedService.findById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && 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)
+        }
+      },
       saveForm (callback) {
         this.loading = true
         this.inputForm.status = '1'
@@ -342,23 +368,28 @@
           this.loading = false
         })
       },
-      startForm (callback) {
+      startFormTrue (callback) {
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
             this.loading = true
             this.inputForm.status = '2'
             this.proofreadIssuedService.save(this.inputForm).then(({data}) => {
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
       async agreeForm (callback) {
+        this.loading = true
         await this.proofreadIssuedService.findById(this.inputForm.id).then(({data}) => {
           if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -375,15 +406,19 @@
                 }).catch(() => {
                   this.loading = false
                 })
+              } else {
+                this.loading = false
               }
             })
           }
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (type === 'reject' || type === 'reback') {
           this.proofreadIssuedService.findById(this.inputForm.id).then(({data}) => {
             if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+              this.loading = false
               this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
               throw new Error()
             } else {
@@ -394,16 +429,17 @@
               if (type === 'reject') {
                 // 驳回
                 this.inputForm.status = '4'
-                this.proofreadIssuedService.updateStatus(this.inputForm)
+                // this.proofreadIssuedService.updateStatus(this.inputForm)
               }
               if (type === 'reback') {
                 // 撤回
                 this.inputForm.status = '3'
-                this.proofreadIssuedService.updateStatus(this.inputForm)
+                // this.proofreadIssuedService.updateStatus(this.inputForm)
               }
               if (type === 'reject' || type === 'reback') {
                 let param = {status: this.inputForm.status, id: this.inputForm.id}
                 this.proofreadIssuedService.updateStatus(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }
@@ -412,12 +448,14 @@
         } else if (type === 'hold') {
           this.proofreadIssuedService.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.proofreadIssuedService.updateStatus(param).then(() => {
+                this.loading = false
                 callback()
               })
             }

+ 38 - 1
src/views/modules/program/registered/RegisItemForm.vue

@@ -850,6 +850,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -992,12 +998,14 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.programProjectListInfoService.queryById(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)
           }
         })
       },
@@ -1005,6 +1013,22 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.programProjectListInfoService.queryById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && 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.doSubmit('start', callback)
       },
       agreeForm (callback) {
@@ -1012,6 +1036,7 @@
       },
       // 表单提交
       doSubmit (status, callback) {
+        this.loading = true
         if (!this.commonJS.isEmpty(this.inputForm.workBeginAndEndDate)) {
           this.inputForm.workBeginDate = this.inputForm.workBeginAndEndDate[0]
           this.inputForm.workEndDate = this.inputForm.workBeginAndEndDate[1]
@@ -1112,6 +1137,7 @@
         if (!this.commonJS.isEmpty(this.inputForm.clientList)) {
           this.inputForm.clientList.forEach(item => {
             if (this.commonJS.isEmpty(item.clientType)) {
+              this.loading = false
               this.$message.error('委托人和对接人中的人员类型不可以为空')
               throw new Error()
             }
@@ -1119,10 +1145,12 @@
             this.inputForm.links.push(item)
           })
         } else {
+          this.loading = false
           this.$message.error('至少填写一条委托人和对接人信息')
           return
         }
         if (this.commonJS.isEmpty(this.inputForm.members)) {
+          this.loading = false
           this.$message.error('至少填写一条项目组成员信息')
           return
         } else {
@@ -1174,6 +1202,7 @@
           })
           this.inputForm.members.forEach((item, index) => {
             if (this.commonJS.isEmpty(item.name)) {
+              this.loading = false
               this.$message.error('项目组成员姓名不允许为空')
               throw new Error('项目组成员姓名不允许为空')
             }
@@ -1189,15 +1218,19 @@
             console.log('this.inputForm.generateReportNumber', this.inputForm.generateReportNumber)
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
             this.programProjectListInfoService.saveForm(this.inputForm).then(({data}) => {
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1205,6 +1238,7 @@
           if (type === 'reject' || type === 'reback') {
             this.programProjectListInfoService.queryById(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -1223,6 +1257,7 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {status: this.inputForm.status, id: this.inputForm.id}
                   this.programProjectListInfoService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -1231,12 +1266,14 @@
           } else if (type === 'hold') {
             this.programProjectListInfoService.queryById(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.programProjectListInfoService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 56 - 0
src/views/modules/reimbursement/info/InfoList.vue

@@ -153,6 +153,8 @@
             <template  slot-scope="scope">
               <el-button v-if="hasPermission('reimbursement:info:edit')&& scope.row.createId === $store.state.user.id && (scope.row.type === '1' || scope.row.type === '3')" type="text"  size="small" @click="edit(scope.row)">修改</el-button>
               <el-button v-if="hasPermission('reimbursement:info:edit')&& scope.row.createId === $store.state.user.id && (scope.row.type === '2')" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
+              <el-button v-if="scope.row.type==='2' && checkIsAudit(scope.row)" type="text"  size="small" @click="examine(scope.row)">审核</el-button>
+              <el-button v-if="hasPermission('reimbursement:info:edit')&& scope.row.createId === $store.state.user.id && scope.row.type === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
               <el-button v-if="hasPermission('reimbursement:info:del')&& scope.row.createId === $store.state.user.id && (scope.row.type === '1')" type="text"  size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
@@ -512,6 +514,60 @@
             console.log(err.response)
           }
         })
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.reimbursementService.findById(row.id).then(({data}) => {
+          if (data.type !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.reimbursementService.findById(row.id).then(({data}) => {
+          if (data.type !== '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: '/reimbursement/info/InfoList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      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
       }
     }
   }

+ 36 - 2
src/views/modules/reimbursement/info/ReimbursementForm.vue

@@ -733,6 +733,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -804,12 +810,14 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
           if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
-            this.startForm(callback)
+            this.startFormTrue(callback)
           }
         })
       },
@@ -982,8 +990,24 @@
           this.loading = false
         })
       },
+      startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.type) && data.type !== '0' && data.type !== '1' && data.type !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error()
+            } else {
+              this.startFormTrue(callback)
+            }
+          })
+        } else {
+          this.startFormTrue(callback)
+        }
+      },
       // 送审
-      async startForm (callback) {
+      async startFormTrue (callback) {
         this.$refs['inputForm'].validate(async (valid) => {
           if (valid) {
             this.loading = true
@@ -1003,6 +1027,7 @@
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
             this.inputForm.type = '2'
             this.reimbursementService.save(this.inputForm).then(({data}) => {
+              this.inputForm.id = data.businessId
               this.inputForm.title = `${this.$store.state.user.name} 发起了 [${data.no}] - [评估-报销审批]`
               callback(data.businessTable, data.businessId, this.inputForm)
               this.$refs.inputForm.resetFields()
@@ -1011,13 +1036,17 @@
               this.$refs.inputForm.resetFields()
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
       // 通过
       async agreeForm (callback) {
+        this.loading = true
         await this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
           if (data.type !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -1052,6 +1081,7 @@
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1059,6 +1089,7 @@
           if (type === 'reject' || type === 'reback') {
             this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
               if (data.type !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -1073,6 +1104,7 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {type: this.inputForm.type, id: this.inputForm.id}
                   this.reimbursementService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -1081,12 +1113,14 @@
           } else if (type === 'hold') {
             this.reimbursementService.findById(this.inputForm.id).then(({data}) => {
               if (data.type !== '4') { // status的值不等于“驳回”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
                 // 终止
                 let param = {type: '1', id: this.inputForm.id}
                 this.reimbursementService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 36 - 2
src/views/modules/sys/workContract/WorkContractFileForm.vue

@@ -344,6 +344,12 @@
         },
         immediate: true,
         deep: false
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -484,8 +490,24 @@
         this.businessId = ''
         callback()
       },
-      // 送审
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.contractFileId)) {
+          this.workContractFileService.findById(this.inputForm.contractFileId).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.filedType) && data.filedType !== '0' && data.filedType !== '1' && data.filedType !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.startFormTrue(callback)
+            }
+          })
+        } else {
+          this.startFormTrue(callback)
+        }
+      },
+      // 送审
+      startFormTrue (callback) {
         let id = this.inputForm.id
         this.loading = true
         this.inputForm.workAttachmentList = this.$refs.uploadComponent.getDataList()
@@ -497,6 +519,7 @@
         this.inputForm.filedType = '2'
         this.inputForm.contractInfoId = id
         this.workContractFileService.save(this.inputForm).then(({data}) => {
+          this.inputForm.contractFileId = data.businessId
           callback(data.businessTable, data.businessId, this.inputForm)
           this.$refs.inputForm.resetFields()
           this.loading = false
@@ -504,21 +527,25 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.workContractFileService.findById(this.inputForm.contractFileId).then(({data}) => {
           if (data.filedType !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
-            this.startForm(callback)
+            this.startFormTrue(callback)
           }
         })
       },
       // 通过
       agreeForm (callback) {
+        this.loading = true
         this.$refs['inputForm2'].validate(async (valid) => {
           if (valid) {
             await this.workContractFileService.findById(this.inputForm.contractFileId).then(({data}) => {
               if (data.filedType !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -566,6 +593,8 @@
             //   this.loading = false
             //   this.businessId = ''
             // })
+          } else {
+            this.loading = false
           }
         })
       },
@@ -745,6 +774,7 @@
         // }
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -752,6 +782,7 @@
           if (type === 'reject' || type === 'reback') {
             this.workContractFileService.findById(this.inputForm.contractFileId).then(({data}) => {
               if (data.filedType !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -770,6 +801,7 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {filedType: this.inputForm.filedType, id: this.inputForm.id}
                   this.workContractFileService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -778,12 +810,14 @@
           } else if (type === 'hold') {
             this.workContractFileService.findById(this.inputForm.contractFileId).then(({data}) => {
               if (data.filedType !== '4') { // status的值不等于“驳回”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
                 // 终止
                 let param = {filedType: '1', id: this.inputForm.id}
                 this.workContractFileService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 38 - 2
src/views/modules/sys/workContract/WorkContractForm.vue

@@ -285,6 +285,12 @@
         },
         immediate: true,
         deep: false
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -392,8 +398,24 @@
           this.loading = false
         })
       },
-      // 送审
       startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.workContractService.findById(this.inputForm.id).then(({data}) => {
+            if (this.commonJS.isNotEmpty(data.status) && 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.$refs['inputForm'].validate(async (valid) => {
           if (valid) {
             this.loading = true
@@ -401,6 +423,7 @@
             this.inputForm.status = '2'
             this.inputForm.fees = this.inputForm.contractFees.join(',')
             await this.workContractService.save(this.inputForm).then(({data}) => {
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.$refs.inputForm.resetFields()
               this.loading = false
@@ -408,25 +431,31 @@
               this.$refs.inputForm.resetFields()
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.workContractService.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)
           }
         })
       },
       // 通过
       agreeForm (callback) {
+        this.loading = true
         this.$refs['inputForm'].validate(async (valid) => {
           if (valid) {
             await this.workContractService.findById(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -444,6 +473,8 @@
                 })
               }
             })
+          } else {
+            this.loading = false
           }
         })
       },
@@ -603,6 +634,7 @@
         }
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -610,6 +642,7 @@
           if (type === 'reject' || type === 'reback') {
             this.workContractService.findById(this.inputForm.id).then(({data}) => {
               if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -628,6 +661,7 @@
                 if (type === 'reject' || type === 'reback') {
                   let param = {status: this.inputForm.status, id: this.inputForm.id}
                   this.workContractService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                 }
@@ -636,12 +670,14 @@
           } else if (type === 'hold') {
             this.workContractService.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.workContractService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }

+ 120 - 2
src/views/modules/sys/workContract/WorkContractList.vue

@@ -122,12 +122,12 @@
                 <vxe-column width="100px" title="合同金额(元)" field="contractAmount"></vxe-column>
                 <vxe-column width="100px" title="创建人" field="createBy"></vxe-column>
                 <vxe-column width="150px" title="签订日期" field="contractDate"></vxe-column>
-                <vxe-column  width="120px" title="登记状态" field="status" >
+                <vxe-column  width="120px" title="登记状态" field="status" fixed="right" align="center">
                   <template slot-scope="scope">
                     <el-button  type="text" @click="detail(scope.row)" :type="$dictUtils.getDictLabel('approval_type_status', scope.row.status, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("approval_type", scope.row.status, '-')}} </el-button>
                   </template>
                 </vxe-column>
-                <vxe-column width="100px"  title="归档状态" field="filedType" >
+                <vxe-column width="100px"  title="归档状态" field="filedType" fixed="right" align="center">
                   <template slot-scope="scope">
                     <el-button  type="text" @click="detailFiled(scope.row)" :type="$dictUtils.getDictLabel('filed_type_status', scope.row.filedType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("filed_type", scope.row.filedType, '未归档')}} </el-button>
                   </template>
@@ -145,6 +145,11 @@
                       <el-button v-if="hasPermission('sys:workContract:edit') && scope.row.status === '5' && isAdmin" type="text" size="small" @click="editForm(scope.row.id)">修改</el-button>
                       <el-button v-if="hasPermission('sys:workContract:del') && (scope.row.status === '1' || scope.row.status === '3' )  && scope.row.createId === create" type="text" size="small" @click="del(scope.row.id)">删除</el-button>
                       <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'  && scope.row.createId === create" type="text" size="small" @click="reback(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('sys: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('sys:workContract:filed') && scope.row.status === '5' && scope.row.createId === create && (scope.row.filedType === '0' || scope.row.filedType === undefined)" type="text" size="small" @click="filed(scope.row.id)">归档</el-button>
                       <!--归档暂存修改-->
                       <el-button v-if="hasPermission('sys:workContract:filed') && scope.row.status === '5' && scope.row.createId === create && scope.row.filedType === '1'" type="text" size="small" @click="filed(scope.row.id)">修改</el-button>
@@ -152,6 +157,11 @@
                       <el-button v-if="hasPermission('sys:workContract:filed') && scope.row.status === '5' && scope.row.createId === create && (scope.row.filedType === '3')" type="text" size="small" @click="filedAndClose(scope.row)">修改</el-button>
                       <!--归档撤回-->
                       <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '5' && scope.row.filedType === '2'  && scope.row.createId === create" type="text"  size="small" @click="rebackFiled(scope.row)">撤回</el-button>
+      <!--              合同归档  审核-->
+                      <el-button v-if="scope.row.filedType==='2' && checkIsAuditFiled(scope.row)" type="text"  size="small" @click="examineFiled(scope.row)">归档审核</el-button>
+      <!--              合同归档  被驳回后当前申请人重新调整-->
+                      <el-button v-if="hasPermission('sys:workContract:edit')&&scope.row.createId === $store.state.user.id&&scope.row.filedType === '4'" type="text"  size="small" @click="adjustFiled(scope.row)">驳回调整</el-button>
+
                       <!--合同借用-->
 <!--                      <el-button v-if="hasPermission('sys:workContract:borrow') && scope.row.status === '5' && scope.row.filedType === '5' && (scope.row.borrowType === undefined || scope.row.borrowType === '0' || scope.row.borrowType === '1')" type="text" size="small" @click="borrow(scope.row.id)">借用</el-button>-->
 <!--                      &lt;!&ndash;借用撤回&ndash;&gt;-->
@@ -819,6 +829,114 @@
           this.updateStatusById(row, 'retureBorrow')
           this.refreshList()
         })
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.workContractService.findById(row.id).then(({data}) => {
+          if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.workContractService.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}) => {
+          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: '/sys/workContract/WorkContractList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      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
+      },
+      // 驳回后调整
+      adjustFiled (row) {
+        this.workContractFileService.findByContractInfoId(row.id).then(({data}) => {
+          if (data.filedType !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoFiled(row)
+          }
+        })
+      },
+      // 审核
+      examineFiled (row) {
+        this.workContractFileService.findByContractInfoId(row.id).then(({data}) => {
+          if (data.filedType !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todoFiled(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todoFiled (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.taskFiledId
+        }).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: '/sys/workContract/WorkContractList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAuditFiled (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsFiled)) {
+          for (const userId of row.auditUserIdsFiled) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
       }
     }
   }