Browse Source

报告流程修改

lizhenhao 2 years atrás
parent
commit
8e62133fd8

+ 2 - 2
src/views/modules/cw/projectRecords/ProjectRecordsList.vue

@@ -102,8 +102,8 @@
           </vxe-column>
           <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('cwProjectRecords: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="push(scope.row)">修改</el-button>
-              <el-button v-else-if="hasPermission('cwProjectRecords:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('cwProjectRecords:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3')" type="text"  size="small" @click="push(scope.row)">修改</el-button>
+              <el-button v-else-if="hasPermission('cwProjectRecords:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
               <el-button v-if="hasPermission('cwProjectRecords:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('cwProjectRecords:del')&&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-else-if="hasPermission('cwProjectRecords:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3' ||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>

+ 3 - 1
src/views/modules/cw/projectRecords/ProjectRecordsTaskForm.vue

@@ -633,7 +633,9 @@
                   // 驳回
                   this.inputForm.status = '4'
                   let param = {status: '4', id: this.inputForm.id}
-                  this.projectRecordsService.updateStatusById(param)
+                  this.projectRecordsService.updateStatusById(param).then(() => {
+                    callback()
+                  })
                 }
                 if (type === 'reback') {
                   // 撤回

+ 12 - 8
src/views/modules/cw/reportManagement/ReportManagementList.vue

@@ -133,11 +133,11 @@
 
           <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('cwProjectReport:edit')&&scope.row.createById === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text"  size="small" @click="push(scope.row)">修改</el-button>
-              <el-button v-else-if="hasPermission('cwProjectReport:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('cwProjectReport:edit')&&scope.row.createById === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3')" type="text"  size="small" @click="push(scope.row)">修改</el-button>
+              <el-button v-else-if="hasPermission('cwProjectReport:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
               <el-button v-if="hasPermission('cwProjectReport:edit')&&scope.row.createById === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
-              <el-button v-if="hasPermission('cwProjectReport:del')&&scope.row.createById === $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-else-if="hasPermission('cwProjectReport:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('cwProjectReport:del')&&scope.row.createById === $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-else-if="hasPermission('cwProjectReport:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
 <!--              公章流程-->
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.signatureType === '1' && (scope.row.status1 === '0' || scope.row.status1 === '3' || scope.row.status1 === '4')" type="text" size="small" @click="pushS(scope.row)">公章</el-button>
               <el-button v-if="hasPermission('cw:workContract:filed') && scope.row.status === '5' && scope.row.signatureType === '1' && scope.row.status1 === '2'" type="text" size="small" @click="rebackS(scope.row)">撤回签章申请</el-button>
@@ -360,6 +360,7 @@
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionAuditId,
                 procDefKey: this.procDefAuditKey,
                 status: 'startAndHold',
@@ -380,15 +381,18 @@
         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.processDefinitionAuditId,
           businessId: row.id,
-          businessTable: 'cw_work_client_base'}).then((data) => {
+          businessTable: 'cw_project_report'}).then((data) => {
             this.$router.push({
               path: '/flowable/task/TaskForm',
               query: {
+                ...pick(data.data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
                 procDefId: this.processDefinitionAuditId,
                 procDefKey: this.procDefAuditKey,
                 title: title,
@@ -415,13 +419,13 @@
             this.$router.push({
               path: '/flowable/task/TaskFormDetail',
               query: {
+                ...pick(data.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', 'title', 'businessId')
+                status: 'reback'
               }
             })
           })

+ 71 - 43
src/views/modules/cw/reportManagement/ReportManagementTaskForm.vue

@@ -536,6 +536,16 @@
       startForm (callback) {
         this.doSubmit('start', callback)
       },
+      reapplyForm (callback) {
+        this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+          if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('reapply', callback)
+          }
+        })
+      },
       async agreeForm (callback) {
         await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
           // console.log('进来了看看data', data)
@@ -575,6 +585,8 @@
           this.inputForm.agreeDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
           this.inputForm.agreeUserId = this.$store.state.user.id
           this.inputForm.status = '5'
+        } else if (status === 'reapply') {
+          this.inputForm.status = '2'
         }
         this.$refs['inputForm'].validate((valid) => {
           if (valid) {
@@ -615,51 +627,67 @@
           }
         })
       },
-      async updateStatusById (type) {
-        if (type === 'reject' || type === 'reback') {
-          // if (await this.$refs.uploadComponent.checkProgress()) {
-          //   this.loading = false
-          //   throw new Error()
-          // }
-          await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
-            if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
-              this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-              throw new Error()
-            } else {
-              if (type === 'reject') {
-                // 驳回
-                this.inputForm.status = '4'
-                let param = {status: '4', id: this.inputForm.id}
-                this.projectReportService.updateStatusById(param)
-                // this.projectRecordsService.updateStatusById(param)
+      async updateStatusById (type, callback) {
+        if (await this.$refs.archiveFile.checkProgress()) {
+          this.loading = false
+          throw new Error()
+        } else {
+          if (type === 'reject' || type === 'reback') {
+            await this.projectReportService.queryById(this.inputForm.id).then(({data}) => {
+              if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+                this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                throw new Error()
+              } else {
+                if (type === 'reject') {
+                  // 驳回
+                  this.inputForm.status = '4'
+                  let param = {status: '4', id: this.inputForm.id}
+                  this.projectReportService.updateStatusById(param).then(() => {
+                    callback()
+                  })
+                  // this.projectRecordsService.updateStatusById(param)
+                }
+                if (type === 'reback') {
+                  // 撤回
+                  let param = {status: '3', id: this.inputForm.id}
+                  // this.projectRecordsService.updateStatusById(param)
+                  this.projectReportService.updateStatusById(param)
+                }
               }
-              if (type === 'reback') {
-                // 撤回
-                let param = {status: '3', id: this.inputForm.id}
-                // this.projectRecordsService.updateStatusById(param)
-                this.projectReportService.updateStatusById(param)
+            })
+            // await this.projectRecordsService.queryById(this.inputForm.id).then(({data}) => {
+            //   if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
+            //     this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            //     throw new Error()
+            //   } else {
+            //     if (type === 'reject') {
+            //       // 驳回
+            //       this.inputForm.status = '4'
+            //       let param = {status: '4', id: this.inputForm.id}
+            //       this.projectRecordsService.updateStatusById(param)
+            //     }
+            //     if (type === 'reback') {
+            //       // 撤回
+            //       let param = {status: '3', id: this.inputForm.id}
+            //       // this.projectRecordsService.updateStatusById(param)
+            //       this.projectReportService.updateStatusById(param)
+            //     }
+            //   }
+            // })
+          } else if (type === 'hold') {
+            this.projectReportService.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.projectReportService.updateStatusById(param).then(() => {
+                  callback()
+                })
               }
-            }
-          })
-          // await this.projectRecordsService.queryById(this.inputForm.id).then(({data}) => {
-          //   if (data.status !== '2') { // status的值不等于“审核中”就弹出提示
-          //     this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
-          //     throw new Error()
-          //   } else {
-          //     if (type === 'reject') {
-          //       // 驳回
-          //       this.inputForm.status = '4'
-          //       let param = {status: '4', id: this.inputForm.id}
-          //       this.projectRecordsService.updateStatusById(param)
-          //     }
-          //     if (type === 'reback') {
-          //       // 撤回
-          //       let param = {status: '3', id: this.inputForm.id}
-          //       // this.projectRecordsService.updateStatusById(param)
-          //       this.projectReportService.updateStatusById(param)
-          //     }
-          //   }
-          // })
+            })
+          }
         }
       },
       close () {

+ 2 - 2
src/views/modules/cw/workClientInfo/WorkClientList.vue

@@ -158,8 +158,8 @@
           </vxe-column>
           <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('cw_work_client:info: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="push(scope.row)">修改</el-button>
-              <el-button v-else-if="hasPermission('cw_work_client:info:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.createBy.id === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3')" type="text"  size="small" @click="push(scope.row)">修改</el-button>
+              <el-button v-else-if="hasPermission('cw_work_client:info:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
               <el-button v-if="hasPermission('cw_work_client:info:edit')&&scope.row.createBy.id === $store.state.user.id&&scope.row.status==='2'" type="text"  size="small" @click="reback(scope.row)">撤回</el-button>
               <el-button v-if="hasPermission('cw_work_client:info:del')&&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-else-if="hasPermission('cw_work_client:info:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>

+ 3 - 1
src/views/modules/cw/workClientInfo/WorkClientTaskForm.vue

@@ -1141,7 +1141,9 @@
                   // 驳回
                   this.inputForm.status = '4'
                   let param = {status: '4', id: this.inputForm.id}
-                  this.workClientService.updateStatusById(param)
+                  this.workClientService.updateStatusById(param).then(() => {
+                    callback()
+                  })
                 }
                 if (type === 'reback') {
                   // 撤回

+ 38 - 13
src/views/modules/flowable/task/TaskForm.vue

@@ -451,7 +451,7 @@
       },
       // 驳回
       reject (vars) {
-        if (this.procDefId.includes('Process_1667978088459') || this.procDefId.includes('UserTask_07ofhqm') || this.procDefId.includes('Process_1668394732246') || this.procDefId.includes('UserTask_0a4v9r9')) {
+        if (this.procDefId.includes('Process_1667978088459') || this.procDefId.includes('Process_1668394732246') || this.procDefId.includes('Process_1668503117077')) {
           console.log('进入新版驳回')
           this.$confirm(`确定驳回流程吗?`, '提示', {
             confirmButtonText: '确定',
@@ -459,19 +459,44 @@
             type: 'warning'
           }).then(async () => {
             if (this.formType === '2') {
-              if (this.cUser === true || this.cUser === 'true') { // cUser为true则页面审核人为自定义多选,驳回时要将审核人重新定义一次
-                await setTimeout(() => {
-                  vars = {...vars, agree: false}
-                  this.commit(vars) // 驳回
-                }, 100)
-                this.$refs.form.updateStatusById('reject', (businessTable, businessId, inputForm) => {
-                  this.auditForm.candidateUserList = inputForm.assignee
+              vars = {...vars, agree: false}
+              // await this.commit(vars) // 驳回
+              this.$refs.form.updateStatusById('reject', () => {
+                this.taskService.audit({
+                  taskId: this.taskId,
+                  taskDefKey: this.taskDefKey,
+                  procInsId: this.procInsId,
+                  procDefId: this.procDefId,
+                  vars: vars,
+                  comment: this.auditForm,
+                  assignee: this.auditForm.assignee
+                }).then(({data}) => {
+                  this.$message.success('提交成功')
+                  this.changeBusiness()
+                  this.$refs.form.close()
+                  // 我的通知
+                  let createDate = ''
+                  this.myNotice(data, this.procDefId, this.title, vars.userName, createDate)
+                  this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+                  // this.$router.push('/flowable/task/TodoList')
+                  // this.cc(data)
+                  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)
+                    }
+                  }
                 })
-              } else {
-                vars = {...vars, agree: false}
-                await this.commit(vars) // 驳回
-                this.$refs.form.updateStatusById('reject')
-              }
+              })
             }
           })
         } else {