添加医院配置文件

This commit is contained in:
Flow 2025-06-20 10:45:47 +08:00
parent 9ae0f2fbcf
commit a0f4b802a3
2 changed files with 54 additions and 10 deletions

22
src/config/hospitals.ts Normal file
View File

@ -0,0 +1,22 @@
export interface Hospital {
name: string
code: string
shortCode: string
}
export const hospitals: Hospital[] = [
{ name: '乌兰察布第四医院', code: '121526004609160793', shortCode: '1001' },
{ name: '乌兰察布第四医院实验室', code: '221526004609160793', shortCode: '2001' },
{ name: '卓资县卓资山镇第二社区卫生服务中心', code: '150921353066575', shortCode: '4001' },
{ name: '卓资县卓资山镇社区卫生服务中心', code: '150921353066574', shortCode: '4002' },
{ name: '旗下营镇中心卫生院', code: '15092146096496X', shortCode: '4003' },
{ name: '十八台镇八苏木卫生院', code: '15092168001259X', shortCode: '4004' },
{ name: '十八台镇梅力盖图卫生院', code: '150921680043070', shortCode: '4005' },
{ name: '十八台镇中心卫生院', code: '150921460965305', shortCode: '4006' },
{ name: '巴音锡勒镇中心卫生院', code: '150921793646900', shortCode: '4007' },
{ name: '大榆树乡卫生院', code: '150921680012530', shortCode: '4008' },
{ name: '复兴乡卫生院', code: '150921680043679', shortCode: '4009' },
{ name: '梨花镇卫生院', code: '15092168001267X', shortCode: '4010' },
{ name: '卓资山镇马盖图卫生院', code: '15092168004337X', shortCode: '4011' },
{ name: '红召乡中心卫生院', code: '150921460965380', shortCode: '4012' }
]

View File

@ -72,8 +72,12 @@
clearable clearable
class="!w-200px" class="!w-200px"
> >
<el-option label="乌兰察布第四医院" value="121526004609160793" /> <el-option
<el-option label="乌兰察布第四医院实验室" value="221526004609160793" /> v-for="hospital in hospitals"
:key="hospital.code"
:label="hospital.name"
:value="hospital.code"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -203,6 +207,7 @@ import { ElMessageBox } from 'element-plus' // 添加 ElMessageBox 导入
import { InspectOrgApi, InspectOrgVO } from '@/api/inspect/inspectorg/index' import { InspectOrgApi, InspectOrgVO } from '@/api/inspect/inspectorg/index'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { getUserProfile } from '@/api/system/user/profile' import { getUserProfile } from '@/api/system/user/profile'
import { hospitals } from '@/config/hospitals'
defineOptions({ name: 'Department' }) defineOptions({ name: 'Department' })
@ -228,7 +233,6 @@ const queryParams = reactive({
const queryFormRef = ref() // const queryFormRef = ref() //
const fileInputRef = ref<HTMLInputElement | null>(null) // const fileInputRef = ref<HTMLInputElement | null>(null) //
const idCardReading = ref(false) // const idCardReading = ref(false) //
const shortid = ref('')
// //
const dialogVisible = ref(false) const dialogVisible = ref(false)
const addFormRef = ref() const addFormRef = ref()
@ -319,13 +323,31 @@ const handlePrint = async (row: PatientVO) => {
const userInfo = await getUserProfile() const userInfo = await getUserProfile()
const deptInfo = await InspectOrgApi.getInspectOrg(userInfo.deptId) const deptInfo = await InspectOrgApi.getInspectOrg(userInfo.deptId)
if (queryParams.hospitalNo) { if (queryParams.hospitalNo) {
if (queryParams.hospitalNo == '121526004609160793') { const selectedHospital = hospitals.find((h) => h.code === queryParams.hospitalNo)
shortid.value = '1001' if (selectedHospital) {
await PatientApi.updatePatientOrg(row.medicalSn, deptInfo.orgid, deptInfo.orgName, queryParams.hospitalNo, shortid.value) const shortid = selectedHospital.shortCode
} await PatientApi.updatePatientOrg(
if (queryParams.hospitalNo == '221526004609160793') { row.medicalSn,
shortid.value = '2001' deptInfo.orgid,
await PatientApi.updatePatientOrg(row.medicalSn, deptInfo.orgid, deptInfo.orgName, queryParams.hospitalNo, shortid.value) deptInfo.orgName,
queryParams.hospitalNo,
shortid
)
console.log(
'updatePatientOrg',
row.medicalSn,
deptInfo.orgid,
deptInfo.orgName,
queryParams.hospitalNo,
shortid
)
} else {
// This case should ideally not happen if the dropdown is populated correctly
ElMessageBox.alert('选择的机构无效', '提示', {
confirmButtonText: '确定',
type: 'warning'
})
return
} }
} else { } else {
ElMessageBox.alert('请选择当前机构', '提示', { ElMessageBox.alert('请选择当前机构', '提示', {