chenyc
2024-12-21 83ef13dab87cb59fccf0514d7d47f2ca0cae9f0f
src/views/home/components/suifangjilu/index.vue
@@ -1,40 +1,64 @@
<template>
    <div>
        <el-row>
            <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                <div class="tableDiv">
                    <table>
                        <tr>
                            <th colspan="7" style="text-align: left">营养服务管理记录</th>
                        </tr>
                        <tr>
                            <td rowspan="3">基本信息</td>
                            <td :rowspan="2+state.patientData.透析方案.length">基本信息</td>
                            <td>患者姓名</td>
                            <td></td>
                            <td>{{ patientsInfo.patientName }}</td>
                            <td>性别</td>
                            <td></td>
                            <td>{{ patientsInfo.patientGenderText }}</td>
                            <td>年龄</td>
                            <td></td>
                            <td><span v-if="patientsInfo.age">{{ patientsInfo.age }} 岁</span></td>
                        </tr>
                        <tr>
                            
                           
                            <td>身高(m)</td>
                            <td></td>
                            <td>身高</td>
                            <td>{{ state.patientData.身高 }} <span v-if="state.patientData.身高">(cm)</span></td>
                            <td>病史</td>
                            <td></td>
                            <td>听力/视力障碍</td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>透析频次</td>
                            <td></td>
                            <td>透析时长</td>
                            <td></td>
                            <td>{{ state.patientData.诊断 }}</td>
                            <td>透龄</td>
                            <td></td>
                            <td>
                                <span v-if="patientsInfo.medHistoryStatByMonth">{{
                                    patientsInfo.medHistoryStatByMonth }}
                                (月)</span>
                            </td>
                        </tr>
                        <template v-for="(row,index) in state.patientData.透析方案" :key="index">
                            <tr v-if="index===0">
                                <td :rowspan="state.patientData.透析方案.length*1">透析方案</td>
                                <td>
                                    {{state.patientData.透析方案[index]?.透析方案}}
                                </td>
                                <td>频次</td>
                                <td>
                                    {{state.patientData.透析方案[index]?.透析频率}}
                                </td>
                                <td>时长</td>
                                <td>
                                    {{state.patientData.透析方案[index]?.透析时长}}
                                </td>
                            </tr>
                            <tr v-else>
                                <td>
                                    {{state.patientData.透析方案[index]?.透析方案}}
                                </td>
                                <td>频次</td>
                                <td>
                                    {{state.patientData.透析方案[index]?.透析频率}}
                                </td>
                                <td>时长</td>
                                <td>
                                    {{state.patientData.透析方案[index]?.透析时长}}
                                </td>
                            </tr>
                        </template>
                        <tr>
                            <td rowspan="2">其他</td>
                            <td>口腔功能</td>
