فهرست منبع

报告归档流程调整

lizhenhao 2 سال پیش
والد
کامیت
fd678a3e80

+ 44 - 20
src/views/modules/cw/projectReportArchive/ProjectReportArchiveList.vue

@@ -181,7 +181,7 @@
               </el-button>
             </template>
           </vxe-column>
-          <vxe-column title="操作" width="70px" fixed="right" align="center">
+          <vxe-column title="操作" width="100px" fixed="right" align="center">
             <template  slot-scope="scope">
               <el-button v-if="hasPermission('cwProjectReportArchive:edit')&&(scope.row.createBy.id === $store.state.user.id||haveProjectIds.includes(scope.row.projectId))&&(scope.row.status==='0'||scope.row.status==='1'||scope.row.status==='3')" type="text"  size="small" @click="push(scope.row)">归档</el-button>
               <el-button v-else-if="hasPermission('cwProjectReportArchive: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>
@@ -223,6 +223,7 @@
   import UserSelect from '@/components/userSelect'
   import ProjectRecordsService from '@/api/cw/projectRecords/ProjectRecordsService'
   import XEUtils from 'xe-utils'
+  import OfficeService from '@/api/sys/OfficeService'
   export default {
     data () {
       return {
@@ -256,6 +257,8 @@
         loading: false,
         processDefinitionAuditId: '',
         procDefAuditKey: '',
+        processDefinitionAuditIdSZ: '',
+        procDefAuditKeySZ: '',
         isAdmin: false,
         haveProjectIds: '',
         typeDictList: [
@@ -298,12 +301,14 @@
     processService: null,
     userService: null,
     projectRecordsService: null,
+    officeService: null,
     created () {
       this.projectRecordsService = new ProjectRecordsService()
       this.projectReportArchiveService = new ProjectReportArchiveService()
       this.taskService = new TaskService()
       this.processService = new ProcessService()
       this.userService = new UserService()
+      this.officeService = new OfficeService()
     },
     components: {
       ProjectRecordsForm,
@@ -383,6 +388,12 @@
             this.procDefAuditKey = data.key
           }
         })
+        this.processService.getByName('会计-项目报告归档-苏州分部').then(({data}) => {
+          if (!this.commonJS.isEmpty(data.id)) {
+            this.processDefinitionAuditIdSZ = data.id
+            this.procDefAuditKeySZ = data.key
+          }
+        })
       },
       // 当前页
       currentChangeHandle ({ currentPage, pageSize }) {
@@ -423,7 +434,7 @@
       start () {
         // 读取流程表单
         let tabTitle = `发起流程【会计-项目报告归档】`
-        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [会计-项目报告归档]`
+        let processTitle = `${this.$store.state.user.name} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [会计-项目报告归档]`
         this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
           status: 'startAndHold'}).then((data) => {
             this.$router.push({
@@ -448,7 +459,7 @@
       push (row) {
         // 读取流程表单
         let title = `发起流程【会计-项目报告归档】`
-        let processTitle = `${this.userName} 发起了 ${row.reportNo} - ${row.projectName} [会计-项目报告归档]`
+        let processTitle = `${this.$store.state.user.name} 发起了 ${row.reportNo} - ${row.projectName} [会计-项目报告归档]`
         let status = 'startAndHold'
         if (row.status === '3' || row.status === '4') {
           status = 'startAndClose'
@@ -478,26 +489,39 @@
       // 查看项目归档流程结果
       detail (row) {
         if (row.status !== '0' && row.status !== '1') {
-          // eslint-disable-next-line eqeqeq
-          this.taskService.getTaskDef({
-            procInsId: row.procInsId,
-            procDefId: this.processDefinitionAuditId
-          }).then(({data}) => {
-            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'
-              }
-            })
+          let procInsId = row.procInsId
+          let procDefId = this.processDefinitionAuditId
+          this.officeService.queryById(this.$store.state.user.office.id).then((byId) => {
+            // 判断当前人的所属部门是否为苏州分部,根据部门的机构编码(szfb)来判断是不是苏州分部
+            if (byId.data.code === 'szfb') {
+              procDefId = this.processDefinitionAuditIdSZ
+              this.getTaskDef(row, procInsId, procDefId)
+            } else {
+              this.getTaskDef(row, procInsId, procDefId)
+            }
           })
         }
       },
+      getTaskDef (row, procInsId, procDefId) {
+        // eslint-disable-next-line eqeqeq
+        this.taskService.getTaskDef({
+          procInsId: procInsId,
+          procDefId: procDefId
+        }).then(({data}) => {
+          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'
+            }
+          })
+        })
+      },
       // 撤回项目归档
       reback (row) {
         this.$confirm(`确定要撤回该申请吗?`, '提示', {

+ 80 - 36
src/views/modules/cw/projectReportArchive/ProjectReportArchiveTaskForm.vue

@@ -258,6 +258,8 @@
   import ProjectRecordsChooseCom from '@/views/modules/cw/projectRecords/ProjectRecordsChooseCom'
   import WorkClientChooseByProjectCom from '@/views/modules/cw/projectReportArchive/WorkClientChooseByProjectCom'
   import ReportChooseByProjectCom from '@/views/modules/cw/projectReportArchive/ReportChooseByProjectCom'
+  import OfficeService from '@/api/sys/OfficeService'
+  import ProcessService from '@/api/flowable/ProcessService'
   export default {
     props: {
       businessId: {
@@ -326,7 +328,11 @@
           signatureAnnotator2Name: '',
           reportCreateName: '',
           reportId: '',
-          reportRemarks: ''
+          reportRemarks: '',
+          procDefId: '',
+          procDefKey: '',
+          formTitle: '',
+          title: ''
         },
         keyWatch: '',
         activeName: 'files',
@@ -335,9 +341,13 @@
     },
     projectRecordsService: null,
     projectReportArchiveService: null,
+    officeService: null,
+    processService: null,
     created () {
       this.projectRecordsService = new ProjectRecordsService()
       this.projectReportArchiveService = new ProjectReportArchiveService()
+      this.officeService = new OfficeService()
+      this.processService = new ProcessService()
     },
     computed: {
       bus: {
@@ -436,7 +446,11 @@
           signatureAnnotator2Name: '',
           reportCreateName: '',
           reportId: '',
-          reportRemarks: ''
+          reportRemarks: '',
+          procDefId: '',
+          procDefKey: '',
+          formTitle: '',
+          title: ''
         }
         this.inputForm.id = id
         this.loading = false
@@ -557,41 +571,67 @@
               this.loading = false
               throw new Error()
             } else {
-              let _this = this
-              const wait = function () {
-                return new Promise(async (resolve, reject) => {
-                  if (status === 'agree') {
-                    // 审核同意
-                    _this.inputForm.auditDate = _this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-                    // this.inputForm.agreeUserId = this.$store.state.user.id
-                    _this.inputForm.status = '5'
-                    if (_this.inputForm.isNumber !== _this.inputForm.number) {
-                      _this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
-                      _this.loading = false
-                      throw new Error('“案卷号”与“确认案卷号”不一致,请重新填写')
-                    }
-                  }
-                  await _this.$refs.uploadComponent.getDataList().then((list) => {
-                    // list为返回数据
-                    _this.inputForm.workAttachmentDtoList = list
-                    list.forEach(item => {
-                      if (_this.commonJS.isEmpty(item.fileType)) {
-                        _this.$message.error('附件中的文件类型不可以为空')
-                        _this.loading = false
-                        throw new Error('附件中的文件类型不可以为空')
-                      }
-                    })
-                  })
-                  if (_this.commonJS.isEmpty(_this.inputForm.createDate)) {
-                    _this.inputForm.createDate = _this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+              if (status === 'agree') {
+                // 审核同意
+                this.inputForm.auditDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+                // this.inputForm.agreeUserId = this.$store.state.user.id
+                this.inputForm.status = '5'
+                if (this.inputForm.isNumber !== this.inputForm.number) {
+                  this.$message.error('“案卷号”与“确认案卷号”不一致,请重新填写')
+                  this.loading = false
+                  throw new Error('“案卷号”与“确认案卷号”不一致,请重新填写')
+                }
+              }
+              if (this.commonJS.isEmpty(this.inputForm.createDate)) {
+                this.inputForm.createDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
+              }
+              this.$refs.uploadComponent.getDataList().then((list) => {
+                // list为返回数据
+                this.inputForm.workAttachmentDtoList = list
+                list.forEach(item => {
+                  if (this.commonJS.isEmpty(item.fileType)) {
+                    this.$message.error('附件中的文件类型不可以为空')
+                    this.loading = false
+                    throw new Error('附件中的文件类型不可以为空')
                   }
-                  resolve()
                 })
-              }
-              wait().then(() => {
-                this.projectReportArchiveService.saveForm(this.inputForm).then(({data}) => {
-                  callback(data.businessTable, data.businessId, this.inputForm)
-                  this.loading = false
+                this.projectReportArchiveService.saveForm(this.inputForm).then((saveDate) => {
+                  this.officeService.queryById(this.$store.state.user.office.id).then((byId) => {
+                    // 判断当前人的所属部门是否为苏州分部,根据部门的机构编码(szfb)来判断是不是苏州分部
+                    if (byId.data.code === 'szfb') { // 当前人的所属部门为苏州分部
+                      this.processService.getByName('会计-项目报告归档-苏州分部').then(({data}) => {
+                        if (!this.commonJS.isEmpty(data.id)) {
+                          if (status === 'start' || status === 'reapply') {
+                            if (status === 'start') {
+                              this.inputForm.procDefId = data.id
+                              this.inputForm.procDefKey = data.key
+                            }
+                            let processTitle = `${this.$store.state.user.name} 发起了 ${this.inputForm.reportNo} - ${this.inputForm.cwProjectRecordsDTO.projectName} ` + `[会计-项目报告归档-苏州分部]`
+                            this.inputForm.formTitle = processTitle
+                            this.inputForm.title = `发起流程【会计-项目报告归档-苏州分部】`
+                          }
+                          callback(saveDate.data.businessTable, saveDate.data.businessId, this.inputForm)
+                          this.loading = false
+                        }
+                      })
+                    } else {
+                      this.processService.getByName('会计-项目报告归档').then(({data}) => {
+                        if (!this.commonJS.isEmpty(data.id)) {
+                          if (status === 'start' || status === 'reapply') {
+                            if (status === 'start') {
+                              this.inputForm.procDefId = data.id
+                              this.inputForm.procDefKey = data.key
+                            }
+                            let processTitle = `${this.$store.state.user.name} 发起了 ${this.inputForm.reportNo} - ${this.inputForm.cwProjectRecordsDTO.projectName} ` + `[会计-项目报告归档]`
+                            this.inputForm.formTitle = processTitle
+                            this.inputForm.title = `发起流程【会计-项目报告归档】`
+                          }
+                          callback(saveDate.data.businessTable, saveDate.data.businessId, this.inputForm)
+                          this.loading = false
+                        }
+                      })
+                    }
+                  })
                 }).catch(() => {
                   this.loading = false
                   throw new Error()
@@ -726,7 +766,11 @@
           signatureAnnotator2Name: '',
           reportCreateName: '',
           reportId: '',
-          reportRemarks: ''
+          reportRemarks: '',
+          procDefId: '',
+          procDefKey: '',
+          formTitle: '',
+          title: ''
         }
         this.$refs.uploadComponent.clearUpload()
         this.$refs.inputForm.resetFields()

+ 6 - 3
src/views/modules/flowable/task/TaskForm.vue

@@ -308,6 +308,7 @@
       start (vars) {
         if (this.formType === '2') { // 外置表单
           this.$refs.form.startForm((businessTable, businessId, inputForm) => {
+            console.log(inputForm.title)
             vars = {...vars, ...inputForm}
             if (inputForm.procDefId) {
               this.procDefId = inputForm.procDefId
@@ -325,8 +326,8 @@
             if (!this.commonJS.isEmpty(inputForm.assignee)) {
               assignee = inputForm.assignee
             }
-            console.log(this.procDefId)
-            console.log(this.procDefKey)
+            // console.log(this.procDefId)
+            // console.log(this.procDefKey)
             this.taskService.start({
               procDefId: this.procDefId,
               procDefKey: this.procDefKey,
@@ -495,6 +496,7 @@
       // Process_1673600899831 物资管理-合同
       // Process_1673924346231 中审-报销审批
       // Process_1667894339167 会计-合同登记
+      // Process_1678433162860 会计-项目报告归档-苏州分部
       // 驳回
       reject (vars) {
         if (this.procDefId.includes('Process_1667978088459') ||
@@ -528,7 +530,8 @@
           this.procDefId.includes('Process_1673514092406') ||
           this.procDefId.includes('Process_1673600899831') ||
           this.procDefId.includes('Process_1673924346231') ||
-          this.procDefId.includes('Process_1667894339167')
+          this.procDefId.includes('Process_1667894339167') ||
+          this.procDefId.includes('Process_1678433162860')
         ) {
           console.log('进入新版驳回')
           this.$confirm(`确定驳回流程吗?`, '提示', {