🔥 移除合规对账功能

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
@@ -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>