hare8999@163.com 2 gadi atpakaļ
vecāks
revīzija
2f8e85256f

+ 16 - 8
src/views/questioncenter/components/generate-tabs/paper-work-publish.vue

@@ -85,7 +85,8 @@ export default {
         defaultSelected: [],
         defaultRemark: '',
         dialogVisible: false
-      }
+      },
+      uploading: false
     }
   },
   computed: {
@@ -139,14 +140,21 @@ export default {
       this.uploadOption.dialogVisible = true
     },
     async handleUploadReady(type, name, selectData) {
-      const commit = {
-        workId: this.uploadWork.id,
-        stuIds: selectData.checkedStudent,
-        remark: selectData.remark
+      if (this.uploading) return
+      this.uploading = true
+      try {
+        const commit = {
+          workId: this.uploadWork.id,
+          stuIds: selectData.checkedStudent,
+          remark: selectData.remark
+        }
+        await publicStudentHomework(commit)
+        this.uploadOption.dialogVisible = false
+        this.msgSuccess('发布成功')
+        this.uploading = false
+      } catch (e) {
+        this.uploading = false
       }
-      await publicStudentHomework(commit)
-      this.uploadOption.dialogVisible = false
-      this.msgSuccess('发布成功')
       await this.getList()
     }
   }