合并缺失弥补

This commit is contained in:
zhanchao 2026-09-04 09:52:41 +08:00
parent 1040539640
commit f887d00a60

View File

@ -5,9 +5,7 @@
<view class="patient-info-content"> <view class="patient-info-content">
<view class="patient-basic-info"> <view class="patient-basic-info">
<text class="patient-name">{{ patientInfo.name }}</text> <text class="patient-name">{{ patientInfo.name }}</text>
<text class="patient-detail" <text class="patient-detail">{{ patientInfo.sex }} · {{ patientInfo.age }}</text>
>{{ patientInfo.sex }} · {{ patientInfo.age }}</text
>
</view> </view>
<view class="header-actions"> <view class="header-actions">
<view class="patient-detail-btn" @click="handleViewPatientDetail"> <view class="patient-detail-btn" @click="handleViewPatientDetail">
@ -21,16 +19,8 @@
</view> </view>
<!-- 聊天消息区域 --> <!-- 聊天消息区域 -->
<scroll-view <scroll-view class="chat-content" scroll-y="true" enhanced="true" bounces="false" :scroll-into-view="scrollIntoView"
class="chat-content" @scroll="onScroll" @scrolltoupper="handleScrollToUpper" ref="chatScrollView">
scroll-y="true"
enhanced="true"
bounces="false"
:scroll-into-view="scrollIntoView"
@scroll="onScroll"
@scrolltoupper="handleScrollToUpper"
ref="chatScrollView"
>
<!-- 加载更多提示 --> <!-- 加载更多提示 -->
<view class="load-more-tip" v-if="messageList.length >= 15"> <view class="load-more-tip" v-if="messageList.length >= 15">
<view class="loading" v-if="isLoadingMore"> <view class="loading" v-if="isLoadingMore">
@ -46,21 +36,13 @@
<!-- 聊天消息列表 --> <!-- 聊天消息列表 -->
<view class="message-list" @click="closeMorePanel"> <view class="message-list" @click="closeMorePanel">
<view <view v-for="(message, index) in messageList" :key="message.ID" :id="`msg-${message.ID}`" class="message-item"
v-for="(message, index) in messageList"
:key="message.ID"
:id="`msg-${message.ID}`"
class="message-item"
:class="{ :class="{
'message-right': message.flow === 'out', 'message-right': message.flow === 'out',
'message-left': message.flow === 'in', 'message-left': message.flow === 'in',
}" }">
>
<!-- 时间分割线 --> <!-- 时间分割线 -->
<view <view v-if="shouldShowTime(message, index, messageList)" class="time-divider">
v-if="shouldShowTime(message, index, messageList)"
class="time-divider"
>
<text class="time-text">{{ formatTime(message.lastTime) }}</text> <text class="time-text">{{ formatTime(message.lastTime) }}</text>
</view> </view>
@ -70,29 +52,18 @@
<!-- 消息内容 --> <!-- 消息内容 -->
<view v-else class="message-content"> <view v-else class="message-content">
<image <image v-if="message.flow === 'in'" class="doctor-msg-avatar" :src="getUserAvatar(message.from)"
v-if="message.flow === 'in'" mode="aspectFill" />
class="doctor-msg-avatar" <image v-if="message.flow === 'out'" class="user-msg-avatar" :src="getUserAvatar(message.from)"
:src="getUserAvatar(message.from)" mode="aspectFill" />
mode="aspectFill"
/>
<image
v-if="message.flow === 'out'"
class="user-msg-avatar"
:src="getUserAvatar(message.from)"
mode="aspectFill"
/>
<!-- 消息内容区域 --> <!-- 消息内容区域 -->
<view class="message-bubble-container"> <view class="message-bubble-container">
<!-- 用户名显示 --> <!-- 用户名显示 -->
<view <view class="username-label" :class="{
class="username-label"
:class="{
left: message.flow === 'in', left: message.flow === 'in',
right: message.flow === 'out', right: message.flow === 'out',
}" }">
>
<text class="username-text">{{ <text class="username-text">{{
chatMember[message.from]?.name chatMember[message.from]?.name
}}</text> }}</text>
@ -100,24 +71,15 @@
<view class="message-bubble" :class="getBubbleClass(message)"> <view class="message-bubble" :class="getBubbleClass(message)">
<!-- 消息内容 --> <!-- 消息内容 -->
<MessageTypes <MessageTypes :message="message" :formatTime="formatTime" :playingVoiceId="playingVoiceId"
:message="message" @playVoice="playVoice" @previewImage="previewImage"
:formatTime="formatTime" @viewDetail="(message) => handleViewDetail(message)" />
:playingVoiceId="playingVoiceId"
@playVoice="playVoice"
@previewImage="previewImage"
@viewDetail="(message) => handleViewDetail(message)"
/>
</view> </view>
</view> </view>
<!-- 发送状态 --> <!-- 发送状态 -->
<view v-if="message.flow === 'out'" class="message-status"> <view v-if="message.flow === 'out'" class="message-status">
<text <text v-if="message.status === 'failed'" class="status-text failed">发送失败</text>
v-if="message.status === 'failed'"
class="status-text failed"
>发送失败</text
>
</view> </view>
</view> </view>
</view> </view>
@ -125,75 +87,38 @@
</scroll-view> </scroll-view>
<!-- 接受问诊组件 --> <!-- 接受问诊组件 -->
<ConsultAccept <ConsultAccept v-if="showConsultAccept" @accept="handleAcceptConsult" @reject="handleRejectConsult" />
v-if="showConsultAccept"
@accept="handleAcceptConsult"
@reject="handleRejectConsult"
/>
<!-- 拒绝原因对话框 --> <!-- 拒绝原因对话框 -->
<RejectReasonModal <RejectReasonModal :visible="showRejectReasonModal" @confirm="handleRejectReasonConfirm"
:visible="showRejectReasonModal" @cancel="handleRejectReasonCancel" />
@confirm="handleRejectReasonConfirm"
@cancel="handleRejectReasonCancel"
/>
<!-- 聊天输入组件 --> <!-- 聊天输入组件 -->
<ChatInput <ChatInput v-if="!isEvaluationPopupOpen && !showConsultAccept" ref="chatInputRef" :timChatManager="timChatManager"
v-if="!isEvaluationPopupOpen && !showConsultAccept" :formatTime="formatTime" :groupId="chatInfo.conversationID
ref="chatInputRef"
:timChatManager="timChatManager"
:formatTime="formatTime"
:groupId="
chatInfo.conversationID
? chatInfo.conversationID.replace('GROUP', '') ? chatInfo.conversationID.replace('GROUP', '')
: '' : ''
" " :userId="openid" :teamId="teamId" :patientId="patientId" :corpId="corpId" :patientInfo="patientInfo"
:userId="openid" :orderStatus="orderStatus" :isGenerating="isGenerating"
:teamId="teamId" :canBenefitEntry="isBenefitEntryEnabled"
:patientId="patientId" @scrollToBottom="() => scrollToBottom(true)" @messageSent="() => scrollToBottom(true)"
:corpId="corpId" @endConsult="handleEndConsult" @openConsult="handleOpenConsult">
:patientInfo="patientInfo"
:orderStatus="orderStatus"
:isGenerating="isGenerating"
@scrollToBottom="() => scrollToBottom(true)"
@messageSent="() => scrollToBottom(true)"
@endConsult="handleEndConsult"
@openConsult="handleOpenConsult"
>
<!-- AI助手按钮组插槽 --> <!-- AI助手按钮组插槽 -->
<template #ai-assistant> <template #ai-assistant>
<AIAssistantButtons <AIAssistantButtons v-if="orderStatus === 'processing'" ref="aiAssistantRef" :groupId="groupId"
v-if="orderStatus === 'processing'" :patientAccountId="chatInfo.userID || ''" :patientId="patientId" :corpId="corpId"
ref="aiAssistantRef" :typeSelectorRef="typeSelectorRef" :progressRef="progressRef" @streamText="handleStreamText"
:groupId="groupId" @clearInput="handleClearInput" @generatingStateChange="handleGeneratingStateChange"
:patientAccountId="chatInfo.userID || ''" @caseTypeSelect="handleCaseTypeSelect" @regenerateFromProgress="handleRegenerateFromProgress"
:patientId="patientId" @nextFromProgress="handleNextFromProgress" />
:corpId="corpId"
:typeSelectorRef="typeSelectorRef"
:progressRef="progressRef"
@streamText="handleStreamText"
@clearInput="handleClearInput"
@generatingStateChange="handleGeneratingStateChange"
@caseTypeSelect="handleCaseTypeSelect"
@regenerateFromProgress="handleRegenerateFromProgress"
@nextFromProgress="handleNextFromProgress"
/>
</template> </template>
</ChatInput> </ChatInput>
<!-- 病历类型选择弹窗 --> <!-- 病历类型选择弹窗 -->
<MedicalCaseTypeSelector <MedicalCaseTypeSelector ref="typeSelectorRef" @select="handleCaseTypeSelect" />
ref="typeSelectorRef"
@select="handleCaseTypeSelect"
/>
<!-- 进度显示弹窗 --> <!-- 进度显示弹窗 -->
<MedicalCaseProgress <MedicalCaseProgress ref="progressRef" @regenerate="handleRegenerateFromProgress" @next="handleNextFromProgress" />
ref="progressRef"
@regenerate="handleRegenerateFromProgress"
@next="handleNextFromProgress"
/>
</view> </view>
</template> </template>
@ -308,10 +233,11 @@ const env = __VITE_ENV__;
const corpId = env.MP_CORP_ID || ""; const corpId = env.MP_CORP_ID || "";
// //
const accountStore = useAccountStore();
const { account, openid, isIMInitialized, doctorInfo } = storeToRefs( const { account, openid, isIMInitialized, doctorInfo } = storeToRefs(
useAccountStore() accountStore
); );
const { initIMAfterLogin } = useAccountStore(); const { getDoctorInfo, initIMAfterLogin } = useAccountStore();
// //
const chatInputRef = ref(null); const chatInputRef = ref(null);
@ -358,6 +284,11 @@ const teamId = ref("");
// - pending // - pending
const showConsultAccept = computed(() => orderStatus.value === "pending"); const showConsultAccept = computed(() => orderStatus.value === "pending");
const isBenefitEntryEnabled = computed(() => {
const value = doctorInfo.value?.benefitEntryEnabled ?? doctorInfo.value?.canBenefitEntry;
return value === true || value === 1 || ["true", "1", "yes"].includes(String(value).toLowerCase());
});
// //
const showRejectReasonModal = ref(false); const showRejectReasonModal = ref(false);
// //
@ -905,14 +836,14 @@ const handleScrollToUpper = async () => {
}; };
// //
onShow(() => { onShow(async () => {
if (!account.value || !openid.value) { if (!account.value || !openid.value) {
uni.redirectTo({ uni.redirectTo({
url: "/pages-center/login/login", url: "/pages-center/login/login",
}); });
return; return;
} }
await getDoctorInfo();
if (!isIMInitialized.value) { if (!isIMInitialized.value) {
checkLoginAndInitTIM(); checkLoginAndInitTIM();
} else if (timChatManager.tim && !timChatManager.isLoggedIn) { } else if (timChatManager.tim && !timChatManager.isLoggedIn) {
@ -1172,8 +1103,7 @@ const handleNextFromProgress = (data) => {
// //
uni.navigateTo({ uni.navigateTo({
url: `/pages/case/ai-medical-case-form?caseType=${data.caseType}&patientId=${ url: `/pages/case/ai-medical-case-form?caseType=${data.caseType}&patientId=${patientId.value
patientId.value
}&groupId=${groupId.value}&formData=${encodeURIComponent( }&groupId=${groupId.value}&formData=${encodeURIComponent(
JSON.stringify(extractedData) JSON.stringify(extractedData)
)}`, )}`,