Browse Source

流程修改

lizhenhao 2 years ago
parent
commit
e0678cc31c

+ 54 - 24
src/views/modules/cw/invoice/InvoiceFormTask.vue

@@ -848,6 +848,16 @@
           }
         })
       },
+      reapplyForm (callback) {
+        this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('reapply', callback)
+          }
+        })
+      },
       // 表单提交
       async doSubmit (status, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
@@ -872,6 +882,8 @@
         } else if (status === 'agree') {
           // 审核同意
           this.inputForm.status = '5'
+        } else if (status === 'reapply') {
+          this.inputForm.status = '2'
         }
         if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
           this.$message.error('至少新增一条基本信息')
@@ -1182,34 +1194,52 @@
           this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
         }
       },
-      async updateStatusById (type) {
+      async updateStatusById (type, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
-        }
-        await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
-          if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
-            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-            throw new Error()
-          } else {
-            // if (type === 'agree') {
-            //   // 同意
-            //   this.inputForm.status = '5'
-            // }
-            if (type === 'reject') {
-              // 驳回
-              this.inputForm.status = '4'
-            }
-            if (type === 'reback') {
-              // 撤回
-              this.inputForm.status = '3'
-            }
-            if (type === 'reject' || type === 'reback') {
-              let param = {status: this.inputForm.status, id: this.inputForm.id}
-              this.financeInvoiceService.updateStatusById(param)
-            }
+        } else {
+          if (type === 'reject' || type === 'reback') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                // if (type === 'agree') {
+                //   // 同意
+                //   this.inputForm.status = '5'
+                // }
+                if (type === 'reject') {
+                  // 驳回
+                  this.inputForm.status = '4'
+                }
+                if (type === 'reback') {
+                  // 撤回
+                  this.inputForm.status = '3'
+                }
+                if (type === 'reject' || type === 'reback') {
+                  let param = {status: this.inputForm.status, id: this.inputForm.id}
+                  this.financeInvoiceService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                }
+              }
+            })
+          } else if (type === 'hold') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                // 终止
+                let param = {status: '1', id: this.inputForm.id}
+                this.financeInvoiceService.updateStatusById(param).then(() => {
+                  callback()
+                })
+              }
+            })
           }
-        })
+        }
       },
       // 下载模板
       downloadTpl () {

+ 56 - 26
src/views/modules/cw/invoice/InvoiceFormTaskInvalid.vue

@@ -790,6 +790,16 @@
           }
         })
       },
+      reapplyForm (callback) {
+        this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '8') { // 审核状态不是“驳回”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('reapply', callback)
+          }
+        })
+      },
       // 表单提交
       async doSubmit (status, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
@@ -816,6 +826,8 @@
           this.inputForm.status = '9'
           this.inputForm.financeInvoiceInvalidDTO.invalidStatus = '1'
           this.inputForm.invalidStatus = '1'
+        } else if (status === 'reapply') {
+          this.inputForm.status = '6'
         }
         if (this.commonJS.isEmpty(this.inputForm.financeInvoiceBaseDTOList)) {
           this.$message.error('至少新增一条基本信息')
@@ -1120,36 +1132,54 @@
           this.financeInvoiceDetailDTOList.push({account: this.inputForm.account})
         }
       },
-      async updateStatusById (type) {
+      async updateStatusById (type, callback) {
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
-        }
-        await this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
-          if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
-            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-            throw new Error()
-          } else {
-            if (type === 'agree') {
-              // 同意
-              this.inputForm.status = '9'
-            }
-            if (type === 'reject') {
-              // 驳回
-              // this.inputForm.status = '8'
-              this.inputForm.status = '5'
-            }
-            if (type === 'reback') {
-              // 撤回
-              // this.inputForm.status = '7'
-              this.inputForm.status = '5'
-            }
-            if (type === 'reject' || type === 'reback') {
-              let param = {status: this.inputForm.status, id: this.inputForm.id}
-              this.financeInvoiceService.updateStatusById(param)
-            }
+        } else {
+          if (type === 'reject' || type === 'reback') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                if (type === 'agree') {
+                  // 同意
+                  this.inputForm.status = '9'
+                }
+                if (type === 'reject') {
+                  // 驳回
+                  this.inputForm.status = '8'
+                  // this.inputForm.status = '5'
+                }
+                if (type === 'reback') {
+                  // 撤回
+                  // this.inputForm.status = '7'
+                  this.inputForm.status = '5'
+                }
+                if (type === 'reject' || type === 'reback') {
+                  let param = {status: this.inputForm.status, id: this.inputForm.id}
+                  this.financeInvoiceService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                }
+              }
+            })
+          } else if (type === 'hold') {
+            this.financeInvoiceService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '8') { // status的值不等于“驳回”就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                // 终止
+                let param = {status: '5', id: this.inputForm.id}
+                this.financeInvoiceService.updateStatusById(param).then(() => {
+                  callback()
+                })
+              }
+            })
           }
