瀏覽代碼

merge fix

scorpio 2 年之前
父節點
當前提交
65ad3b86ba
共有 2 個文件被更改,包括 11 次插入2 次删除
  1. 7 2
      src/components/uploads.vue
  2. 4 0
      src/views/home/component/form_dialog.vue

+ 7 - 2
src/components/uploads.vue

@@ -176,8 +176,13 @@ export default {
       this.$refs.upload.submit()
     },
     onError (res, file, fileList) {
-      console.log(res)
-      this.$message.error(res.msg)
+      const error = JSON.parse(res.message)
+      this.$confirm(error.msg, {
+        confirmButtonText: '确定',
+        type: 'warning'
+      }).then(() => {
+        this.$emit('error')
+      })
     }
   }
 }

+ 4 - 0
src/views/home/component/form_dialog.vue

@@ -13,6 +13,7 @@
           <span class="bold mr-20">文件上传</span>
           <div>
             <uploads ref='upload' max="9" btn-text="点击进行文件上传" @before="before" @success="upload"
+                     @error='loading = false'
                      :loading='loading'
                      :data='dept'
                      action='/api/wutong-parse-file/import-excel/v1/parse-excel'
@@ -147,6 +148,8 @@ export default {
           this.showExport = false
           this.showImport = false
           this.loading = false
+          this.deptName = ''
+          this.attaches = []
         }
       },
       immediate: true
@@ -195,6 +198,7 @@ export default {
       this.$message.success('操作成功')
       this.showImport = false
       this.loading = false
+      this.deptName = ''
       this.close()
     },
     before (files) {