Selaa lähdekoodia

企业微信工时导入提示框

seyason 3 vuotta sitten
vanhempi
commit
384fab489e

+ 9 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -789,7 +789,7 @@
             <div v-if="active==2" >
                 <p style="display: flex;justify-content: center;height:390px;">
                     <el-upload style="margin-top:100px;" ref="upload"  action="#" :limit="1" :http-request="batchImportWxData" :show-file-list="false">
-                        <el-button type="primary" :underline="false" >选择文件并上传</el-button>
+                        <el-button type="primary" :underline="false" :loading="importingData">选择文件并上传</el-button>
                     </el-upload>
                 </p>
             </div>
@@ -1151,7 +1151,7 @@
                         type: "error"
                     });
                 } else {
-                    this.listLoading = true;
+                    this.importingData = true;
                     let formData = new FormData();
                     formData.append("file", item.file);
                     formData.append("companyId", this.user.companyId);
@@ -1159,19 +1159,15 @@
                     this.http.uploadFile('/report/importData', formData,
                     res => {
                         this.$refs.upload.clearFiles();
-                        this.listLoading = false;
+                        this.showImportResult = true;
+                        this.importingData = false;
                         if (res.code == "ok") {
-                            this.$message({
-                                message: "成功导入"+res.data+"条工时数据",
-                                type: "success"
-                            });
+                            //换成弹出框,以免有人等了半天回来啥也没看到
+                            this.importResultMsg = "成功导入"+res.data+"条工时数据";
                             this.getReportList();
                             this.importWxDialog = false;
                         } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
+                            this.importResultMsg = "导入失败:"+res.msg;
                         }
                     },
                     error => {
@@ -1207,14 +1203,14 @@
                             //换成弹出框,以免有人等了半天回来啥也没看到
                             this.importResultMsg = "成功导入"+res.data+"条工时数据";
                             this.getReportList();
-                            this.importDialog = false;
+                            this.importWXDialog = false;
                         } else {
                             this.importResultMsg = "导入失败:"+res.msg;
                         }
                     },
                     error => {
                         this.$refs.upload.clearFiles();
-                        this.listLoading = false;
+                        this.importingData = false;
                         this.$message({
                             message: error,
                             type: "error"