feat(anesthesia): 麻醉小结功能
- V63 Flyway migration: anes_summary table
- Entity, Mapper, Service, AppService, Controller
- POST /anesthesia/summary, GET /anesthesia/summary/{recordId}
- Frontend AnesthesiaSummary.vue with form and display
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.healthlink.his.web.anesthesia.appservice;
|
||||
|
||||
import com.healthlink.his.anesthesia.domain.AnesAsaAssessment;
|
||||
import com.healthlink.his.anesthesia.domain.AnesSummary;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaMedication;
|
||||
@@ -40,4 +41,8 @@ public interface IAnesthesiaAppService {
|
||||
AnesthesiaVitalSign recordVitalSign(AnesthesiaVitalSign vitalSign);
|
||||
|
||||
List<AnesthesiaVitalSign> getVitalSignTimeline(Long recordId);
|
||||
|
||||
AnesSummary saveSummary(AnesSummary summary);
|
||||
|
||||
AnesSummary getSummary(Long recordId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.healthlink.his.web.anesthesia.appservice.impl;
|
||||
|
||||
import com.healthlink.his.anesthesia.domain.AnesAsaAssessment;
|
||||
import com.healthlink.his.anesthesia.domain.AnesSummary;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaMedication;
|
||||
@@ -9,6 +10,7 @@ import com.healthlink.his.anesthesia.domain.AnesthesiaVitalSign;
|
||||
import com.healthlink.his.anesthesia.dto.AnesthesiaIoSummaryDto;
|
||||
import com.healthlink.his.anesthesia.dto.AnesthesiaRecordDetailDto;
|
||||
import com.healthlink.his.anesthesia.service.IAnesAsaAssessmentService;
|
||||
import com.healthlink.his.anesthesia.service.IAnesSummaryService;
|
||||
import com.healthlink.his.anesthesia.service.IAnesthesiaFollowupService;
|
||||
import com.healthlink.his.anesthesia.service.IAnesthesiaIoRecordService;
|
||||
import com.healthlink.his.anesthesia.service.IAnesthesiaMedicationService;
|
||||
@@ -44,6 +46,9 @@ public class AnesthesiaAppServiceImpl implements IAnesthesiaAppService {
|
||||
@Resource
|
||||
private IAnesAsaAssessmentService anesAsaAssessmentService;
|
||||
|
||||
@Resource
|
||||
private IAnesSummaryService anesSummaryService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AnesthesiaRecord createRecord(AnesthesiaRecord record) {
|
||||
@@ -158,4 +163,26 @@ public class AnesthesiaAppServiceImpl implements IAnesthesiaAppService {
|
||||
public List<AnesthesiaVitalSign> getVitalSignTimeline(Long recordId) {
|
||||
return anesthesiaVitalSignService.selectByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AnesSummary saveSummary(AnesSummary summary) {
|
||||
if (summary.getId() != null) {
|
||||
anesSummaryService.updateById(summary);
|
||||
} else {
|
||||
AnesSummary existing = anesSummaryService.selectByRecordId(summary.getRecordId());
|
||||
if (existing != null) {
|
||||
summary.setId(existing.getId());
|
||||
anesSummaryService.updateById(summary);
|
||||
} else {
|
||||
anesSummaryService.save(summary);
|
||||
}
|
||||
}
|
||||
return summary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnesSummary getSummary(Long recordId) {
|
||||
return anesSummaryService.selectByRecordId(recordId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.healthlink.his.web.anesthesia.controller;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.healthlink.his.anesthesia.domain.AnesAsaAssessment;
|
||||
import com.healthlink.his.anesthesia.domain.AnesSummary;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaFollowup;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaIoRecord;
|
||||
import com.healthlink.his.anesthesia.domain.AnesthesiaMedication;
|
||||
@@ -164,4 +165,18 @@ public class AnesthesiaController {
|
||||
public R<List<AnesthesiaVitalSign>> getVitalSignTimeline(@PathVariable Long recordId) {
|
||||
return R.ok(anesthesiaAppService.getVitalSignTimeline(recordId));
|
||||
}
|
||||
|
||||
@PostMapping("/summary")
|
||||
@Operation(summary = "保存麻醉小结")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:anesthesia:edit')")
|
||||
public R<AnesSummary> saveSummary(@RequestBody AnesSummary summary) {
|
||||
return R.ok(anesthesiaAppService.saveSummary(summary));
|
||||
}
|
||||
|
||||
@GetMapping("/summary/{recordId}")
|
||||
@Operation(summary = "获取麻醉小结")
|
||||
@PreAuthorize("@ss.hasPermi('inpatient:anesthesia:list')")
|
||||
public R<AnesSummary> getSummary(@PathVariable Long recordId) {
|
||||
return R.ok(anesthesiaAppService.getSummary(recordId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
CREATE TABLE anes_summary (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
record_id BIGINT NOT NULL,
|
||||
encounter_id BIGINT NOT NULL,
|
||||
patient_id BIGINT NOT NULL,
|
||||
anesthesia_type VARCHAR(32),
|
||||
anesthesia_start_time TIMESTAMP,
|
||||
anesthesia_end_time TIMESTAMP,
|
||||
surgery_start_time TIMESTAMP,
|
||||
surgery_end_time TIMESTAMP,
|
||||
intraop_blood_loss_ml INTEGER,
|
||||
intraop_urine_ml INTEGER,
|
||||
intraop_fluid_ml INTEGER,
|
||||
blood_transfusion_ml INTEGER,
|
||||
complications TEXT,
|
||||
has_complications BOOLEAN DEFAULT FALSE,
|
||||
airway_management VARCHAR(50),
|
||||
extubation_time TIMESTAMP,
|
||||
patient_condition VARCHAR(50),
|
||||
summary TEXT,
|
||||
anesthetist_id BIGINT,
|
||||
anesthetist_name VARCHAR(50),
|
||||
tenant_id BIGINT DEFAULT 0,
|
||||
delete_flag CHAR(1) DEFAULT '0',
|
||||
create_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
create_by VARCHAR(64),
|
||||
update_time TIMESTAMP,
|
||||
update_by VARCHAR(64)
|
||||
);
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.healthlink.his.anesthesia.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("anes_summary")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AnesSummary extends HisBaseEntity {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
private Long recordId;
|
||||
|
||||
private Long encounterId;
|
||||
|
||||
private Long patientId;
|
||||
|
||||
private String anesthesiaType;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date anesthesiaStartTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date anesthesiaEndTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date surgeryStartTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date surgeryEndTime;
|
||||
|
||||
private Integer intraopBloodLossMl;
|
||||
|
||||
private Integer intraopUrineMl;
|
||||
|
||||
private Integer intraopFluidMl;
|
||||
|
||||
private Integer bloodTransfusionMl;
|
||||
|
||||
private String complications;
|
||||
|
||||
private Boolean hasComplications;
|
||||
|
||||
private String airwayManagement;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date extubationTime;
|
||||
|
||||
private String patientCondition;
|
||||
|
||||
private String summary;
|
||||
|
||||
private Long anesthetistId;
|
||||
|
||||
private String anesthetistName;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.healthlink.his.anesthesia.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.healthlink.his.anesthesia.domain.AnesSummary;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface AnesSummaryMapper extends BaseMapper<AnesSummary> {
|
||||
|
||||
AnesSummary selectByRecordId(@Param("recordId") Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.healthlink.his.anesthesia.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.healthlink.his.anesthesia.domain.AnesSummary;
|
||||
|
||||
public interface IAnesSummaryService extends IService<AnesSummary> {
|
||||
|
||||
AnesSummary selectByRecordId(Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.healthlink.his.anesthesia.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.healthlink.his.anesthesia.domain.AnesSummary;
|
||||
import com.healthlink.his.anesthesia.mapper.AnesSummaryMapper;
|
||||
import com.healthlink.his.anesthesia.service.IAnesSummaryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AnesSummaryServiceImpl
|
||||
extends ServiceImpl<AnesSummaryMapper, AnesSummary>
|
||||
implements IAnesSummaryService {
|
||||
|
||||
@Override
|
||||
public AnesSummary selectByRecordId(Long recordId) {
|
||||
return baseMapper.selectByRecordId(recordId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.healthlink.his.anesthesia.mapper.AnesSummaryMapper">
|
||||
<select id="selectByRecordId" resultType="com.healthlink.his.anesthesia.domain.AnesSummary">
|
||||
SELECT * FROM anes_summary WHERE record_id = #{recordId} AND delete_flag = '0' LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -85,3 +85,11 @@ export function recordVitalSign(data) {
|
||||
export function getVitalSignTimeline(recordId) {
|
||||
return request({ url: '/api/v1/anesthesia/vital-sign/timeline/' + recordId, method: 'get' })
|
||||
}
|
||||
|
||||
export function saveAnesSummary(data) {
|
||||
return request({ url: '/api/v1/anesthesia/summary', method: 'post', data })
|
||||
}
|
||||
|
||||
export function getAnesSummary(recordId) {
|
||||
return request({ url: '/api/v1/anesthesia/summary/' + recordId, method: 'get' })
|
||||
}
|
||||
|
||||
@@ -0,0 +1,336 @@
|
||||
<template>
|
||||
<div class="anes-summary-container">
|
||||
<el-card v-loading="loading">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span>麻醉小结</span>
|
||||
<el-button type="primary" size="small" @click="handleNew">新建小结</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div v-if="!summaryData" class="empty-tip">
|
||||
<el-empty description="暂无麻醉小结" />
|
||||
</div>
|
||||
|
||||
<div v-else class="summary-content">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="麻醉类型">{{ summaryData.anesthesiaType || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="麻醉医师">{{ summaryData.anesthetistName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="麻醉开始时间">{{ summaryData.anesthesiaStartTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="麻醉结束时间">{{ summaryData.anesthesiaEndTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手术开始时间">{{ summaryData.surgeryStartTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手术结束时间">{{ summaryData.surgeryEndTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="气道管理">{{ summaryData.airwayManagement || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="拔管时间">{{ summaryData.extubationTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="术中出血量(ml)">{{ summaryData.intraopBloodLossMl ?? '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="术中尿量(ml)">{{ summaryData.intraopUrineMl ?? '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="术中输液(ml)">{{ summaryData.intraopFluidMl ?? '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="输血量(ml)">{{ summaryData.bloodTransfusionMl ?? '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="有无并发症">
|
||||
<el-tag v-if="summaryData.hasComplications" type="danger">有</el-tag>
|
||||
<el-tag v-else type="success">无</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="患者情况">{{ summaryData.patientCondition || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="并发症详情" :span="2">{{ summaryData.complications || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="小结" :span="2">{{ summaryData.summary || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<div class="summary-actions">
|
||||
<el-button type="primary" size="small" @click="handleEdit(summaryData)">编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-model="dialogVisible" title="麻醉小结" width="800px" destroy-on-close :close-on-click-modal="false">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-divider content-position="left">基本信息</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉类型" prop="anesthesiaType">
|
||||
<el-select v-model="form.anesthesiaType" placeholder="请选择麻醉类型" style="width: 100%">
|
||||
<el-option label="全身麻醉" value="全身麻醉" />
|
||||
<el-option label="椎管内麻醉" value="椎管内麻醉" />
|
||||
<el-option label="神经阻滞" value="神经阻滞" />
|
||||
<el-option label="局部麻醉" value="局部麻醉" />
|
||||
<el-option label="复合麻醉" value="复合麻醉" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉医师ID" prop="anesthetistId">
|
||||
<el-input-number v-model="form.anesthetistId" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉医师姓名">
|
||||
<el-input v-model="form.anesthetistName" placeholder="请输入麻醉医师姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="就诊ID" prop="encounterId">
|
||||
<el-input-number v-model="form.encounterId" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="患者ID" prop="patientId">
|
||||
<el-input-number v-model="form.patientId" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉记录ID" prop="recordId">
|
||||
<el-input-number v-model="form.recordId" :min="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">时间记录</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉开始时间">
|
||||
<el-date-picker v-model="form.anesthesiaStartTime" type="datetime" placeholder="选择时间" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="麻醉结束时间">
|
||||
<el-date-picker v-model="form.anesthesiaEndTime" type="datetime" placeholder="选择时间" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手术开始时间">
|
||||
<el-date-picker v-model="form.surgeryStartTime" type="datetime" placeholder="选择时间" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手术结束时间">
|
||||
<el-date-picker v-model="form.surgeryEndTime" type="datetime" placeholder="选择时间" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">术中数据</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="术中出血量(ml)">
|
||||
<el-input-number v-model="form.intraopBloodLossMl" :min="0" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="术中尿量(ml)">
|
||||
<el-input-number v-model="form.intraopUrineMl" :min="0" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="术中输液(ml)">
|
||||
<el-input-number v-model="form.intraopFluidMl" :min="0" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="输血量(ml)">
|
||||
<el-input-number v-model="form.bloodTransfusionMl" :min="0" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">气道与并发症</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="气道管理">
|
||||
<el-select v-model="form.airwayManagement" placeholder="请选择" style="width: 100%">
|
||||
<el-option label="气管插管" value="气管插管" />
|
||||
<el-option label="喉罩" value="喉罩" />
|
||||
<el-option label="面罩" value="面罩" />
|
||||
<el-option label="其他" value="其他" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="拔管时间">
|
||||
<el-date-picker v-model="form.extubationTime" type="datetime" placeholder="选择时间" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="患者情况">
|
||||
<el-select v-model="form.patientCondition" placeholder="请选择" style="width: 100%">
|
||||
<el-option label="良好" value="良好" />
|
||||
<el-option label="一般" value="一般" />
|
||||
<el-option label="较差" value="较差" />
|
||||
<el-option label="危重" value="危重" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="有无并发症">
|
||||
<el-select v-model="form.hasComplications" style="width: 100%">
|
||||
<el-option label="无" :value="false" />
|
||||
<el-option label="有" :value="true" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item v-if="form.hasComplications" label="并发症详情">
|
||||
<el-input v-model="form.complications" type="textarea" :rows="3" placeholder="请描述并发症情况" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider content-position="left">小结</el-divider>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="麻醉小结">
|
||||
<el-input v-model="form.summary" type="textarea" :rows="4" placeholder="请输入麻醉小结" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="handleSave">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { saveAnesSummary, getAnesSummary } from '@/api/anesthesia'
|
||||
|
||||
const props = defineProps({
|
||||
recordId: { type: [Number, String], default: null }
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const submitLoading = ref(false)
|
||||
const summaryData = ref(null)
|
||||
const dialogVisible = ref(false)
|
||||
const formRef = ref(null)
|
||||
|
||||
const form = reactive({
|
||||
id: null,
|
||||
recordId: null,
|
||||
encounterId: null,
|
||||
patientId: null,
|
||||
anesthesiaType: '',
|
||||
anesthesiaStartTime: '',
|
||||
anesthesiaEndTime: '',
|
||||
surgeryStartTime: '',
|
||||
surgeryEndTime: '',
|
||||
intraopBloodLossMl: null,
|
||||
intraopUrineMl: null,
|
||||
intraopFluidMl: null,
|
||||
bloodTransfusionMl: null,
|
||||
complications: '',
|
||||
hasComplications: false,
|
||||
airwayManagement: '',
|
||||
extubationTime: '',
|
||||
patientCondition: '',
|
||||
summary: '',
|
||||
anesthetistId: null,
|
||||
anesthetistName: ''
|
||||
})
|
||||
|
||||
const rules = {
|
||||
anesthesiaType: [{ required: true, message: '请选择麻醉类型', trigger: 'change' }],
|
||||
recordId: [{ required: true, message: '请输入麻醉记录ID', trigger: 'blur' }],
|
||||
encounterId: [{ required: true, message: '请输入就诊ID', trigger: 'blur' }],
|
||||
patientId: [{ required: true, message: '请输入患者ID', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
form.id = null
|
||||
form.recordId = null
|
||||
form.encounterId = null
|
||||
form.patientId = null
|
||||
form.anesthesiaType = ''
|
||||
form.anesthesiaStartTime = ''
|
||||
form.anesthesiaEndTime = ''
|
||||
form.surgeryStartTime = ''
|
||||
form.surgeryEndTime = ''
|
||||
form.intraopBloodLossMl = null
|
||||
form.intraopUrineMl = null
|
||||
form.intraopFluidMl = null
|
||||
form.bloodTransfusionMl = null
|
||||
form.complications = ''
|
||||
form.hasComplications = false
|
||||
form.airwayManagement = ''
|
||||
form.extubationTime = ''
|
||||
form.patientCondition = ''
|
||||
form.summary = ''
|
||||
form.anesthetistId = null
|
||||
form.anesthetistName = ''
|
||||
}
|
||||
|
||||
function handleNew() {
|
||||
resetForm()
|
||||
if (props.recordId) {
|
||||
form.recordId = Number(props.recordId)
|
||||
}
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
function handleEdit(row) {
|
||||
Object.assign(form, row)
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
function handleSave() {
|
||||
formRef.value?.validate(valid => {
|
||||
if (!valid) return
|
||||
submitLoading.value = true
|
||||
saveAnesSummary({ ...form }).then(res => {
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('保存成功')
|
||||
dialogVisible.value = false
|
||||
loadData()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '保存失败')
|
||||
}
|
||||
}).catch(() => {
|
||||
ElMessage.error('保存失败')
|
||||
}).finally(() => {
|
||||
submitLoading.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function loadData() {
|
||||
if (!props.recordId) return
|
||||
loading.value = true
|
||||
getAnesSummary(props.recordId).then(res => {
|
||||
summaryData.value = res.data || null
|
||||
}).catch(() => {
|
||||
ElMessage.error('查询失败')
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
watch(() => props.recordId, () => {
|
||||
loadData()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.anes-summary-container {
|
||||
padding: 12px;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.empty-tip {
|
||||
padding: 40px 0;
|
||||
}
|
||||
.summary-content {
|
||||
padding: 12px 0;
|
||||
}
|
||||
.summary-actions {
|
||||
margin-top: 16px;
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user