From dfc80c46d2d2384a7cc9747a0ffc0722db67c296 Mon Sep 17 00:00:00 2001 From: Jafeng <2998840497@qq.com> Date: Tue, 10 Feb 2026 15:47:35 +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 --- .../archive-detail/follow-up-manage-tab.vue | 23 +++- .../archive-detail/health-profile-tab.vue | 59 +++++++-- pages/case/search.vue | 30 ++++- pages/case/utils/visit-record.js | 5 +- pages/case/visit-record-detail.vue | 7 ++ pages/case/visit-record-view.vue | 114 +++++++++++------- pages/home/case-home.vue | 97 +++++---------- 7 files changed, 205 insertions(+), 130 deletions(-) diff --git a/pages/case/components/archive-detail/follow-up-manage-tab.vue b/pages/case/components/archive-detail/follow-up-manage-tab.vue index 9a098b2..50ceea6 100644 --- a/pages/case/components/archive-detail/follow-up-manage-tab.vue +++ b/pages/case/components/archive-detail/follow-up-manage-tab.vue @@ -376,11 +376,20 @@ function eventTypeLabel(eventType) { } function resolveUserName(userId) { + const id = String(userId || ""); if (!id) return ""; const map = userNameMap.value || {}; return String(map[id] || "") || id; } +function refreshChatRoom() { + if (!props.fromChat) return; + const pending = uni.getStorageSync(PENDING_FOLLOWUP_SEND_STORAGE_KEY); + if (pending && typeof pending === "object") { + chatGroupId.value = String(pending.chatGroupId || pending.groupId || ""); + } +} + function formatTodo(todo) { const status = getStatus(todo); const plannedExecutionTime = todo?.plannedExecutionTime; @@ -446,13 +455,23 @@ async function getMore() { toast(res?.message || "获取回访任务失败"); return; } - const arr = Array.isArray(res.data) ? res.data : []; + + // 对齐管理端同接口返回结构:{ success, data: { data: [], total } } + const payload = res?.data; + const arr = payload && Array.isArray(payload.data) + ? payload.data + : Array.isArray(payload) + ? payload + : []; const next = arr.map(formatTodo); - total.value = typeof res.total === "number" ? res.total : 0; + total.value = payload && typeof payload.total === "number" ? payload.total : 0; pages.value = Math.ceil(total.value / pageSize) || 0; list.value = page.value === 1 ? next : [...list.value, ...next]; page.value += 1; + } catch (e) { + console.error("getCustomerTodos failed:", e); + toast("获取回访任务失败"); } finally { loading.value = false; } diff --git a/pages/case/components/archive-detail/health-profile-tab.vue b/pages/case/components/archive-detail/health-profile-tab.vue index 2a30219..b0ff568 100644 --- a/pages/case/components/archive-detail/health-profile-tab.vue +++ b/pages/case/components/archive-detail/health-profile-tab.vue @@ -9,10 +9,15 @@ - + {{ dateRangeLabel }} - + + + + + + @@ -80,7 +85,7 @@ const props = defineProps({ floatingBottom: { type: Number, default: 16 }, }); -const FALLBACK_TEMPLATE_TYPES = ['outpatient', 'inhospital', 'preConsultation', 'physicalExaminationTemplate']; +const FALLBACK_TEMPLATE_TYPES = ['outpatient', 'inhospital', 'preConsultationRecord', '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); @@ -97,6 +102,9 @@ const currentType = ref({ name: '全部', value: 'ALL' }); const records = ref([]); const dateRange = ref([]); +const isDateRangeActive = computed( + () => Array.isArray(dateRange.value) && dateRange.value.length === 2 && dateRange.value[0] && dateRange.value[1] +); const dateRangeLabel = computed(() => { if (Array.isArray(dateRange.value) && dateRange.value.length === 2 && dateRange.value[0] && dateRange.value[1]) { return `${dateRange.value[0]} 至 ${dateRange.value[1]}`; @@ -226,12 +234,13 @@ async function loadTeamMembers() { function getSortTimeTitle(templateType) { const rawType = String(templateType || ''); + const ui = normalizeMedicalType(rawType); + // 预问诊记录:列表时间固定使用就诊日期字段,避免被模板配置的 timeTitle 覆盖 + if (ui === 'preConsultationRecord') return 'consultationDate'; const t = templateMap.value[rawType] || {}; if (t?.service?.timeTitle) return String(t.service.timeTitle); - const ui = normalizeMedicalType(rawType); if (ui === 'outpatient') return 'visitTime'; if (ui === 'inhospital') return 'inhosDate'; - if (ui === 'preConsultation') return 'consultDate'; if (ui === 'physicalExaminationTemplate') return 'inspectDate'; return ''; } @@ -275,14 +284,15 @@ function normalizeMedicalType(raw) { const s = String(raw || '').trim(); if (!s) return ''; const lower = s.toLowerCase(); - if (lower.includes('preconsult') || (lower.includes('pre') && lower.includes('consult'))) return 'preConsultation'; + if (lower.includes('preconsult') || (lower.includes('pre') && lower.includes('consult'))) return 'preConsultationRecord'; if (lower === 'outpatient' || lower === 'out_patient' || lower === 'out-patient') return 'outpatient'; if (lower === 'inhospital' || lower === 'in_hospital' || lower === 'in-hospital' || lower === 'inpatient') return 'inhospital'; - if (lower === 'preconsultation' || lower === 'pre_consultation' || lower === 'pre-consultation') return 'preConsultation'; + if (lower === 'preconsultation' || lower === 'pre_consultation' || lower === 'pre-consultation') return 'preConsultationRecord'; if (lower === 'physicalexaminationtemplate' || lower === 'physicalexamination' || lower === 'physical_examination') return 'physicalExaminationTemplate'; if (s === 'outPatient') return 'outpatient'; if (s === 'inHospital') return 'inhospital'; - if (s === 'preConsultation') return 'preConsultation'; + if (s === 'preConsultation') return 'preConsultationRecord'; + if (s === 'preConsultationRecord') return 'preConsultationRecord'; if (s === 'physicalExaminationTemplate') return 'physicalExaminationTemplate'; return s; } @@ -389,7 +399,7 @@ async function refreshList() { const tagClass = { outpatient: 'bg-amber', inhospital: 'bg-teal', - preConsultation: 'bg-indigo', + preConsultationRecord: 'bg-indigo', physicalExaminationTemplate: 'bg-green', }; @@ -401,14 +411,14 @@ function resolveRecordType(r) { if (r.inspectDate || r.positiveFind || r.inspectSummary) return 'physicalExaminationTemplate'; if (r.inhosDate || r.surgeryName || r.surgeryDate || r.operationDate) return 'inhospital'; if (r.visitTime || r.disposePlan || r.treatmentPlan) return 'outpatient'; - if (r.consultDate || r.presentIllness || r.presentIllnessHistory || r.pastHistory) return 'preConsultation'; + if (r.consultationDate || r.consultDate || r.presentIllness || r.presentIllnessHistory || r.pastHistory) return 'preConsultationRecord'; return ''; } function getDiagnosis(r) { if (!r) return '--'; const t = resolveRecordType(r); - if (t === 'preConsultation') return normalizeText(r.chiefComplaint) || normalizeText(r.summary) || '--'; + if (t === 'preConsultationRecord') return normalizeText(r.chiefComplaint) || normalizeText(r.summary) || '--'; if (t === 'physicalExaminationTemplate') return formatPositiveFind(r.positiveFind) || normalizeText(r.summary) || '--'; if (t === 'outpatient' || t === 'inhospital') return normalizeText(r.diagnosisName || r.diagnosis) || normalizeText(r.summary) || '--'; return normalizeText(r.diagnosisName || r.diagnosis || r.summary) || '--'; @@ -433,7 +443,7 @@ function getDisplayLines(r) { if (t === 'physicalExaminationTemplate') { return [{ label: '体检小结:', value: firstLine(r.summary || r.inspectSummary) }]; } - if (t === 'preConsultation') { + if (t === 'preConsultationRecord') { const lines = [ { label: '主诉:', value: firstLine(r.chiefComplaint) }, { label: '现病史:', value: firstLine(r.presentIllness || r.presentIllnessHistory) }, @@ -461,7 +471,19 @@ function pickType(e) { refreshList(); } function pickTimeRange(val) { - dateRange.value = val; + if (Array.isArray(val)) { + dateRange.value = val; + } else if (val && typeof val === 'object' && Array.isArray(val.value)) { + dateRange.value = val.value; + } else if (val && typeof val === 'object' && val.detail && Array.isArray(val.detail.value)) { + dateRange.value = val.detail.value; + } else { + dateRange.value = []; + } + refreshList(); +} +function clearTimeRange() { + dateRange.value = []; refreshList(); } @@ -589,6 +611,17 @@ watch( text-overflow: ellipsis; white-space: nowrap; } +.pill-icons { + display: flex; + align-items: center; + gap: 12rpx; + flex-shrink: 0; +} +.pill-clear { + display: flex; + align-items: center; + justify-content: center; +} .share-tip { padding: 20rpx 28rpx 0; diff --git a/pages/case/search.vue b/pages/case/search.vue index 7a69213..d50f346 100644 --- a/pages/case/search.vue +++ b/pages/case/search.vue @@ -136,7 +136,7 @@ function formatPatient(raw) { const lr = raw.latestRecord; const type = normalizeRecordTypeLabel(lr.type || lr.medicalTypeName || lr.medicalType || ''); const date = lr.date || ''; - const diagnosis = lr.diagnosis || ''; + const diagnosis = normalizeBriefText(lr.diagnosisName || lr.inspectSummary || lr.chiefComplaint || lr.diagnosis || ''); if (type || date || diagnosis) { record = { type: type || '-', @@ -169,6 +169,34 @@ function normalizeText(value) { return String(value || '').trim(); } +function normalizeBriefText(value) { + if (value === null || value === undefined) return ''; + if (Array.isArray(value)) { + const parts = value.map((i) => normalizeBriefText(i)).filter((i) => String(i).trim()); + return parts.join(','); + } + let s = String(value || '').trim(); + if (!s) return ''; + + // 常见异常:后端把数组字符串化成 "[]" 或带换行的 JSON 数组 + if (s === '[]' || s === '[ ]') return ''; + if (s.startsWith('[') && s.endsWith(']')) { + try { + const parsed = JSON.parse(s); + if (Array.isArray(parsed)) { + s = parsed.map((i) => normalizeBriefText(i)).filter((i) => String(i).trim()).join(','); + } + } catch { + // 非 JSON 数组:去掉最外层括号,避免展示成 “[]” + s = s.replace(/^\[\s*/, '').replace(/\s*\]$/, ''); + } + } + + s = String(s || '').replace(/[\r\n]+/g, ' ').replace(/\s+/g, ' ').trim(); + if (s === '[]' || s === '[ ]') return ''; + return s; +} + function normalizeDigits(value) { const s = normalizeText(value); return s.replace(/\D/g, ''); diff --git a/pages/case/utils/visit-record.js b/pages/case/utils/visit-record.js index 721c1ef..4524da4 100644 --- a/pages/case/utils/visit-record.js +++ b/pages/case/utils/visit-record.js @@ -24,6 +24,10 @@ const ALIAS_MAP = { presentIllnessHistory: 'presentIllness', pastMedicalHistory: 'pastHistory', }, + preConsultationRecord: { + presentIllnessHistory: 'presentIllness', + pastMedicalHistory: 'pastHistory', + }, }; export function normalizeVisitRecordFormData(templateType, raw) { @@ -37,4 +41,3 @@ export function normalizeVisitRecordFormData(templateType, raw) { return out; } - diff --git a/pages/case/visit-record-detail.vue b/pages/case/visit-record-detail.vue index b2c9dd5..4f8da51 100644 --- a/pages/case/visit-record-detail.vue +++ b/pages/case/visit-record-detail.vue @@ -76,6 +76,7 @@ const forms = computed(() => ({ ...detail.value, ...form })); const HIDDEN_FIELD_NAMES = { outpatient: ['就诊机构', '就诊科室', '机构名称', '责任医生'], inhospital: ['就诊机构', '机构名称'], + physicalExaminationTemplate: ['体检套餐名称'], }; const HIDDEN_FIELD_TITLES = { // 对应 systemFieldName/title(来自模板): @@ -87,6 +88,8 @@ const HIDDEN_FIELD_TITLES = { // - 就诊机构: corp // - 机构名称: corpName inhospital: ['corp', 'corpName'], + // - 体检套餐名称: inspectPakageName + physicalExaminationTemplate: ['inspectPakageName'], }; function shouldHideField(item) { const t = String(templateType.value || ''); @@ -306,10 +309,13 @@ async function remove() { height: 100vh; display: flex; flex-direction: column; + position: relative; } .scroll { flex: 1; min-height: 0; + position: relative; + z-index: 1; } .scroll-gap { height: calc(240rpx + env(safe-area-inset-bottom)); @@ -340,6 +346,7 @@ async function remove() { display: flex; gap: 24rpx; box-shadow: 0 -8rpx 24rpx rgba(0, 0, 0, 0.06); + z-index: 50; } .btn { flex: 1; diff --git a/pages/case/visit-record-view.vue b/pages/case/visit-record-view.vue index 4ef176d..37bb2c9 100644 --- a/pages/case/visit-record-view.vue +++ b/pages/case/visit-record-view.vue @@ -49,8 +49,8 @@