🔥 移除合规对账功能

This commit is contained in:
刘泉佳
2026-10-11 16:27:09 +08:00
parent ef1a43f947
commit 8640238cbe
5 changed files with 4 additions and 233 deletions
-24
View File
@@ -48,30 +48,6 @@ export const downloadAttachment = (fdId, name) =>
timeout: 120000,
});
export const reconProject = projectCode =>
request({
url: `${baseUrl}/recon/project`,
method: 'get',
params: { projectCode },
timeout: 30000,
});
export const reconContract = contractNo =>
request({
url: `${baseUrl}/recon/contract`,
method: 'get',
params: { contractNo },
timeout: 30000,
});
export const reconContractDetail = params =>
request({
url: `${baseUrl}/recon/contract/detail`,
method: 'get',
params,
timeout: 30000,
});
export const applyContractSpec = data =>
request({
url: `${baseUrl}/contract/spec-apply`,
@@ -20,7 +20,6 @@
>
确认特批结果
</el-button>
<el-button type="primary" plain @click="reconVisible = true">合规对账</el-button>
</div>
</div>
@@ -103,12 +102,6 @@
<el-button @click="specDialogVisible = false">取消</el-button>
</template>
</el-dialog>
<hcs-recon-dialog
v-model="reconVisible"
title="合同合规对账"
:loader="reconLoader"
/>
</section>
</template>
@@ -117,10 +110,8 @@ import { UploadFilled } from '@element-plus/icons-vue';
import {
applyContractSpec,
confirmContractSpec,
reconContract,
uploadAttachment,
} from '@/api/business/hcs';
import HcsReconDialog from './hcs-recon-dialog.vue';
const SYNC_STATUS_OPTIONS = [
{ label: '待推送', value: 'unsynced', type: 'info' },
@@ -137,7 +128,7 @@ const SPEC_STATUS_OPTIONS = [
export default {
name: 'HcsContractPanel',
components: { UploadFilled, HcsReconDialog },
components: { UploadFilled },
props: {
// 合同详情行(须含 id/hcsSyncStatus/hcsFdId/hcsRiskLevel/hcsBlackStatus/hcsSpecStatus 等)
contract: { type: Object, required: true },
@@ -148,7 +139,6 @@ export default {
specDialogVisible: false,
specApplying: false,
materials: [],
reconVisible: false,
};
},
computed: {
@@ -176,9 +166,6 @@ export default {
canApplySpec() {
return ['need', 'rejected'].includes(this.contract.hcsSpecStatus);
},
reconLoader() {
return () => reconContract(this.contract.contractNo);
},
},
methods: {
openSpecDialog() {
@@ -1,147 +0,0 @@
<template>
<el-dialog
:model-value="modelValue"
:title="title"
width="720px"
append-to-body
destroy-on-close
class="hcs-recon-dialog"
@update:model-value="value => $emit('update:modelValue', value)"
>
<div v-loading="loading" class="hcs-recon-dialog__body">
<el-alert
v-if="error"
:title="error"
type="error"
:closable="false"
class="hcs-recon-dialog__alert"
/>
<template v-else-if="!loading">
<div class="hcs-recon-dialog__download">
<el-input
v-model="downloadFdId"
placeholder="合规附件ID(C103-5 下载)"
clearable
style="width: 320px"
/>
<el-input
v-model="downloadName"
placeholder="保存文件名(可选)"
clearable
style="width: 200px"
/>
<el-button type="primary" plain :disabled="!downloadFdId" @click="download">
下载附件
</el-button>
</div>
<pre class="hcs-recon-dialog__json">{{ jsonText }}</pre>
</template>
</div>
<template #footer>
<el-button @click="$emit('update:modelValue', false)">关闭</el-button>
</template>
</el-dialog>
</template>
<script>
import { downloadAttachment } from '@/api/business/hcs';
export default {
name: 'HcsReconDialog',
props: {
modelValue: Boolean,
title: { type: String, default: '合规对账' },
// 对账加载函数:返回 Promise,resolve 结果对象
loader: { type: Function, default: null },
},
emits: ['update:modelValue'],
data() {
return {
loading: false,
error: '',
result: null,
downloadFdId: '',
downloadName: '',
};
},
computed: {
jsonText() {
if (this.result === null || this.result === undefined) return '';
try {
return JSON.stringify(this.result, null, 2);
} catch (error) {
return String(this.result);
}
},
},
watch: {
modelValue(visible) {
if (visible) this.load();
},
},
methods: {
load() {
if (!this.loader) return;
this.loading = true;
this.error = '';
this.result = null;
this.loader()
.then(response => {
const data = response?.data?.data ?? response?.data;
this.result = data && typeof data === 'object' && 'data' in data ? data.data : data;
})
.catch(error => {
this.error = error?.response?.data?.msg || error?.message || '合规对账查询失败';
})
.finally(() => {
this.loading = false;
});
},
download() {
downloadAttachment(this.downloadFdId, this.downloadName || undefined)
.then(response => {
const blob = new Blob([response.data]);
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = this.downloadName || `hcs-attachment-${this.downloadFdId}`;
link.click();
URL.revokeObjectURL(url);
this.$message.success('下载成功');
})
.catch(() => {
this.$message.error('附件下载失败,请确认合规附件ID');
});
},
},
};
</script>
<style lang="scss" scoped>
.hcs-recon-dialog__body {
min-height: 120px;
}
.hcs-recon-dialog__alert {
margin-bottom: 8px;
}
.hcs-recon-dialog__download {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.hcs-recon-dialog__json {
max-height: 420px;
margin: 0;
padding: 12px;
overflow: auto;
font-size: 12px;
line-height: 1.6;
word-break: break-all;
white-space: pre-wrap;
background: #f5f7fa;
border-radius: 4px;
}
</style>
+1 -23
View File
@@ -102,17 +102,10 @@
<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 v-if="canDelete(row)" type="danger" @click="removeRow(row)">删除</el-link>
</template>
</avue-crud>
<hcs-recon-dialog
v-model="hcsReconVisible"
title="合同合规对账"
:loader="hcsReconLoader"
/>
<empty-pagination
:page="page"
@size-change="sizeChange"
@@ -1043,7 +1036,7 @@ 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, reconContract, getRisk } from '@/api/business/hcs';
import { repush as hcsRepush, getRisk } from '@/api/business/hcs';
import { getMkPublicDetail } from '@/api/mk-process';
import { getList as getProjectList } from '@/api/business/project-apply';
import { getList as getCustomerArchiveList } from '@/api/vehicle/customer-archive';
@@ -1061,7 +1054,6 @@ import ContractAttachmentSection, {
attachmentUrl as sharedAttachmentUrl,
normalizeContractFileRows,
} from './components/contract-attachment-section.vue';
import HcsReconDialog from './components/hcs-recon-dialog.vue';
import HcsContractPanel from './components/hcs-contract-panel.vue';
import PdfPreview from '@/components/pdf-preview/main.vue';
import { ElImageViewer, ElCascader } from 'element-plus';
@@ -1219,7 +1211,6 @@ export default {
ContractAttachmentSection,
BillingPlanEditor,
ChangeRecordDetailDialog,
HcsReconDialog,
HcsContractPanel,
ElImageViewer,
OpenFileViewer,
@@ -1327,8 +1318,6 @@ export default {
detailRow: {},
// 合规(HCS)推送/对账状态
hcsRepushingId: null,
hcsReconVisible: false,
hcsReconLoader: null,
detailContractFileRows: [],
detailAttachmentRows: [],
detailBillingPlanRows: [],
@@ -1646,9 +1635,6 @@ export default {
row.hcsSyncStatus !== 'synced'
);
},
canHcsRecon(row) {
return ['approved', 'change_approved'].includes(row.approvalStatus);
},
handleHcsRepush(row) {
if (this.hcsRepushingId) return;
this.$confirm('确定推送该数据到合同合规系统?', '提示', {
@@ -1674,14 +1660,6 @@ export default {
});
});
},
openHcsRecon(row) {
if (!row.contractNo) {
this.$message.warning('该合同无合同编号,无法对账');
return;
}
this.hcsReconLoader = () => reconContract(row.contractNo);
this.hcsReconVisible = true;
},
canEdit(row) {
return (
this.hasPermission(`${this.config.permission}_edit`) &&
+2 -25
View File
@@ -146,19 +146,10 @@
>
{{ 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"
@@ -929,7 +920,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 { repush as hcsRepush } from '@/api/business/hcs';
import { getMkPublicDetail } from '@/api/mk-process';
import {
getList as getCustomerArchiveList,
@@ -1070,7 +1061,6 @@ export default {
name: 'ProjectApply',
components: {
CustomerArchive: defineAsyncComponent(() => import('@/views/vehicle/customer-archive.vue')),
HcsReconDialog: defineAsyncComponent(() => import('./components/hcs-recon-dialog.vue')),
ChangeRecordDetailDialog,
ElImageViewer,
OpenFileViewer,
@@ -1136,10 +1126,8 @@ export default {
{ label: '高风险', value: 'high', statKey: 'high' },
{ label: '中风险', value: 'medium', statKey: 'medium' },
],
// 合规(HCS)推送/对账状态
// 合规(HCS)推送状态
hcsRepushingId: null,
hcsReconVisible: false,
hcsReconLoader: null,
page: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
@@ -1625,9 +1613,6 @@ export default {
row.hcsSyncStatus !== 'synced'
);
},
canHcsRecon(row) {
return ['approved', 'change_approved'].includes(row.approvalStatus);
},
handleHcsRepush(row) {
if (this.hcsRepushingId) return;
this.$confirm('确定推送该数据到合同合规系统?', '提示', {
@@ -1653,14 +1638,6 @@ export default {
});
});
},
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;