修复门诊医生站->【处方单】按钮,点击【处方单】按钮无响应问题
This commit is contained in:
@@ -594,15 +594,22 @@ function getPrescriptionNoInit() {
|
||||
form.rxTypeCode = props.prescriptionData.rxTypeCode;
|
||||
infoForm.prescriptionNo = props.prescriptionData.prescriptionNo;
|
||||
}
|
||||
console.log(infoForm.prescriptionNo, 'infoForm.prescriptionNo', props.prescriptionData);
|
||||
console.log('infoForm.prescriptionNo (初始值):', infoForm.prescriptionNo, 'props.prescriptionData:', props.prescriptionData);
|
||||
// prescriptionInfo.value = props.prescriptionData;
|
||||
if (title.value === '新增处方') {
|
||||
prescriptionNoInit().then((res) => {
|
||||
infoForm.prescriptionNo = res.data;
|
||||
console.log(props, 'props', res, 'res', 'form', form.value);
|
||||
console.log('处方号初始化成功:', {
|
||||
prescriptionNo: infoForm.prescriptionNo,
|
||||
form: form,
|
||||
medicationInfoListLength: form.medicationInfoList.length
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('处方号初始化失败:', error);
|
||||
proxy.$modal.msgError('获取处方号失败,请重试');
|
||||
});
|
||||
}
|
||||
form.medicationInfoList = props.medicationInfo;
|
||||
form.medicationInfoList = props.medicationInfo || [];
|
||||
}
|
||||
|
||||
function getDiagnosisInfo() {
|
||||
@@ -611,13 +618,26 @@ function getDiagnosisInfo() {
|
||||
let diagnosisInfo = diagnosisList.value.filter((item) => {
|
||||
return item.maindiseFlag == 1;
|
||||
});
|
||||
diagnosisInfo.value = diagnosisInfo[0];
|
||||
if (title.value === '新增处方') {
|
||||
conditionId.value = diagnosisInfo[0].id;
|
||||
if (diagnosisInfo.length > 0) {
|
||||
diagnosisInfo.value = diagnosisInfo[0];
|
||||
if (title.value === '新增处方') {
|
||||
conditionId.value = diagnosisInfo[0].id;
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('获取诊断信息失败:', error);
|
||||
});
|
||||
|
||||
// 获取慢性病诊断信息,如果医保未连接则静默跳过
|
||||
getChronicDisease({ encounterId: props.patient.encounterId }).then((res) => {
|
||||
speDiagnosisList.value = res.data;
|
||||
speDiagnosisList.value = res.data || [];
|
||||
}).catch((error) => {
|
||||
// 医保未连接时,静默处理,不显示错误信息
|
||||
// 只在开发环境下记录日志,生产环境不输出
|
||||
if (import.meta.env.DEV) {
|
||||
console.debug('获取慢性病诊断信息失败(医保未连接,已静默处理):', error.message);
|
||||
}
|
||||
speDiagnosisList.value = [];
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ function getRowDisabled(row) {
|
||||
* 新增处方按钮操作
|
||||
*/
|
||||
function handleAddPrescription() {
|
||||
console.log('handleAddPrescription新增处方按钮操作', prescriptionNoTemp.value);
|
||||
console.log('新增处方按钮操作 - 打开新增处方弹窗');
|
||||
title.value = '新增处方';
|
||||
openPrescriptionDialog();
|
||||
}
|
||||
|
||||
@@ -3212,7 +3212,54 @@ function getPrescriptionTotalAmount(prescriptionId) {
|
||||
}
|
||||
|
||||
|
||||
defineExpose({ getListInfo, getDiagnosisInfo });
|
||||
/**
|
||||
* 获取已签发的处方单信息(用于处方单预览)
|
||||
* 返回已签发的药品处方单数据(statusEnum == 2 且 adviceType == 1 或 2)
|
||||
*/
|
||||
function getSignedPrescriptionInfo() {
|
||||
const signedPrescriptions = [];
|
||||
|
||||
// 遍历所有处方
|
||||
Object.keys(allPrescriptionsData.value).forEach(prescriptionId => {
|
||||
const prescriptionData = allPrescriptionsData.value[prescriptionId] || [];
|
||||
const prescription = westernPrescriptions.value.find(p => p.id === prescriptionId);
|
||||
|
||||
if (!prescription) return;
|
||||
|
||||
// 筛选已签发的药品(西药和中成药)
|
||||
const signedMedicines = prescriptionData.filter(item =>
|
||||
item.statusEnum === 2 && (item.adviceType === 1 || item.adviceType === 2)
|
||||
);
|
||||
|
||||
if (signedMedicines.length > 0) {
|
||||
// 构建处方单信息
|
||||
const prescriptionInfo = {
|
||||
prescriptionNo: prescription.name || `处方${prescriptionId}`,
|
||||
patientName: props.patientInfo?.patientName || '',
|
||||
requestTime: new Date().toISOString(),
|
||||
conditionDefinitionName: diagnosisName.value || '',
|
||||
prescriptionInfoDetail: signedMedicines.map(item => ({
|
||||
requestId: item.requestId,
|
||||
adviceName: item.adviceName || '',
|
||||
volume: item.volume || '',
|
||||
quantity: item.quantity || '',
|
||||
unitCode_dictText: item.unitCode_dictText || '',
|
||||
lotNumber: item.lotNumber || '',
|
||||
methodCode_dictText: item.methodCode_dictText || '',
|
||||
dose: item.dose || '',
|
||||
doseUnitCode_dictText: item.doseUnitCode_dictText || '',
|
||||
rateCode_dictText: item.rateCode_dictText || ''
|
||||
}))
|
||||
};
|
||||
|
||||
signedPrescriptions.push(prescriptionInfo);
|
||||
}
|
||||
});
|
||||
|
||||
return signedPrescriptions;
|
||||
}
|
||||
|
||||
defineExpose({ getListInfo, getDiagnosisInfo, getSignedPrescriptionInfo });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user