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

添加立即执行按钮loading

上级 b91903c1
......@@ -662,7 +662,11 @@
</el-form>
<div slot="footer" class="dialog-footer">
<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
>
</div>
......@@ -948,9 +952,9 @@ export default {
brokerOwnerList: [],
showOrderNoFlag: false,
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:
"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,
pickerOptions1: {
disabledDate: (time) => {
......@@ -968,6 +972,7 @@ export default {
errorFileUrl: "", // 失败 原因文件
errorList: [], // 失败列表
},
isLoading: false,
// errorFileUrl:"",
};
},
......@@ -998,84 +1003,114 @@ export default {
},
// 批量更新物流操作
uploadExpress() {
this.isLoading = true;
openLoading(this);
uploadExpress(this.fileData)
.then((res) => {
if (res && res.code == "000000") {
closeLoading(this);
this.getUploadExpressProgress(res.data.tradeBatchUploadLogId);
this.getUploadExpressProgressInterval(
res.data.tradeBatchUploadLogId
);
} else {
this.isLoading = false;
this.$message.error(res.message);
}
})
.catch((err) => {
this.isLoading = false;
closeLoading(this);
});
},
// 批量取消退款操作
uploadRefund() {
this.isLoading = true;
openLoading(this);
uploadRefund(this.fileData)
.then((res) => {
console.log(res);
if (res && res.code == "000000") {
closeLoading(this);
this.getUploadRefundProgress(res.data.tradeBatchUploadLogId);
this.getUploadRefundProgressInterval(res.data.tradeBatchUploadLogId);
} else {
this.isLoading = false;
this.$message.error(res.message);
}
})
.catch((err) => {
this.isLoading = false;
closeLoading(this);
});
},
// 获取物流上传进度
getUploadExpressProgress(id) {
async getUploadExpressProgressInterval(id) {
clearInterval(this.timer);
this.timer = setInterval(() => {
getUploadExpressProgress(id).then((res) => {
if (res && res.code == "000000") {
this.exportDialog = false;
this.progressFlag = true;
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);
let status = await this.getUploadExpressProgress(id);
if (status == 0) {
console.log("status------", status);
this.timer = setInterval(() => {
this.getUploadExpressProgress(id);
}, 2000);
}
},
getUploadExpressProgress(id) {
return getUploadExpressProgress(id).then((res) => {
if (res && res.code == "000000") {
this.isLoading = false;
this.exportDialog = false;
this.progressFlag = true;
this.ProgressData = res.data;
if (res.data.status == 1) {
clearInterval(this.timer);
setTimeout(() => {
this.progressFlag = false;
this.statFlg = true;
}, 2000);
}
});
}, 1000);
return res.data.status;
} else {
this.isLoading = false;
this.$message.error(res.message);
return;
}
});
},
// 获取批量取消进度
getUploadRefundProgress(id) {
async getUploadRefundProgressInterval(id) {
clearInterval(this.timer);
this.timer = setInterval(() => {
getUploadRefundProgress(id).then((res) => {
if (res && res.code == "000000") {
this.exportDialog = false;
this.progressFlag = true;
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);
let status = await this.getUploadRefundProgress(id);
if (status == 0) {
this.timer = setInterval(() => {
this.getUploadRefundProgress(id);
}, 2000);
}
},
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() {
(this.fileData = {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册