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