Browse Source

清表上传

duy 2 years ago
parent
commit
6ac8ea5efd
1 changed files with 10 additions and 4 deletions
  1. 10 4
      src/views/exctab/excelmodel/excelmodel.vue

+ 10 - 4
src/views/exctab/excelmodel/excelmodel.vue

@@ -232,7 +232,7 @@
         </el-table>
       </span>
       <span slot="footer" class="dialog-footer">
-        <el-button @click="exceldialogVisible = false">取 消</el-button>
+        <el-button @click="cancleexceldialog">取 消</el-button>
         <el-button type="primary" @click="aumbitexcelmoudel">确 定上传</el-button>
       </span>
     </el-dialog>
@@ -1033,9 +1033,10 @@ export default {
     },
     aumbitexcelmoudel() {
       let formData = new FormData()
-      this.dataList.forEach((item,index) => {
-        formData.append(`filList[${index}].file`, item.raw)
-        formData.append(`filList[${index}].fileName`, item.name)
+      this.dataList.forEach((item) => {
+        // formData.append(`filList[${index}].file`, item.raw)
+        // formData.append(`filList[${index}].fileName`, item.name)
+        formData.append('file', item.raw,item.name)
       })
       formData.append('id',this.uploadId)
       const loading = this.$loading({
@@ -1057,6 +1058,11 @@ export default {
           loading.close();
         });
         this.$refs.excelmoudelupload.clearFiles();
+       
+    },
+    cancleexceldialog(){
+      this.exceldialogVisible=false
+      this.refreshTree()
     }
   },
   created() {