Compare commits

..
2 Commits
2 changed files with 36 additions and 20 deletions
+18 -10
View File
@@ -1771,6 +1771,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
// 同步推送合规耗时较长,加遮罩防重复操作(照审批通过遮罩)
const loading = this.$loading({
lock: true,
text: '正在推送合规,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
});
this.hcsRepushingId = row.id; this.hcsRepushingId = row.id;
hcsRepush('contract', row.id) hcsRepush('contract', row.id)
.then(res => { .then(res => {
@@ -1781,14 +1787,12 @@ export default {
this.$message.success(res.data?.data || '推送合规成功'); this.$message.success(res.data?.data || '推送合规成功');
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}) })
.catch(error => { .catch(() => {
// 拦截器已弹出后端 msg(如特批审核中禁止重推),此处不再重复提示 // 失败原因由 axios 拦截器统一弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '推送合规失败');
}
}) })
.finally(() => { .finally(() => {
this.hcsRepushingId = null; this.hcsRepushingId = null;
loading.close();
}); });
}); });
}, },
@@ -1808,6 +1812,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
// 同步推送合规耗时较长,加遮罩防重复操作(照审批通过遮罩)
const loading = this.$loading({
lock: true,
text: '正在批量推送合规,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
});
this.hcsRepushingId = 'batch'; this.hcsRepushingId = 'batch';
hcsRepushBatch('contract', this.selectionList.map(item => item.id)) hcsRepushBatch('contract', this.selectionList.map(item => item.id))
.then(res => { .then(res => {
@@ -1818,14 +1828,12 @@ export default {
this.$message.success(res.data?.data || '批量推送合规完成'); this.$message.success(res.data?.data || '批量推送合规完成');
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}) })
.catch(error => { .catch(() => {
// 拦截器已弹出后端 msg,此处不再重复提示 // 失败原因由 axios 拦截器统一弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '批量推送合规失败');
}
}) })
.finally(() => { .finally(() => {
this.hcsRepushingId = null; this.hcsRepushingId = null;
loading.close();
}); });
}); });
}, },
+18 -10
View File
@@ -1670,6 +1670,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
// 同步推送合规耗时较长,加遮罩防重复操作(照审批通过遮罩)
const loading = this.$loading({
lock: true,
text: '正在推送合规,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
});
this.hcsRepushingId = row.id; this.hcsRepushingId = row.id;
hcsRepush('project', row.id) hcsRepush('project', row.id)
.then(res => { .then(res => {
@@ -1680,14 +1686,12 @@ export default {
this.$message.success(res.data?.data || '推送合规成功'); this.$message.success(res.data?.data || '推送合规成功');
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}) })
.catch(error => { .catch(() => {
// 拦截器已弹出后端 msg,此处不再重复提示 // 失败原因由 axios 拦截器统一弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '推送合规失败');
}
}) })
.finally(() => { .finally(() => {
this.hcsRepushingId = null; this.hcsRepushingId = null;
loading.close();
}); });
}); });
}, },
@@ -1707,6 +1711,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { }).then(() => {
// 同步推送合规耗时较长,加遮罩防重复操作(照审批通过遮罩)
const loading = this.$loading({
lock: true,
text: '正在批量推送合规,请稍候…',
background: 'rgba(255, 255, 255, 0.6)',
});
this.hcsRepushingId = 'batch'; this.hcsRepushingId = 'batch';
hcsRepushBatch('project', this.selectionList.map(item => item.id)) hcsRepushBatch('project', this.selectionList.map(item => item.id))
.then(res => { .then(res => {
@@ -1717,14 +1727,12 @@ export default {
this.$message.success(res.data?.data || '批量推送合规完成'); this.$message.success(res.data?.data || '批量推送合规完成');
this.onLoad(this.page, this.query); this.onLoad(this.page, this.query);
}) })
.catch(error => { .catch(() => {
// 拦截器已弹出后端 msg,此处不再重复提示 // 失败原因由 axios 拦截器统一弹出后端 msg,此处不再重复提示
if (!error?._notified) {
this.$message.error(error?.response?.data?.msg || '批量推送合规失败');
}
}) })
.finally(() => { .finally(() => {
this.hcsRepushingId = null; this.hcsRepushingId = null;
loading.close();
}); });
}); });
}, },