新增申请记录界面

This commit is contained in:
lxd 2024-07-11 19:46:39 +08:00
parent aa14e004d2
commit c825a118a4
3 changed files with 645 additions and 0 deletions

View File

@ -0,0 +1,61 @@
import request from '@/config/axios'
// 申请登记记录 VO
export interface ApplyformVO {
id: string // 主键
regId: string // 登记单号
regSource: string // 登记来源
examId: string // 检查ID
pname: string // 患者姓名
gender: string // 性别
birthday: Date // 出生日期
examDate: Date // 检查日期
examItemName: string // 检查项目名称
deviceId: string // 检查设备ID
deviceName: string // 检查设备名称
contactTel: string // 患者联系电话
regDate: Date // 登记时间
sortDate: Date // 分检时间
billgDoctor: string // 开单医生
examStatus: string // 检查状态
billDoctorDepartment: string // 开单医生科室
createDate: Date // 此条记录的创建时间
examItemCode: string // 检查项目代码
orgId: string // 机构ID
sortDoctor: string // 分检医生
deviceDepartment:string // 执行科室
departmentCode:string //执行科室代码
}
// 申请登记记录 API
export const ApplyformApi = {
// 查询申请登记记录分页
getApplyformPage: async (params: any) => {
return await request.get({ url: `/applyregistration/applyform/page`, params })
},
// 查询申请登记记录详情
getApplyform: async (id: number) => {
return await request.get({ url: `/applyregistration/applyform/get?id=` + id })
},
// 新增申请登记记录
createApplyform: async (data: ApplyformVO) => {
return await request.post({ url: `/applyregistration/applyform/create`, data })
},
// 修改申请登记记录
updateApplyform: async (data: ApplyformVO) => {
return await request.put({ url: `/applyregistration/applyform/update`, data })
},
// 删除申请登记记录
deleteApplyform: async (id: number) => {
return await request.delete({ url: `/applyregistration/applyform/delete?id=` + id })
},
// 导出申请登记记录 Excel
exportApplyform: async (params) => {
return await request.download({ url: `/applyregistration/applyform/export-excel`, params })
},
}

View File

