提交 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,45 +1003,62 @@ export default { ...@@ -998,45 +1003,62 @@ 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);
let status = await this.getUploadExpressProgress(id);
if (status == 0) {
console.log("status------", status);
this.timer = setInterval(() => { this.timer = setInterval(() => {
getUploadExpressProgress(id).then((res) => { this.getUploadExpressProgress(id);
}, 2000);
}
},
getUploadExpressProgress(id) {
return getUploadExpressProgress(id).then((res) => {
if (res && res.code == "000000") { if (res && res.code == "000000") {
this.isLoading = false;
this.exportDialog = false; this.exportDialog = false;
this.progressFlag = true; this.progressFlag = true;
this.ProgressData = res.data; this.ProgressData = res.data;
...@@ -1047,21 +1069,33 @@ export default { ...@@ -1047,21 +1069,33 @@ export default {
this.statFlg = true; this.statFlg = true;
}, 2000); }, 2000);
} }
return res.data.status;
} else { } else {
this.isLoading = false;
this.$message.error(res.message); this.$message.error(res.message);
return;
} }
}); });
}, 1000);
}, },
// 获取批量取消进度 // 获取批量取消进度
getUploadRefundProgress(id) { async getUploadRefundProgressInterval(id) {
clearInterval(this.timer); clearInterval(this.timer);
let status = await this.getUploadRefundProgress(id);
if (status == 0) {
this.timer = setInterval(() => { this.timer = setInterval(() => {
getUploadRefundProgress(id).then((res) => { this.getUploadRefundProgress(id);
}, 2000);
}
},
getUploadRefundProgress(id) {
return getUploadRefundProgress(id).then((res) => {
if (res && res.code == "000000") { if (res && res.code == "000000") {
this.exportDialog = false; this.exportDialog = false;
this.progressFlag = true; this.progressFlag = true;
this.ProgressData = res.data; this.ProgressData = res.data;
this.isLoading = false;
if (res.data.status == 1) { if (res.data.status == 1) {
clearInterval(this.timer); clearInterval(this.timer);
setTimeout(() => { setTimeout(() => {
...@@ -1069,13 +1103,14 @@ export default { ...@@ -1069,13 +1103,14 @@ export default {
this.statFlg = true; this.statFlg = true;
}, 2000); }, 2000);
} }
return res.data.status;
} else { } else {
this.isLoading = false;
this.$message.error(res.message); this.$message.error(res.message);
return;
} }
}); });
}, 1000);
}, },
// 取消导入物流信息 // 取消导入物流信息
cancelExport() { cancelExport() {
(this.fileData = { (this.fileData = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册