feat(credit): 添加信用模块主体企业归属修正功能
- 新增 refreshCreditCompanyId API 方法用于修正信用模块数据的企业归属 - 创建 RefreshCompanyIdButton 组件提供统一的修正企业归属按钮界面 - 在多个信用模块页面集成修正企业归属功能按钮 - 更新 CreditSearchToolbar 组件添加修正企业归属按钮 - 修改多个信用模块页面布局结构调整工具栏元素顺序 - 启用 .env.development 中的 API URL 配置
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
27
src/api/credit/companyId.ts
Normal file
27
src/api/credit/companyId.ts
Normal 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));
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
</template>
|
||||
<span>导出</span>
|
||||
</a-button>
|
||||
<RefreshCompanyIdButton module="credit-case-filing" @done="reload"/>
|
||||
<a-button
|
||||
danger
|
||||
class="ele-btn-icon"
|
||||
@@ -44,11 +45,11 @@
|
||||
<script lang="ts" setup>
|
||||
import {computed, ref} from 'vue';
|
||||
import {
|
||||
PlusOutlined,
|
||||
CloudUploadOutlined,
|
||||
CloudDownloadOutlined,
|
||||
DeleteOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import RefreshCompanyIdButton from "@/views/credit/components/RefreshCompanyIdButton.vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
||||
60
src/views/credit/components/RefreshCompanyIdButton.vue
Normal file
60
src/views/credit/components/RefreshCompanyIdButton.vue
Normal 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>
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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'">
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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'">
|
||||
|
||||
@@ -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'">
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
CreditJudiciary,
|
||||
CreditJudiciaryParam
|
||||
} from '@/api/credit/creditJudiciary/model';
|
||||
import RefreshCompanyIdButton from "@/views/credit/components/RefreshCompanyIdButton.vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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'">
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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'">
|
||||
|
||||
@@ -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'">
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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'">
|
||||
|
||||
Reference in New Issue
Block a user