feat(api): 添加百色中学和诊所相关API接口

- 新增百色中学报名记录相关接口和数据模型
- 新增百色中学分部、班级、年代、年级管理接口
- 新增百色中学捐款记录和排行相关接口
- 新增诊所挂号和医生入驻申请接口
- 添加相应的数据传输对象和搜索参数模型
- 实现分页查询、增删改查等基础操作接口
- 集成请求处理和错误处理机制
This commit is contained in:
2026-01-07 14:44:06 +08:00
parent 424e5641bb
commit d32fd4f711
459 changed files with 79443 additions and 1460 deletions

View File

@@ -0,0 +1,96 @@
<!-- 对外投资导入弹窗 -->
<template>
<ele-modal
:width="520"
:footer="null"
title="对外投资批量导入"
:visible="visible"
@update:visible="updateVisible"
>
<a-spin :spinning="loading">
<a-upload-dragger
accept=".xls,.xlsx"
:show-upload-list="false"
:customRequest="doUpload"
style="padding: 24px 0; margin-bottom: 16px"
>
<p class="ant-upload-drag-icon">
<cloud-upload-outlined />
</p>
<p class="ant-upload-hint">将文件拖到此处或点击上传</p>
</a-upload-dragger>
</a-spin>
<div class="ele-text-center">
<span>只能上传xlsxlsx文件</span>
<a :href="templateUrl" download="对外投资导入模板.xlsx">
下载导入模板
</a>
</div>
</ele-modal>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { message } from 'ant-design-vue/es';
import { CloudUploadOutlined } from '@ant-design/icons-vue';
import { importCreditExternal } from '@/api/credit/creditExternal';
import { API_BASE_URL } from '@/config/setting';
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
defineProps<{
// 是否打开弹窗
visible: boolean;
}>();
// 导入请求状态
const loading = ref(false);
// 模板下载地址,保持与当前接口域名一致
const templateUrl = computed(() => {
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
/\/$/,
''
);
return `${base}/credit/credit-external/import/template`;
});
/* 上传 */
const doUpload = ({ file }) => {
if (
![
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
].includes(file.type)
) {
message.error('只能选择 excel 文件');
return false;
}
if (file.size / 1024 / 1024 > 10) {
message.error('大小不能超过 10MB');
return false;
}
loading.value = true;
importCreditExternal(file)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
return false;
};
/* 更新 visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
</script>

View File

@@ -0,0 +1,300 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑对外投资' : '添加对外投资'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="被投资企业名称" name="name">
<a-input
allow-clear
placeholder="请输入被投资企业名称"
v-model:value="form.name"
/>
</a-form-item>
<a-form-item label="状态" name="statusTxt">
<a-input
allow-clear
placeholder="请输入企业状态(如存续、注销等)"
v-model:value="form.statusTxt"
/>
</a-form-item>
<a-form-item label="法定代表人" name="legalRepresentative">
<a-input
allow-clear
placeholder="请输入法定代表人姓名"
v-model:value="form.legalRepresentative"
/>
</a-form-item>
<a-form-item label="注册资本" name="registeredCapital">
<a-input
allow-clear
placeholder="请输入注册资本(金额)"
v-model:value="form.registeredCapital"
/>
</a-form-item>
<a-form-item label="成立日期" name="establishmentDate">
<a-input
allow-clear
placeholder="请输入成立日期"
v-model:value="form.establishmentDate"
/>
</a-form-item>
<a-form-item label="持股比例" name="shareholdingRatio">
<a-input
allow-clear
placeholder="请输入持股比例"
v-model:value="form.shareholdingRatio"
/>
</a-form-item>
<a-form-item label="认缴出资额" name="subscribedInvestmentAmount">
<a-input
allow-clear
placeholder="请输入认缴出资额"
v-model:value="form.subscribedInvestmentAmount"
/>
</a-form-item>
<a-form-item label="认缴出资日期" name="subscribedInvestmentDate">
<a-input
allow-clear
placeholder="请输入认缴出资日期"
v-model:value="form.subscribedInvestmentDate"
/>
</a-form-item>
<a-form-item label="间接持股比例" name="indirectShareholdingRatio">
<a-input
allow-clear
placeholder="请输入间接持股比例"
v-model:value="form.indirectShareholdingRatio"
/>
</a-form-item>
<a-form-item label="投资日期" name="investmentDate">
<a-input
allow-clear
placeholder="请输入投资日期"
v-model:value="form.investmentDate"
/>
</a-form-item>
<a-form-item label="所属地区" name="region">
<a-input
allow-clear
placeholder="请输入所属地区"
v-model:value="form.region"
/>
</a-form-item>
<a-form-item label="所属行业" name="industry">
<a-input
allow-clear
placeholder="请输入所属行业"
v-model:value="form.industry"
/>
</a-form-item>
<a-form-item label="投资数量" name="investmentCount">
<a-input
allow-clear
placeholder="请输入投资数量"
v-model:value="form.investmentCount"
/>
</a-form-item>
<a-form-item label="关联产品/机构" name="relatedProductsInstitutions">
<a-input
allow-clear
placeholder="请输入关联产品/机构"
v-model:value="form.relatedProductsInstitutions"
/>
</a-form-item>
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
<!-- <a-form-item label="状态, 0正常, 1冻结" name="status">-->
<!-- <a-radio-group v-model:value="form.status">-->
<!-- <a-radio :value="0">显示</a-radio>-->
<!-- <a-radio :value="1">隐藏</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
</a-form>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import {
addCreditExternal,
updateCreditExternal
} from '@/api/credit/creditExternal';
import { CreditExternal } from '@/api/credit/creditExternal/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
// 是否开启响应式布局
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 修改回显的数据
data?: CreditExternal | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
// 提交状态
const loading = ref(false);
// 是否显示最大化切换按钮
const maxable = ref(true);
// 表格选中数据
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
// 用户信息
const form = reactive<CreditExternal>({
id: undefined,
name: undefined,
statusTxt: undefined,
legalRepresentative: undefined,
registeredCapital: undefined,
establishmentDate: undefined,
shareholdingRatio: undefined,
subscribedInvestmentAmount: undefined,
subscribedInvestmentDate: undefined,
indirectShareholdingRatio: undefined,
investmentDate: undefined,
region: undefined,
industry: undefined,
investmentCount: undefined,
relatedProductsInstitutions: undefined,
comments: undefined,
recommend: undefined,
sortNumber: undefined,
status: undefined,
deleted: undefined,
userId: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
creditExternalId: undefined,
creditExternalName: '',
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 表单验证规则
const rules = reactive({
creditExternalName: [
{
required: true,
type: 'string',
message: '请填写对外投资名称',
trigger: 'blur'
}
]
});
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.image = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.image = '';
};
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value
? updateCreditExternal
: addCreditExternal;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
});
}
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{ immediate: true }
);
</script>

View File

@@ -0,0 +1,42 @@
<!-- 搜索表单 -->
<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-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import { watch } from 'vue';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
// 新增
const add = () => {
emit('add');
};
watch(
() => props.selection,
() => {}
);
</script>

View File

@@ -0,0 +1,349 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
@importData="openImport"
@exportData="exportData"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
</template>
<template v-if="column.key === 'name'">
<template v-if="record.url">
<a :href="record.url" target="_blank">{{ record.name }}</a>
</template>
<template v-else>
{{ record.name }}
</template>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</a-space>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<CreditExternalEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
<!-- 导入弹窗 -->
<CreditExternalImport v-model:visible="showImport" @done="reload" />
</a-page-header>
</template>
<script lang="ts" setup>
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';
import { toDateString } from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
import { exportCreditData } from '../utils/export';
import { getPageTitle } from '@/utils/common';
import CreditExternalEdit from './components/creditExternalEdit.vue';
import CreditExternalImport from './components/credit-external-import.vue';
import {
pageCreditExternal,
listCreditExternal,
removeCreditExternal,
removeBatchCreditExternal
} from '@/api/credit/creditExternal';
import type {
CreditExternal,
CreditExternalParam
} from '@/api/credit/creditExternal/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格选中数据
const selection = ref<CreditExternal[]>([]);
// 当前编辑数据
const current = ref<CreditExternal | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
// 是否显示导入弹窗
const showImport = ref(false);
// 是否显示批量移动弹窗
const showMove = ref(false);
// 加载状态
const loading = ref(true);
// 搜索关键词
const searchText = ref('');
// 表格数据源
const datasource: DatasourceFunction = ({
page,
limit,
where = {},
orders,
filters
}) => {
const params: CreditExternalParam = { ...where };
if (filters) {
(params as any).status = filters.status;
}
if (!params.keywords && searchText.value) {
params.keywords = searchText.value;
}
return pageCreditExternal({
...params,
...orders,
page,
limit
});
};
// 关键信息列
const columns = ref<ColumnItem[]>([
{
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 80
},
{
title: '被投资企业名称',
dataIndex: 'name',
key: 'name',
ellipsis: true
},
{
title: '状态',
dataIndex: 'statusTxt',
key: 'statusTxt',
ellipsis: true
},
{
title: '法定代表人',
dataIndex: 'legalRepresentative',
key: 'legalRepresentative',
ellipsis: true,
width: 120
},
{
title: '注册资本',
dataIndex: 'registeredCapital',
key: 'registeredCapital',
width: 120
},
{
title: '成立日期',
dataIndex: 'establishmentDate',
key: 'establishmentDate',
width: 120
},
{
title: '持股比例',
dataIndex: 'shareholdingRatio',
key: 'shareholdingRatio',
width: 120
},
{
title: '认缴出资额',
dataIndex: 'subscribedInvestmentAmount',
key: 'subscribedInvestmentAmount',
ellipsis: true
},
{
title: '投资日期',
dataIndex: 'investmentDate',
key: 'investmentDate',
width: 120
},
{
title: '所属地区',
dataIndex: 'region',
key: 'region',
ellipsis: true
},
{
title: '所属行业',
dataIndex: 'industry',
key: 'industry',
ellipsis: true
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
width: 180,
align: 'center',
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
},
{
title: '操作',
key: 'action',
width: 160,
fixed: 'right',
align: 'center',
hideInSetting: true
}
]);
/* 搜索 */
const reload = (where?: CreditExternalParam) => {
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
searchText.value = where.keywords ?? '';
}
const targetWhere = where ?? { keywords: searchText.value || undefined };
selection.value = [];
tableRef?.value?.reload({ where: targetWhere });
};
/* 打开编辑弹窗 */
const openEdit = (row?: CreditExternal) => {
current.value = row ?? null;
showEdit.value = true;
};
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
/* 打开导入弹窗 */
const openImport = () => {
showImport.value = true;
};
/* 导出 */
const exportData = () => {
exportCreditData<CreditExternal>({
filename: '对外投资',
columns: [
{ title: 'ID', dataIndex: 'id' },
{ title: '被投资企业名称', dataIndex: 'name' },
{ title: '企业状态', dataIndex: 'statusTxt' },
{ title: '法定代表人姓名', dataIndex: 'legalRepresentative' },
{ title: '注册资本(金额)', dataIndex: 'registeredCapital' },
{ title: '成立日期', dataIndex: 'establishmentDate' },
{ title: '持股比例', dataIndex: 'shareholdingRatio' },
{ title: '认缴出资额', dataIndex: 'subscribedInvestmentAmount' },
{ title: '投资日期', dataIndex: 'investmentDate' },
{ title: '所属地区', dataIndex: 'region' },
{ title: '所属行业', dataIndex: 'industry' },
{
title: '创建时间',
dataIndex: 'createTime',
formatter: (record: CreditExternal) =>
record.createTime
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
: ''
}
],
fetchData: () =>
listCreditExternal({
keywords: searchText.value || undefined
})
});
};
/* 删除单个 */
const remove = (row: CreditExternal) => {
const hide = message.loading('请求中..', 0);
removeCreditExternal(row.id)
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
};
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
}
Modal.confirm({
title: '提示',
content: '确定要删除选中的记录吗?',
icon: createVNode(ExclamationCircleOutlined),
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchCreditExternal(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
reload();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: CreditExternal) => {
return {
// 行点击事件
onClick: () => {
// console.log(record);
},
// 行双击事件
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'CreditExternal'
};
</script>
<style lang="less" scoped></style>