From 4a2485e4346547f0ec1e241eba95e85dd37f8891 Mon Sep 17 00:00:00 2001 From: wzk <2438381872@qq.com> Date: Tue, 18 Nov 2025 09:25:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E5=8C=BB=E7=94=9F=E7=AB=99-?= =?UTF-8?q?=E3=80=8B=E5=8C=BB=E5=98=B1=EF=BC=9A=E7=9A=AE=E8=AF=95=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=81=9A=E6=88=90=E5=8D=95=E9=80=89=E6=A1=86=E3=80=82?= =?UTF-8?q?=E5=BD=93=E5=BC=80=E5=8D=95=E5=8C=BB=E7=94=9F=E9=80=89=E4=B8=AD?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E5=87=BA=E6=9D=A5=E7=9A=84=E8=8D=AF=E5=93=81?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E6=97=B6=EF=BC=8C=E5=A6=82=E6=9E=9C=E8=AF=A5?= =?UTF-8?q?=E8=8D=AF=E5=93=81=E6=98=AF=E7=9A=AE=E8=AF=95=E8=8D=AF=E5=93=81?= =?UTF-8?q?=EF=BC=8C=E7=B3=BB=E7=BB=9F=E2=80=99=E8=8D=AF=E5=93=81=EF=BC=9A?= =?UTF-8?q?=E8=AF=A5=E8=8D=AF=E5=93=81=E5=90=8D=E7=A7=B0+=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=81=9A=E7=9A=AE=E8=AF=95=EF=BC=8C=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=81=9A=E7=9A=AE=E8=AF=95=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prescription/prescriptionlist.vue | 114 +++++++++++++++++- 1 file changed, 110 insertions(+), 4 deletions(-) diff --git a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue index 4dc997e6..f4a8f07b 100644 --- a/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue +++ b/openhis-ui-vue3/src/views/doctorstation/components/prescription/prescriptionlist.vue @@ -131,7 +131,15 @@ /> 诊断:{{ diagnosisName }} - 皮试:{{ scope.row.skinTestFlag_enumText }} + + + 是 + + 注射药品:{{ scope.row.injectFlag_enumText }} 总金额:{{ scope.row.totalPrice ? scope.row.totalPrice + ' 元' : '0.00 元' }} @@ -415,7 +423,15 @@ /> 诊断:{{ diagnosisName }} - 皮试:{{ scope.row.skinTestFlag_enumText }} + + + 是 + + 注射药品:{{ scope.row.injectFlag_enumText }} 总金额:{{ scope.row.totalPrice ? scope.row.totalPrice + ' 元' : '0.00 元' }} @@ -1149,6 +1165,12 @@ function getListInfo(addNewRow) { getPrescriptionList(props.patientInfo.encounterId).then((res) => { prescriptionList.value = res.data.map((item) => { 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 { ...parsedContent, ...item, @@ -1156,6 +1178,8 @@ function getListInfo(addNewRow) { adviceType: parsedContent.adviceType !== undefined ? Number(parsedContent.adviceType) : (item.adviceType !== undefined ? Number(item.adviceType) : undefined), doseQuantity: parsedContent?.doseQuantity, doseUnitCode_dictText: parsedContent?.doseUnitCode_dictText, + skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型 + skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本 }; }); groupMarkers.value = getGroupMarkers(prescriptionList.value); // 更新标记 @@ -1296,6 +1320,22 @@ function handleChange(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); } + // 确保 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], ...JSON.parse(JSON.stringify(row)), adviceType: finalAdviceType, // 确保是数字类型 + skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型 }; // 确保字典已加载后更新显示 @@ -1445,7 +1491,52 @@ function selectAdviceBase(key, row) { prescriptionList.value[rowIndex.value].orgId = defaultOrgId; 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(() => { if (row.adviceType == 1 || row.adviceType == 2) { if (row.injectFlag == 1) { @@ -1457,7 +1548,6 @@ function selectAdviceBase(key, row) { inputRefs.value['quantity']?.focus(); } }); - } function getOrgList() { @@ -1698,6 +1788,15 @@ function handleSaveSign(row, index) { row.conditionDefinitionId = conditionDefinitionId.value; row.encounterDiagnosisId = encounterDiagnosisId.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) { row.sortNumber = row.sortNumber ? row.sortNumber : prescriptionList.value.length; } @@ -1783,11 +1882,18 @@ function setValue(row) { 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], ...JSON.parse(JSON.stringify(row)), // 确保adviceType为数字类型,避免类型不匹配导致的显示问题 adviceType: Number(row.adviceType), + skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型 + skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本 }; prescriptionList.value[rowIndex.value].orgId = undefined; prescriptionList.value[rowIndex.value].dose = undefined;