@@ -53,129 +77,155 @@
                            <td></td>
                        </tr>
                        <tr>
                            <td>项目</td>
                            <td>序号</td>
                            <td>项目内容</td>
                            <td>时间</td>
                            <td>详情</td>
                            <td>备注</td>
                            <td>记录者</td>
                            <th>项目</th>
                            <!-- <td>序号</td> -->
                            <th>项目内容</th>
                            <th>时间</th>
                            <th colspan="2">详情</th>
                            <th>备注</th>
                            <th>记录者</th>
                        </tr>
                        <tr>
                            <td rowspan="4">食物过敏史及
                                <br/>胃肠功能评估</td>
                            <td rowspan="2">1</td>
                            <td rowspan="2">食物过敏源</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                        <!-- 食物过敏原 -->
                        <template v-for="(row,index) in state.from1Datas" :key="index">
                            <tr v-if="index===0">
                                <td :rowspan="state.from1Datas.length*2">
                                    食物过敏史及
                                    <br/>胃肠功能评估
                                </td>
                                <td :rowspan="state.from1Datas.length*1">食物过敏源</td>
                                <td>{{state.from1Datas[index]?.初次调查日期}}</td>
                                <td colspan="2">
                                    {{state.from1Datas[index]?.过敏食物?.type.join()}}
                                </td>
                                <td>
                                    {{state.from1Datas[index]?.过敏食物?.input1}}
                                </td>
                                <td>{{state.from1Datas[index]?.记录者}}</td>
                            </tr>
                            <tr v-else>
                                <td>{{state.from1Datas[index].初次调查日期}}</td>
                                <td colspan="2">
                                    {{state.from1Datas[index].过敏食物?.type.join()}}
                                </td>
                                <td>
                                    {{state.from1Datas[index].过敏食物?.input1}}
                                </td>
                                <td>{{state.from1Datas[index].记录者}}</td>
                            </tr>
                        </template>
                        <!--  胃肠功能评估 -->
                        <template v-for="(row,index) in state.from1Datas" :key="index">
                            <tr v-if="index===0">
                                <td :rowspan="state.from1Datas.length*1">胃肠功能评估</td>
                                <td>{{state.from1Datas[index].初次调查日期}}</td>
                                <td colspan="2" >
                                    <span v-if="state.from1Datas[index]?.胃肠道紊乱者?.type==='是'"></span>
                                    胃肠道紊乱者
                                </td>
                                <td>
                                    {{state.from1Datas[index]?.胃肠道紊乱者?.input1}}
                                </td>
                                <td>{{state.from1Datas[index]?.记录者}}</td>
                            </tr>
                            <tr v-else>
                                <td>{{state.from1Datas[index].初次调查日期}}</td>
                                <td colspan="2" >
                                    <span v-if="state.from1Datas[index]?.胃肠道紊乱者?.type==='是'"></span>
                                    胃肠道紊乱者
                                </td>
                                <td>
                                    {{state.from1Datas[index]?.胃肠道紊乱者?.input1}}
                                </td>
                                <td>{{state.from1Datas[index]?.记录者}}</td>
                            </tr>
                            
                            <td rowspan="2">2</td>
                            <td rowspan="2">胃肠功能评估</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        </template>
                        <!-- 饮食管理 -->
                        <tr>
                            <td rowspan="6">饮食管理</td>
                            <td rowspan="2">1</td>
                            <td rowspan="2">膳食调查</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td rowspan="2">2</td>
                            <td rowspan="2">饮食问题</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td rowspan="2">3</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td rowspan="2">饮食建议</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <!-- 生活方式管理 -->
                         <tr>
                            <td rowspan="4">生活方式管理</td>
                            <td rowspan="2">1</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">生活习惯</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            
                            <td rowspan="2">2</td>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">指导建议</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                         <!-- 用药管理 -->
                         <tr>
                            <td rowspan="6">用药管理</td>
                            <td rowspan="2">1</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">用药调查</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
@@ -187,10 +237,10 @@
                        </tr>
                        <tr>
                            
                            <td rowspan="2">2</td>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">用药监督</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
@@ -202,10 +252,10 @@
                        </tr>
                        <tr>
                            
                            <td rowspan="2">3</td>
                            <!-- <td rowspan="2">3</td> -->
                            <td rowspan="2">指导建议</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
@@ -218,16 +268,278 @@
                        <!-- 随访 -->
                        <tr>
                            <td rowspan="2">随访</td>
                            <td rowspan="2">1</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">随访情况</td>
                            <td></td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <!-- 营养筛查评估 -->
                        <tr>
                            <td rowspan="4">营养筛查评估</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">营养筛查结果</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">营养评估结果</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <!-- 数据评估 -->
                        <tr>
                            <td rowspan="12">数据评估</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">干体重</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">BMI </td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">3</td> -->
                            <td rowspan="2">生化指标 </td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">4</td> -->
                            <td rowspan="2">脱水量 </td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">5</td> -->
                            <td rowspan="2">血压 </td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">6</td> -->
                            <td rowspan="2">血糖 </td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td rowspan="8">个性化管理</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">指导目标</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">指导建议</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">3</td> -->
                            <td rowspan="2">指导方案</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">4</td> -->
                            <td rowspan="2">随访情况</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <!-- 效果反馈 -->
                        <tr>
                            <td rowspan="4">效果反馈</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">生化数据改善</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">主观感受改善</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <!-- 产品管理 -->
                        <tr>
                            <td rowspan="4">产品管理</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">好馨意</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">其他品牌</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td rowspan="4">健康营养宣教</td>
                            <!-- <td rowspan="2">1</td> -->
                            <td rowspan="2">生化指标</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <!-- <td rowspan="2">2</td> -->
                            <td rowspan="2">营养饮食</td>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="2"></td>
                            <td></td>
                            <td></td>
                        </tr>
