门诊医生站-》开立诊断 页面调整
This commit is contained in:
@@ -542,17 +542,7 @@ async function getListInfo(addNewRow) {
|
||||
tcmPrescriptionList.value.forEach((prescription) => {
|
||||
prescription.isAdding = false;
|
||||
});
|
||||
|
||||
// 如果没有encounterId,不调用接口
|
||||
if (!props.patientInfo || !props.patientInfo.encounterId) {
|
||||
console.warn('【中医处方】patientInfo或encounterId为空,不调用接口')
|
||||
tcmPrescriptionList.value = []
|
||||
return
|
||||
}
|
||||
|
||||
console.log('【中医处方】调用API,encounterId:', props.patientInfo.encounterId)
|
||||
await getTcmAdviceList({ encounterId: props.patientInfo.encounterId }).then(async (res) => {
|
||||
console.log('【中医处方】获取数据成功,处方数量:', res.data?.length || 0)
|
||||
// 按 groupId 分组数据
|
||||
const groupedData = {};
|
||||
res.data.forEach((item) => {
|
||||
@@ -633,15 +623,7 @@ async function getListInfo(addNewRow) {
|
||||
}
|
||||
|
||||
function getDiagnosisInfo() {
|
||||
// 如果没有encounterId,不调用接口
|
||||
if (!props.patientInfo || !props.patientInfo.encounterId) {
|
||||
console.warn('【中医诊断】patientInfo或encounterId为空,不调用接口')
|
||||
diagnosisList.value = []
|
||||
return
|
||||
}
|
||||
|
||||
diagnosisList.value = [];
|
||||
console.log('【中医诊断】调用API,encounterId:', props.patientInfo.encounterId)
|
||||
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
|
||||
if (res.data.illness.length > 0) {
|
||||
res.data.illness.forEach((item, index) => {
|
||||
@@ -653,7 +635,6 @@ function getDiagnosisInfo() {
|
||||
});
|
||||
});
|
||||
}
|
||||
console.log('【中医诊断】获取数据成功,诊断数量:', diagnosisList.value.length)
|
||||
// 默认选择第一个诊断
|
||||
if (diagnosisList.value.length > 0) {
|
||||
const firstDiagnosis = diagnosisList.value[0];
|
||||
@@ -775,19 +756,6 @@ function deletePrescription(prescription) {
|
||||
|
||||
const index = tcmPrescriptionList.value.findIndex((p) => p.id === prescription.id);
|
||||
if (index !== -1) {
|
||||
const prescriptionData = tcmPrescriptionList.value[index];
|
||||
|
||||
if (prescriptionData.prescriptionList && prescriptionData.prescriptionList.length > 0) {
|
||||
proxy.$modal.msgWarning('该处方单还有药品,请先删除所有药品后再删除处方单');
|
||||
return;
|
||||
}
|
||||
|
||||
const hasChargedItems = prescriptionData.prescriptionList && prescriptionData.prescriptionList.some(item => item.statusEnum === 2);
|
||||
if (hasChargedItems) {
|
||||
proxy.$modal.msgWarning('该处方单已收费,不能删除');
|
||||
return;
|
||||
}
|
||||
|
||||
tcmPrescriptionList.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
@@ -906,7 +874,7 @@ function selectAdviceBase(key, row, pIndex) {
|
||||
).chargeItemDefinitionId;
|
||||
|
||||
// 库存列表 + 价格列表拼成批次号的下拉框
|
||||
if (row.adviceType == 1 || row.adviceType == 2) {
|
||||
if (row.adviceType != 3) {
|
||||
if (row.inventoryList && row.inventoryList.length == 0) {
|
||||
prescription.expandOrder = [];
|
||||
proxy.$modal.msgWarning('该项目无库存');
|
||||
@@ -1082,32 +1050,23 @@ function handleSaveSign(row, index, pIndex) {
|
||||
const prescription = tcmPrescriptionList.value[pIndex];
|
||||
const formRefName = 'formRef' + pIndex + '-' + index;
|
||||
proxy.$refs[formRefName][0].validate((valid) => {
|
||||
if (valid) {
|
||||
row.isEdit = false;
|
||||
prescription.isAdding = false;
|
||||
prescription.expandOrder = [];
|
||||
row.contentJson = undefined;
|
||||
row.patientId = props.patientInfo.patientId;
|
||||
row.encounterId = props.patientInfo.encounterId;
|
||||
row.accountId = prescription.accountId;
|
||||
row.quantity = row.minUnitQuantity;
|
||||
row.chineseHerbsDoseQuantity = prescription.chineseHerbsDoseQuantity;
|
||||
row.unitPrice =
|
||||
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
|
||||
? row.unitPrice
|
||||
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
|
||||
row.conditionDefinitionId = prescription.conditionDefinitionId;
|
||||
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
|
||||
row.diagnosisName = prescription.diagnosisName;
|
||||
|
||||
// 寻找当前选中的单位字典值
|
||||
const selectedUnit = row.unitCodeList.find((item) => item.value === row.minUnitCode);
|
||||
if (selectedUnit) {
|
||||
row.doseUnitCode_dictText = selectedUnit.label;
|
||||
}
|
||||
|
||||
row.contentJson = JSON.stringify(row);
|
||||
}
|
||||
row.isEdit = false;
|
||||
prescription.isAdding = false;
|
||||
prescription.expandOrder = [];
|
||||
row.contentJson = undefined;
|
||||
row.patientId = props.patientInfo.patientId;
|
||||
row.encounterId = props.patientInfo.encounterId;
|
||||
row.accountId = prescription.accountId;
|
||||
row.quantity = row.minUnitQuantity;
|
||||
row.conditionId = prescription.conditionId;
|
||||
row.unitPrice =
|
||||
row.unitCodeList.find((item) => item.value == row.unitCode).type == 'unit'
|
||||
? row.unitPrice
|
||||
: new Decimal(row.unitPrice).div(row.partPercent).toFixed(2);
|
||||
row.conditionDefinitionId = prescription.conditionDefinitionId;
|
||||
row.encounterDiagnosisId = prescription.encounterDiagnosisId;
|
||||
row.diagnosisName = prescription.diagnosisName;
|
||||
row.contentJson = JSON.stringify(row);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user