Browse Source

导入文件

lilei 3 năm trước cách đây
mục cha
commit
256adf1e5e

+ 6 - 1
src/components/UploadFile/index.vue

@@ -182,9 +182,14 @@ export default {
         } else if (this.uploadType == 'attach') { // 附件    将接口的返回数据返回页面
           a.map(item => {
             if (item.response && item.status == 'done') {
-              temp = [...temp, ...item.response.data]
+              if (item.response.data instanceof Array) {
+                temp = [...temp, ...item.response.data]
+              } else {
+                temp = [...temp, ...[item.response.data]]
+              }
             }
           })
+          console.log(temp)
           obj = JSON.stringify(temp)
         }
       }

+ 1 - 0
src/views/expenseManagement/expenseReimbursement/importGuideModal.vue

@@ -105,6 +105,7 @@ export default {
     },
     // 上传文件  change
     changeImport (file) {
+      console.log(file, JSON.parse(file))
       if (file && JSON.parse(file).length > 0) {
         this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.params)
       } else {