Backup local changes before resolving remote repository issue
This commit is contained in:
@@ -525,19 +525,33 @@ function getList() {
|
||||
function refresh() {
|
||||
getListInfo(false);
|
||||
}
|
||||
// 防止重复请求的标志
|
||||
let listInfoRequestPromise = null;
|
||||
|
||||
// 获取列表信息
|
||||
function getListInfo(addNewRow) {
|
||||
// 如果已经有正在进行的请求,则返回该请求的Promise
|
||||
if (listInfoRequestPromise) {
|
||||
return listInfoRequestPromise;
|
||||
}
|
||||
|
||||
loadingInstance = ElLoading.service({ fullscreen: true });
|
||||
setTimeout(() => {
|
||||
loadingInstance.close();
|
||||
if (loadingInstance) {
|
||||
loadingInstance.close();
|
||||
}
|
||||
}, 180);
|
||||
isAdding.value = false;
|
||||
expandOrder.value = [];
|
||||
getPrescriptionList(patientInfo.value.encounterId).then((res) => {
|
||||
console.log('getListInfo==========>', JSON.stringify(res.data));
|
||||
|
||||
loadingInstance.close();
|
||||
prescriptionList.value = res.data
|
||||
// 并行请求两个API并将结果合并处理
|
||||
listInfoRequestPromise = Promise.all([
|
||||
getPrescriptionList(patientInfo.value.encounterId),
|
||||
getContract({ encounterId: patientInfo.value.encounterId })
|
||||
])
|
||||
.then(([prescriptionRes, contractRes]) => {
|
||||
// 处理处方列表
|
||||
prescriptionList.value = prescriptionRes.data
|
||||
.map((item) => {
|
||||
return {
|
||||
...JSON.parse(item.contentJson),
|
||||
@@ -549,15 +563,35 @@ function getListInfo(addNewRow) {
|
||||
.sort((a, b) => {
|
||||
return new Date(b.requestTime) - new Date(a.requestTime);
|
||||
});
|
||||
getGroupMarkers(); // 更新标记
|
||||
|
||||
// 处理合同列表
|
||||
contractList.value = contractRes.data;
|
||||
|
||||
// 更新账户ID
|
||||
accountId.value = patientInfo.value.accountId;
|
||||
|
||||
// 更新标记
|
||||
getGroupMarkers();
|
||||
|
||||
if (props.activeTab == 'prescription' && addNewRow) {
|
||||
handleAddPrescription();
|
||||
}
|
||||
|
||||
console.log('getListInfo==========>', JSON.stringify(prescriptionRes.data));
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('获取列表信息失败:', error);
|
||||
ElMessage.error('获取列表信息失败');
|
||||
})
|
||||
.finally(() => {
|
||||
if (loadingInstance) {
|
||||
loadingInstance.close();
|
||||
}
|
||||
// 请求完成后清除Promise引用
|
||||
listInfoRequestPromise = null;
|
||||
});
|
||||
getContract({ encounterId: patientInfo.value.encounterId }).then((res) => {
|
||||
contractList.value = res.data;
|
||||
});
|
||||
accountId.value = patientInfo.value.accountId;
|
||||
|
||||
return listInfoRequestPromise;
|
||||
}
|
||||
// 数据过滤
|
||||
const filterPrescriptionList = computed(() => {
|
||||
@@ -571,18 +605,37 @@ const filterPrescriptionList = computed(() => {
|
||||
return pList;
|
||||
});
|
||||
|
||||
// 防止诊断信息重复请求的标志
|
||||
let diagnosisInfoRequestPromise = null;
|
||||
|
||||
function getDiagnosisInfo() {
|
||||
getEncounterDiagnosis(patientInfo.value.encounterId).then((res) => {
|
||||
diagnosisList.value = res.data;
|
||||
let diagnosisInfo = diagnosisList.value.filter((item) => {
|
||||
return item.maindiseFlag == 1;
|
||||
// 如果已经有正在进行的请求,则返回该请求的Promise
|
||||
if (diagnosisInfoRequestPromise) {
|
||||
return diagnosisInfoRequestPromise;
|
||||
}
|
||||
|
||||
diagnosisInfoRequestPromise = getEncounterDiagnosis(patientInfo.value.encounterId)
|
||||
.then((res) => {
|
||||
diagnosisList.value = res.data;
|
||||
let diagnosisInfo = diagnosisList.value.filter((item) => {
|
||||
return item.maindiseFlag == 1;
|
||||
});
|
||||
diagnosisInfo.value = diagnosisInfo[0];
|
||||
conditionDefinitionId.value = diagnosisInfo[0].definitionId;
|
||||
conditionId.value = diagnosisInfo[0].conditionId;
|
||||
encounterDiagnosisId.value = diagnosisInfo[0].encounterDiagnosisId;
|
||||
diagnosisName.value = diagnosisInfo[0].name;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('获取诊断信息失败:', error);
|
||||
ElMessage.error('获取诊断信息失败');
|
||||
})
|
||||
.finally(() => {
|
||||
// 请求完成后清除Promise引用
|
||||
diagnosisInfoRequestPromise = null;
|
||||
});
|
||||
diagnosisInfo.value = diagnosisInfo[0];
|
||||
conditionDefinitionId.value = diagnosisInfo[0].definitionId;
|
||||
conditionId.value = diagnosisInfo[0].conditionId;
|
||||
encounterDiagnosisId.value = diagnosisInfo[0].encounterDiagnosisId;
|
||||
diagnosisName.value = diagnosisInfo[0].name;
|
||||
});
|
||||
|
||||
return diagnosisInfoRequestPromise;
|
||||
}
|
||||
|
||||
function getRowDisabled(row) {
|
||||
|
||||
Reference in New Issue
Block a user