Browse Source

添加流程key参数

lizhenhao 2 years ago
parent
commit
cbd03d0f16

+ 4 - 4
src/api/centerservice/ccpm/ReimbursementService.js

@@ -1,18 +1,18 @@
 import request from '@/utils/httpRequest'
 
 export default class ReimbursementService {
-  getReimbursementById (id) {
+  getReimbursementById (id, processDefKey) {
     return request({
       url: '/ccpm_reimbursement/getReimbursementById',
       method: 'get',
-      params: {id: id}
+      params: {id: id, processDefKey: processDefKey}
     })
   }
-  reimAudit (id, flag, comment) {
+  reimAudit (id, flag, comment, processDefKey) {
     return request({
       url: '/ccpm_reimbursement/reimAudit',
       method: 'get',
-      params: {id: id, flag: flag, comment: comment}
+      params: {id: id, flag: flag, comment: comment, processDefKey: processDefKey}
     })
   }
   reimReapply (id) {

+ 2 - 1
src/views/modules/flowable/task/CenterForm.vue

@@ -5,7 +5,7 @@
       <h4 style="text-align:center">{{title}}</h4>
       <el-card>
         <!--详情页面-->
-        <component ref="form" :businessId="businessId" :is="form"></component>
+        <component ref="form" :businessId="businessId" :is="form" :processDefKey="processDefKey"></component>
         <!--操作按钮-->
         <div class="FlowFormFooter">
           <el-button type="primary" :loading="loading" @click="agree" v-noMoreClick plain>同意</el-button>
@@ -37,6 +37,7 @@
       init () {
         this.form = _import(`modules${this.$route.query.formUrl}`)
         this.businessId = this.$route.query.id
+        this.processDefKey = this.$route.query.processDefKey
         this.title = this.$route.query.title
         this.$nextTick(() => {
           this.$refs.form.getKeyWatch(Math.random().toString())

+ 4 - 3
src/views/modules/flowable/task/TodoList.vue

@@ -318,12 +318,12 @@
           let id = row.vars.notifyId
           let title = '报销申请审批'
           let formUrl = '/reimbursement/ReimbursementFormCcpm'
-          this.toCenterForm(id, title, formUrl) // 跳转
+          this.toCenterForm(id, title, formUrl, row.task.processDefKey) // 跳转
         } else {
           this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
         }
       },
-      toCenterForm (id, title, formUrl) {
+      toCenterForm (id, title, formUrl, processDefKey) {
         let backPath = '/sys/dashboard/workBench/PendingList'
         this.$router.push({ // 跳转
           path: '/flowable/task/CenterForm',
@@ -331,7 +331,8 @@
             id: id,
             backPath: backPath,
             title: title,
-            formUrl: formUrl
+            formUrl: formUrl,
+            processDefKey: processDefKey
           }
         })
       }

+ 18 - 6
src/views/modules/reimbursement/ReimbursementFormCcpm.vue

@@ -252,6 +252,10 @@
       businessId: {
         type: String,
         default: ''
+      },
+      processDefKey: {
+        type: String,
+        default: ''
       }
     },
     components: {
@@ -275,6 +279,14 @@
           this.businessId = val
         }
       },
+      pdKey: {
+        get () {
+          return this.processDefKey
+        },
+        set (val) {
+          this.processDefKey = val
+        }
+      },
       name () {
         return JSON.parse(localStorage.getItem('user')).name
       },
@@ -288,8 +300,8 @@
     watch: {
       'keyWatch': {
         handler (newVal) {
-          if (this.commonJS.isNotEmpty(this.bus)) {
-            this.init('view', this.bus)
+          if (this.commonJS.isNotEmpty(this.bus) && this.commonJS.isNotEmpty(this.pdKey)) {
+            this.init('view', this.bus, this.pdKey)
           } else {
             this.$nextTick(() => {
               this.$refs.inputForm.resetFields()
@@ -309,7 +321,7 @@
       getKeyWatch (keyWatch) {
         this.keyWatch = keyWatch
       },
-      init (method, id) {
+      init (method, id, processDefKey) {
         this.method = method
         // this.title = this.$route.query.title
         this.inputForm = {
@@ -343,7 +355,7 @@
         this.$nextTick(() => {
           this.loading = true
           this.$refs.inputForm.resetFields()
-          this.reimbursementService.getReimbursementById(this.inputForm.id).then(({data}) => {
+          this.reimbursementService.getReimbursementById(this.inputForm.id, processDefKey).then(({data}) => {
             this.inputForm = this.recover(this.inputForm, data)
             this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
             this.$refs.uploadComponent.clearUpload()
@@ -996,7 +1008,7 @@
       // 同意
       agree (backPath) {
         this.loading = true
-        this.reimbursementService.reimAudit(this.businessId, 'yes', this.comment).then(({data}) => {
+        this.reimbursementService.reimAudit(this.businessId, 'yes', this.comment, this.pdKey).then(({data}) => {
           if (data.success) {
             this.$message.success(data.message)
             this.closeBack(backPath)
@@ -1016,7 +1028,7 @@
           type: 'warning'
         }).then(() => {
           this.loading = true
-          this.reimbursementService.reimAudit(this.businessId, 'no', this.comment).then(({data}) => {
+          this.reimbursementService.reimAudit(this.businessId, 'no', this.comment, this.pdKey).then(({data}) => {
             if (data.success) {
               this.$message.success(data.message)
               this.closeBack(backPath)