chenyc
2025-07-14 05c827fea632f004821cc746ba73880769fab7cd
src/views/home/components/suifangjilu/index.vue
@@ -1,717 +1,297 @@
<template>
    <div>
        <el-row>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
                <div class="tableDiv">
                    <el-scrollbar :height="(tableHeight-130)+'px'">
                    <table v-if="tableHeight > 0" >
                        <tr>
                            <th colspan="7" style="text-align: left">营养服务管理记录</th>
                        </tr>
                        <tr>
                            <td :rowspan="2+state.patientData.透析方案.length">基本信息</td>
                            <td>患者姓名</td>
                            <td>{{ patientsInfo.patientName }}</td>
                            <td>性别</td>
                            <td>{{ patientsInfo.patientGenderText }}</td>
                            <td>年龄</td>
                            <td><span v-if="patientsInfo.age">{{ patientsInfo.age }} 岁</span></td>
                        </tr>
                        <tr>
                            <td>身高</td>
                            <td>{{ state.patientData.身高 }} <span v-if="state.patientData.身高">(cm)</span></td>
                            <td>病史</td>
                            <td>{{ state.patientData.诊断 }}</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>
                            <td></td>
                            <td>手机使用度</td>
                            <td></td>
                            <td>营养服务类别</td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>知识接受度</td>
                            <td></td>
                            <td>临床依从性</td>
                            <td></td>
                            <td>营养服务认可度</td>
                            <td></td>
                        </tr>
                        <tr>
                            <th>项目</th>
                            <!-- <td>序号</td> -->
                            <th>项目内容</th>
                            <th>时间</th>
                            <th colspan="2">详情</th>
                            <th>备注</th>
                            <th>记录者</th>
                        </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>
                        </template>
                        <!-- 饮食管理 -->
                        <tr>
                            <td rowspan="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="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">饮食建议</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="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></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></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">随访</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></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>
                    </table>
                    </el-scrollbar>
                </div>
            </el-col>
    <div class="dietarySurvey-home" >
        <el-row v-if="patientsInfo.id"  style="padding-left: 10px;">
            <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="primary" plain @click="addItem">添加</el-button>
                </el-form-item>
            </el-form>
        </el-row>
        <div v-if="patientsInfo.id"  class="divcont">
            <el-table size="default" :data="state.tableData" stripe style="width: 100%"  :height="tableHe">
                <el-table-column fixed label="NO" type="index" widtd="80" >
                        <template #header>
                            <el-icon @click="onSubmit"><RefreshRight /></el-icon>
                        </template>
                    </el-table-column>
                    <el-table-column  prop="surveryTime" label="填表时间" show-overflow-tooltip >
                        <template #default="scope">
                            {{scope.row.updateTime?.substring(0,11)}}
                        </template>
                    </el-table-column>
                    <el-table-column   label="干体重" show-overflow-tooltip >
                        <template #default="scope">
                            {{scope.row.mode.干体重}}
                        </template>
                    </el-table-column>
                    <el-table-column   label="脱水量" show-overflow-tooltip >
                        <template #default="scope">
                            {{scope.row.mode.脱水量}}
                        </template>
                    </el-table-column>
                    <el-table-column   label="指导建议" show-overflow-tooltip >
                        <template #default="scope">
                            {{scope.row.mode.指导建议}}
                        </template>
                    </el-table-column>
                    <el-table-column   label="执行反馈" show-overflow-tooltip >
                        <template #default="scope">
                            {{scope.row.mode.执行反馈}}
                        </template>
                    </el-table-column>
                    <el-table-column  prop="surveryPersonName" label="填表人" show-overflow-tooltip />
                    <!-- <el-table-column  prop="updateTime" label="更新时间" show-overflow-tooltip /> -->
                    <el-table-column  label="操作" >
                        <template #default="scope">
                            <el-button size="small" @click="handleEdit(scope.$index, scope.row)">
                                    编辑
                            </el-button>
                            <el-button
                            size="small"
                            type="danger"
                            @click="handleDelete(scope.$index, scope.row)"
                            >
                                 删除
                            </el-button>
                        </template>
                    </el-table-column>
            </el-table>
            <el-pagination
                v-model:current-page="state.page"
                v-model:page-size="state.size"
                :page-sizes="[10, 20, 30, 40]"
                layout="total, sizes, prev, pager, next, jumper"
                :total="state.total"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                />
        </div>
        <el-empty v-if="!patientsInfo.id" description="无数据,请先选择患者"></el-empty>
        <editDietary ref="editDietaryRef"  @shuaxin="onSubmit"></editDietary>
    </div>
