门诊医生站-》医嘱:皮试字段做成单选框。当开单医生选中检索出来的药品确认时,如果该药品是皮试药品,系统’药品:该药品名称+需要做皮试,是否做皮试?
This commit is contained in:
@@ -131,7 +131,15 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<span class="medicine-info"> 诊断:{{ diagnosisName }} </span>
|
<span class="medicine-info"> 诊断:{{ diagnosisName }} </span>
|
||||||
<span class="medicine-info"> 皮试:{{ scope.row.skinTestFlag_enumText }} </span>
|
<el-form-item label="皮试:" prop="skinTestFlag" style="margin: 0; margin-right: 20px">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="scope.row.skinTestFlag"
|
||||||
|
:true-label="1"
|
||||||
|
:false-label="0"
|
||||||
|
>
|
||||||
|
是
|
||||||
|
</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
<span class="medicine-info"> 注射药品:{{ scope.row.injectFlag_enumText }} </span>
|
<span class="medicine-info"> 注射药品:{{ scope.row.injectFlag_enumText }} </span>
|
||||||
<span class="total-amount">
|
<span class="total-amount">
|
||||||
总金额:{{ scope.row.totalPrice ? scope.row.totalPrice + ' 元' : '0.00 元' }}
|
总金额:{{ scope.row.totalPrice ? scope.row.totalPrice + ' 元' : '0.00 元' }}
|
||||||
@@ -415,7 +423,15 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<span class="medicine-info"> 诊断:{{ diagnosisName }} </span>
|
<span class="medicine-info"> 诊断:{{ diagnosisName }} </span>
|
||||||
<span class="medicine-info"> 皮试:{{ scope.row.skinTestFlag_enumText }} </span>
|
<el-form-item label="皮试:" prop="skinTestFlag" style="margin: 0; margin-right: 20px">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="scope.row.skinTestFlag"
|
||||||
|
:true-label="1"
|
||||||
|
:false-label="0"
|
||||||
|
>
|
||||||
|
是
|
||||||
|
</el-checkbox>
|
||||||
|
</el-form-item>
|
||||||
<span class="medicine-info"> 注射药品:{{ scope.row.injectFlag_enumText }} </span>
|
<span class="medicine-info"> 注射药品:{{ scope.row.injectFlag_enumText }} </span>
|
||||||
<span class="total-amount">
|
<span class="total-amount">
|
||||||
总金额:{{ scope.row.totalPrice ? scope.row.totalPrice + ' 元' : '0.00 元' }}
|
总金额:{{ scope.row.totalPrice ? scope.row.totalPrice + ' 元' : '0.00 元' }}
|
||||||
@@ -1149,6 +1165,12 @@ function getListInfo(addNewRow) {
|
|||||||
getPrescriptionList(props.patientInfo.encounterId).then((res) => {
|
getPrescriptionList(props.patientInfo.encounterId).then((res) => {
|
||||||
prescriptionList.value = res.data.map((item) => {
|
prescriptionList.value = res.data.map((item) => {
|
||||||
const parsedContent = JSON.parse(item.contentJson);
|
const parsedContent = JSON.parse(item.contentJson);
|
||||||
|
// 确保 skinTestFlag 是数字类型(1 或 0)
|
||||||
|
const skinTestFlag = parsedContent?.skinTestFlag !== undefined && parsedContent?.skinTestFlag !== null
|
||||||
|
? (typeof parsedContent.skinTestFlag === 'number' ? parsedContent.skinTestFlag : (parsedContent.skinTestFlag ? 1 : 0))
|
||||||
|
: (item.skinTestFlag !== undefined && item.skinTestFlag !== null
|
||||||
|
? (typeof item.skinTestFlag === 'number' ? item.skinTestFlag : (item.skinTestFlag ? 1 : 0))
|
||||||
|
: 0);
|
||||||
return {
|
return {
|
||||||
...parsedContent,
|
...parsedContent,
|
||||||
...item,
|
...item,
|
||||||
@@ -1156,6 +1178,8 @@ function getListInfo(addNewRow) {
|
|||||||
adviceType: parsedContent.adviceType !== undefined ? Number(parsedContent.adviceType) : (item.adviceType !== undefined ? Number(item.adviceType) : undefined),
|
adviceType: parsedContent.adviceType !== undefined ? Number(parsedContent.adviceType) : (item.adviceType !== undefined ? Number(item.adviceType) : undefined),
|
||||||
doseQuantity: parsedContent?.doseQuantity,
|
doseQuantity: parsedContent?.doseQuantity,
|
||||||
doseUnitCode_dictText: parsedContent?.doseUnitCode_dictText,
|
doseUnitCode_dictText: parsedContent?.doseUnitCode_dictText,
|
||||||
|
skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
|
||||||
|
skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
groupMarkers.value = getGroupMarkers(prescriptionList.value); // 更新标记
|
groupMarkers.value = getGroupMarkers(prescriptionList.value); // 更新标记
|
||||||
@@ -1296,6 +1320,22 @@ function handleChange(value) {
|
|||||||
adviceQueryParams.value.searchKey = value;
|
adviceQueryParams.value.searchKey = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理皮试字段变化
|
||||||
|
*/
|
||||||
|
function handleSkinTestChange(row, index) {
|
||||||
|
// 确保 skinTestFlag 是数字类型(1 或 0)
|
||||||
|
if (row.skinTestFlag !== undefined && row.skinTestFlag !== null) {
|
||||||
|
row.skinTestFlag = typeof row.skinTestFlag === 'number'
|
||||||
|
? row.skinTestFlag
|
||||||
|
: (row.skinTestFlag ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
row.skinTestFlag = 0;
|
||||||
|
}
|
||||||
|
// 更新显示文本
|
||||||
|
row.skinTestFlag_enumText = row.skinTestFlag == 1 ? '是' : '否';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择药品回调
|
* 选择药品回调
|
||||||
*/
|
*/
|
||||||
@@ -1369,10 +1409,16 @@ function selectAdviceBase(key, row) {
|
|||||||
finalAdviceType = Number(row.adviceType);
|
finalAdviceType = Number(row.adviceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 确保 skinTestFlag 是数字类型(1 或 0),如果未定义则默认为 0
|
||||||
|
let skinTestFlag = row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||||
|
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
|
||||||
|
: 0;
|
||||||
|
|
||||||
prescriptionList.value[rowIndex.value] = {
|
prescriptionList.value[rowIndex.value] = {
|
||||||
...prescriptionList.value[rowIndex.value],
|
...prescriptionList.value[rowIndex.value],
|
||||||
...JSON.parse(JSON.stringify(row)),
|
...JSON.parse(JSON.stringify(row)),
|
||||||
adviceType: finalAdviceType, // 确保是数字类型
|
adviceType: finalAdviceType, // 确保是数字类型
|
||||||
|
skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
|
||||||
};
|
};
|
||||||
|
|
||||||
// 确保字典已加载后更新显示
|
// 确保字典已加载后更新显示
|
||||||
@@ -1445,7 +1491,52 @@ function selectAdviceBase(key, row) {
|
|||||||
prescriptionList.value[rowIndex.value].orgId = defaultOrgId;
|
prescriptionList.value[rowIndex.value].orgId = defaultOrgId;
|
||||||
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
|
prescriptionList.value[rowIndex.value].unitPrice = row.priceList[0].price;
|
||||||
}
|
}
|
||||||
expandOrder.value = [key];
|
|
||||||
|
// 检查是否是皮试药品,如果是则弹出确认提示
|
||||||
|
// 只对药品类型(西药和中成药)进行皮试提示
|
||||||
|
// 使用原始 row 中的 skinTestFlag 来判断,因为这是药品基础信息中的皮试标志
|
||||||
|
const isSkinTestDrug = row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||||
|
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag == 1 : (row.skinTestFlag ? true : false))
|
||||||
|
: false;
|
||||||
|
|
||||||
|
if ((row.adviceType == 1 || row.adviceType == 2) && isSkinTestDrug) {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
`药品:${row.adviceName}需要做皮试,是否做皮试?`,
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '是(Y)',
|
||||||
|
cancelButtonText: '否(N)',
|
||||||
|
type: 'info',
|
||||||
|
closeOnClickModal: false,
|
||||||
|
closeOnPressEscape: false,
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
// 用户点击"是",自动勾选皮试字段
|
||||||
|
prescriptionList.value[rowIndex.value].skinTestFlag = 1;
|
||||||
|
prescriptionList.value[rowIndex.value].skinTestFlag_enumText = '是';
|
||||||
|
// 展开订单并继续后续流程
|
||||||
|
expandOrderAndFocus(key, row);
|
||||||
|
})
|
||||||
|
.catch((action) => {
|
||||||
|
// 用户点击"否"或关闭,不勾选皮试字段
|
||||||
|
prescriptionList.value[rowIndex.value].skinTestFlag = 0;
|
||||||
|
prescriptionList.value[rowIndex.value].skinTestFlag_enumText = '否';
|
||||||
|
// 展开订单并继续后续流程
|
||||||
|
expandOrderAndFocus(key, row);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 不是皮试药品,直接展开订单
|
||||||
|
expandOrderAndFocus(key, row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展开订单并聚焦输入框
|
||||||
|
*/
|
||||||
|
function expandOrderAndFocus(key, row) {
|
||||||
|
expandOrder.value = [key];
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (row.adviceType == 1 || row.adviceType == 2) {
|
if (row.adviceType == 1 || row.adviceType == 2) {
|
||||||
if (row.injectFlag == 1) {
|
if (row.injectFlag == 1) {
|
||||||
@@ -1457,7 +1548,6 @@ function selectAdviceBase(key, row) {
|
|||||||
inputRefs.value['quantity']?.focus();
|
inputRefs.value['quantity']?.focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOrgList() {
|
function getOrgList() {
|
||||||
@@ -1698,6 +1788,15 @@ function handleSaveSign(row, index) {
|
|||||||
row.conditionDefinitionId = conditionDefinitionId.value;
|
row.conditionDefinitionId = conditionDefinitionId.value;
|
||||||
row.encounterDiagnosisId = encounterDiagnosisId.value;
|
row.encounterDiagnosisId = encounterDiagnosisId.value;
|
||||||
row.diagnosisName = diagnosisName.value;
|
row.diagnosisName = diagnosisName.value;
|
||||||
|
// 确保 skinTestFlag 是数字类型(1 或 0)
|
||||||
|
if (row.skinTestFlag !== undefined && row.skinTestFlag !== null) {
|
||||||
|
row.skinTestFlag = typeof row.skinTestFlag === 'number'
|
||||||
|
? row.skinTestFlag
|
||||||
|
: (row.skinTestFlag ? 1 : 0);
|
||||||
|
} else {
|
||||||
|
row.skinTestFlag = 0;
|
||||||
|
}
|
||||||
|
row.skinTestFlag_enumText = row.skinTestFlag == 1 ? '是' : '否';
|
||||||
if (row.injectFlag == 1) {
|
if (row.injectFlag == 1) {
|
||||||
row.sortNumber = row.sortNumber ? row.sortNumber : prescriptionList.value.length;
|
row.sortNumber = row.sortNumber ? row.sortNumber : prescriptionList.value.length;
|
||||||
}
|
}
|
||||||
@@ -1783,11 +1882,18 @@ function setValue(row) {
|
|||||||
type: 'minUnit',
|
type: 'minUnit',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 确保 skinTestFlag 是数字类型(1 或 0),如果未定义则默认为 0
|
||||||
|
const skinTestFlag = row.skinTestFlag !== undefined && row.skinTestFlag !== null
|
||||||
|
? (typeof row.skinTestFlag === 'number' ? row.skinTestFlag : (row.skinTestFlag ? 1 : 0))
|
||||||
|
: 0;
|
||||||
|
|
||||||
prescriptionList.value[rowIndex.value] = {
|
prescriptionList.value[rowIndex.value] = {
|
||||||
...prescriptionList.value[rowIndex.value],
|
...prescriptionList.value[rowIndex.value],
|
||||||
...JSON.parse(JSON.stringify(row)),
|
...JSON.parse(JSON.stringify(row)),
|
||||||
// 确保adviceType为数字类型,避免类型不匹配导致的显示问题
|
// 确保adviceType为数字类型,避免类型不匹配导致的显示问题
|
||||||
adviceType: Number(row.adviceType),
|
adviceType: Number(row.adviceType),
|
||||||
|
skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
|
||||||
|
skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本
|
||||||
};
|
};
|
||||||
prescriptionList.value[rowIndex.value].orgId = undefined;
|
prescriptionList.value[rowIndex.value].orgId = undefined;
|
||||||
prescriptionList.value[rowIndex.value].dose = undefined;
|
prescriptionList.value[rowIndex.value].dose = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user