医疗机构

This commit is contained in:
wuyy 2026-06-17 17:49:37 +08:00
parent 83fab3a4d7
commit d1ba068d7b
17 changed files with 364 additions and 83 deletions

View File

@ -5,23 +5,12 @@
<script setup lang="ts">
import useSettingsStore from '@/store/modules/settings'
import { handleThemeStyle } from '@/utils/theme'
import { useSysParam } from '@/hooks/useSysParam'
const { initAllParams } = useSysParam()
// ========== 在这里统一维护【所有需要全局获取的参数 key】 ==========
const GLOBAL_PARAM_KEYS = [
'YBZFXMTSXX', // YBZFXMTSXX
'HZBQGY', // 患者病情概要是否必填
]
onMounted(() => {
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme)
})
// 获取参数值
initAllParams(GLOBAL_PARAM_KEYS)
})
</script>

View File

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询医疗机构列表
export function listhospital(query?: Object) {
return request({
url: '/transitdict/hospital/list',
method: 'get',
params: query
})
}
// 查询医疗机构详细
export function gethospital(hospitalId: number) {
return request({
url: '/transitdict/hospital/' + hospitalId,
method: 'get'
})
}
// 新增医疗机构
export function addhospital(data: Object) {
return request({
url: '/transitdict/hospital',
method: 'post',
data: data
})
}
// 修改医疗机构
export function updatehospital(data: Object) {
return request({
url: '/transitdict/hospital',
method: 'put',
data: data
})
}
// 删除医疗机构
export function delhospital(hospitalId: number) {
return request({
url: '/transitdict/hospital/' + hospitalId,
method: 'delete'
})
}

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 获取医疗机构列表
export function queryHosList(query?: Object) {
return request({
url: '/bus/bloodbank/hosInfo/queryList',
method: 'get',
params: query
})
}
// 新增机构
export function addHos(query?: Object) {
return request({
url: '/bus/bloodbank/hosInfo/add',
method: 'post',
data: query
})
}
// 修改机构
export function upadteHos(query?: Object) {
return request({
url: '/bus/bloodbank/hosInfo/update',
method: 'post',
data: query
})
}

View File

