feat(credit): 添加信用模块主体企业归属修正功能

- 新增 refreshCreditCompanyId API 方法用于修正信用模块数据的企业归属
- 创建 RefreshCompanyIdButton 组件提供统一的修正企业归属按钮界面
- 在多个信用模块页面集成修正企业归属功能按钮
- 更新 CreditSearchToolbar 组件添加修正企业归属按钮
- 修改多个信用模块页面布局结构调整工具栏元素顺序
- 启用 .env.development 中的 API URL 配置
This commit is contained in:
2026-01-20 22:12:39 +08:00
parent d5e2c43f4e
commit fa188f482b
24 changed files with 346 additions and 202 deletions

View File

@@ -1,5 +1,5 @@
VITE_APP_NAME=后台管理(开发环境)
#VITE_API_URL=http://127.0.0.1:9200/api
VITE_API_URL=http://127.0.0.1:9200/api
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api

View File

@@ -0,0 +1,27 @@
import request from '@/utils/request';
import type { ApiResult } from '@/api';
/**
* 修正某个信用模块数据的主体企业归属(按名称匹配回填 companyId
*
* 后端约定: POST /api/credit/{module}/company-id/refresh
* 例如: module = "credit-judgment-debtor"
*/
export async function refreshCreditCompanyId(
module: string,
params?: {
onlyNull?: boolean;
limit?: number;
}
) {
const res = await request.post<ApiResult<unknown>>(
`/credit/${module}/company-id/refresh`,
undefined,
{ params }
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,24 +1,25 @@
<!-- 信用模块通用工具栏 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-button class="ele-btn-icon" @click="openImport">
<template #icon>
<CloudUploadOutlined />
<CloudUploadOutlined/>
</template>
<span>导入()</span>
</a-button>
<a-button class="ele-btn-icon" @click="exportData">
<template #icon>
<CloudDownloadOutlined />
<CloudDownloadOutlined/>
</template>
<span>导出</span>
</a-button>
<RefreshCompanyIdButton module="credit-case-filing" @done="reload"/>
<a-button
danger
class="ele-btn-icon"
@@ -26,7 +27,7 @@
@click="remove"
>
<template #icon>
<DeleteOutlined />
<DeleteOutlined/>
</template>
<span>批量删除</span>
</a-button>
@@ -42,57 +43,57 @@
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import {
PlusOutlined,
import {computed, ref} from 'vue';
import {
CloudUploadOutlined,
CloudDownloadOutlined,
DeleteOutlined
} from '@ant-design/icons-vue';
} from '@ant-design/icons-vue';
import RefreshCompanyIdButton from "@/views/credit/components/RefreshCompanyIdButton.vue";
const props = withDefaults(
const props = withDefaults(
defineProps<{
selection?: any[];
}>(),
{
selection: () => []
}
);
);
const emit = defineEmits<{
const emit = defineEmits<{
(e: 'search', where?: { keywords?: string }): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
(e: 'importData'): void;
(e: 'exportData'): void;
}>();
}>();
const keywords = ref('');
const selection = computed(() => props.selection || []);
const keywords = ref('');
const selection = computed(() => props.selection || []);
// 新增
const add = () => {
// 新增
const add = () => {
emit('add');
};
};
// 搜索
const handleSearch = () => {
emit('search', { keywords: keywords.value });
};
// 搜索
const handleSearch = () => {
emit('search', {keywords: keywords.value});
};
// 导入
const openImport = () => {
// 导入
const openImport = () => {
emit('importData');
};
};
// 导出
const exportData = () => {
// 导出
const exportData = () => {
emit('exportData');
};
};
// 批量删除
const remove = () => {
// 批量删除
const remove = () => {
emit('remove');
};
};
</script>

View File

@@ -0,0 +1,60 @@
<template>
<a-button class="ele-btn-icon" @click="confirmRefresh">
修正主体企业归属
</a-button>
</template>
<script lang="ts" setup>
import { createVNode } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { refreshCreditCompanyId } from '@/api/credit/companyId';
const props = withDefaults(
defineProps<{
/** 后端模块路径片段,如: credit-breach-of-trust */
module: string;
/** 默认 true仅更新 companyId 为空/0 的数据(由后端实现决定) */
onlyNull?: boolean;
/** 可选,限制处理条数 */
limit?: number;
/** 确认弹窗文案 */
content?: string;
}>(),
{
onlyNull: true,
content:
'将按记录名称匹配企业名称并回填 companyId默认仅更新 companyId 为0的数据确定要执行吗'
}
);
const emit = defineEmits<{
(e: 'done'): void;
}>();
const confirmRefresh = () => {
Modal.confirm({
title: '提示',
content: props.content,
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
return refreshCreditCompanyId(props.module, {
onlyNull: props.onlyNull,
limit: props.limit
})
.then((msg) => {
hide();
message.success(msg || '操作成功');
emit('done');
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
</script>

View File

@@ -14,6 +14,10 @@
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton
module="credit-administrative-license"
@done="reload"
/>
<search
@search="reload"
:selection="selection"
@@ -85,6 +89,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditAdministrativeLicenseEdit from './components/creditAdministrativeLicenseEdit.vue';

View File

@@ -13,6 +13,7 @@
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton module="credit-bankruptcy" @done="reload" />
<search
@search="reload"
:selection="selection"
@@ -82,6 +83,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditBankruptcyEdit from './components/creditBankruptcyEdit.vue';

View File

@@ -12,6 +12,8 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton module="credit-branch" @done="reload" />
<search
@search="reload"
:selection="selection"
@@ -21,6 +23,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -79,6 +82,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditBranchEdit from './components/creditBranchEdit.vue';

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -79,6 +81,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditCaseFilingEdit from './components/creditCaseFilingEdit.vue';

View File

@@ -1,13 +1,13 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
<a-button class="ele-btn-icon" @click="openImport">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-button type="primary" class="ele-btn-icon" @click="openImport">
<template #icon>
<CloudUploadOutlined />
</template>

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -69,7 +71,7 @@
</template>
<script lang="ts" setup>
import { createVNode, ref, computed } from 'vue';
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">

View File

@@ -13,6 +13,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -22,6 +23,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">

View File

@@ -12,6 +12,11 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton
module="credit-historical-legal-person"
@done="reload"
/>
<search
@search="reload"
:selection="selection"
@@ -21,6 +26,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -82,6 +88,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditHistoricalLegalPersonEdit from './components/creditHistoricalLegalPersonEdit.vue';

View File

@@ -22,9 +22,6 @@
@importData="openImport"
@exportData="exportData"
/>
<a-button type="dashed" class="ele-btn-icon" @click="belongToCompany">
<span class="text-pink-500">修正主体企业归属</span>
</a-button>
<a-button type="dashed" class="ele-btn-icon" @click="openImport2">
<template #icon>
<CloudUploadOutlined />

View File

@@ -53,6 +53,7 @@
CreditJudiciary,
CreditJudiciaryParam
} from '@/api/credit/creditJudiciary/model';
import RefreshCompanyIdButton from "@/views/credit/components/RefreshCompanyIdButton.vue";
const props = withDefaults(
defineProps<{

View File

@@ -13,6 +13,8 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton module="credit-judiciary" @done="reload" />
<search
@search="reload"
:selection="selection"
@@ -22,6 +24,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -74,12 +77,12 @@
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { getPageTitle } from '@/utils/common';
import CreditJudiciaryEdit from './components/creditJudiciaryEdit.vue';
import CreditJudiciaryImport from './components/credit-judiciary-import.vue';

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">

View File

@@ -13,6 +13,11 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton
module="credit-nearby-company"
@done="reload"
/>
<search
@search="reload"
:selection="selection"
@@ -22,6 +27,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -81,6 +87,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditNearbyCompanyEdit from './components/creditNearbyCompanyEdit.vue';

View File

@@ -12,6 +12,8 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton module="credit-patent" @done="reload" />
<search
@search="reload"
:selection="selection"
@@ -21,6 +23,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -79,6 +82,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditPatentEdit from './components/creditPatentEdit.vue';

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">

View File

@@ -12,6 +12,7 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -21,6 +22,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">

View File

@@ -12,6 +12,11 @@
class="sys-org-table"
>
<template #toolbar>
<a-space class="flex">
<RefreshCompanyIdButton
module="credit-suspected-relationship"
@done="reload"
/>
<search
@search="reload"
:selection="selection"
@@ -21,6 +26,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyName'">
@@ -82,6 +88,7 @@
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar2.vue';
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditSuspectedRelationshipEdit from './components/creditSuspectedRelationshipEdit.vue';

View File

@@ -13,6 +13,7 @@
v-model:selection="selection"
>
<template #toolbar>
<a-space class="flex">
<search
@search="reload"
:selection="selection"
@@ -22,6 +23,7 @@
@importData="openImport"
@exportData="exportData"
/>
</a-space>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">