feat: 立项与合同HCS前端接入——列表合规状态列/推送合规/合规对账弹窗、合同详情合规信息面板与特批发起、甲乙方客商风险提示、合规主数据页

This commit is contained in:
刘泉佳
2026-10-09 19:46:56 +08:00
parent 4294c92e43
commit ef1a43f947
9 changed files with 893 additions and 3 deletions
+83
View File
@@ -58,6 +58,17 @@
{{ displayStatus(row, 'approvalStatus') }}
</template>
<template #hcsSyncStatus="{ row }">
<el-tag
v-if="row.hcsSyncStatus"
:type="hcsSyncTagType(row.hcsSyncStatus)"
class="status-text"
>
{{ hcsSyncLabel(row.hcsSyncStatus) }}
</el-tag>
<span v-else>-</span>
</template>
<template #header>
<div class="project-apply-page__risk-search">
<span class="project-apply-page__risk-label">
@@ -128,10 +139,26 @@
>
{{ operation.label }}
</el-link>
<el-link
v-if="canHcsRepush(row)"
type="warning"
@click="handleHcsRepush(row)"
>
{{ hcsRepushingId === row.id ? '推送中…' : '推送合规' }}
</el-link>
<el-link v-if="canHcsRecon(row)" type="info" @click="openHcsRecon(row)">
合规对账
</el-link>
<el-link type="danger" v-if="canDelete(row)" @click="rowDel(row)"> 删除 </el-link>
</template>
</avue-crud>
<hcs-recon-dialog
v-model="hcsReconVisible"
title="项目立项合规对账"
:loader="hcsReconLoader"
/>
<empty-pagination
v-if="!isProjectFormPage"
:page="page"
@@ -902,6 +929,7 @@
import { exportBlob } from '@/api/common';
import { defineAsyncComponent } from 'vue';
import * as api from '@/api/business/project-apply';
import { repush as hcsRepush, reconProject } from '@/api/business/hcs';
import { getMkPublicDetail } from '@/api/mk-process';
import {
getList as getCustomerArchiveList,
@@ -1042,6 +1070,7 @@ export default {
name: 'ProjectApply',
components: {
CustomerArchive: defineAsyncComponent(() => import('@/views/vehicle/customer-archive.vue')),
HcsReconDialog: defineAsyncComponent(() => import('./components/hcs-recon-dialog.vue')),
ChangeRecordDetailDialog,
ElImageViewer,
OpenFileViewer,
@@ -1107,6 +1136,10 @@ export default {
{ label: '高风险', value: 'high', statKey: 'high' },
{ label: '中风险', value: 'medium', statKey: 'medium' },
],
// 合规(HCS)推送/对账状态
hcsRepushingId: null,
hcsReconVisible: false,
hcsReconLoader: null,
page: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
@@ -1578,6 +1611,56 @@ export default {
return this.canOperation(operation, row);
});
},
// ==================== 合规(HCS)推送/对账(照“同步金蝶”按钮模式) ====================
hcsSyncLabel(value) {
return { unsynced: '待推送', synced: '已推送', failed: '推送失败' }[value] || value;
},
hcsSyncTagType(value) {
return { unsynced: 'info', synced: 'success', failed: 'danger' }[value] || 'info';
},
canHcsRepush(row) {
return (
!this.readonlyScope &&
['approved', 'change_approved'].includes(row.approvalStatus) &&
row.hcsSyncStatus !== 'synced'
);
},
canHcsRecon(row) {
return ['approved', 'change_approved'].includes(row.approvalStatus);
},
handleHcsRepush(row) {
if (this.hcsRepushingId) return;
this.$confirm('确定推送该数据到合同合规系统?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.hcsRepushingId = row.id;
hcsRepush('project', row.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;
});
});
},
openHcsRecon(row) {
if (!row.projectCode) {
this.$message.warning('该项目无项目编号,无法对账');
return;
}
this.hcsReconLoader = () => reconProject(row.projectCode);
this.hcsReconVisible = true;
},
canOperation(operation, row) {
const permission = operation.permission || `${this.config.permission}_${operation.action}`;
if (!this.hasPermission(permission) || this.readonlyScope || row.readonly) return false;