Files
tms-erp-web/src/views/business/hcs-master-data.vue
T

101 lines
3.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<basic-container class="hcs-master-data-page">
<div class="hcs-master-data-page__head">
<div class="dialog-section-title">合规主数据(HCS)</div>
<el-button type="primary" :loading="refreshing" @click="handleRefresh">刷新缓存</el-button>
</div>
<el-tabs v-model="activeTab">
<el-tab-pane label="合同模板" name="template" />
</el-tabs>
<el-table v-loading="loading" :data="templates" border>
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="fdId" label="模板ID(fdTemplateId)" min-width="320" show-overflow-tooltip />
<el-table-column prop="fdName" label="模板名称" min-width="220" show-overflow-tooltip />
<el-table-column prop="fdStatus" label="状态" width="100" align="center" />
<el-table-column prop="fdContractCharacter" label="合同性质" min-width="140" align="center" />
<el-table-column label="创建时间" min-width="170" align="center">
<template #default="{ row }">{{ formatTime(row.fdCreateTime) }}</template>
</el-table-column>
</el-table>
<el-alert
class="hcs-master-data-page__tip"
title="合同类别与合规模板的对应关系由 Nacos 配置 thirdParty.hcs.contract.template-mapping 维护;此列表用于核对映射的模板ID 是否存在。"
type="info"
:closable="false"
/>
</basic-container>
</template>
<script>
import { getTemplates, refreshMasterData } from '@/api/business/hcs';
export default {
name: 'HcsMasterData',
data() {
return {
activeTab: 'template',
loading: false,
refreshing: false,
templates: [],
};
},
created() {
this.loadTemplates();
},
methods: {
loadTemplates() {
this.loading = true;
getTemplates()
.then(response => {
const data = response?.data?.data ?? response?.data;
this.templates = Array.isArray(data) ? data : [];
})
.catch(() => {
this.$message.error('合规模板列表加载失败');
})
.finally(() => {
this.loading = false;
});
},
handleRefresh() {
this.refreshing = true;
refreshMasterData()
.then(response => {
this.$message.success(response?.data?.data || '合规主数据缓存已刷新');
this.loadTemplates();
})
.catch(error => {
this.$message.error(error?.response?.data?.msg || '刷新失败');
})
.finally(() => {
this.refreshing = false;
});
},
formatTime(value) {
if (!value) return '-';
return this.$dayjs(Number(value)).format('YYYY-MM-DD HH:mm:ss');
},
},
};
</script>
<style lang="scss" scoped>
.hcs-master-data-page__head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
.dialog-section-title {
margin-bottom: 0;
}
}
.hcs-master-data-page__tip {
margin-top: 12px;
}
</style>