feat(credit): 添加历史被执行人导入功能
- 新增 importCreditJudgmentDebtorHistory API 接口用于导入历史被执行人数据 - 修复历史被执行人导入组件中的 API 路径引用错误 - 更新导入按钮文字为"导入历史被执行人" - 在表格中添加 updateTime 列显示更新时间 - 新增历史被执行人导入弹窗组件并集成到主页面 - 重命名 createTime 列为 updateTime 以匹配实际字段 - 添加打开历史被执行人导入弹窗的功能函数
This commit is contained in:
@@ -136,3 +136,30 @@ export async function importCreditJudgmentDebtor(
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史被执行人
|
||||||
|
*/
|
||||||
|
export async function importCreditJudgmentDebtorHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { message } from 'ant-design-vue/es';
|
import { message } from 'ant-design-vue/es';
|
||||||
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
import { importCreditJudgmentDebtorHistory } from '@/api/credit/creditJudgmentDebtorHistory';
|
import { importCreditJudgmentDebtorHistory } from '@/api/credit/creditJudgmentDebtor';
|
||||||
import { API_BASE_URL } from '@/config/setting';
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
/\/$/,
|
/\/$/,
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
return `${base}/credit/credit-judgment-debtor-history/import/template`;
|
return `${base}/credit/credit-judgment-debtor/import/history/template`;
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 上传 */
|
/* 上传 */
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<CloudUploadOutlined />
|
<CloudUploadOutlined />
|
||||||
</template>
|
</template>
|
||||||
<span class="text-red-500">导入被执行人</span>
|
<span class="text-red-500">导入历史被执行人</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -61,6 +61,9 @@
|
|||||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="column.key === 'updateTime'">
|
||||||
|
<div>{{ record.updateTime }}</div>
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
@@ -85,13 +88,21 @@
|
|||||||
/>
|
/>
|
||||||
<!-- 导入弹窗 -->
|
<!-- 导入弹窗 -->
|
||||||
<CreditJudgmentDebtorImport v-model:visible="showImport" @done="reload" />
|
<CreditJudgmentDebtorImport v-model:visible="showImport" @done="reload" />
|
||||||
|
<!-- 历史被执行人导入弹窗 -->
|
||||||
|
<CreditJudgmentDebtorHistoryImport
|
||||||
|
v-model:visible="showImport2"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import { createVNode, ref } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined,CloudUploadOutlined } from '@ant-design/icons-vue';
|
import {
|
||||||
|
CloudUploadOutlined,
|
||||||
|
ExclamationCircleOutlined
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
import { toDateString } from 'ele-admin-pro';
|
import { toDateString } from 'ele-admin-pro';
|
||||||
import type {
|
import type {
|
||||||
@@ -103,6 +114,7 @@
|
|||||||
import { getPageTitle } from '@/utils/common';
|
import { getPageTitle } from '@/utils/common';
|
||||||
import CreditJudgmentDebtorEdit from './components/creditJudgmentDebtorEdit.vue';
|
import CreditJudgmentDebtorEdit from './components/creditJudgmentDebtorEdit.vue';
|
||||||
import CreditJudgmentDebtorImport from './components/credit-judgment-debtor-import.vue';
|
import CreditJudgmentDebtorImport from './components/credit-judgment-debtor-import.vue';
|
||||||
|
import CreditJudgmentDebtorHistoryImport from './components/credit-judgment-debtor-history-import.vue';
|
||||||
import {
|
import {
|
||||||
pageCreditJudgmentDebtor,
|
pageCreditJudgmentDebtor,
|
||||||
listCreditJudgmentDebtor,
|
listCreditJudgmentDebtor,
|
||||||
@@ -125,6 +137,8 @@
|
|||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 是否显示导入弹窗
|
// 是否显示导入弹窗
|
||||||
const showImport = ref(false);
|
const showImport = ref(false);
|
||||||
|
// 是否显示历史被执行人导入弹窗
|
||||||
|
const showImport2 = ref(false);
|
||||||
// 是否显示批量移动弹窗
|
// 是否显示批量移动弹窗
|
||||||
const showMove = ref(false);
|
const showMove = ref(false);
|
||||||
// 加载状态
|
// 加载状态
|
||||||
@@ -208,9 +222,9 @@
|
|||||||
// width: 90
|
// width: 90
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '更新时间',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'updateTime',
|
||||||
key: 'createTime',
|
key: 'updateTime',
|
||||||
width: 180,
|
width: 180,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
@@ -252,6 +266,11 @@
|
|||||||
showImport.value = true;
|
showImport.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 打开历史被执行人导入弹窗 */
|
||||||
|
const openImport2 = () => {
|
||||||
|
showImport2.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
/* 导出 */
|
/* 导出 */
|
||||||
const exportData = () => {
|
const exportData = () => {
|
||||||
exportCreditData<CreditJudgmentDebtor>({
|
exportCreditData<CreditJudgmentDebtor>({
|
||||||
|
|||||||
Reference in New Issue
Block a user