fix: 修复患者就诊历史

This commit is contained in:
2025-12-25 11:19:38 +08:00
parent d9ec5c88be
commit bbb78c77ff
2 changed files with 55 additions and 9 deletions

View File

@@ -320,6 +320,15 @@ export default {
},
golist(type) {
if (type === 3) {
// 检查是否配置了在线复诊负责人
if (!this.defaultDoctorId) {
uni.showToast({
title: '该门店暂不支持在线复诊',
icon: 'none',
duration: 2000
});
return;
}
return uni.navigateTo({
url: '/subPackages/product/product?doctor_id=' + this.defaultDoctorId + '&register_type=3'
})
@@ -584,6 +593,15 @@ export default {
},
// 直接购买
buyProduct(item) {
// 检查是否配置了在线复诊负责人
if (!this.defaultDoctorId) {
uni.showToast({
title: '该门店暂不支持在线复诊',
icon: 'none',
duration: 2000
});
return;
}
uni.navigateTo({
url: `/subPackages/product/product?doctor_id=${this.defaultDoctorId}&register_type=3`
});
@@ -603,18 +621,29 @@ export default {
url: '/pages/index/platform-info'
});
},
// 获取默认医生ID
// 获取默认医生ID(根据门店配置)
async getDefaultDoctorId() {
try {
const storeId = uni.getStorageSync('store_id');
if (!storeId) {
console.warn('未找到store_id无法获取默认医生');
this.defaultDoctorId = null;
return;
}
const res = await request('/xkApi/online-consultation/get-default-doctor-id', {
method: 'GET'
method: 'GET',
data: { store_id: storeId }
}, 0);
if (res.data && res.data.result && res.data.result.doctor_id) {
this.defaultDoctorId = res.data.result.doctor_id;
} else {
// 门店未配置在线复诊负责人
this.defaultDoctorId = null;
console.warn('该门店未配置在线复诊负责人:', res.data?.result?.message);
}
} catch (error) {
console.error('获取默认医生ID失败:', error);
// 如果接口失败保持默认值39
this.defaultDoctorId = null;
}
}
},

View File

@@ -528,9 +528,20 @@ export default {
this.closePrescriptionFormPopup();
try {
// 1. 获取默认医生ID=39
// 1. 获取默认医生ID(根据门店配置)
const doctorRes = await this.getDefaultDoctorId();
const doctorId = doctorRes.data.result?.doctor_id || '39';
const doctorId = doctorRes.data.result?.doctor_id;
// 检查是否配置了在线复诊负责人
if (!doctorId) {
uni.showToast({
title: '该门店暂不支持在线复诊',
icon: 'none',
duration: 2000
});
this.submitted = false;
return;
}
// 2. 先调用后端API保存就诊信息获取info_id
const createRes = await request('/xkApi/order/create-register-info', {
@@ -578,17 +589,23 @@ export default {
}
},
// 获取默认医生ID
// 获取默认医生ID(根据门店配置)
async getDefaultDoctorId() {
try {
const storeId = uni.getStorageSync('store_id');
if (!storeId) {
console.warn('未找到store_id无法获取默认医生');
return { data: { result: { doctor_id: null, message: '未找到门店信息' } } };
}
const res = await request('/xkApi/online-consultation/get-default-doctor-id', {
method: 'GET'
method: 'GET',
data: { store_id: storeId }
}, 0);
return res;
} catch (error) {
console.error('获取默认医生ID失败:', error);
// 如果接口失败,返回默认值39
return { data: { result: { doctor_id: '39' } } };
// 如果接口失败,返回空值
return { data: { result: { doctor_id: null, message: '获取失败' } } };
}
},
goToCart() {