<template>
|
<div class="personal layout-pd">
|
<el-form size="small" :inline="true" :model="state.formInline">
|
<el-form-item label="填报日期">
|
<el-date-picker
|
v-model="state.formInline.date"
|
type="daterange"
|
unlink-panels
|
range-separator="To"
|
start-placeholder="开始"
|
end-placeholder="结束"
|
:shortcuts="shortcuts"
|
format="YYYY/MM/DD"
|
value-format="YYYY-MM-DD"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="onSubmit">查询</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="success" @click="daochuExcel">导出</el-button>
|
</el-form-item>
|
</el-form>
|
|
<div class="scrollable-table" :style="{maxHeight:tableHe}">
|
<table id="tabledome" class="gridtable">
|
<thead>
|
<tr>
|
<th colspan="22">健康管理服务明细表</th>
|
</tr>
|
<tr>
|
<td colspan="10">服务单位:{{clientName}}</td>
|
<td colspan="22">服务期({{state.formInline.date[0]}}到{{state.formInline.date[1]}})</td>
|
</tr>
|
<tr>
|
<th rowspan="2">序号</th>
|
<th rowspan="2">姓名</th>
|
<th rowspan="2">干体重</th>
|
<th rowspan="2">最新生化检验数据更新</th>
|
<th colspan="5">营养风险&营养评估</th>
|
<th rowspan="2">膳食调查</th>
|
<th colspan="8">个性化饮食指导</th>
|
<th>团体宣教</th>
|
<th rowspan="2">随访跟进</th>
|
<th rowspan="2">营养咨询回复</th>
|
<th rowspan="2">购买套餐</th>
|
</tr>
|
<tr>
|
|
<th>NRS-2002</th>
|
<th>SGA</th>
|
<th>MIS</th>
|
<th>GNRI</th>
|
<th>PEW</th>
|
<!-- <th>膳食调查</th> -->
|
<!-- <th colspan="8">个性化饮食指导</th> -->
|
<th>控磷</th>
|
<th>控钾</th>
|
<th>控水</th>
|
<th>贫血</th>
|
<th>蛋白质</th>
|
<th>便秘</th>
|
<th>腹泻</th>
|
<th>体重管理</th>
|
<th style="color: red;">专题勾选</th>
|
|
|
</tr>
|
</thead>
|
<tbody>
|
|
<tr v-for="(row,index) in state.tableData" :key="index">
|
<td>{{index+1}}</td>
|
<td>{{row?.patientName}}</td>
|
<td>{{row?.patientDryWeight}}</td>
|
<td>{{row?.checkIsData?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['NRS-2002']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['SGA']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['MIS']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['GNRI']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['PEW']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['膳食生活调查表']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td>{{row?.surveryTimeMap?.['营养饮食指导方案']?.id?'✔':''}}</td>
|
<td></td>
|
<td>{{row?.surveryTimeMap?.['随访记录']?.id?'✔':''}}</td>
|
<td></td>
|
<td></td>
|
</tr>
|
|
</tbody>
|
<tfoot>
|
<tr>
|
<td colspan="3">合计</td>
|
<td>{{HJcheckIsData}}</td>
|
<td>{{HJNRS}}</td>
|
<td>{{HJSGA}}</td>
|
<td>{{HJMIS}}</td>
|
<td>{{HJGNRI}}</td>
|
<td>{{HJPEW}}</td>
|
|
<td>{{HJ膳食生活调查表}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td>{{HJ营养饮食指导方案}}</td>
|
<td></td>
|
<td>{{HJ随访记录}}</td>
|
<td></td>
|
<td></td>
|
</tr>
|
</tfoot>
|
</table>
|
</div>
|
</div>
|
</template>
|
|
<script setup lang="ts" name="personal">
|
import { reactive, computed, onMounted, ref } from 'vue';
|
import { formatAxis } from '/@/utils/formatTime';
|
import { storeToRefs } from 'pinia';
|
import { useUserInfo } from '/@/stores/userInfo';
|
import {nutritionalSummary} from '/@/api/Patients'
|
import {editUserInfo} from '/@/api/login'
|
import { ElLoading } from 'element-plus';
|
import * as XLSX from 'xlsx';
|
import {formatDate} from '/@/utils/formatTime'
|
const stores = useUserInfo();
|
const { userInfos } = storeToRefs(stores);
|
const shortcuts = [
|
{
|
text: '上一周',
|
value: () => {
|
const end = new Date()
|
const start = new Date()
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
return [start, end]
|
},
|
},
|
{
|
text: '上一个月',
|
value: () => {
|
const end = new Date()
|
const start = new Date()
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
return [start, end]
|
},
|
},
|
{
|
text: '前三个月',
|
value: () => {
|
const end = new Date()
|
const start = new Date()
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
return [start, end]
|
},
|
},
|
]
|
const clientName=computed(()=>{
|
return userInfos.value.clientName
|
})
|
const HJcheckIsData=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row.checkIsData){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
|
const HJNRS=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['NRS-2002']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJSGA=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['SGA']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJMIS=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['MIS']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJGNRI=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['GNRI']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJPEW=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['PEW']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJ膳食生活调查表=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['膳食生活调查表']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJ营养饮食指导方案=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['营养饮食指导方案']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const HJ随访记录=computed(()=>{
|
let x=0
|
if(state.tableData.length>0){
|
state.tableData.forEach(row => {
|
if(row?.surveryTimeMap?.['随访记录']?.id){
|
x++
|
}
|
});
|
}
|
return x
|
})
|
const tableHe = computed(() => {
|
let height = document.documentElement.clientHeight;
|
console.log('窗口高度')
|
const navDom = document.querySelector('.layout-navbars-breadcrumb-index');
|
if (navDom) {
|
height -= navDom.scrollHeight;
|
}
|
return height-60+'px'
|
})
|
// 当前时间提示语
|
const end = new Date()
|
const start = new Date()
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
const state = reactive({
|
tableData: <any>[],
|
page:1,
|
size:10,
|
total:0,
|
loading: false,
|
formInline:{
|
date: [formatDate(start,'YYYY-mm-dd'), formatDate(end,'YYYY-mm-dd')],
|
},
|
dialogTableVisible:false
|
})
|
const daochuExcel=()=>{
|
let table = document.getElementById('tabledome');
|
if (table) {
|
const wb = XLSX.utils.table_to_book(table, { sheet: "Sheet1" });
|
XLSX.writeFile(wb, "患者健康服务统计.xlsx"); // 文件名和扩展名可以根据需要更改
|
} else {
|
console.error("找不到指定的表格");
|
}
|
}
|
const onSubmit=()=>{
|
const pasm={
|
startTime:state.formInline.date[0]+ ' 00:00:00',
|
endTime:state.formInline.date[1]+ ' 23:59:59',
|
clientCode:userInfos.value.clientCode,
|
queryValue:''
|
}
|
console.log(pasm)
|
const loading = ElLoading.service({
|
lock: true,
|
text: 'Loading',
|
background: 'rgba(0, 0, 0, 0.7)',
|
})
|
nutritionalSummary(pasm).then(re=>{
|
console.log(re.data)
|
state.tableData=re.data
|
}).finally(()=>{
|
loading.close()
|
})
|
|
}
|
onMounted(()=>{
|
onSubmit()
|
})
|
</script>
|
|
<style scoped lang="scss">
|
.scrollable-table {
|
width: 100%;
|
overflow-y: auto;
|
display: block;
|
}
|
table {
|
width: 100%;
|
border-collapse: collapse;
|
}
|
thead, tfoot {
|
background-color: #f5f5f5;
|
position: sticky;
|
left: 0;
|
right: 0;
|
z-index: 2;
|
}
|
thead {
|
top: 0;
|
}
|
tfoot {
|
bottom: 0;
|
}
|
th, td {
|
padding: 8px 12px;
|
text-align: left;
|
border: 1px solid #ddd;
|
}
|
|
.gridtable {
|
width: 100%;
|
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;
|
border-color: #666666;
|
background-color: #a4b0e2;
|
}
|
|
.gridtable td {
|
border-width: 1px;
|
padding: 8px;
|
border-style: solid;
|
border-color: #666666;
|
background-color: #ffffff;
|
text-align: center;
|
}
|
</style>
|