From 411fdd24257ce8ffa567de44c65d0a4e79272b3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E6=B3=89=E4=BD=B3?= <1107186916@qq.com>
Date: Thu, 15 Oct 2026 19:42:02 +0800
Subject: [PATCH] =?UTF-8?q?:feat:=20=E9=A1=B9=E7=9B=AE=E7=AB=8B=E9=A1=B9?=
=?UTF-8?q?=E4=B8=8E=E5=90=88=E5=90=8C=E5=88=97=E8=A1=A8=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E6=89=B9=E9=87=8F=E6=8E=A8=E9=80=81=E5=90=88=E8=A7=84=E6=8C=89?=
=?UTF-8?q?=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/business/hcs.js | 9 +++++
src/views/business/contract-manage.vue | 46 ++++++++++++++++++++++++-
src/views/business/project-apply.vue | 47 +++++++++++++++++++++++++-
3 files changed, 100 insertions(+), 2 deletions(-)
diff --git a/src/api/business/hcs.js b/src/api/business/hcs.js
index 7039307..8ccfd1b 100644
--- a/src/api/business/hcs.js
+++ b/src/api/business/hcs.js
@@ -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`,
diff --git a/src/views/business/contract-manage.vue b/src/views/business/contract-manage.vue
index e6b5df1..811b738 100644
--- a/src/views/business/contract-manage.vue
+++ b/src/views/business/contract-manage.vue
@@ -32,6 +32,14 @@
>
批量导出
+
+ 批量推送合规
+
@@ -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`) &&
diff --git a/src/views/business/project-apply.vue b/src/views/business/project-apply.vue
index c83ee63..2ddc8ee 100644
--- a/src/views/business/project-apply.vue
+++ b/src/views/business/project-apply.vue
@@ -52,6 +52,15 @@
>
批量删除
+
+ 批量推送合规
+
@@ -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;