</template>
<script setup lang="ts">
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';
import {list,tiaochabiaoInfo,deleteId} from '/@/api/tiaochabiao/index'
import { computed, reactive, ref } from 'vue';
import { useRoute,useRouter } from 'vue-router';
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus';
import editDietary from './editDietary.vue'
const storesPat = usePatientsInfo();
const { patientsInfo } = storeToRefs(storesPat);
const props = defineProps(['tableHeight'])
const editDietaryRef=ref()
const router = useRouter()
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 state = reactive({
    tableData: {
        基本信息:{
            患者姓名:'',
            性别:'',
            年龄:'',
            身高:'',
            病史:'',
            听力视力障碍:'',
            透析频次:"",
            透析时长:"",
        },
    },
    patientData: {
        姓名: '',
        干体重: '',
        证件号: "",
        诊断: '',
        身高: '',
        上一次透前体重: '',
        干体重最近调整记录:[{干体重:'',调整日期:'',调整人:'',备注:""}],
        透析方案:[{透析频率: "", 透析时长: "", 透析方案: ""}]
    },
    // 隐私调差
    from1Datas:<any>[],
    // 风险筛查
    from2Datas:{},
    // 风险评估
    from3Datas:{},
    tableData: [],
    page:1,
    size:10,
    total:0,
    loading: false,
    formInline:{
        user: '',
        formTableName:'随访记录',
        date: [],
    },
    dialogTableVisible:false
})
const tableHe = computed(() => {
    return props.tableHeight - 130
    return (props.tableHeight-200)+'px'
})
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 handleSizeChange = (val: number) => {
  console.log(`${val} items per page`)
  state.size=val
  onSubmit()
}
const handleCurrentChange = (val: number) => {
  console.log(`current page: ${val}`)
  state.page=val
  onSubmit()
}
const onSubmit=()=>{
    console.log(state.formInline)
    const pasm={
        page: state.page,
        size: state.size,
        wherecondition:`survery_form_type=0 and patient_code='${patientsInfo.value.code}'`,
        ordercondition: 'survery_time desc'
    }
})
    if(state.formInline?.date?.length===2){
        pasm.wherecondition+=` and survery_time BETWEEN '${state.formInline.date[0]} 00:00:00' AND '${state.formInline.date[1]} 23:59:59'`
    }
    if(state.formInline?.formTableName){
        pasm.wherecondition+=`and suvery_form_name='${state.formInline.formTableName}'`
    }
    const loading = ElLoading.service({
        lock: true,
        text: 'Loading',
        background: 'rgba(0, 0, 0, 0.7)',
    })
    list(pasm).then(re=>{
        state.tableData=re.data.list.map((v: any) => {
                v.mode=JSON.parse(v.surveryJsonBody)
                return v;
            })
        state.total=re.data.total
    }).finally(()=>{
        loading.close()
    })
}
const addItem=()=>{
    editDietaryRef.value.openShow('add')
    // router.push({path:'/tiaochabiao1',query:{type:'add',id:0}})
}
// 第一步:定义子组件里面的方法
const getData = async (str: string) => {
    console.log("子组件获取显示数据!" + str);
    console.log(props.tableHeight)
    var pam = {
        patCode: patientsInfo.value.code,
const getData = (str: string) => {
    const pasm = {
        page: 1,
        size: 10,
        wherecondition:`survery_form_type=0 and patient_code='${patientsInfo.value.code}'`,
        ordercondition:'survery_time DESC'
    }
    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)
    if(state.formInline?.date?.length===2){
        pasm.wherecondition+=`and survery_time BETWEEN '${state.formInline.date[0]} 00:00:00' AND '${state.formInline.date[1]} 23:59:59'`
    }
    catch (error) {
        state.loading = false
        ElMessage.error('结果请求错误,请联系管理员!')
    if(state.formInline.formTableName){
        pasm.wherecondition+=`and suvery_form_name='${state.formInline.formTableName}'`
    }
    const loading = ElLoading.service({
        lock: true,
        text: 'Loading',
        background: 'rgba(0, 0, 0, 0.7)',
    })
    list(pasm).then(re=>{
        console.log(re)
        state.tableData=re.data.list.map((v: any) => {
            v.mode=JSON.parse(v.surveryJsonBody)
            return v;
        })
        state.total=re.data.total
    }).finally(()=>{
        loading.close()
    })
}
// 获取膳食调查表
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='GNRI'"
    const yinyangbiaodan1 = await list(pasm)
    return yinyangbiaodan1
    state.loading = true
}
// 第二步:暴露方法
defineExpose({ getData })
/**
 * 编辑
 */
const handleEdit = (index: number, row: any) => {
  console.log(index, row,state.formInline.formTableName)
  editDietaryRef.value.openShow('update',row)
}
const handleDelete = (index: number, row: any) => {
  console.log(index, row)
  ElMessageBox.confirm(
    '你确定要删除该条记录?',
    'Warning',
    {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
    }
  )
    .then(() => {
        deleteId(`id=${row.id}`).then(re=>{
            ElMessage.success('删除成功')
            onSubmit()
        }).catch(e=>{
            ElMessage.error('删除失败!')
        })
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消操作',
      })
    })
}
</script>
<style  lang="scss">
.tableDiv {
   table {
      width: 100%;
      border-collapse: collapse;
   }
   th,
   td {
      border: 1px solid #ddd;
      padding: 8px;
      text-align: center;
   }
   th {
      background-color: #409eff;
      font-weight: bold;
      color: #ffffff;
   }
   tr:nth-child(even) {
      background-color: #f2f2f2;
   }
   .note {
      color: #409eff;
      font-size: smaller;
   }
   .fontred {
      color: red;
      font-size: large;
   }
    .gridtable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #666666;border-collapse: collapse;width: 100%;}
    .gridtable th {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;}
    .gridtable td {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;min-width: 100px;}
    .input-underline {
        border: none; /* 移除所有边框 */
        border-bottom: 1px solid #ccc; /* 显示下边框 */
        outline: none; /* 移除点击输入框时浏览器可能会提供的默认轮廓线 */
        text-align: center;
    }
    .width50{
        width: 50px;
    }
.infinite-list {
    overflow: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}
.infinite-list .infinite-list-item {
  display: flex;
}
.divcont{
    overflow-y: auto; /* 垂直滚动条 */
}
</style>