Procházet zdrojové kódy

报销审批最后节点通过时,流程状态改成5

lizhenhao před 2 roky
rodič
revize
3df2fa18b8

+ 11 - 0
src/api/cw/common/CommonApi.js

@@ -0,0 +1,11 @@
+import request from '@/utils/httpRequest'
+
+export default class CommonApi {
+  getTaskNameByProcInsId (procInsId) {
+    return request({
+      url: `/commonApi/getTaskNameByProcInsId`,
+      method: 'get',
+      params: {procInsId: procInsId}
+    })
+  }
+}

+ 18 - 18
src/views/modules/cw/reimbursementApproval/info/ReimbursementForm.vue

@@ -201,6 +201,7 @@
   // import ReimbursementTypePullForm from '@/views/modules/finance/invoice/ReimbursementTypePullForm'
   import CwReimbursementTypePullForm from './CwReimbursementTypePullForm'
   import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
+  import CommonApi from '@/api/cw/common/CommonApi'
   export default {
     data () {
       return {
@@ -238,7 +239,8 @@
           remarks: '',
           detailInfos: [],
           amountInfos: [],
-          files: [] // 附件信息
+          files: [], // 附件信息
+          procInsId: ''
         }
       }
     },
@@ -247,6 +249,7 @@
     // reimbursementTypeService: null,
     reimbursementApprovalTypeService: null,
     userService: null,
+    commonApi: null,
     created () {
       this.reimbursementApprovalService = new ReimbursementApprovalService()
       // this.reimbursementService = new ReimbursementService()
@@ -257,6 +260,7 @@
       this.userService = new UserService()
       // this.reimbursementTypeService = new ReimbursementTypeService()
       this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
+      this.commonApi = new CommonApi()
     },
     props: {
       businessId: {
@@ -294,7 +298,6 @@
     watch: {
       'businessId': {
         handler (newVal) {
-          console.log('aaaaaaaaaaaaaaaaaaaaaaaaaa', this.businessId)
           if (this.businessId && this.businessId !== 'false') {
             this.init('edit', this.businessId)
           } else {
@@ -316,7 +319,8 @@
           remarks: '',
           detailInfos: [],
           amountInfos: [],
-          files: [] // 附件信息
+          files: [], // 附件信息
+          procInsId: ''
         }
         if (method === 'add') {
           this.title = `新建报销类型`
@@ -527,23 +531,19 @@
               this.inputForm.files = []
             }
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
-            await this.userService.is().then(({data}) => {
-              if (data) {
-                this.inputForm.type = '5'
+            this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
+              if (this.commonJS.isNotEmpty(data)) {
+                if (data === '公司领导审批') {
+                  this.inputForm.type = '5'
+                }
               }
+              this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
+                callback(data.businessTable, data.businessId, this.inputForm)
+                this.loading = false
+              }).catch(() => {
+                this.loading = false
+              })
             })
-            this.reimbursementApprovalService.save(this.inputForm).then(({data}) => {
-              callback(data.businessTable, data.businessId, this.inputForm)
-              this.loading = false
-            }).catch(() => {
-              this.loading = false
-            })
-            // this.reimbursementService.save(this.inputForm).then(({data}) => {
-            //   callback(data.businessTable, data.businessId, this.inputForm)
-            //   this.loading = false
-            // }).catch(() => {
-            //   this.loading = false
-            // })
           }
         })
       },