Browse Source

合同信息修改

lizhenhao 2 năm trước cách đây
mục cha
commit
e96c37312a
1 tập tin đã thay đổi với 15 bổ sung6 xóa
  1. 15 6
      src/views/modules/sys/workContract/WorkContractFileForm.vue

+ 15 - 6
src/views/modules/sys/workContract/WorkContractFileForm.vue

@@ -413,19 +413,21 @@
         }
         this.visible = true
         this.loading = false
-        this.$nextTick(() => {
+        this.$nextTick(async () => {
           this.$refs.inputForm.resetFields()
           if (method === 'edit' || method === 'view') { // 修改或者查看
             this.loading = true
-            this.workContractService.findById(this.inputForm.id).then(({data}) => {
+            await this.workContractService.findById(this.inputForm.id).then(async ({data}) => {
               if (this.commonJS.isEmpty(data.id)) {
                 this.workContractFileService.findById(this.inputForm.id).then(({data}) => {
-                  this.workContractService.findById(data.contractInfoId).then(({data}) => {
-                    this.inputForm = this.recover(this.inputForm, data)
+                  this.workContractService.findById(data.contractInfoId).then(async ({data}) => {
+                    await this.saveData(data)
+                    this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract', 300, '合同文本、补充协议')
                   })
                 })
               } else {
-                this.inputForm = this.recover(this.inputForm, data)
+                await this.saveData(data)
+                this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract', 300, '合同文本、补充协议')
               }
               const f = []
               if (data.fees !== null && data.fees !== undefined && data.fees !== '') {
@@ -436,12 +438,19 @@
                 })
               }
               this.inputForm.contractFees = f
-              this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract', 300, '合同文本、补充协议')
               this.loading = false
             })
+            // setTimeout(() => {
+            //   console.log('123', this.inputForm.workAttachmentList)
+            //   this.$refs.uploadComponent.newUpload(method, this.inputForm.workAttachmentList, 'workContract', 300, '合同文本、补充协议')
+            // }, 500)
           }
         })
       },
+      saveData (data) {
+        this.inputForm = this.recover(this.inputForm, data)
+        this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+      },
       // 表单提交
       // 暂存
       async saveForm (callback) {