@@ -235,27 +547,7 @@
                    </table>
                </div>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                <div class="tableDiv">
                    <table>
                        <tr>
                            <td rowspan="2">随访</td>
                            <td rowspan="2">1</td>
                            <td rowspan="2">随访情况</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>
                    </table>
                </div>
            </el-col>
        </el-row>
    </div>
    
@@ -265,32 +557,125 @@
import { storeToRefs } from 'pinia';
import { usePatientsInfo } from '/@/stores/patientsInfo';
import { computed, reactive } from 'vue';
import { ElMessage } from 'element-plus';
import { getPatData } from '/@/api/Patients';
import { list } from '/@/api/tiaochabiao';
const storesPat = usePatientsInfo();
const { patientsInfo } = storeToRefs(storesPat);
const props = defineProps(['tableHeight'])
const state = reactive({
    tableData: [],
    tableData: {
        基本信息:{
            患者姓名:'',
            性别:'',
            年龄:'',
            身高:'',
            病史:'',
            听力视力障碍:'',
            透析频次:"",
            透析时长:"",
        },
    },
    patientData: {
        姓名: '',
        干体重: '',
        证件号: "",
        诊断: '',
        身高: '',
        上一次透前体重: '',
        干体重最近调整记录:[{干体重:'',调整日期:'',调整人:'',备注:""}],
        透析方案:[{透析频率: "", 透析时长: "", 透析方案: ""}]
    },
    // 隐私调差
    from1Datas:<any>[],
    // 风险筛查
    from2Datas:{},
    // 风险评估
    from3Datas:{},
    loading: false,
})
const tableHe = computed(() => {
    return props.tableHeight - 130
})
const BMI = computed(() => {
    if (state.patientData.干体重 && state.patientData.身高) {
        return (Number(state.patientData.干体重) / (Number(state.patientData.身高) / 100 * Number(state.patientData.身高) / 100)).toFixed(2)
    } else {
        return ''
    }
})
// 第一步:定义子组件里面的方法
const getData = (str: string) => {
const getData = async (str: string) => {
    console.log("子组件获取显示数据!" + str);
    console.log(props.tableHeight)
    var pam = {
        patientCode: patientsInfo.value.code,
        page: 1,
        size: 100,
        orderType: 1,
        orderIsUse: 2,
        desc: 1,
        orderName: '',
        patCode: patientsInfo.value.code,
    }
    state.loading = true
    try {
        state.loading = true
        state.from1Datas=[]
        const [res1,fromData1,fromData2,fromData3] = await Promise.all([
            getPatData(pam),
            getFrom1(),
            getFrom2(),
            getFrom3()
        ])
        state.patientData = res1.data
        const from1 = fromData1
        if (from1.data.list.length >= 1) {
            from1.data.list.forEach((element:any) => {
                state.from1Datas.push(JSON.parse(element?.surveryJsonBody))
            });
        }
        console.log('饮食的------------------')
        console.log(state.from1Datas)
    }
    catch (error) {
        state.loading = false
        ElMessage.error('结果请求错误,请联系管理员!')
    }
}
// 获取膳食调查表
const getFrom1 = async () => {
    const pasm = {
        page: 0,
        size: 0,
        wherecondition: `survery_form_type=0 and patient_code='${patientsInfo.value.code}'`,
        ordercondition: 'survery_time desc'
    }
    pasm.wherecondition += "and suvery_form_name='膳食调查表'"
    const yinyangbiaodan1 = await list(pasm)
    return yinyangbiaodan1
}
// 营养风险筛查结果
const getFrom2 = async () => {
    const pasm = {
        page: 0,
        size: 0,
        wherecondition: `survery_form_type=1 and patient_code='${patientsInfo.value.code}'`,
        ordercondition: 'survery_time desc'
    }
    pasm.wherecondition += "and suvery_form_name='营养风险筛查表(NRS2002)'"
    const yinyangbiaodan1 = await list(pasm)
    return yinyangbiaodan1
}
// 营养评估结果
const getFrom3 = async () => {
    const pasm = {
        page: 0,
        size: 0,
        wherecondition: `survery_form_type=1 and patient_code='${patientsInfo.value.code}'`,
        ordercondition: 'survery_time desc'
    }
    pasm.wherecondition += "and suvery_form_name='GNIR营养评估分'"
    const yinyangbiaodan1 = await list(pasm)
    return yinyangbiaodan1
}
// 第二步:暴露方法
defineExpose({ getData })