浏览代码

文件上传

lizhenhao 2 年之前
父节点
当前提交
39e1e7a1b8
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14 3
      src/views/modules/sys/project/AssessForm.vue

+ 14 - 3
src/views/modules/sys/project/AssessForm.vue

@@ -414,7 +414,8 @@
           assessBaseMessage: '',
           invoiceMessage: '',
           isCommissionReimbursement: '',
-          itemType: ''
+          itemType: '',
+          workAttachments: []
         },
         filesArra2: [],
         fileList: [],
@@ -494,7 +495,8 @@
           assessBaseMessage: '',
           invoiceMessage: '',
           isCommissionReimbursement: '',
-          itemType: ''
+          itemType: '',
+          workAttachments: []
         }
         this.inputForm.id = id
         if (method === 'add') {
@@ -529,6 +531,15 @@
           if (valid) {
             this.loading = true
             this.inputForm.itemType = '1'
+            console.log(this.dataListNew)
+            this.dataListNew.forEach((item) => {
+              item.url = item.raw.url
+              item.attachmentFlag = 'projectRecords'
+              item.fileSize = item.size
+              item.attachmentName = item.name
+              this.inputForm.workAttachments.push(item)
+            })
+            console.log('workAttachments', this.inputForm.workAttachments)
             this.projectService.save(this.inputForm).then(({data}) => {
               this.close()
               this.$message.success(data)
@@ -545,7 +556,7 @@
         this.visible = false
       },
       httpRequest (file) {
-        httpRequest(file, fileName(file), 'project')
+        httpRequest(file, fileName(file), 'projectRecords')
       },
       handleRemove () {
         this.fileList = handleRemove()