ソースを参照

报告归档作废流程修改

lizhenhao 2 年 前
コミット
36474d204a

+ 14 - 9
src/views/modules/cw/reportCancellApply/ReportCancellApplyTaskForm.vue

@@ -258,15 +258,19 @@
       },
       startForm (callback) {
         this.loading = true
-        this.reportCancellApplyService.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)
-          }
-        })
+        if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+          this.reportCancellApplyService.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
@@ -344,6 +348,7 @@
               if (status === 'start' || status === 'reapply') {
                 this.inputForm.title = `${this.$store.state.user.name} 发起了 [${this.inputForm.reportNo}] - ${this.inputForm.projectName} [财务-报告作废]`
               }
+              this.inputForm.id = data.businessId
               callback(data.businessTable, data.businessId, this.inputForm)
               this.loading = false
             }).catch(() => {

+ 60 - 2
src/views/modules/cw/reportCancellApplyArchived/ReportCancellApplyArchivedList.vue

@@ -142,8 +142,12 @@
               <!--纸质归档撤回驳回修改-->
               <el-button v-if="hasPermission('cw:cwProjectReport:filed') && scope.row.status === '5'  && scope.row.createId === $store.state.user.id && (scope.row.applyFileType === '3' )" type="text" size="small" @click="paperFiledAndClose(scope.row.id)">修改</el-button>
               <!--纸质归档撤回-->
-              <el-button v-if="hasPermission('cw:cwProjectReport:back') && scope.row.status === '5'  && scope.row.applyFileType === '2'" type="text"  size="small" @click="rebackPaperFiled(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('cw:cwProjectReport:back') && scope.row.status === '5' && scope.row.createId === $store.state.user.id && scope.row.applyFileType === '2'" type="text"  size="small" @click="rebackPaperFiled(scope.row)">撤回</el-button>
 <!--              <el-button v-else-if="hasPermission('cw:cwProjectReport:del')&&isAdmin&&(scope.row.applyFileType==='1'||scope.row.applyFileType==='3'||scope.row.applyFileType==='4'||scope.row.applyFileType==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>-->
+<!--              审核-->
+              <el-button v-if="scope.row.applyFileType==='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.applyFileType === '4'" type="text"  size="small" @click="adjust(scope.row)">驳回调整</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -559,7 +563,7 @@
           row.applyFileType = '3'
           this.reportCancellApplyArchivedService.updateStatusById(row)
         }
-      }
+      },
       // 归档详情
       // detailPaperFiled (row) {
       //   // console.log('row.id', row.id)
@@ -586,6 +590,60 @@
       //     })
       //   }
       // }
+      // 驳回后调整
+      adjust (row) {
+        this.reportCancellApplyArchivedService.queryById(row.id).then(({data}) => {
+          if (data.applyFileType !== '4') { // status的值不等于“驳回”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核
+      examine (row) {
+        this.reportCancellApplyArchivedService.queryById(row.id).then(({data}) => {
+          if (data.applyFileType !== '2') { // status的值不等于“审核中”,就弹出提示
+            this.$message.error('数据已发生改变或不存在,请刷新数据')
+            this.refreshList()
+          } else {
+            this.todo(row)
+          }
+        })
+      },
+      // 审核或重新调整跳转
+      todo (row) {
+        let cUser = false
+        this.taskService.getTaskDefInfo({
+          taskId: row.archivedTaskId
+        }).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/reportCancellApplyArchived/ReportCancellApplyArchivedList'   // 数据处理后需要跳转的页面路径
+            }
+          })
+        })
+      },
+      // 查询当前登录人是否是数据的审核人
+      checkIsAudit (row) {
+        let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+        if (this.commonJS.isNotEmpty(row.auditUserIdsArchived)) {
+          for (const userId of row.auditUserIdsArchived) {
+            if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+              return true
+            }
+          }
+        }
+        return false
+      }
     }
   }
 </script>

+ 27 - 4
src/views/modules/cw/reportCancellApplyArchived/ReportCancellApplyArchivedTaskForm.vue

@@ -384,6 +384,12 @@
             })
           }
         }
+      },
+      'loading': {
+        handler (newVal) {
+          this.$emit('changeLoading', newVal)
+          this.$refs.uploadComponent.changeLoading(newVal)
+        }
       }
     },
     components: {
@@ -497,12 +503,22 @@
         this.doSubmit('save', callback)
       },
       startForm (callback) {
-        this.doSubmit('start', callback)
+        this.loading = true
+        this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
+          if (this.commonJS.isNotEmpty(data.applyFileType) && data.applyFileType !== '0' && data.applyFileType !== '1' && data.applyFileType !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+            this.loading = false
+            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+            throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+          } else {
+            this.doSubmit('start', callback)
+          }
+        })
       },
       async agreeForm (callback) {
+        this.loading = true
         await this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
-          console.log('data', data)
           if (data.applyFileType !== '2') { // 审核状态不是“待审核”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error()
           } else {
@@ -511,8 +527,10 @@
         })
       },
       reapplyForm (callback) {
+        this.loading = true
         this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
           if (data.applyFileType !== '4') { // 审核状态不是“驳回”,就弹出提示
+            this.loading = false
             this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
             throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
           } else {
@@ -535,7 +553,6 @@
           //   // list为返回数据
           //   this.inputForm.workAttachmentDtoList = list
           // })
-          console.log('this.inputForm', this.inputForm)
           this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
           this.reportCancellApplyArchivedService.saveForm(this.inputForm).then(({data}) => {
             callback(data.businessTable, data.businessId, this.inputForm)
@@ -599,18 +616,21 @@
                 })
               })
             }
+          } else {
+            this.loading = false
           }
         })
       },
       async updateStatusById (type, callback) {
+        this.loading = true
         if (await this.$refs.uploadComponent.checkProgress()) {
           this.loading = false
           throw new Error()
         } else {
           if (type === 'reject' || type === 'reback') {
             this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
-              console.log('data', data)
               if (data.applyFileType !== '2') { // status的值不等于“审核中”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
@@ -619,6 +639,7 @@
                   this.inputForm.applyFileType = '4'
                   let param = {applyFileType: '4', id: this.inputForm.id}
                   this.reportCancellApplyArchivedService.updateStatusById(param).then(() => {
+                    this.loading = false
                     callback()
                   })
                   // this.projectRecordsService.updateStatusById(param)
@@ -667,12 +688,14 @@
           } else if (type === 'hold') {
             this.reportCancellApplyArchivedService.queryById(this.inputForm.id).then(({data}) => {
               if (data.applyFileType !== '4') { // status的值不等于“驳回”就弹出提示
+                this.loading = false
                 this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
                 throw new Error()
               } else {
                 // 终止
                 let param = {applyFileType: '1', id: this.inputForm.id}
                 this.reportCancellApplyArchivedService.updateStatusById(param).then(() => {
+                  this.loading = false
                   callback()
                 })
               }