<template>
|
<div class="dietarySurvey-item">
|
<el-dialog v-model="state.dialogTableVisible" title="SGA" :fullscreen="true" width="100%">
|
<div style="width: 100%; height: 100%;overflow: auto;">
|
<div id="pinggu2">
|
<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 v-model="state.tableData.初次调查日期" type="date" readonly
|
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 v-model="state.tableData.更新日期" type="date" readonly
|
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 rowspan="6">
|
(一)病史
|
|
</td>
|
<td colspan="2">目前体重?</td>
|
<td colspan="3">
|
<el-input v-model="state.tableData.您目前体重" style="max-width: 150px"
|
placeholder="">
|
<template #append>kg</template>
|
</el-input>
|
</td>
|
</tr>
|
<tr>
|
|
<td colspan="2">1.体重变化(过去6个月内的体重下降)</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.体重变化.type">
|
<el-radio :value="1">(1)无变化; </el-radio>
|
<el-radio :value="2">(2)<5%;</el-radio>
|
<el-radio :value="3">(3)5%~10%;</el-radio>
|
<el-radio :value="4">(4)>10%~15%;</el-radio>
|
<el-radio :value="5">(5)>15%</el-radio>
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.体重变化.type}})</td>
|
</tr>
|
|
<!-- 饮食 -->
|
<tr>
|
|
<td colspan="2">2.食物摄入</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.食物摄入.type">
|
<el-radio :value="1">(1)无变化; </el-radio>
|
<el-radio :value="2">(2)固体食物略少;</el-radio>
|
<el-radio :value="3">(3)全量流食或中度减少;</el-radio>
|
<el-radio :value="4">(4)低热卡流食;</el-radio>
|
<el-radio :value="5">(5)饥饿;</el-radio>
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.食物摄入.type}})</td>
|
</tr>
|
<tr>
|
|
<td colspan="2">3.胃肠道症状</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.胃肠道症状.type">
|
<el-radio :value="1">(1)无症状;</el-radio>
|
<el-radio :value="2">(2)恶心;</el-radio>
|
<el-radio :value="3">(3)呕吐或中度胃肠道症状;</el-radio>
|
<el-radio :value="4">(4)腹泻;</el-radio>
|
<el-radio :value="4">(5)严重厌食;</el-radio>
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.胃肠道症状.type}})</td>
|
|
</tr>
|
<tr>
|
|
<td colspan="2">4.活动能力(营养相关性活动能力下降)?</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.活动能力.type">
|
<el-radio :value="1">(1)无变化(改善);</el-radio>
|
<el-radio :value="2">(2)步行困难;</el-radio>
|
<el-radio :value="3">(3)日常活动困难:;</el-radio>
|
<el-radio :value="4">(4)轻度活动;</el-radio>
|
<el-radio :value="5">(5)完全卧床,没有或极少活动</el-radio>
|
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.活动能力.type}})</td>
|
|
</tr>
|
<tr>
|
|
<td colspan="2">5.并存病</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.并存病.type">
|
<el-radio :value="1">(1)MDH<12月,无其他健康问题;</el-radio>
|
<el-radio :value="2">(2)MDH 1~2年或轻度并存病;</el-radio>
|
<el-radio :value="3">(3)MDH 2~4年或>75 岁或中度并存病;</el-radio>
|
<el-radio :value="4">(4)MDH>4年或严重并存病;</el-radio>
|
<el-radio :value="5">(5)非常严重多发并存病;</el-radio>
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.并存病.type}})</td>
|
</tr>
|
|
|
<tr>
|
<td rowspan="2">
|
(二)体格检查
|
</td>
|
<td colspan="2">1.脂肪储存减少或皮下脂肪丢失(下眼眶、肱二头肌、肱三头肌及胸部)</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.脂肪储存减少或皮下脂肪丢失.type">
|
<el-radio :value="1">(1)无丢失;</el-radio>
|
<el-radio :value="2">(2)介于二者之间;</el-radio>
|
<el-radio :value="3">(3)中度丢失;</el-radio>
|
<el-radio :value="4">(4)介于二者之间;</el-radio>
|
<el-radio :value="5">(5)重度丢失;</el-radio>
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.脂肪储存减少或皮下脂肪丢失.type}})</td>
|
</tr>
|
<tr>
|
<td colspan="2">2.肌肉消耗征象(颞肌、锁骨、肩胛骨、肋骨、股四头肌、膝、骨间肌)</td>
|
<td colspan="2">
|
<el-radio-group class="elradiozdi" v-model="state.tableData.肌肉消耗征象.type">
|
<el-radio :value="1">(1)无消耗;</el-radio>
|
<el-radio :value="2">(2)介于二者之间;</el-radio>
|
<el-radio :value="3">(3)中度消耗;</el-radio>
|
<el-radio :value="4">(4)介于二者之间;</el-radio>
|
<el-radio :value="5">(5)重度消耗;</el-radio>
|
</el-radio-group>
|
</td>
|
<td colspan="1">计分:({{state.tableData.肌肉消耗征象.type}})</td>
|
</tr>
|
<tr>
|
<td colspan="1" rowspan="2">(三)SGA评分</td>
|
<td colspan="4" style="font-weight: 600; color: #000;">评分标准:
|
Q-SGA(透析营养评分)包括病史及体格检查两方面资料,包括体重、饮食、胃肠道症状、活动能力、并存病、脂肪丢失及肌肉消耗7个参数,
|
每一个参数按严重程度分为1、2、3、4、5分,最低分7分,最高分35分;7分提示营养良好,8~34分提示营养不良,35分提示严重营养不良。</td>
|
<td colspan="1" style="font-weight: 600; color: #000;">合计:({{sum.value}})</td>
|
</tr>
|
<tr>
|
<td colspan="5" style="font-weight: 600; color: #000;">
|
|
<p>评分结果: <b v-if="sum.value" :style="{color:sum.color}"> {{sum.label}}</b></p>
|
|
</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="'#pinggu2'">
|
<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';
|
import { getPatData } from '/@/api/Patients';
|
const stores = useUserInfo();
|
const { patientsInfo } = storeToRefs(storesPat);
|
const { userInfos } = storeToRefs(stores);
|
const router = useRouter()
|
const emit = defineEmits(["shuaxin"]);
|
const state = reactive({
|
dialogTableVisible: false,
|
tableData: {
|
表名: 'SGA',
|
初次调查日期: "",
|
填表日期: '',
|
更新日期: '',
|
记录者: '陈银成',
|
您目前体重: '',
|
体重变化: {
|
type: 0,
|
input1: '',
|
},
|
食物摄入: { type: 0 },
|
胃肠道症状: { type: 0 },
|
活动能力: { type: 0 },
|
并存病: { type: 0 },
|
进食5: { type: 0 },
|
进食6: { type: 0 },
|
脂肪储存减少或皮下脂肪丢失:{type: 0, input1: ''},
|
肌肉消耗征象:{type: 0, 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: 'SGA',
|
surveryFormType: 1,
|
updateTime: ''
|
}
|
|
})
|
const sum = computed(() => {
|
let heji=0
|
const res={
|
value:0,
|
label:'',
|
color:''
|
}
|
for (let key in state.tableData) {
|
if (state.tableData[key]?.type>0) {
|
heji+= state.tableData[key]?.type
|
}
|
}
|
if(heji>=35){
|
res.label='重度营养不良'
|
res.color='#F56C6C'
|
}else if(heji<=34&&heji>=8){
|
res.label='营养不良'
|
res.color='#E6A23C'
|
}else if(heji<8){
|
res.label='营养良好'
|
res.color='#67C23A'
|
}else{
|
res.label=''
|
}
|
res.value=heji
|
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: 'SGA',
|
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 = async (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
|
await 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 = async () => {
|
const res = await getPatData({ patCode: patientsInfo.value.code, })
|
state.tableData = {
|
表名: 'SGA',
|
初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
|
填表日期: '',
|
更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
|
记录者: userInfos.value.userName,
|
您目前体重: res.data.上一次透前体重,
|
体重变化: {
|
type: 0,
|
input1: '',
|
},
|
食物摄入: { type: 0 },
|
胃肠道症状: { type: 0 },
|
活动能力: { type: 0 },
|
并存病: { type: 0 },
|
进食5: { type: 0 },
|
进食6: { type: 0 },
|
脂肪储存减少或皮下脂肪丢失:{type: 0, input1: ''},
|
肌肉消耗征象:{type: 0, 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: 'SGA',
|
surveryFormType: 1,
|
updateTime: ''
|
}
|
}
|
const generatePDF=()=> {
|
const element = document.getElementById('pinggu2');
|
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>
|