添加基础信息
This commit is contained in:
parent
31407f49f8
commit
d4c86d3527
@ -43,5 +43,10 @@ export const OrgApi = {
|
|||||||
// 导出机构 Excel
|
// 导出机构 Excel
|
||||||
exportOrg: async (params) => {
|
exportOrg: async (params) => {
|
||||||
return await request.download({ url: `/system/org/export-excel`, params })
|
return await request.download({ url: `/system/org/export-excel`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询上级机构
|
||||||
|
getParentOrgList: async () => {
|
||||||
|
return await request.get({ url: `/system/org/parent-org-list` })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
src/api/patient/index.ts
Normal file
1
src/api/patient/index.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
51
src/api/patientinfo/index.ts
Normal file
51
src/api/patientinfo/index.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 人员信息表(患者信息表) VO
|
||||||
|
export interface patientinfoVO {
|
||||||
|
id: number // 主键ID,自增
|
||||||
|
name: string // 患者姓名
|
||||||
|
idcard: string // 身份证号
|
||||||
|
regid: string // 注册ID
|
||||||
|
orgid: string // 机构ID
|
||||||
|
orgname: string // 机构名称
|
||||||
|
phone: string // 手机号
|
||||||
|
gender: number // 性别:0-未知,1-男,2-女
|
||||||
|
birthdate: Date // 出生日期
|
||||||
|
address: string // 地址
|
||||||
|
status: number // 状态:0-禁用,1-启用
|
||||||
|
createtime: Date // 创建时间
|
||||||
|
updatetime: Date // 更新时间
|
||||||
|
}
|
||||||
|
|
||||||
|
// 人员信息表(患者信息表) API
|
||||||
|
export const patientinfoApi = {
|
||||||
|
// 查询人员信息表(患者信息表)分页
|
||||||
|
getpatientinfoPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/system/patientinfo/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询人员信息表(患者信息表)详情
|
||||||
|
getpatientinfo: async (id: number) => {
|
||||||
|
return await request.get({ url: `/system/patientinfo/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增人员信息表(患者信息表)
|
||||||
|
createpatientinfo: async (data: patientinfoVO) => {
|
||||||
|
return await request.post({ url: `/system/patientinfo/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改人员信息表(患者信息表)
|
||||||
|
updatepatientinfo: async (data: patientinfoVO) => {
|
||||||
|
return await request.put({ url: `/system/patientinfo/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除人员信息表(患者信息表)
|
||||||
|
deletepatientinfo: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/system/patientinfo/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出人员信息表(患者信息表) Excel
|
||||||
|
exportpatientinfo: async (params) => {
|
||||||
|
return await request.download({ url: `/system/patientinfo/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,9 +7,6 @@
|
|||||||
label-width="100px"
|
label-width="100px"
|
||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
||||||
>
|
>
|
||||||
<el-form-item label="机构ID" prop="orgId">
|
|
||||||
<el-input v-model="formData.orgId" placeholder="请输入机构ID" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="机构名称" prop="orgName">
|
<el-form-item label="机构名称" prop="orgName">
|
||||||
<el-input v-model="formData.orgName" placeholder="请输入机构名称" />
|
<el-input v-model="formData.orgName" placeholder="请输入机构名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -22,14 +19,33 @@
|
|||||||
<el-form-item label="电话" prop="phone">
|
<el-form-item label="电话" prop="phone">
|
||||||
<el-input v-model="formData.phone" placeholder="请输入电话" />
|
<el-input v-model="formData.phone" placeholder="请输入电话" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="上级机构ID" prop="parentOrgId">
|
<el-form-item label="机构属性" prop="isParent">
|
||||||
<el-input v-model="formData.parentOrgId" placeholder="请输入上级机构ID" />
|
<el-select
|
||||||
|
v-model="formData.isParent"
|
||||||
|
placeholder="请选择机构属性"
|
||||||
|
clearable
|
||||||
|
class="!w-180px"
|
||||||
|
@change="handleIsParentChange"
|
||||||
|
>
|
||||||
|
<el-option label="基层" value="0" />
|
||||||
|
<el-option label="上级" value="1" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="上级机构名称" prop="parentOrgName">
|
<el-form-item v-if="showParentOrgSelect" label="上级机构" prop="parentOrgId">
|
||||||
<el-input v-model="formData.parentOrgName" placeholder="请输入上级机构名称" />
|
<el-select
|
||||||
</el-form-item>
|
v-model="formData.parentOrgId"
|
||||||
<el-form-item label="是否为上级机构(0否1是)" prop="isParent">
|
placeholder="请选择上级机构"
|
||||||
<el-input v-model="formData.isParent" placeholder="请输入是否为上级机构(0否1是)" />
|
clearable
|
||||||
|
class="!w-180px"
|
||||||
|
@change="handleParentOrgChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="org in parentOrgList"
|
||||||
|
:key="org.id"
|
||||||
|
:label="org.orgName"
|
||||||
|
:value="org.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@ -39,7 +55,7 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { OrgApi, OrgVO } from '@/api/system/org'
|
import { OrgApi, OrgVO } from '@/api/org'
|
||||||
|
|
||||||
/** 机构 表单 */
|
/** 机构 表单 */
|
||||||
defineOptions({ name: 'OrgForm' })
|
defineOptions({ name: 'OrgForm' })
|
||||||
@ -51,23 +67,70 @@ const dialogVisible = ref(false) // 弹窗的是否展示
|
|||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const showParentOrgSelect = ref(false) // 是否显示上级机构选择框
|
||||||
|
const parentOrgList = ref<OrgVO[]>([]) // 上级机构列表
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
orgId: undefined,
|
|
||||||
orgName: undefined,
|
orgName: undefined,
|
||||||
orgAddress: undefined,
|
orgAddress: undefined,
|
||||||
manager: undefined,
|
manager: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
parentOrgId: undefined,
|
parentOrgId: undefined as number | undefined,
|
||||||
parentOrgName: undefined,
|
parentOrgName: undefined as string | undefined,
|
||||||
isParent: undefined
|
isParent: undefined
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive<Record<string, any[]>>({
|
||||||
orgId: [{ required: true, message: '机构ID不能为空', trigger: 'blur' }],
|
orgId: [{ required: true, message: '机构ID不能为空', trigger: 'blur' }],
|
||||||
orgName: [{ required: true, message: '机构名称不能为空', trigger: 'blur' }]
|
orgName: [{ required: true, message: '机构名称不能为空', trigger: 'blur' }],
|
||||||
|
parentOrgId: []
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 处理机构属性变化 */
|
||||||
|
const handleIsParentChange = async (value: string | undefined) => {
|
||||||
|
if (value === '0') {
|
||||||
|
// 选择基层,显示上级机构选择框
|
||||||
|
showParentOrgSelect.value = true
|
||||||
|
// 获取上级机构列表
|
||||||
|
await loadParentOrgList()
|
||||||
|
// 添加上级机构的必填验证
|
||||||
|
formRules.parentOrgId = [{ required: true, message: '上级机构不能为空', trigger: 'change' }]
|
||||||
|
} else {
|
||||||
|
// 选择上级,隐藏上级机构选择框
|
||||||
|
showParentOrgSelect.value = false
|
||||||
|
formData.value.parentOrgId = undefined
|
||||||
|
formData.value.parentOrgName = undefined
|
||||||
|
// 移除上级机构的必填验证
|
||||||
|
formRules.parentOrgId = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 处理上级机构选择变化 */
|
||||||
|
const handleParentOrgChange = (value: number | undefined) => {
|
||||||
|
if (value) {
|
||||||
|
const selectedOrg = parentOrgList.value.find((org) => org.id === value)
|
||||||
|
if (selectedOrg) {
|
||||||
|
formData.value.parentOrgName = selectedOrg.orgName
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
formData.value.parentOrgName = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 加载上级机构列表 */
|
||||||
|
const loadParentOrgList = async () => {
|
||||||
|
try {
|
||||||
|
const response = await OrgApi.getParentOrgList()
|
||||||
|
console.log(response)
|
||||||
|
// 如果返回的是直接的数组,直接使用;如果是包装在data字段中,则使用data
|
||||||
|
parentOrgList.value = Array.isArray(response) ? response : response.data || []
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载上级机构列表失败:', error)
|
||||||
|
message.error('加载上级机构列表失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
@ -79,6 +142,12 @@ const open = async (type: string, id?: number) => {
|
|||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value = await OrgApi.getOrg(id)
|
formData.value = await OrgApi.getOrg(id)
|
||||||
|
// 根据机构属性决定是否显示上级机构选择框
|
||||||
|
if (formData.value.isParent === '0') {
|
||||||
|
showParentOrgSelect.value = true
|
||||||
|
await loadParentOrgList()
|
||||||
|
formRules.parentOrgId = [{ required: true, message: '上级机构不能为空', trigger: 'change' }]
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@ -114,15 +183,17 @@ const submitForm = async () => {
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
orgId: undefined,
|
|
||||||
orgName: undefined,
|
orgName: undefined,
|
||||||
orgAddress: undefined,
|
orgAddress: undefined,
|
||||||
manager: undefined,
|
manager: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
parentOrgId: undefined,
|
parentOrgId: undefined as number | undefined,
|
||||||
parentOrgName: undefined,
|
parentOrgName: undefined as string | undefined,
|
||||||
isParent: undefined
|
isParent: undefined
|
||||||
}
|
}
|
||||||
|
showParentOrgSelect.value = false
|
||||||
|
parentOrgList.value = []
|
||||||
|
formRules.parentOrgId = []
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -8,15 +8,6 @@
|
|||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="68px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<el-form-item label="机构ID" prop="orgId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.orgId"
|
|
||||||
placeholder="请输入机构ID"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="机构名称" prop="orgName">
|
<el-form-item label="机构名称" prop="orgName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.orgName"
|
v-model="queryParams.orgName"
|
||||||
@ -26,89 +17,24 @@
|
|||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="机构地址" prop="orgAddress">
|
<el-form-item label="机构属性" prop="isParent">
|
||||||
<el-input
|
<el-select
|
||||||
v-model="queryParams.orgAddress"
|
|
||||||
placeholder="请输入机构地址"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="负责人" prop="manager">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.manager"
|
|
||||||
placeholder="请输入负责人"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="电话" prop="phone">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.phone"
|
|
||||||
placeholder="请输入电话"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="上级机构ID" prop="parentOrgId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.parentOrgId"
|
|
||||||
placeholder="请输入上级机构ID"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="上级机构名称" prop="parentOrgName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.parentOrgName"
|
|
||||||
placeholder="请输入上级机构名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="是否为上级机构(0否1是)" prop="isParent">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.isParent"
|
v-model="queryParams.isParent"
|
||||||
placeholder="请输入是否为上级机构(0否1是)"
|
placeholder="请选择机构属性"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
class="!w-180px"
|
||||||
class="!w-240px"
|
>
|
||||||
/>
|
<el-option label="基层" value="0" />
|
||||||
</el-form-item>
|
<el-option label="上级" value="1" />
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
</el-select>
|
||||||
<el-date-picker
|
|
||||||
v-model="queryParams.createTime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
type="daterange"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
||||||
class="!w-220px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
<el-button
|
<el-button type="primary" plain @click="openForm('create')">
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
@click="openForm('create')"
|
|
||||||
v-hasPermi="['system:org:create']"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
@click="handleExport"
|
|
||||||
:loading="exportLoading"
|
|
||||||
v-hasPermi="['system:org:export']"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -118,40 +44,27 @@
|
|||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
<el-table-column label="主键ID,自增" align="center" prop="id" />
|
<el-table-column label="编号" align="center" width="80px">
|
||||||
<el-table-column label="机构ID" align="center" prop="orgId" />
|
<template #default="scope">
|
||||||
|
{{ (queryParams.pageNo - 1) * queryParams.pageSize + scope.$index + 1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="机构名称" align="center" prop="orgName" />
|
<el-table-column label="机构名称" align="center" prop="orgName" />
|
||||||
<el-table-column label="机构地址" align="center" prop="orgAddress" />
|
<el-table-column label="机构地址" align="center" prop="orgAddress" />
|
||||||
<el-table-column label="负责人" align="center" prop="manager" />
|
<el-table-column label="负责人" align="center" prop="manager" />
|
||||||
<el-table-column label="电话" align="center" prop="phone" />
|
<el-table-column label="电话" align="center" prop="phone" />
|
||||||
<el-table-column label="上级机构ID" align="center" prop="parentOrgId" />
|
|
||||||
<el-table-column label="上级机构名称" align="center" prop="parentOrgName" />
|
<el-table-column label="上级机构名称" align="center" prop="parentOrgName" />
|
||||||
<el-table-column label="是否为上级机构(0否1是)" align="center" prop="isParent" />
|
<el-table-column label="机构属性" align="center" prop="isParent">
|
||||||
<el-table-column
|
<template #default="scope">
|
||||||
label="创建时间"
|
{{ scope.row.isParent === 1 ? '上级' : '基层' }}
|
||||||
align="center"
|
</template>
|
||||||
prop="createTime"
|
</el-table-column>
|
||||||
:formatter="dateFormatter"
|
|
||||||
width="180px"
|
|
||||||
/>
|
|
||||||
<el-table-column label="操作" align="center" min-width="120px">
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button link type="primary" @click="openForm('update', scope.row.id)">
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
@click="openForm('update', scope.row.id)"
|
|
||||||
v-hasPermi="['system:org:update']"
|
|
||||||
>
|
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
|
||||||
link
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(scope.row.id)"
|
|
||||||
v-hasPermi="['system:org:delete']"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -169,9 +82,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { OrgApi, OrgVO } from '@/api/system/org'
|
import { OrgApi, OrgVO } from '@/api/org'
|
||||||
import OrgForm from './OrgForm.vue'
|
import OrgForm from './OrgForm.vue'
|
||||||
|
|
||||||
/** 机构 列表 */
|
/** 机构 列表 */
|
||||||
@ -186,15 +98,10 @@ const total = ref(0) // 列表的总页数
|
|||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orgId: undefined,
|
|
||||||
orgName: undefined,
|
orgName: undefined,
|
||||||
orgAddress: undefined,
|
|
||||||
manager: undefined,
|
manager: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
parentOrgId: undefined,
|
isParent: undefined
|
||||||
parentOrgName: undefined,
|
|
||||||
isParent: undefined,
|
|
||||||
createTime: []
|
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
@ -261,4 +168,4 @@ const handleExport = async () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
308
src/views/patientinfo/index.vue
Normal file
308
src/views/patientinfo/index.vue
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="患者姓名" prop="name">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
placeholder="请输入患者姓名"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idcard">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.idcard"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="注册ID" prop="regid">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.regid"
|
||||||
|
placeholder="请输入注册ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构ID" prop="orgid">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.orgid"
|
||||||
|
placeholder="请输入机构ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构名称" prop="orgname">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.orgname"
|
||||||
|
placeholder="请输入机构名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="phone">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.phone"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="性别:0-未知,1-男,2-女" prop="gender">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.gender"
|
||||||
|
placeholder="请输入性别:0-未知,1-男,2-女"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出生日期" prop="birthdate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.birthdate"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-220px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="地址" prop="address">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.address"
|
||||||
|
placeholder="请输入地址"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态:0-禁用,1-启用" prop="status">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.status"
|
||||||
|
placeholder="请选择状态:0-禁用,1-启用"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option label="请选择字典生成" value="" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createtime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createtime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-220px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新时间" prop="updatetime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.updatetime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-220px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['system:patientinfo:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['system:patientinfo:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="主键ID,自增" align="center" prop="id" />
|
||||||
|
<el-table-column label="患者姓名" align="center" prop="name" />
|
||||||
|
<el-table-column label="身份证号" align="center" prop="idcard" />
|
||||||
|
<el-table-column label="注册ID" align="center" prop="regid" />
|
||||||
|
<el-table-column label="机构ID" align="center" prop="orgid" />
|
||||||
|
<el-table-column label="机构名称" align="center" prop="orgname" />
|
||||||
|
<el-table-column label="手机号" align="center" prop="phone" />
|
||||||
|
<el-table-column label="性别:0-未知,1-男,2-女" align="center" prop="gender" />
|
||||||
|
<el-table-column label="出生日期" align="center" prop="birthdate" />
|
||||||
|
<el-table-column label="地址" align="center" prop="address" />
|
||||||
|
<el-table-column label="状态:0-禁用,1-启用" align="center" prop="status" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createtime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="更新时间"
|
||||||
|
align="center"
|
||||||
|
prop="updatetime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['system:patientinfo:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['system:patientinfo:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<patientinfoForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { patientinfoApi, patientinfoVO } from '@/api/patientinfo'
|
||||||
|
import patientinfoForm from './patientinfoForm.vue'
|
||||||
|
|
||||||
|
/** 人员信息表(患者信息表) 列表 */
|
||||||
|
defineOptions({ name: 'Patientinfo' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<patientinfoVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
idcard: undefined,
|
||||||
|
regid: undefined,
|
||||||
|
orgid: undefined,
|
||||||
|
orgname: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
gender: undefined,
|
||||||
|
birthdate: [],
|
||||||
|
address: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createtime: [],
|
||||||
|
updatetime: []
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await patientinfoApi.getpatientinfoPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await patientinfoApi.deletepatientinfo(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await patientinfoApi.exportpatientinfo(queryParams)
|
||||||
|
download.excel(data, '人员信息表(患者信息表).xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
165
src/views/patientinfo/patientinfoForm.vue
Normal file
165
src/views/patientinfo/patientinfoForm.vue
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="患者姓名" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入患者姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idcard">
|
||||||
|
<el-input v-model="formData.idcard" placeholder="请输入身份证号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="注册ID" prop="regid">
|
||||||
|
<el-input v-model="formData.regid" placeholder="请输入注册ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构ID" prop="orgid">
|
||||||
|
<el-input v-model="formData.orgid" placeholder="请输入机构ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="机构名称" prop="orgname">
|
||||||
|
<el-input v-model="formData.orgname" placeholder="请输入机构名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="phone">
|
||||||
|
<el-input v-model="formData.phone" placeholder="请输入手机号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="性别:0-未知,1-男,2-女" prop="gender">
|
||||||
|
<el-input v-model="formData.gender" placeholder="请输入性别:0-未知,1-男,2-女" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出生日期" prop="birthdate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.birthdate"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择出生日期"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="地址" prop="address">
|
||||||
|
<el-input v-model="formData.address" placeholder="请输入地址" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态:0-禁用,1-启用" prop="status">
|
||||||
|
<el-radio-group v-model="formData.status">
|
||||||
|
<el-radio value="1">请选择字典生成</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间" prop="createtime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.createtime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择创建时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新时间" prop="updatetime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.updatetime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择更新时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { patientinfoApi, patientinfoVO } from '@/api/patientinfo'
|
||||||
|
|
||||||
|
/** 人员信息表(患者信息表) 表单 */
|
||||||
|
defineOptions({ name: 'PatientinfoForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
idcard: undefined,
|
||||||
|
regid: undefined,
|
||||||
|
orgid: undefined,
|
||||||
|
orgname: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
gender: undefined,
|
||||||
|
birthdate: undefined,
|
||||||
|
address: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createtime: undefined,
|
||||||
|
updatetime: undefined
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '患者姓名不能为空', trigger: 'blur' }],
|
||||||
|
idcard: [{ required: true, message: '身份证号不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await patientinfoApi.getpatientinfo(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as patientinfoVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await patientinfoApi.createpatientinfo(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await patientinfoApi.updatepatientinfo(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
idcard: undefined,
|
||||||
|
regid: undefined,
|
||||||
|
orgid: undefined,
|
||||||
|
orgname: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
gender: undefined,
|
||||||
|
birthdate: undefined,
|
||||||
|
address: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createtime: undefined,
|
||||||
|
updatetime: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user