From 240d5dc3f75096eab2c93b837af298005c868663 Mon Sep 17 00:00:00 2001
From: qk123 <18211963828@163.com>
Date: Wed, 7 Jan 2026 17:28:56 +0800
Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=AF=E7=AE=A1=E7=90=86->=E6=9B=B4?=
=?UTF-8?q?=E6=94=B9=E9=83=A8=E5=88=86=E7=BB=84=E4=BB=B6=E6=95=B0=E6=8D=AE?=
=?UTF-8?q?=E6=9D=A5=E6=BA=90,=E6=94=B9=E4=B8=BA=E4=BB=8E=E5=AD=97?=
=?UTF-8?q?=E5=85=B8=E4=B8=AD=E8=8E=B7=E5=8F=96=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/surgery/surgeryApplication.vue | 106 +++++++++---------
.../src/views/surgerymanage/index.vue | 57 +++-------
2 files changed, 70 insertions(+), 93 deletions(-)
diff --git a/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue b/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue
index 2d6daaa8..af818826 100644
--- a/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue
+++ b/openhis-ui-vue3/src/views/doctorstation/components/surgery/surgeryApplication.vue
@@ -56,10 +56,10 @@
{{ scope.row.operatingRoomConfirmTime ? parseTime(scope.row.operatingRoomConfirmTime, '{y}-{m}-{d} {h}:{i}:{s}') : '-' }}
-
+
-
+
@@ -146,9 +146,12 @@
-
-
-
+
@@ -291,20 +294,24 @@
-
-
-
-
+
-
-
-
-
+
@@ -312,27 +319,14 @@
-
- remoteSearchAnesthesia('')"
- >
+
+
- {{ item.retailPrice || item.retail_price || item.salePrice || item.price || 0 }}元 - {{ item.name }}
-
+ v-for="item in anesthesia_type"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ />
@@ -475,7 +469,7 @@
{{ viewData.applyDeptName }}
{{ viewData.preoperativeDiagnosis }}
{{ viewData.surgeryIndication }}
-
+
@@ -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) => {
diff --git a/openhis-ui-vue3/src/views/surgerymanage/index.vue b/openhis-ui-vue3/src/views/surgerymanage/index.vue
index 67c2b6c4..c499e0b4 100644
--- a/openhis-ui-vue3/src/views/surgerymanage/index.vue
+++ b/openhis-ui-vue3/src/views/surgerymanage/index.vue
@@ -32,7 +32,7 @@
-
+
+
+
@@ -391,7 +398,7 @@