@@ -128,10 +139,26 @@
>
{{ operation.label }}
+
+ {{ hcsRepushingId === row.id ? '推送中…' : '推送合规' }}
+
+
+ 合规对账
+
删除
+
+
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;