瀏覽代碼

领用-退回添加附件

lizhenhao 2 年之前
父節點
當前提交
528b62209e

+ 22 - 12
src/views/modules/materialManagement/collect/CollectReturnForm.vue

@@ -176,7 +176,8 @@
           procInsIdReturn: '',
           processDefinitionIdReturn: '',
           returnId: '',
-          returnCause: ''
+          returnCause: '',
+          returnFiles: []
         },
         keyWatch: ''
       }
@@ -281,7 +282,8 @@
           procInsIdReturn: '',
           processDefinitionIdReturn: '',
           returnId: '',
-          returnCause: ''
+          returnCause: '',
+          returnFiles: []
         }
         if (method === 'add') {
           this.title = `新建领用类型`
@@ -297,12 +299,16 @@
           }
           if (this.status === 'audit' || this.status === 'taskFormDetail') {
             method = 'view'
+          } else {
+            method = 'edit'
           }
           this.loading = true
           this.$refs.inputForm.resetFields()
           this.collectService.findByReturnId(this.inputForm.id).then(({data}) => {
+            this.$refs.uploadComponent.clearUpload()
             if (this.inputForm.id !== 'false') {
               this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
               }
@@ -322,7 +328,11 @@
                   }
                 }
               }
-              this.$refs.uploadComponent.newUpload('view', this.inputForm.files, 'material_collect')
+              console.log(this.inputForm, data)
+              if (this.commonJS.isEmpty(this.inputForm.returnFiles)) {
+                this.inputForm.returnFiles = []
+              }
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.returnFiles, 'collect_return')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
             } else {
@@ -460,10 +470,10 @@
           this.loading = false
           return
         }
-        if (this.commonJS.isEmpty(this.inputForm.files)) {
-          this.inputForm.files = []
+        if (this.commonJS.isEmpty(this.inputForm.returnFiles)) {
+          this.inputForm.returnFiles = []
         }
-        this.inputForm.files = this.$refs.uploadComponent.getDataList()
+        this.inputForm.returnFiles = this.$refs.uploadComponent.getDataList()
         this.inputForm.statusReturn = '1'
         this.collectService.saveReturn(this.inputForm).then(({data}) => {
           callback()
@@ -484,8 +494,8 @@
               this.loading = false
               return
             }
-            if (this.commonJS.isEmpty(this.inputForm.files)) {
-              this.inputForm.files = []
+            if (this.commonJS.isEmpty(this.inputForm.returnFiles)) {
+              this.inputForm.returnFiles = []
             }
             if (this.commonJS.isEmpty(this.inputForm.detailInfos)) {
               this.$message.error('至少填写一条领用详情信息')
@@ -517,7 +527,7 @@
                 }
               }
             }
-            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.inputForm.returnFiles = this.$refs.uploadComponent.getDataList()
             this.inputForm.statusReturn = '2'
             this.collectService.saveReturn(this.inputForm).then(({data}) => {
               this.inputForm.id = data.businessId
@@ -543,10 +553,10 @@
               this.loading = false
               return
             }
-            if (this.commonJS.isEmpty(this.inputForm.files)) {
-              this.inputForm.files = []
+            if (this.commonJS.isEmpty(this.inputForm.returnFiles)) {
+              this.inputForm.returnFiles = []
             }
-            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.inputForm.returnFiles = this.$refs.uploadComponent.getDataList()
             // this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then(({data}) => {
             //   if (this.commonJS.isNotEmpty(data)) {
             //     if (data === '仓库管理员审核') {

+ 10 - 3
src/views/modules/materialManagement/collect/CollectReturnHiForm.vue

@@ -190,7 +190,8 @@
           procInsIdReturn: '',
           processDefinitionIdReturn: '',
           returnId: '',
-          returnCause: ''
+          returnCause: '',
+          returnFiles: []
         },
         keyWatch: ''
       }
@@ -296,7 +297,8 @@
           procInsIdReturn: '',
           processDefinitionIdReturn: '',
           returnId: '',
-          returnCause: ''
+          returnCause: '',
+          returnFiles: []
         }
         this.title = '领用退回历史详情'
         this.inputForm.id = id
@@ -312,8 +314,10 @@
           this.loading = true
           this.$refs.inputForm.resetFields()
           this.collectService.findHiByHiId(this.inputForm.id).then(({data}) => {
+            this.$refs.uploadComponent.clearUpload()
             if (this.inputForm.id !== 'false') {
               this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
               }
@@ -333,7 +337,10 @@
                   }
                 }
               }
-              this.$refs.uploadComponent.newUpload('view', this.inputForm.files, 'material_collect')
+              if (this.commonJS.isEmpty(this.inputForm.returnFiles)) {
+                this.inputForm.returnFiles = []
+              }
+              this.$refs.uploadComponent.newUpload('view', this.inputForm.returnFiles, 'collect_return')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
             } else {