From e37c2b1089ba1cdc03b96fcef2eb88e16ede1d37 Mon Sep 17 00:00:00 2001 From: Jafeng <2998840497@qq.com> Date: Fri, 6 Feb 2026 18:04:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/case/archive-detail.vue | 25 +-- .../archive-detail/customer-profile-tab.vue | 17 +- .../archive-detail/health-profile-tab.vue | 58 ++++- .../archive-detail/service-info-tab.vue | 203 +++++++++++++++-- pages/case/patient-inner-info.vue | 36 +++- pages/case/service-record-detail.vue | 204 +++++++++++------- pages/case/visit-record-detail.vue | 4 - 7 files changed, 415 insertions(+), 132 deletions(-) diff --git a/pages/case/archive-detail.vue b/pages/case/archive-detail.vue index e5766e8..628ef24 100644 --- a/pages/case/archive-detail.vue +++ b/pages/case/archive-detail.vue @@ -2,18 +2,12 @@ - - - - {{ archive.name || '-' }} {{ sexOrAge }} - {{ archive.mobile }} - {{ row.label }}: @@ -296,7 +290,7 @@ function normalizeArchiveFromApi(raw) { name: r.name || '', sex: r.sex || r.gender || '', age: r.age ?? '', - avatar: r.avatar || '', + avatar: r.avatar || r.avatarUrl || r.headImgUrl || r.headimgurl || r.headImageUrl || r.profilePhoto || r.photoUrl || r.photo || '', mobile: r.mobile || r.phone1 || r.phone || '', outpatientNo: r.outpatientNo || '', inpatientNo: r.inpatientNo || '', @@ -778,25 +772,10 @@ const saveAddGroup = async () => { border-bottom: 2rpx solid #f2f2f2; } -.avatar { - width: 112rpx; - height: 112rpx; - border-radius: 12rpx; - border: 2rpx solid #e8e8e8; - background: #fafafa; - overflow: hidden; - flex-shrink: 0; -} - -.avatar-img { - width: 112rpx; - height: 112rpx; -} - .header-main { flex: 1; min-width: 0; - padding: 0 20rpx; + padding: 0 20rpx 0 0; } .name-row { diff --git a/pages/case/components/archive-detail/customer-profile-tab.vue b/pages/case/components/archive-detail/customer-profile-tab.vue index a3f0609..3e6472e 100644 --- a/pages/case/components/archive-detail/customer-profile-tab.vue +++ b/pages/case/components/archive-detail/customer-profile-tab.vue @@ -40,13 +40,6 @@ - - 院内来源 - - {{ latestTransferRecord?.executeTeamName || '点击查看' }} - - - (Array.isArray(props.baseItems) && props.baseItems.length ? props.baseItems : fallbackBaseItems)); -const effectiveInternalItems = computed(() => (Array.isArray(props.internalItems) && props.internalItems.length ? props.internalItems : fallbackInternalItems)); +function isInHospitalSourceItem(item) { + const title = String(item?.title || ''); + const name = String(item?.name || ''); + return title === 'inHospitalSource' || title === 'hospitalSource' || name.includes('院内来源'); +} +const effectiveInternalItems = computed(() => { + const raw = Array.isArray(props.internalItems) && props.internalItems.length ? props.internalItems : fallbackInternalItems; + return raw.filter((i) => i && !isInHospitalSourceItem(i)); +}); const filterRule = { reference(formModel) { diff --git a/pages/case/components/archive-detail/health-profile-tab.vue b/pages/case/components/archive-detail/health-profile-tab.vue index 3342079..a26a5c4 100644 --- a/pages/case/components/archive-detail/health-profile-tab.vue +++ b/pages/case/components/archive-detail/health-profile-tab.vue @@ -54,11 +54,11 @@ mode="selector" :range="selectableTemplates" range-key="name" - :disabled="selectableTemplates.length === 0" + :disabled="fabPickerDisabled" :style="{ bottom: `${floatingBottom}px` }" @change="pickAddType" > - + @@ -81,6 +81,8 @@ const props = defineProps({ const FALLBACK_TEMPLATE_TYPES = ['outpatient', 'inhospital', 'preConsultation', 'physicalExaminationTemplate']; const templates = ref([]); const selectableTemplates = computed(() => templates.value.filter((i) => i && i.templateType && typeof i.name === 'string' && i.name.trim())); +const useActionSheet = computed(() => selectableTemplates.value.length > 0 && selectableTemplates.value.length <= 6); +const fabPickerDisabled = computed(() => selectableTemplates.value.length === 0 || useActionSheet.value); const templateMap = computed(() => templates.value.reduce((m, t) => { if (t?.templateType) m[String(t.templateType)] = t; return m; @@ -393,16 +395,58 @@ function previewFiles(r, idx) { uni.previewImage({ urls, current: urls[idx] }); } -function pickAddType(e) { - if (!props.archiveId) return toast('缺少档案信息'); - const idx = Number(e?.detail?.value ?? -1); - const t = selectableTemplates.value[idx]; +function goAdd(t) { if (!t?.templateType) return; uni.navigateTo({ url: `/pages/case/visit-record-detail?archiveId=${encodeURIComponent(props.archiveId)}&type=${encodeURIComponent(t.templateType)}&name=${encodeURIComponent(props.data?.name || '')}`, }); } +function pickAddType(e) { + if (!props.archiveId) return toast('缺少档案信息'); + const idx = Number(e?.detail?.value ?? -1); + const t = selectableTemplates.value[idx]; + if (!t) return; + goAdd(t); +} + +function showAddActionSheet() { + if (!props.archiveId) return toast('缺少档案信息'); + const list = selectableTemplates.value; + if (!list.length) return toast('暂无可用病历模板'); + uni.showActionSheet({ + itemList: list.map((i) => i.name), + success: ({ tapIndex }) => { + const t = list[tapIndex]; + if (!t) return; + goAdd(t); + }, + fail: (e) => { + // 用户取消无需提示;其他错误忽略 + const errMsg = String(e?.errMsg || ''); + if (errMsg && errMsg.includes('cancel')) return; + if (errMsg) console.warn('[health-profile-tab] showActionSheet fail:', errMsg); + }, + }); +} + +async function onFabTap() { + if (!props.archiveId) return toast('缺少档案信息'); + + // 模板可能尚未加载:先拉一次 + if (!templates.value.length) { + loading('加载模板...'); + try { + await loadVisitTemplates(); + } finally { + hideLoading(); + } + } + + // <=6:用 actionSheet;>6:由 picker 自己弹(这里不做额外处理) + if (useActionSheet.value) showAddActionSheet(); +} + function edit(record) { const type = String(record?.medicalType || record?.templateType || '') || ''; uni.navigateTo({ @@ -411,6 +455,8 @@ function edit(record) { } onMounted(() => { + // 提前加载模板,避免首次点“+”时 picker 无法立即弹出 + loadVisitTemplates(); // archiveId 可能后置赋值:这里保留一次兜底刷新,主逻辑交给 watch refreshList(); uni.$on('archive-detail:visit-record-changed', refreshList); diff --git a/pages/case/components/archive-detail/service-info-tab.vue b/pages/case/components/archive-detail/service-info-tab.vue index ea575c8..d351882 100644 --- a/pages/case/components/archive-detail/service-info-tab.vue +++ b/pages/case/components/archive-detail/service-info-tab.vue @@ -40,8 +40,8 @@ {{ i.typeStr }} - {{ i.executorName }} - {{ i.executeTeamName }} + {{ executorText(i) }} + {{ executeTeamText(i) }} @@ -79,6 +79,31 @@ + + + + + + + 修改服务内容 + + + + + +