diff --git a/components/AssistantConsultationShell.vue b/components/AssistantConsultationShell.vue new file mode 100644 index 0000000..03d9f84 --- /dev/null +++ b/components/AssistantConsultationShell.vue @@ -0,0 +1,541 @@ + + + + + diff --git a/pages.json b/pages.json index 7e4898b..1e9607f 100644 --- a/pages.json +++ b/pages.json @@ -5,7 +5,8 @@ // npm安装方式 "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue", // 消息通知组件 - "^MessageNotification": "@/components/MessageNotification/MessageNotification.vue" + "^MessageNotification": "@/components/MessageNotification/MessageNotification.vue", + "^FollowUpDrugDrawer$": "@/subPackages/doctor/components/FollowUpDrugDrawer.vue" }, "pages": [ { @@ -185,6 +186,13 @@ "navigationBarTitleText": "商品详情", "enablePullDownRefresh": false } + }, + { + "path": "follow-up/medication-info", + "style": { + "navigationBarTitleText": "用药信息", + "enablePullDownRefresh": false + } } ] }, diff --git a/request/api/order.js b/request/api/order.js index b24e0b3..674cc6b 100644 --- a/request/api/order.js +++ b/request/api/order.js @@ -1,6 +1,20 @@ import {get, post, uploadFile} from './http' const prefix = '/order'; + +/** + * 在线复诊:创建就诊信息(挂号前) + */ +export async function createRegisterInfoApi(params) { + return await post(`${prefix}/create-register-info`, params, 3) +} + +/** + * 在线复诊:可选西药列表(双端上架) + */ +export async function getWesternDrugsForFollowUpApi(params) { + return await get(`${prefix}/western-drugs-for-follow-up`, params, 3) +} /** * 获取扫码诊所的商品详情 * @param params @@ -26,6 +40,11 @@ export async function saveRegisterInfoApi(params) { return await post(`${prefix}/save-register-info`, params, 3) } +/** 诊所在线复诊:确认是否曾用过所选西药 */ +export async function confirmFollowUpDrugUseApi(params) { + return await post(`${prefix}/confirm-follow-up-drug-use`, params, 3) +} + /** * 查询订单的处方状态 * @param params diff --git a/subPackages/chat/chat.vue b/subPackages/chat/chat.vue index dbf93aa..ce1e202 100644 --- a/subPackages/chat/chat.vue +++ b/subPackages/chat/chat.vue @@ -102,6 +102,7 @@ @viewPrescription="viewPrescription" @goToOrderMedicine="goToOrderMedicine" @viewOrder="viewOrder" + @followUpDrugAnswered="onFollowUpDrugAnswered" /> @@ -403,6 +404,25 @@ export default { return avatar; } }, + + onFollowUpDrugAnswered({ messageId, answerStatus }) { + const roomId = this.doctorUserInfo.room_id; + const idx = this.messages.findIndex((m) => m.id === messageId); + if (idx === -1) return; + const row = this.messages[idx]; + try { + const o = typeof row.message_content === 'string' ? JSON.parse(row.message_content) : { ...row.message_content }; + o.answer_status = answerStatus; + const updated = { ...row, message_content: JSON.stringify(o) }; + this.$set(this.messages, idx, updated); + if (typeof ChatManager !== 'undefined' && roomId && ChatManager.roomMessages && ChatManager.roomMessages[roomId]) { + const ri = ChatManager.roomMessages[roomId].findIndex((m) => m.id === messageId); + if (ri !== -1) this.$set(ChatManager.roomMessages[roomId], ri, updated); + } + } catch (e) { + console.error('onFollowUpDrugAnswered', e); + } + }, // 加载助理配置信息 async loadAssistantConfig() { @@ -1011,7 +1031,7 @@ export default { getRegisterStatusText(status) { const map = { 0: '待就诊', 1: '已缴费', 2: '已就诊', 3: '已取消', 4: '已退费' }; return map[status] || '未知状态'; }, viewPrescription(id, orderNo) { uni.navigateTo({ url: "/subPackages/my/myrecord-detail?id=" + id + '&no=' + orderNo }); }, goToOrderMedicine(id, orderNo) { uni.navigateTo({ url: "/subPackages/my/my-drug/drug-info?id=" + id + '&order_type=prescription' }); }, - viewRegister(id, orderNo) { uni.navigateTo({ url: "/subPackages/register/register-detail?id=" + id + '&no=' + orderNo }); }, + viewRegister(id, orderNo) { uni.navigateTo({ url: `/subPackages/register/register-info?id=${id}&type=1` }); }, viewOrder(orderId, orderNo) { uni.navigateTo({ url: "/subPackages/my/my-drug/drug-info?id=" + orderId }); }, // 处理返回操作(自定义返回逻辑) diff --git a/subPackages/chat/components/MessageBubble.vue b/subPackages/chat/components/MessageBubble.vue index ffb2c70..fcfdf28 100644 --- a/subPackages/chat/components/MessageBubble.vue +++ b/subPackages/chat/components/MessageBubble.vue @@ -12,7 +12,7 @@ > - {{ parsedContent }} + {{ parsedContent }} 订单号{{ parsedContent.order_no }} 就诊人{{ (parsedContent.user_patient && parsedContent.user_patient.name) || '未知' }} 费用¥{{ parsedContent.price }} + + 主诉 + {{ parsedContent.chief_complaint }} + + + 所选药品 + {{ registerCardDrugNamesLine }} + + + 数量 + 各 {{ parsedContent.number }} 盒 + + + + + 医生助理 + + + + {{ parsedContent.question }} + + + {{ row.name || '药品' }} + ×{{ row.quantity != null ? row.quantity : 1 }} + + + 您的选择 + {{ followUpAnsweredLabel }} + + + + + @@ -231,7 +266,6 @@ import { agreeTransferPrescriptionApi, rejectTransferPrescriptionApi } from '@/request/api/transferPrescription' - export default { name: "MessageBubble", components: { @@ -279,6 +313,26 @@ export default { } } return message_content; + }, + /** 挂号卡片:多选西药名称串联,无则单药 drug.name */ + registerCardDrugNamesLine() { + if (this.msg.message_type !== 10) return ''; + const pc = this.parsedContent; + if (!pc || typeof pc !== 'object') return ''; + const arr = pc.selected_western_drugs; + if (Array.isArray(arr) && arr.length) { + return arr.map((d) => d && d.name).filter(Boolean).join('、'); + } + if (pc.drug && pc.drug.name) return pc.drug.name; + return ''; + }, + followUpAnsweredLabel() { + const pc = this.parsedContent; + if (!pc || pc.flow !== 'follow_up_drug') return ''; + const st = pc.answer_status; + if (st === 'yes' || st === '1') return '是,曾使用过'; + if (st === 'no' || st === '0') return '否,未使用过'; + return ''; } }, methods: { @@ -572,6 +626,18 @@ $success-color: #059669; } &.split { display: flex; justify-content: space-between; align-items: center; .link-btn { font-size: 24rpx; color: $primary; padding: 10rpx; } .action-btn { width: 160rpx; } } } + + .follow-up-pending-readonly { + margin-top: 12rpx; + padding: 16rpx 20rpx; + background: #f7f8fa; + border-radius: 12rpx; + .follow-up-pending-tip { + font-size: 24rpx; + color: #909399; + line-height: 1.5; + } + } } // ========== 原生风格服务通知 (Service Notify Card) ========== diff --git a/subPackages/doctor/components/FollowUpDrugDrawer.vue b/subPackages/doctor/components/FollowUpDrugDrawer.vue new file mode 100644 index 0000000..32802c7 --- /dev/null +++ b/subPackages/doctor/components/FollowUpDrugDrawer.vue @@ -0,0 +1,300 @@ + + + + + diff --git a/subPackages/doctor/doctor-userinfo.vue b/subPackages/doctor/doctor-userinfo.vue index 358c5e9..b51e682 100644 --- a/subPackages/doctor/doctor-userinfo.vue +++ b/subPackages/doctor/doctor-userinfo.vue @@ -1,11 +1,18 @@