Pārlūkot izejas kodu

领用的审核流程调整

lizhenhao 2 gadi atpakaļ
vecāks
revīzija
d61aeeb971

+ 19 - 13
src/views/modules/materialManagement/collect/CollectForm.vue

@@ -155,6 +155,7 @@
   import MaterialTypePullForm from '../info/MaterialTypePullForm'
   import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
   import PurchasePageForm from './PurchasePageForm'
+  import CommonApi from '@/api/cw/common/CommonApi'
   export default {
     data () {
       return {
@@ -191,16 +192,19 @@
           remarks: '',
           detailInfos: [],
           // amountInfos: [],
-          files: [] // 附件信息
+          files: [], // 附件信息
+          procInsId: ''
         },
         keyWatch: ''
       }
     },
     CollectService: null,
     userService: null,
+    commonApi: null,
     created () {
       this.collectService = new CollectService()
       this.userService = new UserService()
+      this.commonApi = new CommonApi()
     },
     props: {
       businessId: {
@@ -290,7 +294,8 @@
           remarks: '',
           detailInfos: [],
           // amountInfos: [],
-          files: [] // 附件信息
+          files: [], // 附件信息
+          procInsId: ''
         }
         if (method === 'add') {
           this.title = `新建领用类型`
@@ -559,17 +564,18 @@
               this.inputForm.files = []
             }
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
-            this.inputForm.status = '5'
-            // await this.userService.is().then(({data}) => {
-            //   if (data) {
-            //     this.inputForm.status = '5'
-            //   }
-            // })
-            this.collectService.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.status = '5'
+                }
+              }
+              this.collectService.save(this.inputForm).then(({data}) => {
+                callback(data.businessTable, data.businessId, this.inputForm)
+                this.loading = false
+              }).catch(() => {
+                this.loading = false
+              })
             })
           } else {
             this.loading = false