Sfoglia il codice sorgente

导入订单添加防连点

gongwencan 1 mese fa
parent
commit
c2684abf1e
1 ha cambiato i file con 10 aggiunte e 3 eliminazioni
  1. 10 3
      src/components/DialogImport.vue

+ 10 - 3
src/components/DialogImport.vue

@@ -46,6 +46,7 @@
         >取消</el-button>
 
         <el-button
+          :disabled="!visible || isSave"
           type="primary"
           @click="onImportDataBtnClick"
         >确定</el-button>
@@ -71,7 +72,8 @@ export default {
     activeCollapseName: '1',
     uploadData: {
       file: null
-    }
+    },
+    isSave: false
   }),
   methods: {
     open () {
@@ -96,7 +98,10 @@ export default {
         if (!flag) {
           return
         }
-
+        if (this.isSave) {
+          return
+        }
+        this.isSave = true
         this.$$request(this.api, this.uploadData).then((data) => {
           if (data) {
             this.$notify({
@@ -109,7 +114,9 @@ export default {
             this.close()
             this.$emit('imported', data)
           }
-        }).catch(console.error).finally(() => {})
+        }).catch(console.error).finally(() => {
+          this.isSave = false
+        })
       })
     },
     close () {