在线复诊选择药品、说明主诉
This commit is contained in:
@@ -141,6 +141,10 @@
|
||||
import {checkDev} from "@/utils/utils";
|
||||
import {genOrderApi, saveRegisterInfoApi} from "@/request/api/order";
|
||||
import request from "@/request/api/request";
|
||||
import {
|
||||
CLINIC_POST_REGISTER_STORAGE_KEY,
|
||||
resolveFollowUpDrugsFromRInfo,
|
||||
} from '@/utils/clinicFollowUpAssistantIm';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -270,6 +274,12 @@
|
||||
console.error('waitForRegisterDetail', err);
|
||||
}
|
||||
},
|
||||
/** 诊所复诊(2)且存在复诊药:支付后先走独立用药确认页,再进聊天 */
|
||||
needsClinicPostRegisterDrugPage() {
|
||||
if (!this.registList || this.registList.register_type !== 2) return false;
|
||||
const { registerInfoId, drugsPayload } = resolveFollowUpDrugsFromRInfo(this.rInfo);
|
||||
return !!(registerInfoId && drugsPayload.length);
|
||||
},
|
||||
// 挂号信息
|
||||
getInfo() {
|
||||
const that = this;
|
||||
@@ -369,22 +379,42 @@
|
||||
duration: 0
|
||||
});
|
||||
}
|
||||
|
||||
// 6. 生成订单(如果需要)
|
||||
|
||||
// 6. 生成订单(如果需要);诊所复诊有药时先 redirect 用药确认页,助理卡改在页内提交后发
|
||||
const chatUrl = `/subPackages/chat/chat?user_id=${encodeURIComponent(doctorPrefixed)}&room_id=${roomId}®ister_id=${that.register_id}`;
|
||||
const goAfterGenOrder = () => {
|
||||
if (that.needsClinicPostRegisterDrugPage()) {
|
||||
const { registerInfoId, drugsPayload } = resolveFollowUpDrugsFromRInfo(that.rInfo);
|
||||
uni.setStorageSync(
|
||||
CLINIC_POST_REGISTER_STORAGE_KEY,
|
||||
JSON.stringify({
|
||||
register_info_id: registerInfoId,
|
||||
register_id: that.register_id,
|
||||
drugs: drugsPayload,
|
||||
question: '您是否曾使用过此类药品?',
|
||||
room_id: roomId,
|
||||
doctor_id: doctorId,
|
||||
patient_id: patientId,
|
||||
doctor_prefixed: doctorPrefixed,
|
||||
}),
|
||||
);
|
||||
uni.hideLoading();
|
||||
uni.redirectTo({
|
||||
url: '/subPackages/follow-up/medication-info?mode=clinic_post_register',
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({ url: chatUrl });
|
||||
};
|
||||
genOrderApi({
|
||||
register_id: that.register_id,
|
||||
register_info: typeof that.rInfo === 'string' ? that.rInfo : JSON.stringify(that.rInfo),
|
||||
}).then((resOrder) => {
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: `/subPackages/chat/chat?user_id=${encodeURIComponent(doctorPrefixed)}&room_id=${roomId}®ister_id=${that.register_id}`
|
||||
});
|
||||
}).then(() => {
|
||||
goAfterGenOrder();
|
||||
}).catch((error) => {
|
||||
console.error('生成订单失败:', error);
|
||||
uni.hideLoading();
|
||||
uni.navigateTo({
|
||||
url: `/subPackages/chat/chat?user_id=${encodeURIComponent(doctorPrefixed)}&room_id=${roomId}®ister_id=${that.register_id}`
|
||||
});
|
||||
goAfterGenOrder();
|
||||
});
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
|
||||
Reference in New Issue
Block a user