:feat: 项目立项与合同列表新增批量推送合规按钮

This commit is contained in:
刘泉佳
2026-10-15 19:42:02 +08:00
parent 7ea96bcdc0
commit 411fdd2425
3 changed files with 100 additions and 2 deletions
+9
View File
@@ -10,6 +10,15 @@ export const repush = (bizType, id) =>
timeout: 60000,
});
// 批量推送为逐条同步推送,耗时随勾选行数线性增长,进一步放宽超时
export const repushBatch = (bizType, ids) =>
request({
url: `${baseUrl}/sync/${bizType}/batch`,
method: 'post',
data: ids,
timeout: 300000,
});
export const getTemplates = () =>
request({
url: `${baseUrl}/master-data/template`,
+45 -1
View File
@@ -32,6 +32,14 @@
>
批量导出
</el-button>
<el-button
type="warning"
plain
:loading="hcsRepushingId === 'batch'"
@click="handleHcsBatchRepush"
>
<el-icon class="el-icon--left"><Position /></el-icon>批量推送合规
</el-button>
</template>
<template #header>
@@ -1072,7 +1080,8 @@ import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { exportBlob } from '@/api/common';
import * as api from '@/api/business/contract-manage';
import { repush as hcsRepush, getRisk } from '@/api/business/hcs';
import { repush as hcsRepush, repushBatch as hcsRepushBatch, getRisk } from '@/api/business/hcs';
import { Position } from '@element-plus/icons-vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { getList as getProjectList } from '@/api/business/project-apply';
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
@@ -1270,6 +1279,7 @@ export default {
ElImageViewer,
OpenFileViewer,
PdfPreview,
Position,
},
data() {
return {
@@ -1749,6 +1759,40 @@ export default {
});
});
},
handleHcsBatchRepush() {
if (this.hcsRepushingId) return;
if (!this.selectionList.length) {
this.$message.warning('请选择至少一条数据');
return;
}
const invalidCount = this.selectionList.filter(item => !this.canHcsRepush(item)).length;
if (invalidCount) {
this.$message.warning(`选中数据中有${invalidCount}条不符合推送条件(仅审批通过且未同步的可推送),请重新选择`);
return;
}
this.$confirm(`确定将选中的${this.selectionList.length}条数据推送到合同合规系统?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = 'batch';
hcsRepushBatch('contract', this.selectionList.map(item => item.id))
.then(res => {
if (res.data?.success === false) {
this.$message.error(res.data?.msg || '批量推送合规失败');
return;
}
this.$message.success(res.data?.data || '批量推送合规完成');
this.onLoad(this.page, this.query);
})
.catch(error => {
this.$message.error(error?.response?.data?.msg || '批量推送合规失败');
})
.finally(() => {
this.hcsRepushingId = null;
});
});
},
canEdit(row) {
return (
this.hasPermission(`${this.config.permission}_edit`) &&
+46 -1
View File
@@ -52,6 +52,15 @@
>
批量删除
</el-button>
<el-button
type="warning"
plain
v-if="!readonlyScope"
:loading="hcsRepushingId === 'batch'"
@click="handleHcsBatchRepush"
>
<el-icon class="el-icon--left"><Position /></el-icon>批量推送合规
</el-button>
</template>
<template #approvalStatus="{ row }">
@@ -934,7 +943,8 @@
import { exportBlob } from '@/api/common';
import { defineAsyncComponent } from 'vue';
import * as api from '@/api/business/project-apply';
import { repush as hcsRepush } from '@/api/business/hcs';
import { repush as hcsRepush, repushBatch as hcsRepushBatch } from '@/api/business/hcs';
import { Position } from '@element-plus/icons-vue';
import { getMkPublicDetail } from '@/api/mk-process';
import {
getList as getCustomerArchiveList,
@@ -1079,6 +1089,7 @@ export default {
ElImageViewer,
OpenFileViewer,
PdfPreview,
Position,
},
data() {
const validateAmount = (rule, value, callback) => {
@@ -1672,6 +1683,40 @@ export default {
});
});
},
handleHcsBatchRepush() {
if (this.hcsRepushingId) return;
if (!this.selectionList.length) {
this.$message.warning('请选择至少一条数据');
return;
}
const invalidCount = this.selectionList.filter(item => !this.canHcsRepush(item)).length;
if (invalidCount) {
this.$message.warning(`选中数据中有${invalidCount}条不符合推送条件(仅审批通过且未同步的可推送),请重新选择`);
return;
}
this.$confirm(`确定将选中的${this.selectionList.length}条数据推送到合同合规系统?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = 'batch';
hcsRepushBatch('project', this.selectionList.map(item => item.id))
.then(res => {
if (res.data?.success === false) {
this.$message.error(res.data?.msg || '批量推送合规失败');
return;
}
this.$message.success(res.data?.data || '批量推送合规完成');
this.onLoad(this.page, this.query);
})
.catch(error => {
this.$message.error(error?.response?.data?.msg || '批量推送合规失败');
})
.finally(() => {
this.hcsRepushingId = null;
});
});
},
canOperation(operation, row) {
const permission = operation.permission || `${this.config.permission}_${operation.action}`;
if (!this.hasPermission(permission) || this.readonlyScope || row.readonly) return false;