diff --git a/api/reception.js b/api/reception.js index 67f29c6..ab77a2c 100644 --- a/api/reception.js +++ b/api/reception.js @@ -493,3 +493,48 @@ export function getDrugsByRegisterIdApi(data) { } }) } + +/** 获取病历 */ +export function getMedicalRecordApi(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/get-medical-record', + method: 'GET', + data + }) +} + +/** 保存病历 */ +export function saveMedicalRecordApi(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/save-medical-record', + method: 'POST', + data + }) +} + +/** 清空病历 */ +export function clearMedicalRecordApi(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/clear-medical-record', + method: 'POST', + data + }) +} + +/** 引用最近病历 */ +export function latestMedicalRecordApi(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/latest-medical-record', + method: 'GET', + data + }) +} + +/** 病历词条检索 */ +export function searchMedicalRecordEntryApi(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/search-medical-record-entry', + method: 'GET', + data + }) +} diff --git a/subPackages/sub_business_shared/user-patient/register-detail.vue b/subPackages/sub_business_shared/user-patient/register-detail.vue index 0d90884..c1b6358 100644 --- a/subPackages/sub_business_shared/user-patient/register-detail.vue +++ b/subPackages/sub_business_shared/user-patient/register-detail.vue @@ -28,7 +28,7 @@ :duration="200" @change="onTabSwiperChange" > - + 暂无回答 - + {{ a.question || '问题' }} {{ a.answer || '—' }} diff --git a/subPackages/sub_workbench/prescription_v2/components/MedicalRecordPanel.vue b/subPackages/sub_workbench/prescription_v2/components/MedicalRecordPanel.vue new file mode 100644 index 0000000..833e1eb --- /dev/null +++ b/subPackages/sub_workbench/prescription_v2/components/MedicalRecordPanel.vue @@ -0,0 +1,771 @@ + + + diff --git a/subPackages/sub_workbench/prescription_v2/components/modals/DiagnosisModal.vue b/subPackages/sub_workbench/prescription_v2/components/modals/DiagnosisModal.vue index eeaa775..d9c4c5b 100644 --- a/subPackages/sub_workbench/prescription_v2/components/modals/DiagnosisModal.vue +++ b/subPackages/sub_workbench/prescription_v2/components/modals/DiagnosisModal.vue @@ -73,7 +73,16 @@ :class="{ 'is-selected': item.isSelect === 1 }" @click="selectDiagnosis(item)" > - {{ item.name }} + + + {{ p.text }} + {{ p.text }} + + + {{ item.match_score || 0 }}% @@ -140,6 +149,7 @@ // 保留所有原有逻辑代码与注释 import { getDiseaseList, getMyDiseaseList, addMyDisease, deleteMyDisease } from '@/api/reception.js'; import { getClinicSalespersonDiseaseList } from '@/api/clinicSalesperson.js'; +import { applyDictRankAndHighlight, splitHighlight } from '../../utils/dictSearchRank.js'; export default { name: 'DiagnosisModal', @@ -228,29 +238,37 @@ export default { } let list = []; let hasMore = false; + let rankMode = 'backend'; - // 正确解析响应数据 + // 正确解析响应数据(分页结构为 data.list) if (res && (res.code === 0 || res.errcode === 0)) { - // 优先使用 data,然后是 result - if (res.data && Array.isArray(res.data)) { - list = res.data; - } else if (res.result && Array.isArray(res.result)) { - list = res.result; + const payload = res.data !== undefined ? res.data : res.result; + if (payload && Array.isArray(payload.list)) { + list = payload.list; + hasMore = !!payload.has_more; + if (payload.rank_mode) rankMode = String(payload.rank_mode); + } else if (Array.isArray(payload)) { + list = payload; + hasMore = list.length >= this.pageSize; } else if (Array.isArray(res)) { list = res; - } - - // 从响应中获取分页信息 - if (res.pagination) { + hasMore = list.length >= this.pageSize; + } else if (res.pagination) { hasMore = res.pagination.has_more || false; } else if (res.has_more !== undefined) { hasMore = res.has_more; - } else { - // 如果没有分页信息,根据返回数量判断 - hasMore = list.length >= this.pageSize; } } + // 前端模式时本地按匹配度重排;并拆高亮片段 + list = applyDictRankAndHighlight( + list, + searchKey, + (item) => String(item.name || ''), + rankMode, + (item) => String(item.pinyin || item.pinyin_initials || ''), + ); + const processedList = list.map((item) => { item.isSelect = 0; item.isInMyList = this.doctorMyDiseaseList.some( @@ -264,6 +282,7 @@ export default { } }); } + item._hlParts = item._hlParts || splitHighlight(item.name || '', searchKey); return item; }); @@ -334,7 +353,11 @@ export default { * 搜索诊断 * 职责:防抖搜索,只在有输入时调用加载诊断列表 */ - handleSearch() { + handleSearch(val) { + // u-input @input 传入最新值,避免 v-model 滞后导致搜空/不排序 + if (typeof val === 'string') { + this.searchKey = val + } clearTimeout(this.searchTimer); this.searchTimer = setTimeout(() => { if (this.searchKey && this.searchKey.trim()) { @@ -348,7 +371,7 @@ export default { this.currentPage = 1; this.hasMore = false; } - }, 300); + }, 500); }, /** @@ -546,6 +569,13 @@ export default { color: #4b5563; } + .tag-score { + margin-left: 8rpx; + font-size: 22rpx; + font-weight: 600; + color: #d4380d; + } + .tag-action { margin-left: 12rpx; display: flex; @@ -554,6 +584,11 @@ export default { } } +.hit-text { + color: #cf1322; + background: rgba(255, 214, 102, 0.55); +} + .load-more { display: flex; align-items: center; diff --git a/subPackages/sub_workbench/prescription_v2/components/modals/DoctorOrderModal.vue b/subPackages/sub_workbench/prescription_v2/components/modals/DoctorOrderModal.vue index 61468f3..01db06f 100644 --- a/subPackages/sub_workbench/prescription_v2/components/modals/DoctorOrderModal.vue +++ b/subPackages/sub_workbench/prescription_v2/components/modals/DoctorOrderModal.vue @@ -15,6 +15,18 @@ + + + + + @@ -30,13 +42,19 @@ - {{ item.content }} + + + {{ p.text }} + {{ p.text }} + + + {{ item.match_score || 0 }}% @@ -45,19 +63,25 @@ - + - {{ item.content }} + + + {{ p.text }} + {{ p.text }} + + + {{ item.match_score || 0 }}% @@ -124,6 +148,7 @@