Przeglądaj źródła

评估报销 状态修改

wangqiang 2 lat temu
rodzic
commit
5a84dd1370

+ 15 - 6
src/views/modules/reimbursement/info/ReimbursementForm.vue

@@ -180,6 +180,7 @@
 </template>
 
 <script>
+  import CommonApi from '@/api/cw/common/CommonApi'
   import ReimbursementApprovalTypeService from '@/api/cw/reimbursementApproval/ReimbursementApprovalTypeService'
   import ReimbursementService from '@/api/sys/ReimbursementService'
   import ReimbursementTypeService from '@/api/sys/ReimbursementTypeService'
@@ -216,6 +217,7 @@
     reimbursementService: null,
     reimbursementTypeService: null,
     userService: null,
+    commonApi: null,
     created () {
       this.reimbursementApprovalTypeService = new ReimbursementApprovalTypeService()
       this.reimbursementService = new ReimbursementService()
@@ -224,6 +226,7 @@
       this.inputForm.reimDate = new Date()
       this.inputForm.department = this.officeName
       this.userService = new UserService()
+      this.commonApi = new CommonApi()
       this.reimbursementTypeService = new ReimbursementTypeService()
     },
     props: {
@@ -466,12 +469,18 @@
             //     this.inputForm.type = '5'
             //   }
             // })
-            this.inputForm.type = '5'
-            this.reimbursementService.save(this.inputForm).then(({data}) => {
-              callback(data.businessTable, data.businessId, this.inputForm)
-              this.loading = false
-            }).catch(() => {
-              this.loading = false
+            this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
+              if (this.commonJS.isNotEmpty(data)) {
+                if (data === '公司领导审批') {
+                  this.inputForm.type = '5'
+                }
+              }
+              this.reimbursementService.save(this.inputForm).then(({data}) => {
+                callback(data.businessTable, data.businessId, this.inputForm)
+                this.loading = false
+              }).catch(() => {
+                this.loading = false
+              })
             })
           }
         })