@ -0,0 +1,215 @@
<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="regId">
<el-input v-model="formData.regId" placeholder="请输入登记单号" />
</el-form-item>
<el-form-item label="登记来源" prop="regSource">
<el-input v-model="formData.regSource" placeholder="请输入登记来源" />
</el-form-item>
<el-form-item label="检查ID" prop="examId">
<el-input v-model="formData.examId" placeholder="请输入检查ID" />
</el-form-item>
<el-form-item label="患者姓名" prop="pName">
<el-input v-model="formData.pName" placeholder="请输入患者姓名" />
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-input v-model="formData.gender" placeholder="请输入性别" />
</el-form-item>
<el-form-item label="出生日期" prop="birthday">
<el-date-picker
v-model="formData.birthday"
type="date"
value-format="x"
placeholder="选择出生日期"
/>
</el-form-item>
<el-form-item label="检查日期" prop="examDate">
<el-date-picker
v-model="formData.examDate"
type="date"
value-format="x"
placeholder="选择检查日期"
/>
</el-form-item>
<el-form-item label="检查项目名称" prop="examItemName">
<el-input v-model="formData.examItemName" placeholder="请输入检查项目名称" />
</el-form-item>
<el-form-item label="检查设备ID" prop="deviceId">
<el-input v-model="formData.deviceId" placeholder="请输入检查设备ID" />
</el-form-item>
<el-form-item label="检查设备名称" prop="deviceName">
<el-input v-model="formData.deviceName" placeholder="请输入检查设备名称" />
</el-form-item>
<el-form-item label="患者联系电话" prop="contactTel">
<el-input v-model="formData.contactTel" placeholder="请输入患者联系电话" />
</el-form-item>
<el-form-item label="登记时间" prop="regDate">
<el-date-picker
v-model="formData.regDate"
type="date"
value-format="x"
placeholder="选择登记时间"
/>
</el-form-item>
<el-form-item label="分检时间" prop="sortDate">
<el-date-picker
v-model="formData.sortDate"
type="date"
value-format="x"
placeholder="选择分检时间"
/>
</el-form-item>
<el-form-item label="开单医生" prop="billgDoctor">
<el-input v-model="formData.billgDoctor" placeholder="请输入开单医生" />
</el-form-item>
<el-form-item label="检查状态" prop="examStatus">
<el-radio-group v-model="formData.examStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="开单医生科室" prop="billDoctorDepartment">
<el-input v-model="formData.billDoctorDepartment" placeholder="请输入开单医生科室" />
</el-form-item>
<el-form-item label="此条记录的创建时间" prop="createDate">
<el-date-picker
v-model="formData.createDate"
type="date"
value-format="x"
placeholder="选择此条记录的创建时间"
/>
</el-form-item>
<el-form-item label="检查项目代码" prop="examItemCode">
<el-input v-model="formData.examItemCode" placeholder="请输入检查项目代码" />
</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="sortDoctor">
<el-input v-model="formData.sortDoctor" 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 { ApplyformApi, ApplyformVO } from '@/api/applyregistration/applyform'
/** 申请登记记录 表单 */
defineOptions({ name: 'ApplyformForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
regId: undefined,
regSource: undefined,
examId: undefined,
pName: undefined,
gender: undefined,
birthday: undefined,
examDate: undefined,
examItemName: undefined,
deviceId: undefined,
deviceName: undefined,
contactTel: undefined,
regDate: undefined,
sortDate: undefined,
billgDoctor: undefined,
examStatus: undefined,
billDoctorDepartment: undefined,
createDate: undefined,
examItemCode: undefined,
orgId: undefined,
sortDoctor: undefined,
})
const formRules = reactive({
})
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 ApplyformApi.getApplyform(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 ApplyformVO
if (formType.value === 'create') {
await ApplyformApi.createApplyform(data)
message.success(t('common.createSuccess'))
} else {
await ApplyformApi.updateApplyform(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
regId: undefined,
regSource: undefined,
examId: undefined,
pName: undefined,
gender: undefined,
birthday: undefined,
examDate: undefined,
examItemName: undefined,
deviceId: undefined,
deviceName: undefined,
contactTel: undefined,
regDate: undefined,
sortDate: undefined,
billgDoctor: undefined,
examStatus: undefined,
billDoctorDepartment: undefined,
createDate: undefined,
examItemCode: undefined,
orgId: undefined,
sortDoctor: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,369 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="登记来源" prop="regSource">
<el-select
v-model="queryParams.regSource"
placeholder="请选择来源"
clearable
class="!w-200px"
>
<el-option label="门诊" value="门诊" />
<el-option label="住院" value="住院" />
<el-option label="体检" value="体检" />
</el-select>
</el-form-item>
<el-form-item label="患者姓名" prop="pName">
<el-input
v-model="queryParams.pname"
placeholder="请输入患者姓名"
clearable
@keyup.enter="handleQuery"
class="!w-150px"
/>
</el-form-item>
<el-form-item label="登记时间" prop="regDate">
<el-date-picker
v-model="queryParams.regDate"
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-200px"
/>
</el-form-item>
<el-form-item label="分检时间" prop="sortDate">
<el-date-picker
v-model="queryParams.sortDate"
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-200px"
/>
</el-form-item>
<el-form-item label="登记单号" prop="regId">
<el-input
v-model="queryParams.regId"
placeholder="请输入登记单号"
clearable
@keyup.enter="handleQuery"
class="!w-150px"
/>
</el-form-item>
<el-form-item label="检查单号" prop="examId">
<el-input
v-model="queryParams.examId"
placeholder="请输入检查单号"
clearable
@keyup.enter="handleQuery"
class="!w-150px"
/>
</el-form-item>
<!-- <el-form-item label="检查日期" prop="examDate">
<el-date-picker
v-model="queryParams.examDate"
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-240px"
/>
</el-form-item> -->
<!-- <el-form-item label="检查项目名称" prop="examItemName">
<el-input
v-model="queryParams.examItemName"
placeholder="请输入检查项目名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item> -->
<el-form-item label="检查状态" prop="examStatus">
<el-select
v-model="queryParams.examStatus"
placeholder="请选择检查状态"
clearable
class="!w-200px"
>
<el-option label="未分检" value="未分检" />
<el-option label="未检查" value="未检查" />
<el-option label="已检查" value="已检查" />
<el-option label="已放弃" value="已放弃" />
</el-select>
</el-form-item>
<el-form-item label="执行科室" prop="deviceDepartment">
<el-select
v-model="queryParams.deviceDepartment"
placeholder="请选择执行科室"
clearable
class="!w-200px"
>
<el-option label="影像科" value="影像科" />
</el-select>
</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="['applyregistration:applyform:create']"
v-if="false"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['applyregistration:applyform:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['applyregistration:applyform:export']"
>
<Icon icon="ep:plus" 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 type="selection" width="55" />
<el-table-column label="主键" align="center" prop="id" v-if="false"/>
<el-table-column label="登记单号" align="center" prop="regId" />
<el-table-column label="登记来源" align="center" prop="regSource" width="100px"/>
<el-table-column label="检查单号" align="center" prop="examId" />
<el-table-column label="患者姓名" align="center" prop="pname" width="100px"/>
<el-table-column label="性别" align="center" prop="gender" width="100px"/>
<el-table-column
label="出生日期"
align="center"
prop="birthday"
:formatter="dateFormatter"
width="160px"
v-if="false"
/>
<el-table-column
label="检查日期"
align="center"
prop="examDate"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="检查项目名称" align="center" prop="examItemName" />
<el-table-column label="检查设备ID" align="center" prop="deviceId" v-if="false"/>
<el-table-column label="检查设备" align="center" prop="deviceName" />
<el-table-column label="联系电话" align="center" prop="contactTel" />
<el-table-column
label="登记时间"
align="center"
prop="regDate"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column
label="分检时间"
align="center"
prop="sortDate"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="开单医生" align="center" prop="billgDoctor" width="100px"/>
<el-table-column label="检查状态" align="center" prop="examStatus" width="100px" />
<el-table-column label="开单医生科室" align="center" prop="billDoctorDepartment" :label-class-name="'no-wrap'" v-if="false" />
<el-table-column
label="此条记录的创建时间"
align="center"
prop="createDate"
:formatter="dateFormatter"
width="180px"
v-if="false"
/>
<el-table-column label="检查项目代码" align="center" prop="examItemCode" v-if="false"/>
<el-table-column label="机构ID" align="center" prop="orgId" v-if="false" />
<el-table-column label="分检医生" align="center" prop="sortDoctor" width="100px"/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['applyregistration:applyform:update']"
>
分检
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['applyregistration:applyform:delete']"
>
作废
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['applyregistration:applyform: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>
<!-- 表单弹窗添加/修改 -->
<ApplyformForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { ApplyformApi, ApplyformVO } from '@/api/applyregistration/applyform'
import ApplyformForm from './ApplyformForm.vue'
import { fa } from 'element-plus/es/locale';
/** 申请登记记录 列表 */
defineOptions({ name: 'Applyform' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<ApplyformVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
regId: undefined,
regSource: undefined,
examId: undefined,
pname: undefined,
gender: undefined,
birthday: undefined,
examDate: [],
examItemName: undefined,
deviceId: undefined,
deviceName: undefined,
contactTel: undefined,
regDate: [],
sortDate: [],
billgDoctor: undefined,
examStatus: undefined,
billDoctorDepartment: undefined,
createDate: [],
examItemCode: undefined,
orgId: undefined,
sortDoctor: undefined,
deviceDepartment:undefined,
departmentCode:undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ApplyformApi.getApplyformPage(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 ApplyformApi.deleteApplyform(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ApplyformApi.exportApplyform(queryParams)
download.excel(data, '申请登记记录.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>