手术管理->更改部分组件数据来源,改为从字典中获取。
This commit is contained in:
@@ -56,10 +56,10 @@
|
||||
{{ scope.row.operatingRoomConfirmTime ? parseTime(scope.row.operatingRoomConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') : '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- 手术室确认人 -->
|
||||
<el-table-column label="手术室确认人" align="center" prop="operatingRoomConfirmUser" width="100" />
|
||||
|
||||
|
||||
<!-- 状态 -->
|
||||
<el-table-column label="状态" align="center" prop="statusEnum_dictText" width="100">
|
||||
<template #default="scope">
|
||||
@@ -146,9 +146,12 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手术类型" prop="surgeryTypeEnum">
|
||||
<el-select v-model="form.surgeryTypeEnum" placeholder="请选择手术类型" style="width: 100%">
|
||||
<el-option label="门诊手术" :value="1" />
|
||||
<el-option label="日间手术" :value="2" />
|
||||
<el-option label="急诊手术" :value="3" />
|
||||
<el-option
|
||||
v-for="item in surgery_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -291,20 +294,24 @@
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手术等级" prop="surgeryLevel">
|
||||
<el-select v-model="form.surgeryLevel" placeholder="请选择手术等级" style="width: 100%">
|
||||
<el-option label="一级手术" :value="1" />
|
||||
<el-option label="二级手术" :value="2" />
|
||||
<el-option label="三级手术" :value="3" />
|
||||
<el-option label="四级手术" :value="4" />
|
||||
<el-option
|
||||
v-for="item in surgery_level"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="切口类型" prop="incisionLevel">
|
||||
<el-select v-model="form.incisionLevel" placeholder="请选择切口类型" style="width: 100%">
|
||||
<el-option label="I类切口" :value="1" />
|
||||
<el-option label="II类切口" :value="2" />
|
||||
<el-option label="III类切口" :value="3" />
|
||||
<el-option label="IV类切口" :value="4" />
|
||||
<el-option
|
||||
v-for="item in incision_level"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -312,27 +319,14 @@
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉方式" prop="anesthesiaName">
|
||||
<el-select
|
||||
v-model="form.anesthesiaName"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="搜索麻醉项目"
|
||||
:remote-method="remoteSearchAnesthesia"
|
||||
:loading="anesthesiaLoading"
|
||||
style="width: 100%"
|
||||
@change="handleAnesthesiaChange"
|
||||
@focus="() => remoteSearchAnesthesia('')"
|
||||
>
|
||||
<el-form-item label="麻醉方式" prop="anesthesiaTypeEnum">
|
||||
<el-select v-model="form.anesthesiaTypeEnum" placeholder="请选择麻醉方式" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in anesthesiaNameList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
>
|
||||
<span>{{ item.retailPrice || item.retail_price || item.salePrice || item.price || 0 }}元 - {{ item.name }}</span>
|
||||
</el-option>
|
||||
v-for="item in anesthesia_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -475,7 +469,7 @@
|
||||
<el-descriptions-item label="申请科室">{{ viewData.applyDeptName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="术前诊断" :span="2">{{ viewData.preoperativeDiagnosis }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手术指征" :span="2">{{ viewData.surgeryIndication }}</el-descriptions-item>
|
||||
|
||||
|
||||
<!-- 次要手术详情展示 -->
|
||||
<el-descriptions-item label="次要手术" :span="2" v-if="viewData.secondarySurgeries && viewData.secondarySurgeries.length > 0">
|
||||
<el-table :data="viewData.secondarySurgeries" border size="small">
|
||||
@@ -499,6 +493,10 @@ import { getSurgeryPage, addSurgery, updateSurgery, deleteSurgery, getSurgeryDet
|
||||
import { getEncounterDiagnosis, getDiagnosisTreatmentList, queryParticipantList } from '../api'
|
||||
import { listUser } from '@/api/system/user'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { useDict } from '@/utils/dict'
|
||||
|
||||
//字典数据 手术类型、手术等级、切口等级、麻醉方式
|
||||
const { surgery_type, surgery_level, incision_level, anesthesia_type } = useDict('surgery_type', 'surgery_level', 'incision_level', 'anesthesia_type')
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const userStore = useUserStore()
|
||||
@@ -671,7 +669,7 @@ function loadDoctorList() {
|
||||
|
||||
Promise.all([p1, p2]).then(([res1, res2]) => {
|
||||
let list = []
|
||||
|
||||
|
||||
// 方案1:从参与者接口获取
|
||||
if (res1.code === 200 && res1.data && Array.isArray(res1.data) && res1.data.length > 0) {
|
||||
list = res1.data.map(item => ({
|
||||
@@ -680,8 +678,8 @@ function loadDoctorList() {
|
||||
orgName: item.organizationName || item.organization_name || item.deptName
|
||||
}))
|
||||
console.log('从参与者接口获取到医生:', list.length)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 方案2:如果方案1没数据,从用户接口获取
|
||||
if (list.length === 0 && res2.code === 200) {
|
||||
const data = res2.data?.records || res2.rows || res2.data || []
|
||||
@@ -734,7 +732,7 @@ function handleAdd() {
|
||||
form.value.patientAge = props.patientInfo.age
|
||||
form.value.applyDoctorName = userStore.nickName
|
||||
form.value.applyDeptName = userStore.orgName || props.patientInfo.deptName || ''
|
||||
|
||||
|
||||
// 确保医生列表已加载
|
||||
if (doctorList.value.length === 0) {
|
||||
loadDoctorList()
|
||||
@@ -759,16 +757,16 @@ function handleEdit(row) {
|
||||
if (doctorList.value.length === 0) {
|
||||
loadDoctorList()
|
||||
}
|
||||
|
||||
|
||||
getSurgeryDetail(row.id).then(res => {
|
||||
if (res.code === 200) {
|
||||
console.log('【编辑手术】完整返回数据:', res.data)
|
||||
console.log('【编辑手术】手术指征字段值:', res.data.surgeryIndication)
|
||||
|
||||
|
||||
Object.assign(form.value, res.data)
|
||||
|
||||
|
||||
console.log('【编辑手术】赋值后form.surgeryIndication:', form.value.surgeryIndication)
|
||||
|
||||
|
||||
// 处理麻醉名称回显
|
||||
if (res.data.anesthesiaTypeEnum_dictText) {
|
||||
form.value.anesthesiaName = res.data.anesthesiaTypeEnum_dictText
|
||||
@@ -804,12 +802,12 @@ function handleView(row) {
|
||||
console.log('【手术详情】手术指征字段值:', res.data.surgeryIndication)
|
||||
console.log('【手术详情】手术指征字段类型:', typeof res.data.surgeryIndication)
|
||||
console.log('【手术详情】手术指征是否为空:', res.data.surgeryIndication === null || res.data.surgeryIndication === undefined || res.data.surgeryIndication === '')
|
||||
|
||||
|
||||
viewData.value = res.data
|
||||
if (!viewData.value.secondarySurgeries) {
|
||||
viewData.value.secondarySurgeries = []
|
||||
}
|
||||
|
||||
|
||||
console.log('【手术详情】赋值后viewData:', viewData.value)
|
||||
console.log('【手术详情】赋值后viewData.surgeryIndication:', viewData.value.surgeryIndication)
|
||||
}
|
||||
@@ -872,14 +870,14 @@ function remoteSearchSurgery(query) {
|
||||
} else if (res.records && Array.isArray(res.records)) {
|
||||
data = res.records
|
||||
}
|
||||
|
||||
|
||||
// 在前端进行手术分类过滤 (categoryCode 为 '24' 是手术)
|
||||
// 同时过滤掉停用的项 (statusEnum 为 2 是启用)
|
||||
surgeryNameList.value = data.filter(item =>
|
||||
(item.categoryCode === '24' || item.categoryCode_dictText === '手术') &&
|
||||
surgeryNameList.value = data.filter(item =>
|
||||
(item.categoryCode === '24' || item.categoryCode_dictText === '手术') &&
|
||||
(item.statusEnum === 2 || item.statusEnum_enumText === '启用' || !item.statusEnum)
|
||||
)
|
||||
|
||||
|
||||
surgeryLoading.value = false
|
||||
}).catch(error => {
|
||||
console.error('搜索手术项目失败:', error)
|
||||
@@ -903,13 +901,13 @@ function remoteSearchAnesthesia(query) {
|
||||
} else if (res.records && Array.isArray(res.records)) {
|
||||
data = res.records
|
||||
}
|
||||
|
||||
|
||||
// 过滤麻醉项 (categoryCode 为 '25' 是麻醉)
|
||||
anesthesiaNameList.value = data.filter(item =>
|
||||
(item.categoryCode === '25' || item.categoryCode_dictText === '麻醉') &&
|
||||
anesthesiaNameList.value = data.filter(item =>
|
||||
(item.categoryCode === '25' || item.categoryCode_dictText === '麻醉') &&
|
||||
(item.statusEnum === 2 || item.statusEnum_enumText === '启用' || !item.statusEnum)
|
||||
)
|
||||
|
||||
|
||||
anesthesiaLoading.value = false
|
||||
}).catch(error => {
|
||||
console.error('搜索麻醉项目失败:', error)
|
||||
@@ -939,7 +937,7 @@ function handleAnesthesiaChange(val) {
|
||||
// 设置麻醉费用 (增加对多种字段名和类型的兼容)
|
||||
const price = selected.retailPrice ?? selected.retail_price ?? selected.price ?? selected.salePrice ?? 0
|
||||
form.value.anesthesiaFee = parseFloat(price)
|
||||
|
||||
|
||||
// 尝试根据名称映射麻醉方式枚举
|
||||
form.value.anesthesiaTypeEnum = mapAnesthesiaNameToEnum(selected.name)
|
||||
}
|
||||
@@ -1006,7 +1004,7 @@ function submitForm() {
|
||||
console.log('【提交表单】完整表单数据:', JSON.parse(JSON.stringify(form.value)))
|
||||
console.log('【提交表单】手术指征字段值:', form.value.surgeryIndication)
|
||||
console.log('【提交表单】手术指征字段类型:', typeof form.value.surgeryIndication)
|
||||
|
||||
|
||||
if (form.value.id == undefined) {
|
||||
// 新增手术
|
||||
addSurgery(form.value).then((res) => {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<el-form-item label="手术状态" prop="statusEnum">
|
||||
<el-select v-model="queryParams.statusEnum" placeholder="请选择手术状态" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in surgeryStatusOptions"
|
||||
v-for="item in surgery_status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -42,7 +42,7 @@
|
||||
<el-form-item label="手术类型" prop="surgeryTypeEnum">
|
||||
<el-select v-model="queryParams.surgeryTypeEnum" placeholder="请选择手术类型" clearable style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in surgeryTypeOptions"
|
||||
v-for="item in surgery_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -276,7 +276,7 @@
|
||||
<el-form-item label="手术类型" prop="surgeryTypeEnum">
|
||||
<el-select v-model="form.surgeryTypeEnum" placeholder="请选择手术类型" style="width: 100%" :disabled="isViewMode">
|
||||
<el-option
|
||||
v-for="item in surgeryTypeOptions"
|
||||
v-for="item in surgery_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -288,7 +288,7 @@
|
||||
<el-form-item label="手术等级" prop="surgeryLevel">
|
||||
<el-select v-model="form.surgeryLevel" placeholder="请选择手术等级" style="width: 100%" :disabled="isViewMode">
|
||||
<el-option
|
||||
v-for="item in surgeryLevelOptions"
|
||||
v-for="item in surgery_level"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -313,7 +313,14 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手术部位" prop="bodySite">
|
||||
<el-input v-model="form.bodySite" placeholder="请输入手术部位" :disabled="isViewMode" />
|
||||
<el-select v-model="form.bodySite" placeholder="请选择手术部位" style="width: 100%" :disabled="isViewMode" clearable>
|
||||
<el-option
|
||||
v-for="item in surgical_site"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -391,7 +398,7 @@
|
||||
<el-form-item label="麻醉方式" prop="anesthesiaTypeEnum">
|
||||
<el-select v-model="form.anesthesiaTypeEnum" placeholder="请选择麻醉方式" style="width: 100%" :disabled="isViewMode">
|
||||
<el-option
|
||||
v-for="item in anesthesiaTypeOptions"
|
||||
v-for="item in anesthesia_type"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -480,7 +487,7 @@
|
||||
<el-form-item label="切口等级" prop="incisionLevel">
|
||||
<el-select v-model="form.incisionLevel" placeholder="请选择切口等级" style="width: 100%" :disabled="isViewMode">
|
||||
<el-option
|
||||
v-for="item in incisionLevelOptions"
|
||||
v-for="item in incision_level"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -563,6 +570,7 @@ import { listUser } from '@/api/system/user'
|
||||
import { listOperatingRoom } from '@/api/operatingroom'
|
||||
import { deptTreeSelect } from '@/api/system/user'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { useDict } from '@/utils/dict'
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const loading = ref(true)
|
||||
@@ -627,6 +635,9 @@ const title = ref('')
|
||||
const operatingRoomList = ref([])
|
||||
const operatingRoomLoading = ref(false)
|
||||
|
||||
const { surgery_type, surgery_level, incision_level, anesthesia_type, surgery_status, surgical_site } =
|
||||
useDict('surgery_type', 'surgery_level', 'incision_level', 'anesthesia_type', 'surgery_status', 'surgical_site')
|
||||
|
||||
// 字典选项
|
||||
const surgeryStatusOptions = ref([
|
||||
{ value: 0, label: '待排期' },
|
||||
@@ -637,38 +648,6 @@ const surgeryStatusOptions = ref([
|
||||
{ value: 5, label: '暂停' }
|
||||
])
|
||||
|
||||
const surgeryTypeOptions = ref([
|
||||
{ value: 1, label: '门诊手术' },
|
||||
{ value: 2, label: '住院手术' },
|
||||
{ value: 3, label: '急诊手术' },
|
||||
{ value: 4, label: '择期手术' }
|
||||
])
|
||||
|
||||
const surgeryLevelOptions = ref([
|
||||
{ value: 1, label: '一级手术' },
|
||||
{ value: 2, label: '二级手术' },
|
||||
{ value: 3, label: '三级手术' },
|
||||
{ value: 4, label: '四级手术' },
|
||||
{ value: 5, label: '特级手术' }
|
||||
])
|
||||
|
||||
const anesthesiaTypeOptions = ref([
|
||||
{ value: 0, label: '无麻醉' },
|
||||
{ value: 1, label: '局部麻醉' },
|
||||
{ value: 2, label: '区域麻醉' },
|
||||
{ value: 3, label: '全身麻醉' },
|
||||
{ value: 4, label: '脊椎麻醉' },
|
||||
{ value: 5, label: '硬膜外麻醉' },
|
||||
{ value: 6, label: '表面麻醉' }
|
||||
])
|
||||
|
||||
const incisionLevelOptions = ref([
|
||||
{ value: 1, label: 'I级切口' },
|
||||
{ value: 2, label: 'II级切口' },
|
||||
{ value: 3, label: 'III级切口' },
|
||||
{ value: 4, label: 'IV级切口' }
|
||||
])
|
||||
|
||||
const healingLevelOptions = ref([
|
||||
{ value: 1, label: '甲级愈合' },
|
||||
{ value: 2, label: '乙级愈合' },
|
||||
|
||||
Reference in New Issue
Block a user