user5 2 лет назад
Родитель
Сommit
d5740f7f34

+ 5 - 0
src/views/modules/cw/workContract/ContractNameForm.vue

@@ -1022,6 +1022,11 @@
           this.inputForm.filedType = '3'
           this.contractFileService.updateStatusById(this.inputForm)
         }
+        // 流程终止,调整为暂存状态
+        if (type === 'hold') {
+          this.inputForm.filedType = '1'
+          this.contractFileService.updateStatusById(this.inputForm)
+        }
       },
       checkData () {
         let begin = this.inputForm.effectiveDate

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

@@ -470,7 +470,9 @@
               businessTable: 'work_contract_info',
               businessId: row.id,
               isShow: false,
-              routePath: '/cw/workContract/ContractRegistration'
+              statusFlag: row.status,
+              routePath: '/cw/workContract/ContractRegistration',
+              ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title')
             }
           })
         })

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

@@ -897,6 +897,11 @@
             this.inputForm.status = '3'
             this.contractInfoService.updateStatusById(this.inputForm)
           }
+          // 流程终止,调整为暂存状态
+          if (type === 'hold') {
+            this.inputForm.status = '1'
+            this.contractInfoService.updateStatusById(this.inputForm)
+          }
         }
       },
       checkData () {

+ 7 - 1
src/views/modules/flowable/extension/FlowCopyList.vue

@@ -29,7 +29,12 @@
                 :checkbox-config="{}">
                 <vxe-column type="seq" width="60" title="序号"></vxe-column>
                 <vxe-column type="checkbox"  width="40px"></vxe-column>
-                <vxe-column  title="实例标题" field="procInsName" sortable></vxe-column>
+              <!--<vxe-column  title="实例标题" field="procInsName" sortable></vxe-column>-->
+              <vxe-column  title="实例标题" field="procInsName" >
+                <template slot-scope="scope">
+                  <el-link  type="primary" :underline="false" @click="detail(scope.row)">{{scope.row.procInsName}}</el-link>
+                </template>
+              </vxe-column>
                 <vxe-column  title="抄送日期" field="createDate" sortable> </vxe-column>
                 <vxe-column  title="抄送发起人" field="createBy.name" sortable></vxe-column>
                 <vxe-column title="操作" width="150px" type="html" fixed="right" align="center">
@@ -123,6 +128,7 @@
           procInsId: row.procInsId,
           procDefId: row.procDefId
         }).then(({data}) => {
+          // this.noticeService.update(this.inputForm)
           this.$router.push({
             path: '/flowable/task/TaskFormDetail',
             query: {readOnly: true, title: row.procInsName, formTitle: row.procInsName, ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}

+ 101 - 46
src/views/modules/flowable/task/TaskForm.vue

@@ -164,7 +164,11 @@
       if (this.status === 'start') {  // 送审
         this.buttons = [{code: '_flow_start', name: '启动', isHide: '0'}]
       } else if (this.status === 'startAndClose') { // 送审、关闭
-        this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
+        if (this.statusFlag === '4') {
+          this.buttons = [{code: '_flow_reapply', name: '重新申请', isHide: '0'}, {code: '_flow_stop', name: '流程终止', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
+        } else {
+          this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
+        }
       } else if (this.status === 'startAndHold') {  // 送审、暂存、关闭
         this.buttons = [{code: '_flow_start', name: '送审', isHide: '0'}, {code: '_flow_save', name: '暂存', isHide: '0'}, {code: '_flow_close', name: '关闭', isHide: '0'}]
       } else if (this.status === 'startAndCloseFiled') { // 送审、关闭
@@ -250,6 +254,7 @@
         this.auditForm.message = ''
         this.cUser = this.commonJS.isEmpty(this.$route.query.cUser) ? false : this.$route.query.cUser
         this.contractTitle = this.$route.query.contractTitle
+        this.statusFlag = this.$route.query.statusFlag
         if (this.commonJS.isEmpty(this.$route.query.isShow)) {
           this.isShow = 'true'
         } else {
@@ -346,21 +351,22 @@
       },
       // 同意
       async agree (vars) {
+        vars = {...vars, agree: true}
         if (this.formType === '2' && this.formUrl !== '/sys/workContract/WorkContractFileForm') {
           this.commit(vars) // 同意
-          this.$refs.form.updateStatusById('agree')
+          // this.$refs.form.updateStatusById('agree')
         }
         if (this.formType === '2' && this.formUrl === '/sys/workContract/WorkContractFileForm') {
           this.$refs.form.filedNoIsEmpty((item) => {
             if (item !== 'false') {
               this.commit(vars) // 同意
-              this.$refs.form.updateStatusById('agree')
+              // this.$refs.form.updateStatusById('agree')
             }
           })
         }
       },
       // 驳回
-      reject () {
+      reject (vars) {
         this.$confirm(`确定驳回流程吗?`, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -368,27 +374,31 @@
         }).then(async () => {
           if (this.formType === '2') {
             if (this.cUser === true || this.cUser === 'true') { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
-              await this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
+              await setTimeout(() => {
+                vars = {...vars, agree: false}
+                this.commit(vars) // 驳回
+                // this.taskService.backNodes(this.taskId).then(({data}) => {
+                //   let backNodes = data
+                //   if (backNodes.length > 0) {
+                //     let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
+                //     this.back(backTaskDefKey)
+                //   }
+                // })
+              }, 100)
+              this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
                 this.auditForm.candidateUserList = inputForm.assignee
               })
-              setTimeout(() => {
-                this.taskService.backNodes(this.taskId).then(({data}) => {
-                  let backNodes = data
-                  if (backNodes.length > 0) {
-                    let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
-                    this.back(backTaskDefKey)
-                  }
-                })
-              }, 100)
             } else {
-              await this.$refs.form.updateStatusById('reject')
-              this.taskService.backNodes(this.taskId).then(({data}) => {
-                let backNodes = data
-                if (backNodes.length > 0) {
-                  let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
-                  this.back(backTaskDefKey)
-                }
-              })
+              vars = {...vars, agree: false}
+              await this.commit(vars) // 驳回
+              this.$refs.form.updateStatusById('reject')
+              // this.taskService.backNodes(this.taskId).then(({data}) => {
+              //   let backNodes = data
+              //   if (backNodes.length > 0) {
+              //     let backTaskDefKey = backNodes[backNodes.length - 1].taskDefKey
+              //     this.back(backTaskDefKey)
+              //   }
+              // })
             }
           }
         })
@@ -503,8 +513,27 @@
           type: 'warning'
         }).then(() => {
           this.processService.stop(this.procInsId, this.auditForm.message).then(({data}) => {
+            // 将数据状态更改为暂存状态
+            this.$refs.form.updateStatusById('hold', (businessTable, businessId, inputForm) => {
+              this.auditForm.candidateUserList = inputForm.assignee
+            })
+
             this.$message.success(data)
-            this.$router.push('/flowable/task/TodoList')
+            if (this.$route.query.routePath) {
+              this.$router.push(this.$route.query.routePath)
+            } else {
+              var num = this.$route.query.num
+              if (num === '2') {
+                this.$router.push('/sys/dashboard/workBench/Pending')
+                this.cc(data)
+              } else if (num === '3') {
+                this.$router.push('/sys/dashboard/workBench/PendingList')
+                this.cc(data)
+              } else {
+                this.$router.push('/flowable/task/TodoList')
+                this.cc(data)
+              }
+            }
           })
         })
       },
@@ -516,12 +545,22 @@
       close () {
         this.changeBusiness()
         this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
-        this.$router.push(this.$route.query.routePath)
+        if (this.$route.query.routePath) {
+          this.$router.push(this.$route.query.routePath)
+        } else {
+          var num = this.$route.query.num
+          if (num === '2') {
+            this.$router.push('/sys/dashboard/workBench/Pending')
+          } else if (num === '3') {
+            this.$router.push('/sys/dashboard/workBench/PendingList')
+          } else {
+            this.$router.push('/flowable/task/TodoList')
+          }
+        }
         this.$refs.form.close()
       },
       // 自定义按钮提交
       commit (vars) {
-        var num = this.$route.query.num
         if (this.formType === '2') { // 外置表单
           let param = {
             num: this.$route.query.num,
@@ -561,15 +600,20 @@
               this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
               // this.$router.push('/flowable/task/TodoList')
               // this.cc(data)
-              if (num === '2') {
-                this.$router.push('/sys/dashboard/workBench/Pending')
-                this.cc(data)
-              } else if (num === '3') {
-                this.$router.push('/sys/dashboard/workBench/PendingList')
-                this.cc(data)
+              if (this.$route.query.routePath) {
+                this.$router.push(this.$route.query.routePath)
               } else {
-                this.$router.push('/flowable/task/TodoList')
-                this.cc(data)
+                var num = this.$route.query.num
+                if (num === '2') {
+                  this.$router.push('/sys/dashboard/workBench/Pending')
+                  this.cc(data)
+                } else if (num === '3') {
+                  this.$router.push('/sys/dashboard/workBench/PendingList')
+                  this.cc(data)
+                } else {
+                  this.$router.push('/flowable/task/TodoList')
+                  this.cc(data)
+                }
               }
             })
           }, param)
@@ -580,15 +624,20 @@
             this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
             // this.$router.push('/flowable/task/TodoList')
             // this.cc(data)
-            if (num === '2') {
-              this.$router.push('/sys/dashboard/workBench/Pending')
-              this.cc(data)
-            } else if (num === '3') {
-              this.$router.push('/sys/dashboard/workBench/PendingList')
-              this.cc(data)
+            if (this.$route.query.routePath) {
+              this.$router.push(this.$route.query.routePath)
             } else {
-              this.$router.push('/flowable/task/TodoList')
-              this.cc(data)
+              var num = this.$route.query.num
+              if (num === '2') {
+                this.$router.push('/sys/dashboard/workBench/Pending')
+                this.cc(data)
+              } else if (num === '3') {
+                this.$router.push('/sys/dashboard/workBench/PendingList')
+                this.cc(data)
+              } else {
+                this.$router.push('/flowable/task/TodoList')
+                this.cc(data)
+              }
             }
           })
         }
@@ -621,10 +670,10 @@
             this.agree()
             break
           case '_flow_reject': // 驳回
-            if (this.title.includes('报销申请')) {
-              this.rejectToPointNum(0)
-              break
-            }
+            // if (this.title.includes('报销申请')) {
+            //   this.rejectToPointNum(0)
+            //   break
+            // }
             this.reject()
             break
           case '_flow_back': // 驳回到任意步骤
@@ -648,6 +697,9 @@
           case '_flow_print':// 打印
             this.print()
             break
+          case '_flow_reapply':// 重新申请
+            this.agree()
+            break
           case '_flow_close':// 关闭
             this.close()
             break
@@ -666,7 +718,8 @@
           taskName: '',
           createUser: '',
           createTime: '',
-          noticeName: ''
+          noticeName: '',
+          noticeId: ''
         }
         this.taskService.historicTaskList(taskId).then(({data}) => {
           if (data[data.length - 1].comment.status === '结束') {
@@ -685,6 +738,8 @@
             this.inputForm.createTime = data[0].histIns.endTime
             // 通知人
             this.inputForm.noticeName = data[0].assigneeName
+            // 通知人Id
+            this.inputForm.noticeId = data[0].assigneeId
             this.noticeService.addInfo(this.inputForm)
           }
         })