版本更新
This commit is contained in:
@@ -0,0 +1,419 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-model="props.open"
|
||||
width="1400px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<div style="display: flex; justify-content: space-between; width: 100%">
|
||||
<div style="width: 40%">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" :xs="24">
|
||||
<el-input
|
||||
v-model="searchKey"
|
||||
placeholder="模板名称"
|
||||
clearable
|
||||
style="width: 100%; margin-bottom: 10px"
|
||||
@keyup.enter="getTemplateListInfo"
|
||||
>
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="getTemplateListInfo" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button size="default" type="primary" @click="openTemplateDialog"
|
||||
>新增模板</el-button
|
||||
>
|
||||
<el-button type="danger" plain @click="deleteTemplate()" :disabled="false">
|
||||
删除
|
||||
</el-button>
|
||||
<el-table
|
||||
ref="patientListRef"
|
||||
height="680"
|
||||
:data="templateList"
|
||||
row-key="id"
|
||||
highlight-current-row
|
||||
@row-click="setTemplate"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="templateName" label="模板名称" width="180" />
|
||||
<el-table-column prop="contextJson" label="模板内容" width="80" />
|
||||
<el-table-column prop="useScopeCodeText" label="使用范围" width="80" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleEditTemplate(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="templateTotal > 0"
|
||||
:total="templateTotal"
|
||||
v-model:page="templateQueryParams.pageNo"
|
||||
v-model:limit="templateQueryParams.pageSize"
|
||||
@pagination="getTemplateListInfo"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div
|
||||
style="display: flex; justify-content: space-between; width: 69%"
|
||||
class="app-container"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" label-width="100px">
|
||||
<el-form-item class="changeMajorFromItem" label-width="100px" label="记录时间:">
|
||||
<el-date-picker
|
||||
v-model="form.recordingTime"
|
||||
type="datetime"
|
||||
placeholder="选择日期"
|
||||
style="width: 30%"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="生命体征:" class="changeMajorFromItem" />
|
||||
<el-form-item class="changeMajorFromItem" label-width="10px">
|
||||
<el-row :span="24">
|
||||
<!-- 第一个表单项 -->
|
||||
<el-col :span="5">
|
||||
<el-form-item label="体温:" prop="tw" label-width="80px">
|
||||
<el-input v-model="form.tw" style="width: 80%" /> ℃
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 第二个表单项 -->
|
||||
<el-col :span="5">
|
||||
<el-form-item label="脉搏:" prop="mb" label-width="80px">
|
||||
<el-input v-model="form.mb" style="width: 80%" /> 次
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 第三个表单项 -->
|
||||
<el-col :span="5">
|
||||
<el-form-item label="呼吸:" prop="hx" label-width="80px">
|
||||
<el-input v-model="form.hx" style="width: 80%" /> 次
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 第四个表单项 -->
|
||||
<el-col :span="9">
|
||||
<el-form-item label="血压:" prop="bloodPressure" label-width="80px">
|
||||
<div class="xy-container" style="display: flex; align-items: center">
|
||||
<el-input v-model="form.systolicBloodPressure" style="width: 25%" />
|
||||
<span>/</span>
|
||||
<el-input v-model="form.diastolicBloodPressure" style="width: 25%" />
|
||||
(高/低)mmHg
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 第一个表单项 -->
|
||||
<el-col :span="5" style="margin-top: 10px">
|
||||
<el-form-item label="心率:" prop="xl" label-width="80px">
|
||||
<el-input v-model="form.xl" style="width: 80%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 第二个表单项 -->
|
||||
<el-col :span="5" style="margin-top: 10px">
|
||||
<el-form-item label="血氧:" prop="xy" label-width="80px">
|
||||
<el-input v-model="form.xy" style="width: 80%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 第五个表单项 -->
|
||||
<el-col :span="4" style="margin-top: 10px">
|
||||
<el-form-item style="margin-left: 20px">
|
||||
<el-checkbox
|
||||
v-model="form.vitalSignsSyncFlag"
|
||||
label="同步到体征表"
|
||||
name="SYP"
|
||||
/>
|
||||
<!-- @change="checkTimeValidity" -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="病情观察与护理记录:"
|
||||
label-width="90px"
|
||||
class="changeMajorFromItem"
|
||||
prop="column081"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.bqgcOther"
|
||||
type="textarea"
|
||||
:rows="8"
|
||||
:autosize="{ minRows: 3, maxRows: 8 }"
|
||||
class="el-textarea"
|
||||
style="width: 95%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submit">保存</el-button>
|
||||
<el-button @click="close">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<record-template
|
||||
ref="recordRemplateDialogRef"
|
||||
:open="openRecordTemplate"
|
||||
:patientId="patientId"
|
||||
:editData="editData"
|
||||
:recordTitle="recordTitle"
|
||||
@close="closeRecordTemplateDialog"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import recordTemplate from './recordTemplate.vue';
|
||||
import { ref, nextTick } from 'vue';
|
||||
import { saveRecord, updateRecord, getRecordTemplateList, deleteRecordTemplate } from './api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const props = defineProps({
|
||||
open: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
patientId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
patientInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
editData: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const searchKey = ref('');
|
||||
const emit = defineEmits(['close']);
|
||||
const templateQueryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined, // 患者id
|
||||
});
|
||||
const templateTotal = ref(0);
|
||||
const templateList = ref([]);
|
||||
|
||||
const patientInfo = ref({});
|
||||
const form = ref({});
|
||||
const templateIds = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const editData = ref({});
|
||||
|
||||
const title = ref('');
|
||||
|
||||
const recordTitle = ref('');
|
||||
const openRecordTemplate = ref(false);
|
||||
|
||||
/**
|
||||
* 取得患者信息详细
|
||||
*/
|
||||
function show() {
|
||||
patientInfo.value = props.patientInfo;
|
||||
console.log(props, 'props', props.patientInfo);
|
||||
reset();
|
||||
title.value = '';
|
||||
title.value = props.title;
|
||||
if (title.value === '编辑') {
|
||||
form.value = props.editData.content;
|
||||
}
|
||||
console.log(props, 'props', title.value);
|
||||
getTemplateListInfo();
|
||||
}
|
||||
|
||||
/** 选择删除模板条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, '选择条数');
|
||||
templateIds.value = selection.map((item) => item.id);
|
||||
console.log(templateIds.value, '选择条数');
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/**
|
||||
* 模板列表
|
||||
*/
|
||||
function getTemplateListInfo() {
|
||||
console.log(searchKey.value, '搜索关键字');
|
||||
templateQueryParams.value.searchKey = searchKey.value;
|
||||
getRecordTemplateList(templateQueryParams.value).then((res) => {
|
||||
console.log('模板列表', res);
|
||||
templateList.value = res.data.records;
|
||||
templateTotal.value = res.data.total;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除模板
|
||||
*
|
||||
* @param index - 要删除的处方在列表中的索引
|
||||
*/
|
||||
function deleteTemplate(index) {
|
||||
console.log(templateIds.value, '删除记录单模板');
|
||||
if (templateIds.value.length == 0) {
|
||||
proxy.$modal.msgWarning('请选择要删除的数据信息!');
|
||||
return;
|
||||
}
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除以上数据!')
|
||||
.then(function () {
|
||||
return deleteRecordTemplate(templateIds.value);
|
||||
})
|
||||
.then(() => {
|
||||
getTemplateListInfo();
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function close() {
|
||||
reset();
|
||||
emit('close');
|
||||
}
|
||||
/** 重置操作表单 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
tw: undefined,
|
||||
mb: undefined,
|
||||
hx: undefined,
|
||||
systolicBloodPressure: undefined,
|
||||
diastolicBloodPressure: undefined,
|
||||
xl: undefined,
|
||||
xy: undefined,
|
||||
vitalSignsSyncFlag: false,
|
||||
bqgc: undefined,
|
||||
bqgcOther: undefined,
|
||||
};
|
||||
proxy.resetForm('formRef');
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存记录单
|
||||
*/
|
||||
function submit() {
|
||||
if (title.value === '新增') {
|
||||
const insertParam = {
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
patientId: props.patientInfo.patientId,
|
||||
orgId: props.patientInfo.orgId,
|
||||
recordingTime: form.value.recordingTime,
|
||||
vitalSignsSyncFlag: form.value.vitalSignsSyncFlag ? form.value.vitalSignsSyncFlag : false,
|
||||
contextJson: JSON.stringify(form.value),
|
||||
};
|
||||
console.log(insertParam, 'insertParam');
|
||||
saveRecord(insertParam).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emit('close', 'success');
|
||||
reset();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const updateParamParam = {
|
||||
recordId: props.editData.recordId,
|
||||
encounterId: props.patientInfo.encounterId,
|
||||
patientId: props.patientInfo.patientId,
|
||||
orgId: props.patientInfo.orgId,
|
||||
recordingTime: form.value.recordingTime,
|
||||
vitalSignsSyncFlag: form.value.vitalSignsSyncFlag ? form.value.vitalSignsSyncFlag : false,
|
||||
contextJson: JSON.stringify(form.value),
|
||||
};
|
||||
console.log(updateParamParam, 'updateParamParam');
|
||||
updateRecord(updateParamParam).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emit('close', 'success');
|
||||
reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设定病情观测
|
||||
*/
|
||||
function setTemplate(row) {
|
||||
console.log(row, '设定病情观测');
|
||||
form.value.bqgcOther = row.contextJson;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理模板
|
||||
*/
|
||||
function openTemplateDialog() {
|
||||
recordTitle.value = '新增模板';
|
||||
openRecordTemplate.value = true;
|
||||
nextTick(() => {
|
||||
proxy.$refs['recordRemplateDialogRef'].show();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑护理模板
|
||||
*/
|
||||
function handleEditTemplate(row) {
|
||||
recordTitle.value = '编辑模板';
|
||||
openRecordTemplate.value = true;
|
||||
editData.value = row;
|
||||
nextTick(() => {
|
||||
proxy.$refs['recordRemplateDialogRef'].show();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭记录模板对话框
|
||||
*
|
||||
* 该函数用于关闭记录模板对话框。
|
||||
*/
|
||||
function closeRecordTemplateDialog(str) {
|
||||
openRecordTemplate.value = false;
|
||||
getTemplateListInfo();
|
||||
if (str === 'success') {
|
||||
proxy.$modal.msgSuccess('操作成功!');
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:deep(.pagination-container .el-pagination) {
|
||||
right: 20px !important;
|
||||
}
|
||||
|
||||
.input-select-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.input-select-container .el-input__inner,
|
||||
.input-select-container .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.flex-container {
|
||||
display: flex;
|
||||
align-items: center; /* 垂直居中对齐 */
|
||||
justify-content: flex-start; /* 水平起始对齐 */
|
||||
gap: 8px; /* 两个输入框之间的间距 */
|
||||
}
|
||||
|
||||
.flex-container label {
|
||||
margin: 0 8px; /* 标签的间距 */
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 获取患者列表
|
||||
*
|
||||
* @param query 查询参数对象,可以包含多个查询条件
|
||||
* @returns Promise<any> 返回一个Promise对象,解析后得到患者列表数据
|
||||
*/
|
||||
export function listPatient(query) {
|
||||
return request({
|
||||
url: '/nursing-record/patient-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取患者记录单
|
||||
*
|
||||
* @param query 查询参数对象,可以包含多个查询条件
|
||||
* @returns Promise<any> 返回一个Promise对象,解析后得到患者列表数据
|
||||
*/
|
||||
export function getNursingPatientPage(query) {
|
||||
return request({
|
||||
url: '/nursing-record/nursing-patient-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增记录单信息
|
||||
*
|
||||
*/
|
||||
export function saveRecord(data) {
|
||||
return request({
|
||||
url: '/nursing-record/save-nursing',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存记录单信息
|
||||
*
|
||||
*/
|
||||
export function updateRecord(data) {
|
||||
return request({
|
||||
url: '/nursing-record/update-nursing',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录单
|
||||
*/
|
||||
export function delRecord(data) {
|
||||
return request({
|
||||
url: '/nursing-record/delete-nursing',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*获取记录单模板列表
|
||||
*
|
||||
* @param query 查询参数对象,可以包含多个查询条件
|
||||
* @returns Promise<any> 返回一个Promise对象,解析后得到患者列表数据
|
||||
*/
|
||||
export function getRecordTemplateList(query) {
|
||||
return request({
|
||||
url: '/nursing-record/emr-template-page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增记录单模板
|
||||
*
|
||||
*/
|
||||
export function saveRecordTemplate(data) {
|
||||
return request({
|
||||
url: '/nursing-record/emr-template-save',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存记录单模板
|
||||
*
|
||||
*/
|
||||
export function updateRecordTemplate(data) {
|
||||
return request({
|
||||
url: '/nursing-record/emr-template-update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录单模板
|
||||
*/
|
||||
export function deleteRecordTemplate(data) {
|
||||
return request({
|
||||
url: '/nursing-record/emr-template-del',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="props.recordTitle"
|
||||
v-model="props.open"
|
||||
width="800px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<div>
|
||||
<span> 模板名称: </span>
|
||||
<el-input v-model="templateName" style="width: 260px; margin-top: 10px; margin-right: 20px" />
|
||||
<el-radio-group v-model="radio">
|
||||
<el-radio-button :label="1">个人</el-radio-button>
|
||||
<el-radio-button :label="2">科室</el-radio-button>
|
||||
<el-radio-button :label="3">全院</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<span> 模板内容: </span>
|
||||
<el-input
|
||||
v-model="contextJson"
|
||||
type="textarea"
|
||||
:rows="8"
|
||||
:autosize="{ minRows: 3, maxRows: 8 }"
|
||||
class="el-textarea"
|
||||
style="width: 80%; margin-top: 10px; margin-right: 20px"
|
||||
/>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { parse } from 'vue/compiler-sfc';
|
||||
import { saveRecordTemplate, updateRecordTemplate } from './api';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
const title = ref('');
|
||||
const templateName = ref('');
|
||||
const radio = ref(1);
|
||||
const contextJson = ref('');
|
||||
const userStore = useUserStore();
|
||||
|
||||
const emits = defineEmits(['close']);
|
||||
const props = defineProps({
|
||||
open: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
recordTitle: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
editData: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* 取得患者信息详细
|
||||
*/
|
||||
function show() {
|
||||
console.log(props.recordTitle, 'props.recordTitle', props.editData, 'props.editData');
|
||||
title.value = '';
|
||||
title.value = props.recordTitle;
|
||||
reset();
|
||||
if (title.value === '编辑模板') {
|
||||
console.log(typeof props.editData.useScopeCode, 'props.editData',props.editData.useScopeCode);
|
||||
templateName.value = props.editData.templateName;
|
||||
contextJson.value = props.editData.contextJson;
|
||||
radio.value = +props.editData.useScopeCode;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 弹窗确认操作,保存模板
|
||||
*/
|
||||
function submit() {
|
||||
console.log(title.value, 'title');
|
||||
if (title.value === '新增模板') {
|
||||
const insertParam = {
|
||||
templateName: templateName.value,
|
||||
templateTypeCode: '1',
|
||||
useScopeCode: radio.value,
|
||||
contextJson: contextJson.value,
|
||||
};
|
||||
|
||||
if (radio.value == 1) {
|
||||
insertParam.userId = userStore.id;
|
||||
} else if (radio.value == 2) {
|
||||
insertParam.userId = userStore.orgId;
|
||||
} else {
|
||||
insertParam.userId = '';
|
||||
}
|
||||
|
||||
console.log(insertParam, 'insertParam');
|
||||
saveRecordTemplate(insertParam).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emits('close', 'success');
|
||||
reset();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const updateParamParam = {
|
||||
id: props.editData.id,
|
||||
templateName: templateName.value,
|
||||
templateTypeCode: '1',
|
||||
useScopeCode: radio.value,
|
||||
contextJson: contextJson.value,
|
||||
};
|
||||
if (radio.value == 1) {
|
||||
updateParamParam.userId = userStore.id;
|
||||
} else if (radio.value == 2) {
|
||||
updateParamParam.userId = userStore.orgId;
|
||||
} else {
|
||||
updateParamParam.userId = '';
|
||||
}
|
||||
console.log(updateParamParam, 'updateParamParam');
|
||||
updateRecordTemplate(updateParamParam).then((res) => {
|
||||
if (res.code == 200) {
|
||||
emits('close', 'success');
|
||||
reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
emits('close');
|
||||
}
|
||||
|
||||
function reset() {
|
||||
templateName.value = '';
|
||||
contextJson.value = '';
|
||||
radio.value = 1;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
</script>
|
||||
343
openhis-ui-vue3/src/views/inpatientNurse/nursingRecord/index.vue
Normal file
343
openhis-ui-vue3/src/views/inpatientNurse/nursingRecord/index.vue
Normal file
@@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<div class="business-temperature" style="display: flex; justify-content: space-evenly">
|
||||
<el-card style="width: 35%">
|
||||
<template #header>
|
||||
<span style="vertical-align: middle">患者列表</span>
|
||||
</template>
|
||||
<div style="width: 100%">
|
||||
<el-input
|
||||
v-model="queryParams.searchKey"
|
||||
placeholder="请输入患者名/病历号"
|
||||
clearable
|
||||
style="width: 48%; margin-bottom: 10px; margin-right: 10px"
|
||||
@keyup.enter="getPatientListInfo"
|
||||
>
|
||||
</el-input>
|
||||
<el-button type="primary" style="margin-bottom: 10px" @click="getPatientListInfo">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-table
|
||||
ref="patientListRef"
|
||||
height="672"
|
||||
:data="patientList"
|
||||
row-key="encounterId"
|
||||
@row-click="viewPatient"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="bedLocationId_dictText" label="床号" min-width="50" />
|
||||
<el-table-column label="病历号" align="center" prop="patientBusNo" />
|
||||
<el-table-column label="姓名" align="center" prop="patientName" />
|
||||
<el-table-column label="性别" align="center" prop="genderEnum_enumText" />
|
||||
<el-table-column label="年龄" align="center" prop="ageString" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getPatientListInfo"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="width: 60%">
|
||||
<template #header>
|
||||
<span style="vertical-align: middle">护理记录</span>
|
||||
</template>
|
||||
<div style="width: 100%">
|
||||
<div style="width: 100%">
|
||||
<el-date-picker
|
||||
v-model="recordingTime"
|
||||
type="daterange"
|
||||
range-separator="~"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
placement="bottom"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 64%; margin-bottom: 10px; margin-right: 10px"
|
||||
/>
|
||||
<el-button type="primary" style="margin-bottom: 10px" @click="viewPatient(patientData)">
|
||||
搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button size="default" type="primary" @click="openAddTprDialog">新增</el-button>
|
||||
<el-button type="danger" plain @click="deletePrescription()" :disabled="false">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="patientListRef"
|
||||
height="680"
|
||||
:data="recordList"
|
||||
row-key="recordId"
|
||||
highlight-current-row
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="content.recordingTime" label="记录时间" width="180" />
|
||||
<el-table-column prop="content.tw" label="体温" width="80" />
|
||||
<el-table-column prop="content.systolicBloodPressure" label="收缩压" min-width="80" />
|
||||
<el-table-column prop="content.diastolicBloodPressure" label="舒张压" width="80" />
|
||||
<el-table-column prop="content.xl" label="心率" min-width="120" />
|
||||
<el-table-column prop="content.mb" label="脉搏" width="80" />
|
||||
<el-table-column prop="content.hx" label="呼吸" min-width="120" />
|
||||
<el-table-column prop="content.xy" label="血氧" width="80" />
|
||||
<el-table-column prop="content.bqgcOther" label="病情观察与护理记录" min-width="80" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleEdit(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="recordsTotal > 0"
|
||||
:total="recordsTotal"
|
||||
v-model:page="recordQueryParams.pageNo"
|
||||
v-model:limit="recordQueryParams.pageSize"
|
||||
@pagination="viewPatient(patientData)"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<add-nursing-record-dialog
|
||||
ref="addNursingRecordDialogRef"
|
||||
:open="openAddTpr"
|
||||
:patientId="patientId"
|
||||
:patientInfo="patientData"
|
||||
:editData="editData"
|
||||
:title="title"
|
||||
@close="closePatientDetialDialog"
|
||||
/>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import addNursingRecordDialog from './components/addNursingRecordDialog.vue';
|
||||
import { listPatient, getNursingPatientPage, delRecord } from './components/api';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
// 响应式数据
|
||||
const patientId = ref('');
|
||||
const data = ref(undefined);
|
||||
const openAddTpr = ref(false);
|
||||
const total = ref(0);
|
||||
const recordsTotal = ref(0);
|
||||
const recordList = ref([]);
|
||||
const contextJson = ref(undefined);
|
||||
const editData = ref({});
|
||||
const { proxy } = getCurrentInstance();
|
||||
const print = ref(null);
|
||||
const queryParams = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
searchKey: undefined,
|
||||
orgId: userStore.orgId,
|
||||
});
|
||||
|
||||
const recordQueryParams = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
|
||||
const patientData = ref({});
|
||||
const recordingTime = ref([
|
||||
// formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
// formatDateStr(new Date(), 'YYYY-MM-DD'),
|
||||
]);
|
||||
const title = ref('');
|
||||
const patientList = ref([]);
|
||||
const addNursingRecordDialogRef = ref(null);
|
||||
const selectedData = ref([]);
|
||||
|
||||
const ids = ref([]); // 存储选择的药品信息行数据
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
|
||||
getPatientListInfo();
|
||||
|
||||
/**
|
||||
* 患者列表
|
||||
*/
|
||||
function getPatientListInfo() {
|
||||
listPatient(queryParams.value).then((res) => {
|
||||
console.log(userStore, 'userStore', res);
|
||||
patientList.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看患者护理记录单
|
||||
*
|
||||
* @param row 患者数据对象
|
||||
*/
|
||||
function viewPatient(row) {
|
||||
patientData.value = row;
|
||||
patientData.value.orgId = userStore.orgId;
|
||||
|
||||
// recordQueryParams
|
||||
recordQueryParams.value.encounterId = row.encounterId;
|
||||
if (recordingTime.value.length > 0) {
|
||||
recordQueryParams.value.recordingTimeSTime = recordingTime.value[0] + ' 00:00:00';
|
||||
recordQueryParams.value.recordingTimeETime = recordingTime.value[1] + ' 23:59:59';
|
||||
} else {
|
||||
recordQueryParams.value.recordingTimeSTime = undefined;
|
||||
recordQueryParams.value.recordingTimeETime = undefined;
|
||||
}
|
||||
|
||||
recordList.value = [];
|
||||
getNursingPatientPage(recordQueryParams.value).then((response) => {
|
||||
recordList.value = [];
|
||||
// recordList.value = res.data.records;
|
||||
if (response.data && response.data.records.length > 0) {
|
||||
for (let i = 0; i < response.data.records.length; i++) {
|
||||
console.log(
|
||||
typeof response.data.records[i].contextJson,
|
||||
'typeofcontextJson',
|
||||
response.data.records[i]
|
||||
);
|
||||
if (typeof response.data.records[i].contextJson === 'string') {
|
||||
console.log('Parsing string...');
|
||||
try {
|
||||
contextJson.value = JSON.parse(response.data.records[i].contextJson);
|
||||
} catch (error) {
|
||||
console.error('Parsing error:', error);
|
||||
}
|
||||
} else {
|
||||
contextJson.value = response.data.records[i].contextJson; // 如果已经是对象
|
||||
}
|
||||
|
||||
contextJson.value.recordTime = contextJson.value.recordTime
|
||||
? moment(contextJson.value.recordTime).format('YYYY-MM-DD HH:mm:ss')
|
||||
: '';
|
||||
const tableItems = {
|
||||
content: contextJson.value,
|
||||
recordId: response.data.records[i].recordId,
|
||||
patientId: response.data.records[i].patientId,
|
||||
encounterId: response.data.records[i].encounterId,
|
||||
recordingTime: response.data.records[i].recordingTime,
|
||||
};
|
||||
recordList.value.push(tableItems);
|
||||
}
|
||||
} else {
|
||||
recordList.value = [];
|
||||
}
|
||||
console.log(recordList.value, 'recordList');
|
||||
recordsTotal.value = response.data.total;
|
||||
});
|
||||
console.log('查看患者体温单', row);
|
||||
proxy.$refs.addNursingRecordDialogRef.show(row);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开体征录入
|
||||
*/
|
||||
function openAddTprDialog() {
|
||||
if (!patientData.value.patientId) {
|
||||
proxy.$modal.msgError('请先选择患者!');
|
||||
return;
|
||||
}
|
||||
title.value = '新增';
|
||||
openAddTpr.value = true;
|
||||
|
||||
nextTick(() => {
|
||||
proxy.$refs['addNursingRecordDialogRef'].show();
|
||||
});
|
||||
console.log(openAddTpr.value, '打开体征录入对话框');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭新增体征弹窗
|
||||
*/
|
||||
function closePatientDetialDialog(str) {
|
||||
openAddTpr.value = false;
|
||||
viewPatient(patientData.value);
|
||||
if (str === 'success') {
|
||||
proxy.$modal.msgSuccess('操作成功!');
|
||||
}
|
||||
}
|
||||
|
||||
/** 选择条数 */
|
||||
function handleSelectionChange(selection) {
|
||||
console.log(selection, '选择条数');
|
||||
selectedData.value = selection.map((item) => ({ ...item })); // 存储选择的行数据
|
||||
ids.value = selection.map((item) => item.recordId);
|
||||
console.log(ids.value, '选择条数');
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑护理记录
|
||||
*/
|
||||
function handleEdit(row) {
|
||||
title.value = '编辑';
|
||||
openAddTpr.value = true;
|
||||
editData.value = row;
|
||||
nextTick(() => {
|
||||
proxy.$refs['addNursingRecordDialogRef'].show();
|
||||
});
|
||||
console.log(openAddTpr.value, '打开体征录入对话框');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除记录单
|
||||
*
|
||||
* @param index - 要删除的处方在列表中的索引
|
||||
*/
|
||||
function deletePrescription(index) {
|
||||
console.log(selectedData.value, '删除记录单');
|
||||
if (selectedData.value.length == 0) {
|
||||
proxy.$modal.msgWarning('请选择要删除的数据信息!');
|
||||
return;
|
||||
}
|
||||
console.log('deletePrescription删除', data);
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除以上数据!')
|
||||
.then(function () {
|
||||
return delRecord(selectedData.value);
|
||||
})
|
||||
.then(() => {
|
||||
viewPatient(patientData.value);
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.business-temperature {
|
||||
grid-template-columns: 100%;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
::v-deep .business-temperature .el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
.business1 {
|
||||
background: white;
|
||||
padding: 10px 16px;
|
||||
border-radius: 6px;
|
||||
height: 40%;
|
||||
justify-content: center;
|
||||
}
|
||||
.layui-form-label {
|
||||
line-height: 35px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.layui-input-inline {
|
||||
display: inline-block;
|
||||
}
|
||||
.business-temperature-sheet {
|
||||
display: grid;
|
||||
grid-template-columns: 59px 1px 780px;
|
||||
}
|
||||
::v-deep .business-temperature-sheet .el-icon-arrow-down {
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user