转诊方功能

This commit is contained in:
李琦
2026-02-07 09:42:08 +08:00
parent a130f428b9
commit d233a42754
9 changed files with 1072 additions and 6 deletions

View File

@@ -85,6 +85,32 @@
</view>
</view>
<!-- 转诊消息 -->
<view class="list" @click="goTransfer">
<!-- 头像 -->
<view class="avator">
<view class="img">
<image src="/static/xx/ysxx.png" mode=""></image>
<!-- <image src="/static/xx/zhuanzhen.png" mode=""></image>-->
</view>
<u-badge size="default" v-if="transfer.num>=0" :count="transfer.num" :is-dot="transfer.num==0?true:false"
type="error" :offset="transfer.num>0?[-4,-8]:[0,0]"></u-badge>
</view>
<!-- 描述 -->
<view class="info">
<view class="infos_title">
<text class="infos">转诊消息</text>
<text class="time">{{ transfer.time }}</text>
</view>
<view class="preview" v-if="transfer.num>0">
您有{{ transfer.num }}条转诊消息待处理
</view>
<view class="preview" v-if="transfer.num==undefined || transfer.num==0">
暂无转诊消息
</view>
</view>
</view>
<!-- 模拟<u-divider>在线问诊</u-divider>效果-->
<!-- 标题 - 在线咨询 -->
@@ -157,6 +183,7 @@ import {
} from '../../request/api/api'
import {getSystemNoticeIndexApi} from '../../request/api/systemNotice'
import {getChatFriendsListApi} from "@/request/api/im";
import {getTransferPrescriptionListApi} from "@/request/api/transferPrescription";
import {checkDev} from "@/utils/utils";
import MessageNotification from "@/components/MessageNotification/MessageNotification.vue";
@@ -169,6 +196,10 @@ export default {
order: [],
system: [],
doctor: [],
transfer: {
num: 0,
time: ''
},
imChat: [],
onlineConsultationList: [], // 在线咨询列表 (type=1)
onlineReconsultationList: [], // 在线复诊列表 (type=3)
@@ -258,6 +289,12 @@ export default {
// console.log(res, 'res');
})
},
// 转诊消息
goTransfer() {
uni.navigateTo({
url: '/subPackages/transfer/transfer-message'
})
},
goChat(item, index) {
uni.navigateTo({
url: `/subPackages/chat/chat?room_id=${item.room_id}&nick_name=${item.nick_name}&user_id=${item.id}&avatar=${encodeURIComponent(item.avatar || '')}&room_status=${item.room_status || 0}`
@@ -292,10 +329,33 @@ export default {
const allChatList = res.data.result || []
// 根据type字段区分在线咨询和在线复诊
this.onlineConsultationList = allChatList.filter(item => item.type === 1 || !item.type) // type=1或未设置type的为在线咨询
this.onlineReconsultationList = allChatList.filter(item => item.type === 3) // type=3的为在线复诊
this.onlineReconsultationList = allChatList.filter(item => (item.type === 3 || item.type === 2)) // type=3的为在线复诊
// 保持imChat兼容性包含所有
this.imChat = allChatList
})
},
// 获取转诊消息列表
getTransferList() {
getTransferPrescriptionListApi().then((res) => {
if (res.data && res.data.code == 0) {
const transferList = res.data.result || []
// 统计待确认的转诊消息数量
const pendingCount = transferList.filter(item => item.status === 0).length
this.transfer.num = pendingCount
// 获取最新的转诊时间
if (transferList.length > 0) {
const latestTransfer = transferList[0]
if (latestTransfer.transfer_time) {
this.transfer.time = latestTransfer.transfer_time
} else if (latestTransfer.created_at) {
this.transfer.time = latestTransfer.created_at
}
}
}
}).catch((error) => {
console.error('获取转诊消息列表失败:', error)
})
}
},
mounted() {
@@ -305,10 +365,15 @@ export default {
this.order = []
this.system = []
this.doctor = []
this.transfer = {
num: 0,
time: ''
}
this.onlineConsultationList = []
this.onlineReconsultationList = []
this.getInfo()
this.getMyChatFriendsList()
this.getTransferList()
}
}
</script>