<template>
|
<div class="dietarySurvey-item">
|
<el-dialog v-model="state.dialogTableVisible" title="MIS" :fullscreen="true" width="100%">
|
<div class="container" style="width: 100%; height: 100%; overflow: auto">
|
<div id="pinggu3">
|
<div>
|
<el-form size="small">
|
<div style="width: 100%">
|
<table id="tabledome" class="gridtable">
|
<tr>
|
<th colspan="2">
|
<el-form-item label="初次调查日期">
|
<el-date-picker readonly
|
v-model="state.tableData.初次调查日期"
|
type="date"
|
style="width: 100px"
|
placeholder=""
|
format="YYYY/MM/DD"
|
value-format="YYYY-MM-DD"
|
/>
|
</el-form-item>
|
</th>
|
<th colspan="2">
|
<el-form-item label="更新日期">
|
<el-date-picker readonly
|
v-model="state.tableData.更新日期"
|
type="date"
|
style="width: 100px"
|
placeholder=""
|
format="YYYY/MM/DD"
|
value-format="YYYY-MM-DD"
|
/>
|
</el-form-item>
|
</th>
|
<th colspan="2">
|
<el-form-item label="记录者">
|
<el-input v-model="state.tableData.记录者" style="width: 100px" readonly placeholder="" />
|
</el-form-item>
|
</th>
|
</tr>
|
<tr>
|
<th colspan="2">患者姓名:{{ patientsInfo.patientName }}</th>
|
<th colspan="2">年龄:{{ patientsInfo.age }}</th>
|
<th colspan="2">性别:{{ patientsInfo.patientGenderText }}</th>
|
</tr>
|
|
<tr>
|
<td colspan="3" style="text-align: center; background-color: antiquewhite">一、患者的相关病史</td>
|
<td colspan="3" style="text-align: center; background-color: antiquewhite">评分(ABCD=0123)</td>
|
</tr>
|
<tr>
|
<td colspan="3">1:干体重在过去的3-6个月总的变化</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.患者的相关病史.type">
|
<el-radio value="0">A:干体重没有减少或体重丢失<0.5kg</el-radio>
|
<el-radio value="1">B:体重丢失≥0.5kg,但<1kg</el-radio>
|
<el-radio value="2">C:体重丢失≥1kg,但<5%体重评分结果</el-radio>
|
<el-radio value="3">D:体重丢失≥5%体重</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">2:膳食摄入</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.膳食摄入.type">
|
<el-radio value="0">A:食欲很好,膳食模式没有改变</el-radio>
|
<el-radio value="1">B:固体食物摄入欠佳</el-radio>
|
<el-radio value="2">C:饮食中度减少,完全流质饮食</el-radio>
|
<el-radio value="3">D:低能量流质饮食,甚至饥饿</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">3:胃肠道症状</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.胃肠道症状.type">
|
<el-radio value="0">A:没有症状,食欲良好</el-radio>
|
<el-radio value="1">B:轻微的症状,偶尔恶心或呕吐</el-radio>
|
<el-radio value="2">C:有时呕吐,中度的胃肠道症状</el-radio>
|
<el-radio value="3">D:频繁腹泻、呕吐或严重的厌食症</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">4:营养相关损害</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.营养相关损害.type">
|
<el-radio value="0">A:正常,功能能力良好</el-radio>
|
<el-radio value="1">B:偶尔步行困难,经常感到疲惫</el-radio>
|
<el-radio value="2">C:独立活动困难(如去厕所)</el-radio>
|
<el-radio value="3">D:卧床或轮椅,或几乎没有身体活动能力</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">5:并发症和血透年限</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.并发症和血透年限.type">
|
<el-radio value="0">A:透析时间<1年,无其他疾病</el-radio>
|
<el-radio value="1">B:透析时间1-4年,轻度并发症(不包括多种慢性病:MCC)</el-radio>
|
<el-radio value="2">C:透析时间>4年,中度患其他疾病(包括一种)</el-radio>
|
<el-radio value="3">D:任何严重疾病,患有多种慢性病(≥2种)</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="6" style="text-align: center; background-color: antiquewhite">二、身体测量(根据SGA的资料)</td>
|
</tr>
|
<tr>
|
<td colspan="3">6:脂肪存量减少或皮下脂肪减少(眼球下方三头肌、二头肌、胸部)</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.脂肪存量减少或皮下脂肪减少.type">
|
<el-radio value="0">A:正常(没有变化)</el-radio>
|
<el-radio value="1">B:轻度</el-radio>
|
<el-radio value="2">C:中度</el-radio>
|
<el-radio value="3">D:重度</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">7:肌肉消耗的迹象(太阳穴、锁骨、肩胛骨肋骨、股四头肌、膝关节、骨节)</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.肌肉消耗的迹象.type">
|
<el-radio value="0">A:正常(没有变化)</el-radio>
|
<el-radio value="1">B:轻度</el-radio>
|
<el-radio value="2">C:中度</el-radio>
|
<el-radio value="3">D:重度</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">8:体重指数(BMI)</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.体重指数BMI.type">
|
<el-radio value="0">A:BMI>20</el-radio>
|
<el-radio value="1">B:BM1:16-17.99</el-radio>
|
<el-radio value="2">C:BMI:18-19.99</el-radio>
|
<el-radio value="3">D:BMI<16</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="6" style="text-align: center; background-color: antiquewhite">三、实验室数据</td>
|
</tr>
|
<tr>
|
<td colspan="3">9:血清白蛋白</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.血清白蛋白.type">
|
<el-radio value="0">A:≥4.0g/dl</el-radio>
|
<el-radio value="1">B:3.5-3.9g/dl</el-radio>
|
<el-radio value="2">C:3.0-3.4g/dl</el-radio>
|
<el-radio value="3">D:< 3.0g/dl</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="3">10:血清总铁结合力(TIBC))/血清转铁蛋白(TRF)</td>
|
<td colspan="3">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.血清总铁结合力.type">
|
<el-radio value="0">A:TIBC>250mg/dl或TRF>200mg/dl</el-radio>
|
<el-radio value="1">B:TIBC200-249mg/dl或TRF170-199mg/dl</el-radio>
|
<el-radio value="2">C:TIBC150-199mg/dl或TRF150-169mg/dl</el-radio>
|
<el-radio value="3">D:TIBC < 150mg/dl或TRF <150mg/dl</el-radio>
|
</el-radio-group>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="6" style="font-weight: 600">评分结果</td>
|
</tr>
|
<tr>
|
<td colspan="6" style="font-weight: 600">
|
评分标准:<8分 轻度营养不良;9-18分 中度营养不良;>18分 重度营养不良;正常分值范围:0-30分。
|
<br />
|
<br />
|
<br />
|
<div :style="{color:sum.color }">
|
最后得分:{{ sum.value }} ,评价:
|
<span v-if="sum.value <= 8">轻度营养不良</span>
|
<span v-if="sum.value > 8 && sum.value < 18">中度营养不良</span>
|
<span v-if="sum.value >= 18">重度营养不良</span>
|
</div>
|
|
<br />
|
<span></span>
|
</td>
|
</tr>
|
</table>
|
</div>
|
</el-form>
|
</div>
|
</div>
|
</div>
|
<template #footer>
|
<div class="dialog-footer" style="text-align: center">
|
<el-button @click="funhui">取消</el-button>
|
<el-button type="primary" @click="onSubmit"> 保存 </el-button>
|
<el-button v-if="state.viewInfo.id" type="primary" v-print="'#pinggu3'">
|
<el-icon><Printer /></el-icon>
|
打印
|
</el-button>
|
<el-button type="primary" v-if="state.viewInfo.id" @click="generatePDF">
|
<el-icon><Position /></el-icon>
|
导出
|
</el-button>
|
</div>
|
</template>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script setup lang="ts" name="visualizingLinkDemo2">
|
import html2pdf from 'html2pdf.js';
|
import { reactive, onMounted, onUnmounted, ref, computed } from 'vue';
|
import { formatDate } from '/@/utils/formatTime';
|
import { NextLoading } from '/@/utils/loading';
|
import { useUserInfo } from '/@/stores/userInfo';
|
import { usePatientsInfo } from '/@/stores/patientsInfo';
|
const storesPat = usePatientsInfo();
|
import { Add, update, deleteId, tiaochabiaoInfo } from '/@/api/tiaochabiao/index';
|
import { storeToRefs } from 'pinia';
|
import { useRoute, useRouter } from 'vue-router';
|
import { ElMessage } from 'element-plus';
|
const stores = useUserInfo();
|
const { patientsInfo } = storeToRefs(storesPat);
|
const { userInfos } = storeToRefs(stores);
|
const router = useRouter();
|
const emit = defineEmits(['shuaxin']);
|
const state = reactive({
|
dialogTableVisible: false,
|
tableData: {
|
表名: 'MIS',
|
初次调查日期: '',
|
填表日期: '',
|
更新日期: '',
|
记录者: '陈银成',
|
患者的相关病史: {
|
type: '',
|
input1: '',
|
},
|
膳食摄入: {
|
type: '',
|
input1: '',
|
},
|
胃肠道症状: {
|
type: '',
|
input1: '',
|
},
|
营养相关损害: {
|
type: '',
|
input1: '',
|
},
|
并发症和血透年限: {
|
type: '',
|
input1: '',
|
},
|
脂肪存量减少或皮下脂肪减少: {
|
type: '',
|
input1: '',
|
},
|
肌肉消耗的迹象: {
|
type: '',
|
input1: '',
|
},
|
体重指数BMI: {
|
type: '',
|
input1: '',
|
},
|
血清白蛋白: {
|
type: '',
|
input1: '',
|
},
|
血清总铁结合力: {
|
type: '',
|
input1: '',
|
},
|
结果:''
|
},
|
loading: false,
|
viewInfo: {
|
id: 0,
|
code: '',
|
clientCode: userInfos.value.clientCode,
|
patientCode: patientsInfo.value.code,
|
surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
|
surveryPerson: userInfos.value.code,
|
surveryJsonBody: '',
|
suveryFormName: '',
|
surveryFormType: 1,
|
updateTime: '',
|
},
|
});
|
// <span v-if="sum <= 8">轻度营养不良</span>
|
// <span v-if="sum > 8 && sum < 18">>
|
const sum = computed(() => {
|
let x = 0;
|
const res={
|
label:'',
|
value:0,
|
color:'',
|
}
|
for (let key in state.tableData) {
|
console.log(key + 'key==' + state.tableData[key]?.type);
|
if (Number(state.tableData[key]?.type)) {
|
x += Number(state.tableData[key]?.type);
|
}
|
}
|
if(x<=8){
|
res.label="轻度营养不良"
|
res.color='#E6A23C'
|
}else if(x > 8 && x < 18){
|
res.color='#E6A23C'
|
res.label="中度营养不良"
|
}else if(x >=18){
|
res.color='#F56C6C'
|
res.label="重度营养不良"
|
}else{
|
res.color='#303133'
|
res.label="正常"
|
}
|
res.value=x
|
return res;
|
});
|
const funhui = () => {
|
state.dialogTableVisible = false;
|
};
|
const onSubmit = () => {
|
console.log('submit!');
|
console.log(state.tableData);
|
state.tableData.结果=sum.value
|
const info: tiaochabiaoInfo = {
|
id: state.viewInfo.id,
|
surveryFormType: 1,
|
code: state.viewInfo.code,
|
clientCode: userInfos.value.clientCode,
|
patientCode: patientsInfo.value.code,
|
surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
|
surveryPerson: userInfos.value.code,
|
surveryJsonBody: JSON.stringify(state.tableData),
|
suveryFormName: 'MIS',
|
updateTime: '',
|
};
|
console.log(info);
|
if (info.id === 0) {
|
Add(info).then((re) => {
|
console.log(re.data);
|
state.dialogTableVisible = false;
|
emit('shuaxin');
|
});
|
} else if (info.id > 0) {
|
info.surveryTime = state.viewInfo.surveryTime;
|
update(info).then((re) => {
|
console.log(re.data);
|
state.dialogTableVisible = false;
|
emit('shuaxin');
|
});
|
}
|
};
|
// 第一步:定义子组件里面的方法
|
const getData = (str: string) => {
|
console.log('子组件获取显示数据!' + str);
|
state.loading = true;
|
};
|
// 打开查看或者编辑明细
|
const openShow = (type: string, mode: tiaochabiaoInfo) => {
|
console.log(type);
|
|
if (type === 'add') {
|
state.tableData.初次调查日期 = formatDate(new Date(), 'YYYY-mm-dd');
|
state.tableData.更新日期 = formatDate(new Date(), 'YYYY-mm-dd');
|
state.tableData.记录者 = userInfos.value.userName;
|
getPageInfo();
|
state.dialogTableVisible = true;
|
} else if (type === 'update') {
|
console.log('------------------------3333333333333333');
|
console.log(mode);
|
state.viewInfo = mode;
|
state.tableData = JSON.parse(mode.surveryJsonBody);
|
state.tableData.初次调查日期=mode.surveryTime
|
state.tableData.更新日期=mode.updateTime
|
state.dialogTableVisible = true;
|
}
|
};
|
const getPageInfo = () => {
|
state.tableData = {
|
表名: 'MIS',
|
初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
|
填表日期: '',
|
更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
|
记录者: userInfos.value.userName,
|
患者的相关病史: {
|
type: '',
|
input1: '',
|
},
|
膳食摄入: {
|
type: '',
|
input1: '',
|
},
|
胃肠道症状: {
|
type: '',
|
input1: '',
|
},
|
营养相关损害: {
|
type: '',
|
input1: '',
|
},
|
并发症和血透年限: {
|
type: '',
|
input1: '',
|
},
|
脂肪存量减少或皮下脂肪减少: {
|
type: '',
|
input1: '',
|
},
|
肌肉消耗的迹象: {
|
type: '',
|
input1: '',
|
},
|
体重指数BMI: {
|
type: '',
|
input1: '',
|
},
|
血清白蛋白: {
|
type: '',
|
input1: '',
|
},
|
血清总铁结合力: {
|
type: '',
|
input1: '',
|
},
|
结果:''
|
};
|
state.viewInfo = {
|
id: 0,
|
code: '',
|
clientCode: userInfos.value.clientCode,
|
patientCode: patientsInfo.value.code,
|
surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
|
surveryPerson: userInfos.value.code,
|
surveryJsonBody: '',
|
suveryFormName: '',
|
surveryFormType: 1,
|
updateTime: '',
|
};
|
};
|
const generatePDF=()=> {
|
const element = document.getElementById('pinggu3');
|
const opt = {
|
margin: 10,
|
filename: `${state.tableData.表名}.pdf`,
|
image: { type: 'jpeg', quality: 0.98 },
|
html2canvas: { scale: 2 },
|
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
};
|
html2pdf().set(opt).from(element).save();
|
|
}
|
// 第二步:暴露方法
|
defineExpose({ getData, openShow });
|
</script>
|
|
|
<style scoped lang="scss">
|
.gridtable {
|
font-family: verdana, arial, sans-serif;
|
font-size: 11px;
|
color: #333333;
|
border-width: 1px;
|
border-color: #666666;
|
border-collapse: collapse;
|
}
|
|
.gridtable th {
|
border-width: 1px;
|
padding: 8px;
|
border-style: solid;
|
text-align: left;
|
border-color: #666666;
|
background-color: #a4b0e2;
|
}
|
|
.gridtable td {
|
border-width: 1px;
|
padding: 8px;
|
border-style: solid;
|
border-color: #666666;
|
background-color: #ffffff;
|
}
|
</style>
|