diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java index 2f159586..0e78b07f 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/inhospitalnursestation/appservice/impl/ATDManageAppServiceImpl.java @@ -833,12 +833,23 @@ public class ATDManageAppServiceImpl implements IATDManageAppService { = ((List) docStatisticsAppService.queryByEncounterId(encounterId).getData()).stream() .filter(item -> DocDefinitionEnum.ADMISSION_VITAL_SIGNS.getValue().equals(item.getSource())).toList(); List list = new ArrayList<>(data); + + // 先删除所有已有的入院体征记录(重新保存最新数据) + for (DocStatisticsDto existingItem : data) { + if (existingItem.getId() != null) { + docStatisticsMapper.deleteById(existingItem.getId()); + } + } + list.clear(); + map.keySet().forEach(key -> { - if (map.get(key) != null && !map.get(key).isEmpty()) { + String value = map.get(key); + // 只保存非空值 + if (value != null && !value.isEmpty() && !" ".equals(value)) { DocStatisticsDefinitionDto docStatisticsDefinitionDto = definitionDtoHashMap.get(key); DocStatisticsDto statistics = new DocStatisticsDto(); statistics.setStatisticDefinitionCode(key); - statistics.setValue(map.get(key)); + statistics.setValue(value); statistics.setEncounterId(encounterId); statistics.setPatientId(encounter.getPatientId()); statistics.setStatisticDefinitionId(docStatisticsDefinitionDto.getId()); diff --git a/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/transferInDialog.vue b/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/transferInDialog.vue index 29c3df0f..307fc995 100644 --- a/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/transferInDialog.vue +++ b/openhis-ui-vue3/src/views/inpatientNurse/inOut/components/transferInDialog.vue @@ -571,7 +571,13 @@ const handleSubmit = async () => { Object.keys(interventionForm.value).forEach(key => { const value = interventionForm.value[key]; // 保留非空的值(0、false等有效值也需要保留) - if (value !== '' && value !== null && value !== undefined) { + // 特别注意:体征字段(height, weight等)即使为空字符串也要提交,用于清除已有数据 + const vitalSignFields = ['height', 'weight', 'temperature', 'hertRate', 'pulse', 'endBloodPressure', 'highBloodPressure']; + if (vitalSignFields.includes(key)) { + // 体征字段:提交所有值,包括空字符串(用于清除数据) + formData[key] = value === undefined ? '' : value; + } else if (value !== '' && value !== null && value !== undefined) { + // 其他字段:只保留非空值 formData[key] = value; } });