-        })
+        }
       }
     }
   }

+ 9 - 5
src/views/modules/cw/invoice/InvoiceList.vue

@@ -230,14 +230,14 @@
           </vxe-column>
           <vxe-column min-width="300" title="操作"  fixed="right" align="center">
             <template  slot-scope="scope">
-              <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'||scope.row.status === '4')" type="text"  size="small" @click="invoicePush(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="invoicePush(scope.row)">修改</el-button>
               <el-button v-if="hasPermission('cw_finance:invoice:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status === '2'" type="text"  size="small" @click="invoiceReback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('cw_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('cw_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('cw_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')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status === '5'||scope.row.status === '7'||scope.row.status === '8')" 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 === '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'||scope.row.status === '4')" type="text"   size="small" @click="del(scope.row.id)">删除</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>
             </template>
           </vxe-column>
         </vxe-table>
@@ -534,8 +534,10 @@
         let title = `发起流程【发票申请】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票申请]`
         let status = 'startAndHold'
-        if (row.status === '3' || row.status === '4') {
+        if (row.status === '3') {
           status = 'startAndClose'
+        } else if (row.status === '4') {
+          status = 'reapplyFlag'
         }
         this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
           businessId: row.id,
@@ -565,8 +567,10 @@
         let title = `发起流程【发票作废】`
         let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[发票作废]`
         let status = 'startAndHold'
-        if (row.status === '8' || row.status === '7') {
+        if (row.status === '7') {
           status = 'startAndClose'
+        } else if (row.status === '8') {
+          status = 'reapplyFlag'
         }
         this.taskService.getTaskDef({ procDefId: this.processDefinitionInvalidId,
           businessId: row.financeInvoiceInvalidDTO.id,

+ 9 - 4
src/views/modules/cw/reimbursementApproval/info/InfoList.vue

@@ -132,7 +132,7 @@
 
           <vxe-column title="操作" width="230px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('reimbursement:info:edit') && (scope.row.type === '1' || scope.row.type === '3' || scope.row.type === '4')" type="text"  size="small" @click="edit(scope.row)">修改</el-button>
+              <el-button v-if="hasPermission('reimbursement:info:edit') && (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.type === '2')" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('reimbursement:info:del') && (scope.row.type === '1')" type="text"  size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
@@ -249,6 +249,7 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionId,
                 procDefKey: this.procDefKey,
                 status: 'startAndHold',
@@ -271,8 +272,10 @@
           status = 'startAndHold'
         }
         // 撤回或者驳回修改
-        if (row.type === '3' || row.type === '4') {
+        if (row.type === '3') {
           status = 'startAndClose'
+        } else if (row.status === '4') {
+          status = 'reapplyFlag'
         }
         // 读取流程表单
         let tabTitle = `发起流程【财务-报销审批】`
@@ -285,6 +288,7 @@
           this.$router.push({
             path: '/flowable/task/TaskForm',
             query: {
+              ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
               procDefId: this.processDefinitionId,
               procDefKey: this.procDefKey,
               status: status,
@@ -405,13 +409,14 @@
             this.$router.push({
               path: '/flowable/task/TaskFormDetail',
               query: {
+                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 isShow: 'false',
                 readOnly: true,
                 title: '流程详情',
                 formTitle: '流程详情',
                 businessId: row.id,
-                status: 'reback',
-                ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
+                status: 'reback'
+              }
             })
           })
         }

+ 12 - 2
src/views/modules/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -450,6 +450,9 @@
         //   this.loading = false
         // })
       },
+      reapplyForm (callback) {
+        this.startForm(callback)
+      },
       // 送审
       async startForm (callback) {
         this.$refs['inputForm'].validate(async (valid) => {
@@ -548,11 +551,18 @@
         })
       },
       // 修改状态
-      updateStatusById (type) {
+      updateStatusById (type, callback) {
         if (type === 'reject') {
           this.inputForm.type = '4'
-          this.reimbursementApprovalService.updateStatusById(this.inputForm)
+          this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
+            callback()
+          })
           // this.reimbursementService.updateStatusById(this.inputForm)
+        } else if (type === 'hold') {
+          this.inputForm.type = '1'
+          this.reimbursementApprovalService.updateStatusById(this.inputForm).then(() => {
+            callback()
+          })
         }
       },
       footerMethod ({ columns, data }) {

+ 18 - 3
src/views/modules/cw/workContract/ContractFilePaperForm.vue

@@ -756,6 +756,9 @@
           })
         }
       },
+      reapplyForm (callback) {
+        this.startForm(callback)
+      },
       // 送审
       startForm (callback) {
         if (this.commonJS.isEmpty(this.inputForm.actualContractAmount)) {
@@ -964,7 +967,7 @@
       closePop () {
         this.visable = false
       },
-      updateStatusById (type) {
+      updateStatusById (type, callback) {
         if (this.$refs.archiveFile.checkProgress() || this.$refs.uploadFile.checkProgress()) {
           this.loading = false
           throw new Error()
@@ -979,12 +982,24 @@
           if (type === 'reject') {
             this.inputForm.filedPaperType = '4'
             // this.contractFileService.updateStatusById(this.inputForm)
-            this.contractFilePaperService.updateStatusById(this.inputForm)
+            this.contractFilePaperService.updateStatusById(this.inputForm).then(() => {
+              callback()
+            })
           }
           if (type === 'reback') {
             this.inputForm.filedPaperType = '3'
             // this.contractFileService.updateStatusById(this.inputForm)
-            this.contractFilePaperService.updateStatusById(this.inputForm)
+            this.contractFilePaperService.updateStatusById(this.inputForm).then(() => {
+              callback()
+            })
+          }
+          if (type === 'hold') {
+                // 终止
+            this.inputForm.filedPaperType = '1'
+            // this.contractFileService.updateStatusById(this.inputForm)
+            this.contractFilePaperService.updateStatusById(this.inputForm).then(() => {
+              callback()
+            })
           }
         }
       },

+ 6 - 3
src/views/modules/cw/workContract/ContractRegistration.vue

@@ -183,7 +183,7 @@
               <!--纸质归档暂存修改-->
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5'  && scope.row.createId === $store.state.user.id && scope.row.filedPaperType === '1'" type="text" size="small" @click="paperFiled(scope.row.id)">修改</el-button>
               <!--纸质归档撤回驳回修改-->
-              <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5'  && scope.row.createId === $store.state.user.id && (scope.row.filedPaperType === '3' || scope.row.filedPaperType === '4')" type="text" size="small" @click="paperFiledAndClose(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5'  && scope.row.createId === $store.state.user.id && (scope.row.filedPaperType === '3')" type="text" size="small" @click="paperFiledAndClose(scope.row.id)">修改</el-button>
               <!--纸质归档撤回-->
               <el-button v-if="hasPermission('cw:workContract:back') && scope.row.status === '5'  && scope.row.filedPaperType === '2'" type="text"  size="small" @click="rebackPaperFiled(scope.row)">撤回</el-button>
             </template>
@@ -767,6 +767,7 @@
                 this.$router.push({
                   path: '/flowable/task/TaskForm',
                   query: {
+                    ...pick(reture.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                     procDefId: data.id,
                     procDefKey: data.key,
                     status: 'startAndHoldFiled',
@@ -799,6 +800,7 @@
                 this.$router.push({
                   path: '/flowable/task/TaskForm',
                   query: {
+                    ...pick(reture.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                     procDefId: data.id,
                     procDefKey: data.key,
                     status: 'startAndCloseFiled',
@@ -847,11 +849,12 @@
                 this.$router.push({
                   path: '/flowable/task/TaskFormDetail',
                   query: {
+                    ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                     readOnly: true,
                     title: '纸质归档流程详情',
                     formTitle: '纸质归档流程详情',
-                    businessId: row.id,
-                    ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title')}
+                    businessId: row.id
+                  }
                 })
               })
             }

+ 9 - 1
src/views/modules/flowable/task/TaskForm.vue

@@ -462,6 +462,10 @@
       // Process_1670486210438 报告复核
       // Process_1668759076824 报告作废申请
       // Process_1670548572652 报告作废归档
+      // Process_1669700915383 合同登记纸质归档
+      // Process_1669271524486 报销审批
+      // Process_1669275081328 发票申请
+      // Process_1669275380218 发票作废
       // 驳回
       reject (vars) {
         if (this.procDefId.includes('Process_1667978088459') ||
@@ -472,7 +476,11 @@
           this.procDefId.includes('Process_1668677901585') ||
           this.procDefId.includes('Process_1670486210438') ||
           this.procDefId.includes('Process_1668759076824') ||
-          this.procDefId.includes('Process_1670548572652')
+          this.procDefId.includes('Process_1670548572652') ||
+          this.procDefId.includes('Process_1669700915383') ||
+          this.procDefId.includes('Process_1669271524486') ||
+          this.procDefId.includes('Process_1669275081328') ||
+          this.procDefId.includes('Process_1669275380218')
         ) {
           console.log('进入新版驳回')
           this.$confirm(`确定驳回流程吗?`, '提示', {