提交 6547d0ef 编写于 作者: lyf's avatar lyf

添加立即执行按钮loading

上级 b91903c1
...@@ -662,7 +662,11 @@ ...@@ -662,7 +662,11 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelExport">取消</el-button> <el-button size="small" @click="cancelExport">取消</el-button>
<el-button size="small" type="primary" @click="confirmExport" <el-button
size="small"
:loading="isLoading"
type="primary"
@click="confirmExport"
>确认</el-button >确认</el-button
> >
</div> </div>
...@@ -948,9 +952,9 @@ export default { ...@@ -948,9 +952,9 @@ export default {
brokerOwnerList: [], brokerOwnerList: [],
showOrderNoFlag: false, showOrderNoFlag: false,
LogisticsUrl: LogisticsUrl:
"https://pica-pro.oss-cn-shanghai.aliyuncs.com/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/2021/08/11/20210811143152984-191c5df6.xlsx", "https://pica-pro.oss-cn-shanghai.aliyuncs.com/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/2021/08/12/20210812101318239-4c4e680b.xlsx",
CancelOrderUrl: CancelOrderUrl:
"https://pica-pro.oss-cn-shanghai.aliyuncs.com/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/2021/08/11/20210811143101795-d6363772.xlsx", "https://pica-pro.oss-cn-shanghai.aliyuncs.com/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet/2021/08/12/2021081210125196-5a8743b1.xlsx",
timer: null, timer: null,
pickerOptions1: { pickerOptions1: {
disabledDate: (time) => { disabledDate: (time) => {
...@@ -968,6 +972,7 @@ export default { ...@@ -968,6 +972,7 @@ export default {
errorFileUrl: "", // 失败 原因文件 errorFileUrl: "", // 失败 原因文件
errorList: [], // 失败列表 errorList: [], // 失败列表
}, },
isLoading: false,
// errorFileUrl:"", // errorFileUrl:"",
}; };
}, },
...@@ -998,84 +1003,114 @@ export default { ...@@ -998,84 +1003,114 @@ export default {
}, },
// 批量更新物流操作 // 批量更新物流操作
uploadExpress() { uploadExpress() {
this.isLoading = true;
openLoading(this); openLoading(this);
uploadExpress(this.fileData) uploadExpress(this.fileData)
.then((res) => { .then((res) => {
if (res && res.code == "000000") { if (res && res.code == "000000") {
closeLoading(this); closeLoading(this);
this.getUploadExpressProgress(res.data.tradeBatchUploadLogId); this.getUploadExpressProgressInterval(
res.data.tradeBatchUploadLogId
);
} else { } else {
this.isLoading = false;
this.$message.error(res.message); this.$message.error(res.message);
} }
}) })
.catch((err) => { .catch((err) => {
this.isLoading = false;
closeLoading(this); closeLoading(this);
}); });
}, },
// 批量取消退款操作 // 批量取消退款操作
uploadRefund() { uploadRefund() {
this.isLoading = true;
openLoading(this); openLoading(this);
uploadRefund(this.fileData) uploadRefund(this.fileData)
.then((res) => { .then((res) => {
console.log(res); console.log(res);
if (res && res.code == "000000") { if (res && res.code == "000000") {
closeLoading(this); closeLoading(this);
this.getUploadRefundProgress(res.data.tradeBatchUploadLogId); this.getUploadRefundProgressInterval(res.data.tradeBatchUploadLogId);
} else { } else {
this.isLoading = false;
this.$message.error(res.message); this.$message.error(res.message);
} }
}) })
.catch((err) => { .catch((err) => {
this.isLoading = false;
closeLoading(this); closeLoading(this);
}); });
}, },
// 获取物流上传进度 // 获取物流上传进度
getUploadExpressProgress(id) { async getUploadExpressProgressInterval(id) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = setInterval(() => { let status = await this.getUploadExpressProgress(id);
getUploadExpressProgress(id).then((res) => { if (status == 0) {
if (res && res.code == "000000") { console.log("status------", status);
this.exportDialog = false; this.timer = setInterval(() => {
this.progressFlag = true; this.getUploadExpressProgress(id);
this.ProgressData = res.data; }, 2000);
if (res.data.status == 1) { }
clearInterval(this.timer); },
setTimeout(() => { getUploadExpressProgress(id) {
this.progressFlag = false; return getUploadExpressProgress(id).then((res) => {
this.statFlg = true; if (res && res.code == "000000") {
}, 2000); this.isLoading = false;
} this.exportDialog = false;
} else { this.progressFlag = true;
this.$message.error(res.message); this.ProgressData = res.data;
if (res.data.status == 1) {
clearInterval(this.timer);
setTimeout(() => {
this.progressFlag = false;
this.statFlg = true;
}, 2000);
} }
}); return res.data.status;
}, 1000); } else {
this.isLoading = false;
this.$message.error(res.message);
return;
}
});
}, },
// 获取批量取消进度 // 获取批量取消进度
getUploadRefundProgress(id) { async getUploadRefundProgressInterval(id) {
clearInterval(this.timer); clearInterval(this.timer);
this.timer = setInterval(() => { let status = await this.getUploadRefundProgress(id);
getUploadRefundProgress(id).then((res) => { if (status == 0) {
if (res && res.code == "000000") { this.timer = setInterval(() => {
this.exportDialog = false; this.getUploadRefundProgress(id);
this.progressFlag = true; }, 2000);
this.ProgressData = res.data; }
if (res.data.status == 1) {
clearInterval(this.timer);
setTimeout(() => {
this.progressFlag = false;
this.statFlg = true;
}, 2000);
}
} else {
this.$message.error(res.message);
}
});
}, 1000);
}, },
getUploadRefundProgress(id) {
return getUploadRefundProgress(id).then((res) => {
if (res && res.code == "000000") {
this.exportDialog = false;
this.progressFlag = true;
this.ProgressData = res.data;
this.isLoading = false;
if (res.data.status == 1) {
clearInterval(this.timer);
setTimeout(() => {
this.progressFlag = false;
this.statFlg = true;
}, 2000);
}
return res.data.status;
} else {
this.isLoading = false;
this.$message.error(res.message);
return;
}
});
},
// 取消导入物流信息 // 取消导入物流信息
cancelExport() { cancelExport() {
(this.fileData = { (this.fileData = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册