Преглед на файлове

cw报销发票流程调整

lizhenhao преди 2 години
родител
ревизия
f1980de3dd

+ 43 - 1
src/views/modules/cw/invoice/InvoiceFormTask.vue

@@ -723,6 +723,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -840,11 +846,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 (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) {
+        this.loading = true
         await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
           if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -853,8 +874,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 {
@@ -864,6 +887,7 @@
       },
       // 表单提交
       async doSubmit (status, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -890,10 +914,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()
           }
@@ -902,6 +928,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()
             }
@@ -911,16 +938,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()
           }
@@ -928,6 +958,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()
                 }
@@ -936,17 +967,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()
           }
@@ -966,11 +1000,14 @@
               if (status === 'start' || status === 'reapply') {
                 this.inputForm.title = `${this.$store.state.user.name} 发起了 ${data.no} [财务-发票申请]`
               }
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
@@ -1211,6 +1248,7 @@
         }
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1218,6 +1256,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 {
@@ -1236,6 +1275,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()
                   })
                 }
@@ -1244,12 +1284,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()
                 })
               }

+ 40 - 4
src/views/modules/cw/invoice/InvoiceFormTaskInvalid.vue

@@ -663,6 +663,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -778,21 +784,34 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
-        this.doSubmit('start', callback)
+        this.loading = true
+        this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '5') { // status的值不等于“审批完成”(发票作废只有发票申请通过后才可以发起),就弹出提示
+            this.loading = false
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } 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 !== '6') { // status的值不等于“审核中”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-            throw new Error()
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
             this.doSubmit('agree', callback)
           }
         })
       },
       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 {
@@ -802,6 +821,7 @@
       },
       // 表单提交
       async doSubmit (status, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -841,10 +861,12 @@
           throw new Error('请填写作废原因')
         }
         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
           }
@@ -853,16 +875,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
           }
@@ -870,6 +895,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()
                 }
@@ -878,17 +904,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 = ''
             return
           }
@@ -903,6 +932,8 @@
             }).catch(() => {
               this.loading = false
             })
+          } else {
+            this.loading = false
           }
         })
       },
@@ -1144,6 +1175,7 @@
         }
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -1151,6 +1183,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 {
@@ -1171,6 +1204,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()
                   })
                 }
@@ -1179,12 +1213,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()
                 })
               }

+ 116 - 0
src/views/modules/cw/invoice/InvoiceList.vue

@@ -251,6 +251,14 @@
               <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status === '5'||scope.row.status === '7')" type="text"  size="small" @click="invoiceInvalidPush(scope.row)">作废</el-button>
               <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status === '6'" type="text"  size="small" @click="invoiceInvalidReBack(scope.row)">作废撤回</el-button>
               <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status === '1'||scope.row.status === '3')" type="text"   size="small" @click="del(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="scope.row.createBy.id === $store.state.user.id&&scope.row.status === '4'" type="text"  size="small" @click="adjust(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="scope.row.createBy.id === $store.state.user.id&&scope.row.status === '8'" type="text"  size="small" @click="adjustInvalid(scope.row)">驳回调整</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -764,6 +772,114 @@
             console.log(err.response)
           }
         })
+      },
+      // 驳回后调整
+      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: '/cw/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.invalidTaskId
+        }).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/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
       }
     }
   }

+ 58 - 0
src/views/modules/cw/reimbursementApproval/info/InfoList.vue

@@ -164,6 +164,10 @@
               <el-button v-if="hasPermission('cw: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('cw: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="hasPermission('cw: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>
+<!--              审核-->
+              <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="scope.row.createId === $store.state.user.id&&scope.row.type === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -532,6 +536,60 @@
             console.log(err.response)
           }
         })
+      },
+      // 驳回后调整
+      adjust (row) {
+        this.reimbursementApprovalService.findById(row.id).then(({data}) => {
+          if (data.type !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.reimbursementApprovalService.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: '/cw/reimbursementApproval/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
       }
     }
   }

+ 95 - 31
src/views/modules/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -733,6 +733,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     methods: {
@@ -991,10 +997,35 @@
         // })
       },
       reapplyForm (callback) {
-        this.startForm(callback)
+        this.loading = true
+        this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+          if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.startFormTrue(callback)
+          }
+        })
+      },
+      startForm (callback) {
+        this.loading = true
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+            if (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
@@ -1015,6 +1046,7 @@
             this.inputForm.type = '2'
             this.reimbursementApprovalService.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
@@ -1030,35 +1062,48 @@
             //   this.$refs.inputForm.resetFields()
             //   this.loading = false
             // })
+          } else {
+            this.loading = false
           }
         })
       },
       // 通过
       async agreeForm (callback) {
-        this.$refs['inputForm'].validate(async (valid) => {
-          if (valid) {
-            this.loading = true
-            this.submitCheck()
-            if (this.$refs.uploadComponent.checkProgress()) {
-              this.loading = false
-              return
-            }
-            if (this.commonJS.isEmpty(this.inputForm.files)) {
-              this.inputForm.files = []
-            }
-            this.inputForm.files = this.$refs.uploadComponent.getDataList()
-            this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
-              if (this.commonJS.isNotEmpty(data)) {
-                if (data === '公司领导审批') {
-                  this.inputForm.type = '5'
+        this.loading = true
+        this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+          if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
+            this.loading = false
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.$refs['inputForm'].validate(async (valid) => {
+              if (valid) {
+                this.loading = true
+                this.submitCheck()
+                if (this.$refs.uploadComponent.checkProgress()) {
+                  this.loading = false
+                  return
                 }
-              }
-              this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
-                callback(data.businessTable, data.businessId, this.inputForm)
-                this.loading = false
-              }).catch(() => {
+                if (this.commonJS.isEmpty(this.inputForm.files)) {
+                  this.inputForm.files = []
+                }
+                this.inputForm.files = this.$refs.uploadComponent.getDataList()
+                this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
+                  if (this.commonJS.isNotEmpty(data)) {
+                    if (data === '公司领导审批') {
+                      this.inputForm.type = '5'
+                    }
+                  }
+                  this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+                    callback(data.businessTable, data.businessId, this.inputForm)
+                    this.loading = false
+                  }).catch(() => {
+                    this.loading = false
+                  })
+                })
+              } else {
                 this.loading = false
-              })
+              }
             })
           }
         })
@@ -1066,15 +1111,34 @@
       // 修改状态
       updateStatusById (type, callback) {
         if (type === 'reject') {
-          this.inputForm.type = '4'
-          this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
-            callback()
+          this.loading = true
+          this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+            if (data.type !== '2') { // 审核状态不是“审核中”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.inputForm.type = '4'
+              this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
+                this.loading = false
+                callback()
+              })
+            }
           })
-          // this.reimbursementService.updateStatusById(this.inputForm)
         } else if (type === 'hold') {
-          this.inputForm.type = '1'
-          this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
-            callback()
+          this.loading = true
+          this.reimbursementApprovalService.findById(this.inputForm.id).then(({data}) => {
+            if (data.type !== '4') { // 审核状态不是“驳回”,就弹出提示
+              this.loading = false
+              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+              throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            } else {
+              this.inputForm.type = '1'
+              this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
+                this.loading = false
+                callback()
+              })
+            }
           })
         }
       },