333 门诊医生站开立耗材医嘱时,类型误转为“中成药”且保存报错
341 门诊挂号报错
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
T9.gender_enum AS genderEnum,
|
T9.gender_enum AS genderEnum,
|
||||||
T9.id_card AS idCard,
|
T9.id_card AS idCard,
|
||||||
T9.status_enum AS statusEnum,
|
T9.status_enum AS statusEnum,
|
||||||
T9.register_time AS registerTime,
|
T9.register_time AS register_time,
|
||||||
T9.total_price AS totalPrice,
|
T9.total_price AS totalPrice,
|
||||||
T9.account_name AS accountName,
|
T9.account_name AS accountName,
|
||||||
T9.enterer_name AS entererName,
|
T9.enterer_name AS entererName,
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
T8.gender_enum AS gender_enum,
|
T8.gender_enum AS gender_enum,
|
||||||
T8.id_card AS id_card,
|
T8.id_card AS id_card,
|
||||||
T1.status_enum AS status_enum,
|
T1.status_enum AS status_enum,
|
||||||
T1.create_time AS registerTime,
|
T1.create_time AS register_time,
|
||||||
T10.total_price,
|
T10.total_price,
|
||||||
T11."name" AS account_name,
|
T11."name" AS account_name,
|
||||||
T12."name" AS enterer_name,
|
T12."name" AS enterer_name,
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
AND T10.context_enum = #{register}
|
AND T10.context_enum = #{register}
|
||||||
) AS T9
|
) AS T9
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
ORDER BY T9.registerTime DESC
|
ORDER BY T9.register_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTmpActivityList" resultType="com.openhis.web.personalization.dto.ActivityDeviceDto">
|
<select id="getTmpActivityList" resultType="com.openhis.web.personalization.dto.ActivityDeviceDto">
|
||||||
|
|||||||
@@ -257,15 +257,16 @@ function fetchFromApi(searchKey) {
|
|||||||
searchKey: searchKey || '',
|
searchKey: searchKey || '',
|
||||||
statusEnum: 2,
|
statusEnum: 2,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log('[Debug] 耗材列表返回数据:', res.data);
|
console.log('[BugFix] 耗材列表返回数据:', res.data);
|
||||||
if (res.data && res.data.records) {
|
if (res.data && res.data.records) {
|
||||||
adviceBaseList.value = res.data.records.map((item) => {
|
adviceBaseList.value = res.data.records.map((item) => {
|
||||||
console.log('[Debug] 耗材项:', item.name, 'price:', item.price, 'retailPrice:', item.retailPrice);
|
console.log('[BugFix] 耗材项:', item.name, 'price:', item.price, 'retailPrice:', item.retailPrice);
|
||||||
return {
|
const mappedItem = {
|
||||||
...item,
|
...item,
|
||||||
// 🔧 Bug Fix: 强制覆盖后端返回的字段,确保数据正确
|
// 🔧 Bug Fix: 强制覆盖后端返回的字段,确保数据正确
|
||||||
adviceName: item.name || item.busNo,
|
adviceName: item.name || item.busNo,
|
||||||
adviceType: 4, // 强制设置为前端耗材类型
|
adviceType: 4, // 强制设置为前端耗材类型
|
||||||
|
adviceType_dictText: '耗材', // 🔧 Bug Fix: 设置医嘱类型显示文本
|
||||||
adviceTableName: 'adm_device_definition',
|
adviceTableName: 'adm_device_definition',
|
||||||
unitCode: item.unitCode || '',
|
unitCode: item.unitCode || '',
|
||||||
unitCode_dictText: item.unitCode_dictText || '',
|
unitCode_dictText: item.unitCode_dictText || '',
|
||||||
@@ -293,12 +294,14 @@ function fetchFromApi(searchKey) {
|
|||||||
deviceName: item.name,
|
deviceName: item.name,
|
||||||
// 🔧 Bug #220 修复:正确处理耗材价格,支持price或retailPrice字段
|
// 🔧 Bug #220 修复:正确处理耗材价格,支持price或retailPrice字段
|
||||||
// 价格字段优先使用retailPrice
|
// 价格字段优先使用retailPrice
|
||||||
priceList: (item.retailPrice !== undefined && item.retailPrice !== null)
|
priceList: (item.retailPrice !== undefined && item.retailPrice !== null)
|
||||||
? [{ price: item.retailPrice }]
|
? [{ price: item.retailPrice }]
|
||||||
: ((item.price !== undefined && item.price !== null)
|
: ((item.price !== undefined && item.price !== null)
|
||||||
? [{ price: item.price }]
|
? [{ price: item.price }]
|
||||||
: []),
|
: []),
|
||||||
};
|
};
|
||||||
|
console.log('[BugFix] 映射后的耗材项:', mappedItem.adviceName, 'adviceType:', mappedItem.adviceType, 'adviceType_dictText:', mappedItem.adviceType_dictText);
|
||||||
|
return mappedItem;
|
||||||
});
|
});
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
currentIndex.value = 0;
|
currentIndex.value = 0;
|
||||||
|
|||||||
@@ -223,7 +223,12 @@
|
|||||||
style="width: 70px; margin-right: 20px" />
|
style="width: 70px; margin-right: 20px" />
|
||||||
</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>
|
<span class="medicine-info" style="display: flex; align-items: center; gap: 5px;">
|
||||||
|
皮试:<el-checkbox v-model="scope.row.skinTestFlag" :true-value="1" :false-value="0"
|
||||||
|
@change="handleSkinTestChange(scope.row, scope.$index)">
|
||||||
|
是
|
||||||
|
</el-checkbox>
|
||||||
|
</span>
|
||||||
<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">
|
||||||
总金额:{{
|
总金额:{{
|
||||||
@@ -470,6 +475,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<span class="medicine-info" style="display: flex; align-items: center; gap: 5px;">
|
||||||
|
皮试:<el-checkbox v-model="scope.row.skinTestFlag" :true-value="1" :false-value="0"
|
||||||
|
@change="handleSkinTestChange(scope.row, scope.$index)">
|
||||||
|
是
|
||||||
|
</el-checkbox>
|
||||||
|
</span>
|
||||||
<span class="total-amount">
|
<span class="total-amount">
|
||||||
总金额:{{
|
总金额:{{
|
||||||
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice)
|
(scope.row.totalPrice !== undefined && scope.row.totalPrice !== null && !isNaN(scope.row.totalPrice)
|
||||||
@@ -761,7 +772,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="皮试" align="center" prop="" width="80">
|
<el-table-column label="皮试" align="center" prop="" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="!scope.row.isEdit">
|
<template v-if="scope.row.isEdit">
|
||||||
|
<el-checkbox v-model="scope.row.skinTestFlag" :true-value="1" :false-value="0"
|
||||||
|
@change="handleSkinTestChange(scope.row, scope.$index)">
|
||||||
|
是
|
||||||
|
</el-checkbox>
|
||||||
|
</template>
|
||||||
|
<span v-else>
|
||||||
{{ scope.row.skinTestFlag_enumText || '-' }}
|
{{ scope.row.skinTestFlag_enumText || '-' }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -1908,6 +1925,34 @@ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|||||||
* 选择药品回调
|
* 选择药品回调
|
||||||
*/
|
*/
|
||||||
function selectAdviceBase(key, row) {
|
function selectAdviceBase(key, row) {
|
||||||
|
// 🔧 Bug Fix: 检查药品是否需要皮试,如果需要则弹出确认框
|
||||||
|
if (row.skinTestFlag == 1) {
|
||||||
|
ElMessageBox.confirm(`药品:${row.adviceName}需要做皮试,是否做皮试?`, '提示', {
|
||||||
|
confirmButtonText: '是',
|
||||||
|
cancelButtonText: '否',
|
||||||
|
type: 'warning',
|
||||||
|
center: true,
|
||||||
|
customClass: 'skin-test-confirm-dialog',
|
||||||
|
beforeClose: (action, instance, done) => {
|
||||||
|
if (action === 'confirm') {
|
||||||
|
// 用户点击右边的按钮(confirm),保持皮试标记为1
|
||||||
|
setNewRow(key, row);
|
||||||
|
done();
|
||||||
|
} else if (action === 'cancel') {
|
||||||
|
// 用户点击左边的按钮(cancel),将皮试标记改为0
|
||||||
|
row.skinTestFlag = 0;
|
||||||
|
row.skinTestFlag_enumText = '否';
|
||||||
|
setNewRow(key, row);
|
||||||
|
done();
|
||||||
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查检查检验项目是否有历史记录(30天内)
|
||||||
if (row.categoryCode == 22 || row.categoryCode == 23) {
|
if (row.categoryCode == 22 || row.categoryCode == 23) {
|
||||||
checkServicesHistory({
|
checkServicesHistory({
|
||||||
patientId: props.patientInfo.patientId,
|
patientId: props.patientInfo.patientId,
|
||||||
@@ -1930,6 +1975,7 @@ function selectAdviceBase(key, row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setNewRow(key, row) {
|
async function setNewRow(key, row) {
|
||||||
|
console.log('[BugFix] setNewRow - row.adviceType:', row.adviceType, 'row.adviceType_dictText:', row.adviceType_dictText, 'row.adviceTableName:', row.adviceTableName);
|
||||||
// 每次选择药品时,将当前行数据完全重置,清空所有旧数据
|
// 每次选择药品时,将当前行数据完全重置,清空所有旧数据
|
||||||
const preservedData = {
|
const preservedData = {
|
||||||
uniqueKey: prescriptionList.value[rowIndex.value].uniqueKey,
|
uniqueKey: prescriptionList.value[rowIndex.value].uniqueKey,
|
||||||
@@ -1942,26 +1988,28 @@ function selectAdviceBase(key, row) {
|
|||||||
prescriptionList.value[rowIndex.value] = preservedData;
|
prescriptionList.value[rowIndex.value] = preservedData;
|
||||||
|
|
||||||
setValue(row);
|
setValue(row);
|
||||||
|
|
||||||
|
console.log('[BugFix] setNewRow after setValue - prescriptionList[rowIndex].adviceType:', prescriptionList.value[rowIndex.value].adviceType, 'adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
|
||||||
|
|
||||||
// 🔧 Bug #220 修复:确保在setValue之后重新计算耗材类型的总金额
|
// 🔧 Bug #220 修复:确保在setValue之后重新计算耗材类型的总金额
|
||||||
// 耗材(adviceType=4)和诊疗(adviceType=3)需要重新计算以确保显示正确
|
// 耗材(adviceType=4)和诊疗(adviceType=3)需要重新计算以确保显示正确
|
||||||
const currentRow = prescriptionList.value[rowIndex.value];
|
const currentRow = prescriptionList.value[rowIndex.value];
|
||||||
if (currentRow && (currentRow.adviceType == 3 || currentRow.adviceType == 4)) {
|
if (currentRow && (currentRow.adviceType == 3 || currentRow.adviceType == 4)) {
|
||||||
calculateTotalPrice(currentRow, rowIndex.value);
|
calculateTotalPrice(currentRow, rowIndex.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保在setValue之后再次设置showPopover为false,防止被覆盖
|
// 确保在setValue之后再次设置showPopover为false,防止被覆盖
|
||||||
prescriptionList.value[rowIndex.value].showPopover = false;
|
prescriptionList.value[rowIndex.value].showPopover = false;
|
||||||
|
|
||||||
expandOrder.value = [key];
|
expandOrder.value = [key];
|
||||||
|
|
||||||
// 自动聚焦到单次用量字段 - 使用 async/await 多次尝试
|
// 自动聚焦到单次用量字段 - 使用 async/await 多次尝试
|
||||||
await nextTick();
|
await nextTick();
|
||||||
|
|
||||||
// 第一次尝试 - 快速定位
|
// 第一次尝试 - 快速定位
|
||||||
await sleep(300);
|
await sleep(300);
|
||||||
focusDoseQuantityInput(row);
|
focusDoseQuantityInput(row);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 聚焦到单次用量输入框的函数
|
// 聚焦到单次用量输入框的函数
|
||||||
@@ -3067,10 +3115,8 @@ function handleSaveBatch(prescriptionId) {
|
|||||||
|
|
||||||
// 🔧 Bug Fix: 处理accountId,如果是'ZIFEI'或0则转为null,让后端查询默认账户
|
// 🔧 Bug Fix: 处理accountId,如果是'ZIFEI'或0则转为null,让后端查询默认账户
|
||||||
let itemAccountId = finalAccountId;
|
let itemAccountId = finalAccountId;
|
||||||
if (itemAccountId === 'ZIFEI' || itemAccountId === 0) {
|
if (itemAccountId === 'ZIFEI' || itemAccountId === 0 || itemAccountId === '0') {
|
||||||
itemAccountId = null;
|
itemAccountId = null;
|
||||||
} else if (itemAccountId && !isNaN(Number(itemAccountId))) {
|
|
||||||
itemAccountId = Number(itemAccountId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔧 Bug Fix: 确保库存匹配成功的关键字段
|
// 🔧 Bug Fix: 确保库存匹配成功的关键字段
|
||||||
@@ -3117,7 +3163,11 @@ function handleSaveBatch(prescriptionId) {
|
|||||||
accountId: itemAccountId,
|
accountId: itemAccountId,
|
||||||
// 🔧 Bug Fix: 确保库存匹配成功
|
// 🔧 Bug Fix: 确保库存匹配成功
|
||||||
adviceTableName: adviceTableNameVal,
|
adviceTableName: adviceTableNameVal,
|
||||||
locationId: locationIdVal
|
locationId: locationIdVal,
|
||||||
|
// 🔧 Bug Fix: 确保 minUnitQuantity、minUnitCode 等字段被传递(药品必填字段)
|
||||||
|
minUnitQuantity: item.minUnitQuantity,
|
||||||
|
minUnitCode: item.minUnitCode,
|
||||||
|
minUnitCode_dictText: item.minUnitCode_dictText
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// --- 【修改结束】 ---
|
// --- 【修改结束】 ---
|
||||||
@@ -3279,10 +3329,13 @@ function setValue(row) {
|
|||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
// 创建一个新的对象,而不是合并旧数据,以避免残留数据问题
|
// 创建一个新的对象,而不是合并旧数据,以避免残留数据问题
|
||||||
|
console.log('[BugFix] setValue - row.adviceType:', row.adviceType, 'row.adviceType_dictText:', row.adviceType_dictText, 'row.adviceTableName:', row.adviceTableName);
|
||||||
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),
|
||||||
|
// 🔧 Bug Fix: 确保adviceType_dictText被正确设置,避免展开行时显示错误
|
||||||
|
adviceType_dictText: row.adviceType_dictText || mapAdviceTypeLabel(row.adviceType, row.adviceTableName),
|
||||||
skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
|
skinTestFlag: skinTestFlag, // 确保皮试字段是数字类型
|
||||||
skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本
|
skinTestFlag_enumText: skinTestFlag == 1 ? '是' : '否', // 更新显示文本
|
||||||
// 保留原来设置的初始状态值
|
// 保留原来设置的初始状态值
|
||||||
@@ -3291,6 +3344,7 @@ function setValue(row) {
|
|||||||
statusEnum: prescriptionList.value[rowIndex.value].statusEnum,
|
statusEnum: prescriptionList.value[rowIndex.value].statusEnum,
|
||||||
showPopover: false, // 确保查询框关闭
|
showPopover: false, // 确保查询框关闭
|
||||||
};
|
};
|
||||||
|
console.log('[BugFix] setValue - prescriptionList[rowIndex].adviceType_dictText:', prescriptionList.value[rowIndex.value].adviceType_dictText);
|
||||||
// 🔧 Bug #218 修复:保留组套中的值,不要强制设为undefined
|
// 🔧 Bug #218 修复:保留组套中的值,不要强制设为undefined
|
||||||
// 只有当值未定义时才使用默认值
|
// 只有当值未定义时才使用默认值
|
||||||
prescriptionList.value[rowIndex.value].orgId = row.positionId || row.orgId;
|
prescriptionList.value[rowIndex.value].orgId = row.positionId || row.orgId;
|
||||||
@@ -4511,6 +4565,36 @@ function handleOrderSetSaved() {
|
|||||||
defineExpose({ getListInfo, getDiagnosisInfo });
|
defineExpose({ getListInfo, getDiagnosisInfo });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
/* 皮试确认弹窗全局样式 - 反转按钮顺序,左边是是,右边是否 */
|
||||||
|
.skin-test-confirm-dialog.el-message-box {
|
||||||
|
.el-message-box__btns {
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: row-reverse !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
margin-left: 10px !important;
|
||||||
|
margin-right: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 如果自定义类名不生效,使用更强的选择器 */
|
||||||
|
.el-message-box.skin-test-confirm-dialog {
|
||||||
|
.el-message-box__btns {
|
||||||
|
display: flex !important;
|
||||||
|
flex-direction: row-reverse !important;
|
||||||
|
justify-content: center !important;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
margin-left: 10px !important;
|
||||||
|
margin-right: 10px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
:deep(.el-table__expand-icon) {
|
:deep(.el-table__expand-icon) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user