Bladeren bron

调整优化任务看板的导入和导出

Lijy 3 jaren geleden
bovenliggende
commit
156356cddb
1 gewijzigde bestanden met toevoegingen van 9 en 2 verwijderingen
  1. 9 2
      fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

+ 9 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -658,7 +658,7 @@
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button type="primary" @click="exportTask" style="width:100%;" >导出</el-button>
+                <el-button type="primary" @click="exportTask" style="width:100%;" :loading="loadingExport">导出</el-button>
             </div>
         </el-dialog>
 
@@ -677,7 +677,7 @@
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-upload ref="upload" action="#" :limit="1" :http-request="importTask" :show-file-list="false">
-                        <el-button type="primary" :underline="false" style="width:100%;">上传文件</el-button>
+                        <el-button type="primary" :underline="false" style="width:100%;" :loading="loadingExport">上传文件</el-button>
                 </el-upload>
             </div>
         </el-dialog>
@@ -717,6 +717,7 @@
         
         data() {
             return {
+                loadingExport : false,
                 saveTemplateLoading: false,
                 joinMembList:[],
                 setInchargerDialog: false,
@@ -938,9 +939,11 @@
             // 批量导入人员
             importTask(item) {
                 //首先判断文件类型
+                this.loadingExport = true
                 let str = item.file.name.split(".");
                 let format = str[str.length - 1];
                 if (format != "xls" && format != "xlsx") {
+                    this.loadingExport = false
                     this.$message({
                         message: "请选择.xls或.xlsx文件",
                         type: "error"
@@ -956,6 +959,7 @@
                     res => {
                         this.$refs.upload.clearFiles();
                         this.listLoading = false;
+                        this.loadingExport = false
                         if (res.code == "ok") {
                             this.$message({
                                 message: "导入成功",
@@ -974,6 +978,7 @@
                     error => {
                         this.$refs.upload.clearFiles();
                         this.listLoading = false;
+                        this.loadingExport = false
                         this.$message({
                             message: error,
                             type: "error"
@@ -1061,8 +1066,10 @@
             },
             exportTask() {
                 let _this = this;
+                this.loadingExport = true
                 this.http.post('/task/exportTask', {projectId: this.curProjectId, taskType: this.exportTaskType},
                 res => {
+                    this.loadingExport = false
                     if (res.code == "ok") {
                         location.href = res.data;
                     } else {