@ -122,6 +122,13 @@ aside {
//main-container全局样式
.app-container {
padding: 10px;
height: calc(100vh - 5.25rem);
background-color: #fff;
box-sizing: border-box;
}
.box-container {
padding: 10px 10px 0 10px;
height: calc(100vh - 5.25rem);
background-color: #e6edf9;

View File

@ -51,7 +51,7 @@ import RuoYiDoc from '@/components/RuoYi/Doc/index.vue'
import useAppStore from '@/store/modules/app'
import useUserStore from '@/store/modules/user'
import useSettingsStore from '@/store/modules/settings'
import { listhospital } from '@/api/regional/hospital'
import { queryHosList, addHos, upadteHos } from '@/api/system/medicalInstitutions'
const appStore = useAppStore()
const userStore = useUserStore()
const settingsStore = useSettingsStore()
@ -133,8 +133,8 @@ async function toggleTheme(event?: MouseEvent): Promise<void> {
}
onMounted(() => {
listhospital({ pageSize: 100, pageNum: 1 }).then((resp: any) => {
yljgName.value = resp.rows.find((item: any) => item.hospitalId == userStore.sysLoginParam.loginYLJG)?.hospitalName || '输血平台'
queryHosList().then((resp) => {
yljgName.value = resp.data.find((item) => item.hospital_code == userStore.sysLoginParam.loginYLJG)?.hospital_name || '输血平台'
})
})
</script>

View File

@ -19,6 +19,15 @@ import Sidebar from './components/Sidebar/index.vue'
import { AppMain, Navbar, Settings, TagsView } from './components'
import useAppStore from '@/store/modules/app'
import useSettingsStore from '@/store/modules/settings'
import { useSysParam } from '@/hooks/useSysParam'
const { initAllParams } = useSysParam()
// ========== 在这里统一维护【所有需要全局获取的参数 key】 ==========
const GLOBAL_PARAM_KEYS = [
'YBZFXMTSXX', // YBZFXMTSXX
'HZBQGY', // 患者病情概要是否必填
]
const settingsStore = useSettingsStore()
const theme = computed(() => settingsStore.theme)
@ -60,6 +69,12 @@ const settingRef = ref(null)
function setLayout() {
settingRef.value.openSetting()
}
onMounted(() => {
// 获取参数值
initAllParams(GLOBAL_PARAM_KEYS)
})
</script>
<style lang="scss" scoped>

View File

@ -6,7 +6,6 @@ import { tansParams, blobValidate } from '@/utils/ruoyi'
import cache from '@/plugins/cache'
import { saveAs } from 'file-saver'
import useUserStore from '@/store/modules/user'
let downloadLoadingInstance: ReturnType<typeof ElLoading.service>
// 是否显示重新登录
export const isRelogin = { show: false }
@ -30,6 +29,7 @@ service.interceptors.request.use((config: any) => {
const interval = (config.headers || {}).interval || 1000
if (getToken() && !isToken) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
config.headers['hos_id'] = useUserStore().sysLoginParam.loginYLJG // 登录院区ID
}
// get请求映射params参数
if (config.method === 'get' && config.params) {

View File

@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="box-container">
<!-- 顶部工具栏 -->
<div class="toolbar">
<el-button type="primary" plain>新增</el-button>
@ -626,7 +626,7 @@ const submitForm = async () => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
display: flex;
flex-direction: column;
box-sizing: border-box;

View File

@ -6,7 +6,7 @@
*/
<template>
<div class="app-container">
<div class="box-container">
<div class="section">
<el-button type="primary" plain @click="openJsDialog">检索</el-button>
<el-button type="primary" plain @click="handleAdd">新增</el-button>
@ -496,7 +496,7 @@ onMounted(() => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
overflow-y: auto;
font-size: 14px;
padding: 10px;

View File

@ -6,7 +6,7 @@
*/
<template>
<div class="app-container">
<div class="box-container">
<!-- 顶部搜索栏 -->
<div class="top-search-bar">
<el-input placeholder="输入床号/住院号/病人姓名搜索" style="width: 240px" clearable />
@ -366,7 +366,7 @@ const goSxsq = () => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
box-sizing: border-box;
// 顶部搜索栏

View File

@ -5,7 +5,7 @@
* @since: 2026-06-11
*/
<template>
<div class="app-container">
<div class="box-container">
<!-- 顶部工具栏 -->
<div class="toolbar">
<el-button type="primary" plain>检索</el-button>
@ -422,7 +422,7 @@ const preCheckData = reactive({
</script>
<style scoped lang="scss">
.app-container {
.box-container {
display: flex;
flex-direction: column;
box-sizing: border-box;

View File

@ -5,7 +5,7 @@
* @since: 2026-06-03
*/
<template>
<div class="app-container">
<div class="box-container">
<!-- 1.申请单信息卡片 -->
<div class="card-wrap">
<el-button type="primary" plain>检索</el-button>
@ -209,7 +209,7 @@ const searchBlood = () => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
padding: 10px;
display: flex;
flex-direction: column;

View File

@ -6,7 +6,7 @@
*/
<template>
<div class="app-container">
<div class="box-container">
<!-- 顶部筛选卡片 -->
<div class="top-search-card">
<el-form inline :model="searchForm">
@ -125,18 +125,18 @@ const onAudit = () => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
padding: 12px;
display: flex;
flex-direction: column;
gap: 16px;
gap: 10px;
// 顶部搜索卡片
.top-search-card {
background: #ffffff;
border-radius: 6px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
padding: 18px 20px;
padding: 10px;
:deep(.el-form-item) {
margin-bottom: 0;
@ -155,7 +155,7 @@ const onAudit = () => {
border-radius: 6px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
padding: 16px;
height: calc(100% - 80px);
height: calc(100% - 60px);
// 右上角按钮栏
.table-btn-bar {

View File

@ -6,7 +6,7 @@
*/
<template>
<div class="app-container">
<div class="box-container">
<div class="section-card">
<el-button type="primary" plain>检索</el-button>
<el-button type="primary" plain>确认接收</el-button>
@ -230,7 +230,7 @@ const handleBagBarcodeScan = async () => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
display: flex;
flex-direction: column;
gap: 12px;

View File

@ -5,7 +5,7 @@
* @since: 2026-06-15
*/
<template>
<div class="app-container">
<div class="box-container">
<div class="form-card">
<el-button type="primary" plain>检索</el-button>
<el-button type="primary" plain>新增单据</el-button>
@ -290,7 +290,7 @@ const queryByFh = () => { console.log('按发血单号查询', searchForm.value.
const queryByIn = () => { console.log('按住院号查找', searchForm.value.inNo) }
</script>
<style scoped lang="scss">
.app-container {
.box-container {
padding: 14px;
display: flex;
flex-direction: column;

View File

@ -5,7 +5,7 @@
* @since: 2026-06-09
*/
<template>
<div class="app-container">
<div class="box-container">
<!-- 顶部搜索卡片 -->
<div class="search-card">
<el-form :model="searchForm" inline label-width="auto">
@ -158,17 +158,17 @@ const handleSelectionChange = (val: any[]) => {
</script>
<style scoped lang="scss">
.app-container {
.box-container {
display: flex;
flex-direction: column;
gap: 16px;
gap: 10px;
// 顶部搜索卡片(和第二张图样式完全一致)
.search-card {
background: #ffffff;
border-radius: 6px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
padding: 18px 20px;
padding: 10px;
:deep(.el-form-item) {
margin-bottom: 8px;
@ -187,7 +187,7 @@ const handleSelectionChange = (val: any[]) => {
border-radius: 6px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
padding: 16px;
height: calc(100% - 145px);
height: calc(100% - 125px);
// 右上角按钮栏(作废/审核)
.table-btn-bar {

View File

@ -0,0 +1,288 @@
/**
* @file index.vue
* @description: 医疗机构
* @author: w
* @since: 2026-06-17
*/
<template>
<div class="app-container">
<!-- 顶部操作栏 -->
<div>
<el-input v-model="searchKey" placeholder="输入医院名称/编码搜索" style="width: 300px;margin-right: 20px;" clearable
@keyup.enter="handleSearch" />
<el-button type="primary" @click="handleSearch" icon="Search">搜索</el-button>
<!-- <el-button @click="resetSearch">重置</el-button> -->
</div>
<div class="oper-bar ">
<el-button type="primary" icon="Plus" plain @click="openAddDialog">新增</el-button>
<!-- 表格列表 -->
<el-table :data="tableData" border style="width: 100%; margin-top: 12px" v-loading="loading" highlight-current-row
show-overflow-tooltip height="calc(100vh - 250px)">
<el-table-column label="医院编码" prop="hospital_code" align="center" width="80" />
<el-table-column label="医院名称" prop="hospital_name" align="center" width="200" />
<el-table-column label="医院地址" prop="address" align="center" width="200" />
<el-table-column label="所属行政区" prop="org_zone" align="center" />
<el-table-column label="所属街道" prop="org_street" align="center" />
<el-table-column label="机构类型" prop="org_kind" align="center" />
<el-table-column label="结算类型" prop="foot_mode" align="center" />
<el-table-column label="联系人" prop="link_person" align="center" />
<el-table-column label="联系电话" prop="telno" align="center" />
<el-table-column label="邮政编码" prop="post_code" align="center" />
<el-table-column label="使用标志" prop="sfby" align="center">
<template #default="scope">
<el-tag :type="scope.row.sfby === 'Y' ? 'success' : 'danger'">
{{ scope.row.sfby === 'Y' ? '使用' : '停用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="最后修改时间" prop="last_modified" align="center" />
<el-table-column label="操作" align="center" width="140" fixed="right">
<template #default="scope">
<el-button type="primary" icon="Edit" link @click="openEditDialog(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<!-- <el-pagination v-model:current-page="pageNum" v-model:page-size="pageSize" :total="total"
layout="total, sizes, prev, pager, next, jumper" @size-change="handleSearch" @current-change="handleSearch"
style="margin-top:10px; text-align:right" /> -->
</div>
<!-- 新增/编辑弹窗 -->
<el-dialog v-model="dialogVisible" :title="isEdit ? '编辑医院信息' : '新增医院'" width="850px" @close="resetForm">
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="医院编码" prop="hospital_code">
<el-input v-model="form.hospital_code" placeholder="请输入医院编码" :disabled="isEdit" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="医院名称" prop="hospital_name">
<el-input v-model="form.hospital_name" placeholder="请输入医院名称" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属行政区" prop="org_zone">
<el-input v-model="form.org_zone" placeholder="如:XX区/XX县" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属街道" prop="org_street">
<el-input v-model="form.org_street" placeholder="请输入街道" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="机构类型" prop="org_kind">
<el-input v-model="form.org_kind" placeholder="请输入机构类型" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结算类型" prop="foot_mode">
<el-input v-model="form.foot_mode" placeholder="请输入结算类型" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="联系人" prop="link_person">
<el-input v-model="form.link_person" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="telno">
<el-input v-model="form.telno" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="邮政编码" prop="post_code">
<el-input v-model="form.post_code" placeholder="请输入邮政编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="使用标志" prop="sfby">
<el-radio-group v-model="form.sfby">
<el-radio value="Y">启用</el-radio>
<el-radio value="N">停用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="医院地址" prop="address">
<el-input v-model="form.address" type="textarea" :rows="2" placeholder="完整医院地址" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitForm">保存</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import dayjs from 'dayjs'
import { ElMessage } from 'element-plus'
import { queryHosList, addHos, upadteHos } from '@/api/system/medicalInstitutions'
const formRef = useTemplateRef('formRef')
const loading = ref(false)
const dialogVisible = ref(false)
const isEdit = ref(false)
const searchKey = ref('')
const pageNum = ref(1)
const pageSize = ref(20)
const total = ref(0)
// 表格数据类型定义
interface HospitalRow {
address: string
foot_mode: string
hospital_code: string
hospital_name: string
link_person: string
org_kind: string
org_street: string
org_zone: string
post_code: string
sfby: 'Y' | 'N'
telno: string
}
// 表格数据
const tableData = ref<HospitalRow[]>([])
// 表单数据
const form = reactive<HospitalRow>({
address: '',
foot_mode: '',
hospital_code: '',
hospital_name: '',
link_person: '',
org_kind: '',
org_street: '',
org_zone: '',
post_code: '',
sfby: 'Y',
telno: ''
})
// 表单校验规则
const rules = reactive({
hospital_code: [{ required: true, message: '请填写医院编码', trigger: 'blur' }],
hospital_name: [{ required: true, message: '请填写医院名称', trigger: 'blur' }],
sfby: [{ required: true, message: '请选择使用标志', trigger: 'change' }],
address: [{ required: true, message: '请填写医院地址', trigger: 'blur' }]
})
// 获取列表
const getTableList = async () => {
loading.value = true
queryHosList({ searchKey: searchKey.value }).then((res) => {
loading.value = false
if (res.code == 0) {
tableData.value = res.data
}
})
}
// 查询
const handleSearch = () => {
pageNum.value = 1
getTableList()
}
// 重置搜索
const resetSearch = () => {
searchKey.value = ''
pageNum.value = 1
getTableList()
}
// 打开新增弹窗
const openAddDialog = () => {
isEdit.value = false
dialogVisible.value = true
resetForm()
}
// 打开编辑弹窗
const openEditDialog = (row: HospitalRow) => {
isEdit.value = true
dialogVisible.value = true
// 拷贝行数据到表单
Object.assign(form, row)
}
// 重置表单
const resetForm = () => {
formRef.value?.clearValidate()
Object.assign(form, {
address: '',
foot_mode: '',
hospital_code: '',
hospital_name: '',
last_modified: '',
link_person: '',
org_kind: '',
org_street: '',
org_zone: '',
post_code: '',
sfby: 'Y',
telno: ''
})
}
// 提交表单
const submitForm = async () => {
await formRef.value?.validate(async (valid) => {
if (!valid) return
if (isEdit.value) {
// 编辑
upadteHos(form).then((res) => {
if (res.code == 0) {
ElMessage.success(res.msg)
dialogVisible.value = false
getTableList()
}
})
} else {
// 新增
addHos(form).then((res) => {
if (res.code == 0) {
ElMessage.success(res.msg)
dialogVisible.value = false
getTableList()
}
})
}
})
}
onMounted(() => {
getTableList()
})
</script>
<style scoped lang="scss">
.oper-bar {
margin: 18px 0 8px 0
}
</style>