<template>
|
<div class="dietarySurvey-item">
|
<el-dialog v-model="state.dialogTableVisible" title="营养膳食调查表" :fullscreen="true" width="100%">
|
<div class="container" style="width: 100%; height: 100%;overflow: auto;">
|
<div id='printFrom2'>
|
<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"
|
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"
|
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;"
|
placeholder="" />
|
</el-form-item>
|
</th>
|
|
</tr>
|
<tr>
|
<th colspan="6"> 一、饮食习惯调查 </th>
|
</tr>
|
<tr>
|
<td>
|
1.常吃的主食
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group
|
v-model="state.tableData.常吃的主食.type">
|
<el-checkbox value="精米面类">A.精米面类</el-checkbox>
|
<el-checkbox value="杂豆类">B.杂豆类</el-checkbox>
|
<el-checkbox value="粗粮">C.粗粮</el-checkbox>
|
<el-checkbox value="薯类">B.薯类</el-checkbox>
|
<el-checkbox value="其它">E.其它</el-checkbox>
|
|
</el-radio-group>
|
<span>
|
<el-input v-model="state.tableData.常吃的主食.input1"
|
style="max-width: 150px" placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
</span>
|
<span>食用份量</span>
|
<span>
|
<el-input v-model="state.tableData.常吃的主食.input2"
|
style="max-width: 150px" placeholder="">
|
<template #append>g/天</template>
|
</el-input>
|
</span>
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
2.常吃的蔬菜
|
</td>
|
<td colspan="5">
|
<el-form :inline="true" size="small" >
|
<el-form-item>
|
<el-radio-group v-model="state.tableData.常吃的蔬菜.type">
|
<el-checkbox value="叶菜">A.叶菜</el-checkbox>
|
<el-checkbox value="根茎类">B.根茎类</el-checkbox>
|
<el-checkbox value="瓜茄">C.瓜茄</el-checkbox>
|
<el-checkbox value="鲜豆">B.鲜豆</el-checkbox>
|
<el-checkbox value="菌藻">E.菌藻</el-checkbox>
|
</el-radio-group>
|
</el-form-item>
|
|
<el-form-item label="食用频率">
|
<el-input v-model="state.tableData.常吃的蔬菜.input1"
|
style="max-width: 150px" placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="食用份量">
|
<el-input v-model="state.tableData.常吃的蔬菜.input2"
|
style="max-width: 150px" placeholder="">
|
<template #append>g/天</template>
|
</el-input>
|
</el-form-item>
|
</el-form>
|
</td>
|
|
|
|
</tr>
|
<tr>
|
<td>
|
蔬菜日食用量
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.蔬菜日食用量.type">
|
<el-radio value="<300g">A.< 300g </el-radio>
|
<el-radio value="300g-500g">B.300g-500g</el-radio>
|
<el-radio value=">500g">C.> 500g</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
3.水果食用量及频率
|
</td>
|
<td colspan="5">
|
<el-input v-model="state.tableData.水果食用量及频率.input1" style="max-width: 150px"
|
placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
|
|
<el-input v-model="state.tableData.水果食用量及频率.input2"
|
style="max-width: 200px;margin-left: 10px" placeholder="">
|
<template #prepend>约</template>
|
<template #append>g/次</template>
|
</el-input>
|
<el-input style="max-width: 250px;margin-left: 10px"
|
v-model="state.tableData.水果食用量及频率.input3" placeholder="备注" />
|
</td>
|
</tr>
|
<tr>
|
<td>
|
4.常吃的肉类
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi" v-model="state.tableData.常吃的肉类.type">
|
<el-checkbox value="畜产品">A.畜产品</el-checkbox>
|
<el-checkbox value="禽产品">B.禽产品</el-checkbox>
|
<el-checkbox value="水产品类">C.水产品类</el-checkbox>
|
<el-checkbox value="蛋类">D.蛋类</el-checkbox>
|
<el-checkbox value="其他">E.其他</el-checkbox>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
食用频率以及份量
|
</td>
|
<td colspan="5">
|
<el-input v-model="state.tableData.常吃的肉类.input1" style="max-width: 150px"
|
placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
|
|
<el-input v-model="state.tableData.常吃的肉类.input2"
|
style="max-width: 200px;margin-left: 10px" placeholder="">
|
<template #prepend>约</template>
|
<template #append>g/次</template>
|
</el-input>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
5.常吃的大豆及其制品是
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi" v-model="state.tableData.常吃的肉类.type">
|
<el-checkbox value="大豆类">A.大豆类,具体为:
|
<el-input v-model="state.tableData.常吃的大豆及其制品是.input1"
|
style="max-width: 100px" placeholder="" />
|
</el-checkbox>
|
<el-checkbox value="非发酵豆制品">B.非发酵豆制品</el-checkbox>
|
<el-checkbox value="发酵豆制品">C.发酵豆制品</el-checkbox>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
食用频率以及份量
|
</td>
|
<td colspan="5">
|
<el-input v-model="state.tableData.常吃的大豆及其制品是.input1"
|
style="max-width: 150px" placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
|
|
<el-input v-model="state.tableData.常吃的大豆及其制品是.input2"
|
style="max-width: 200px;margin-left: 10px" placeholder="">
|
<template #prepend>约</template>
|
<template #append>g/次</template>
|
</el-input>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
6.坚果摄入量
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi" v-model="state.tableData.坚果摄入量.type">
|
<el-radio value="不吃">不吃</el-radio>
|
<el-radio value="吃">吃
|
<el-input v-model="state.tableData.坚果摄入量.input1"
|
style="max-width: 150px" placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
|
|
<el-input v-model="state.tableData.坚果摄入量.input2"
|
style="max-width: 200px;margin-left: 10px" placeholder="">
|
<template #prepend>约</template>
|
<template #append>g/次</template>
|
</el-input>
|
</el-radio>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
7.每天食用奶类的量:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.每天食用奶类的量.type">
|
|
<el-radio value="液态奶">A.液态奶 具体为:
|
<el-input v-model="state.tableData.每天食用奶类的量.input1"
|
style="max-width: 100px" placeholder="" />
|
</el-radio>
|
<el-radio value="酸奶">B.酸奶</el-radio>
|
<el-radio value="奶粉">C.奶粉 具体为:
|
<el-input v-model="state.tableData.每天食用奶类的量.input2"
|
style="max-width: 100px" placeholder="" />
|
</el-radio>
|
<el-radio value="奶酪">D.奶酪</el-radio>
|
<el-radio value="无">D.无</el-radio>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
8.每日饮水量、种类:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-input v-model="state.tableData.每日饮水量种类.input1"
|
style="max-width: 150px;margin-right: 20px" placeholder="">
|
<template #append>ml/d</template>
|
</el-input>
|
<el-form-item label="备注">
|
<el-input v-model="state.tableData.每日饮水量种类.type"
|
style="max-width: 150px" placeholder="">
|
</el-input>
|
|
</el-form-item>
|
</el-form-item>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
<td>
|
9.日食盐量:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-input v-model="state.tableData.日食盐量.input1" style="max-width: 150px;margin-right: 20px"
|
placeholder="">
|
<template #append>g</template>
|
</el-input>
|
|
<el-form-item label="调味品使用">
|
<el-input v-model="state.tableData.日食盐量.input2"
|
style="max-width: 150px" placeholder="">
|
|
</el-input>
|
|
|
</el-form-item>
|
</el-form-item>
|
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
10.烹饪油:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi" v-model="state.tableData.烹饪油.type">
|
|
<el-checkbox value="植物油">A.植物油,具体是:
|
<el-input v-model="state.tableData.烹饪油.input1"
|
style="max-width: 100px" placeholder="" />
|
</el-checkbox>
|
<el-checkbox value="动物油">B.动物油,具体是:
|
<el-input v-model="state.tableData.烹饪油.input2"
|
style="max-width: 100px" placeholder="" />
|
</el-checkbox>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
11.经常使用的烹饪方法:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.经常使用的烹饪方法.type">
|
<el-checkbox value="煎炸">A.煎炸</el-checkbox>
|
<el-checkbox value="烧煮">B.烧煮</el-checkbox>
|
<el-checkbox value="炖煨">C.炖煨</el-checkbox>
|
<el-checkbox value="滑炒">D.滑炒</el-checkbox>
|
<el-checkbox value="熏烤">E.熏烤</el-checkbox>
|
<el-checkbox value="其它">F.其它:
|
<el-input v-model="state.tableData.经常使用的烹饪方法.input1"
|
style="max-width: 100px" placeholder="" />
|
</el-checkbox>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
12.是否食用零食:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.是否食用零食.type">
|
<el-checkbox value="烟熏食品">A.烟熏食品</el-checkbox>
|
<el-checkbox value="油炸食品">B.油炸食品</el-checkbox>
|
<el-checkbox value="腌腊食品">C.腌腊食品</el-checkbox>
|
<el-checkbox value="饼干">D.饼干</el-checkbox>
|
<el-checkbox value="膨化食品">E.膨化食品</el-checkbox>
|
<el-checkbox value="快餐">F.快餐</el-checkbox>
|
<el-checkbox value="方便面">G.方便面</el-checkbox>
|
<el-checkbox value="火腿肠">H.火腿肠</el-checkbox>
|
<el-checkbox value="碳酸饮料">I.碳酸饮料</el-checkbox>
|
<el-checkbox value="辛辣食品">J.辛辣食品</el-checkbox>
|
<el-checkbox value="其它">K.其它:
|
<el-input v-model="state.tableData.是否食用零食.input1"
|
style="max-width: 100px" placeholder="" />
|
</el-checkbox>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
13.三餐怎么安排:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.三餐怎么安排.type">
|
<el-checkbox value="不吃">A.不吃</el-checkbox>
|
<el-checkbox value="在外面凑合吃">B.在外面凑合吃</el-checkbox>
|
<el-checkbox value="在家中简单吃">C.在家中简单吃</el-checkbox>
|
<el-checkbox value="在家中吃得近丰盛">D.在家中吃得近丰盛</el-checkbox>
|
<el-checkbox value="其它">F.其它:
|
<el-input v-model="state.tableData.三餐怎么安排.input1"
|
style="max-width: 100px" placeholder="" />
|
</el-checkbox>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
|
<tr>
|
<td>
|
14.每日膳食搭配::
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.每日膳食搭配.type">
|
<el-radio value="以荤为主">A.以荤为主</el-radio>
|
<el-radio value="荤素各半">B.荤素各半</el-radio>
|
<el-radio value="以素为">C.以素为主</el-radio>
|
<el-radio value="不吃素菜">D.不吃素菜</el-radio>
|
<el-radio value="全素食">E.全素食
|
</el-radio>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
15.一日三餐能按时:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.一日三餐能按时.type">
|
<el-radio value="按时">A.按时</el-radio>
|
<el-radio value="基本按时">B.基本按时</el-radio>
|
<el-radio value="很难按时">C.很难按时</el-radio>
|
<el-radio value="不按时">D.不按时</el-radio>
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
16.一日三餐中饮食结构最合理的是:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.一日三餐中饮食结构最合理的是.type">
|
<el-radio value="早餐">A.早餐</el-radio>
|
<el-radio value="中餐">B.中餐</el-radio>
|
<el-radio value="晚餐">C.晚餐</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
17.是否加餐:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi" v-model="state.tableData.是否加餐.type">
|
<el-radio value="是">A.是</el-radio>
|
<el-radio value="否">
|
<el-form-item label="B.否">
|
<el-input v-model="state.tableData.是否加餐.input1"
|
style="max-width: 150px" placeholder="">
|
<template #append>次/周</template>
|
</el-input>
|
<el-form-item>
|
<el-input v-model="state.tableData.是否加餐.input1"
|
style="max-width: 150px;margin-left: 10px;"
|
placeholder="">
|
<template #append>次/天</template>
|
</el-input>
|
</el-form-item>
|
</el-form-item>
|
|
</el-radio>
|
|
</el-radio-group>
|
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
18.三天饮食记录表(食材、份量)
|
</td>
|
<td>早餐</td>
|
<td>加餐</td>
|
<td>午餐</td>
|
<td>加餐</td>
|
<td>晚餐</td>
|
</tr>
|
<tr>
|
<td>
|
<el-form-item label="透析日一">
|
<el-date-picker v-model="state.tableData.三天饮食记录表.透析日1.日期" type="date"
|
style="width: 100px;" placeholder="" format="MM/DD"
|
value-format="YYYY-MM-DD" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日1.早餐" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日1.加餐1" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日1.午餐" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日1.加餐2" placeholder="" />
|
</el-form-item>
|
</td>
|
<td><el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日1.晚餐" placeholder="" />
|
</el-form-item>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<el-form-item label="非透析日">
|
<el-date-picker v-model="state.tableData.三天饮食记录表.非透析日.日期" type="date"
|
style="width: 100px;" placeholder="" format="MM/DD"
|
value-format="YYYY-MM-DD" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.非透析日.早餐" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.非透析日.加餐1" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.非透析日.午餐" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.非透析日.加餐2" placeholder="" />
|
</el-form-item>
|
</td>
|
<td><el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.非透析日.晚餐" placeholder="" />
|
</el-form-item>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<el-form-item label="透析日二">
|
<el-date-picker v-model="state.tableData.三天饮食记录表.透析日2.日期" type="date"
|
style="width: 100px;" placeholder="" format="MM/DD"
|
value-format="YYYY-MM-DD" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日2.早餐" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日2.加餐1" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日2.午餐" placeholder="" />
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日2.加餐2" placeholder="" />
|
</el-form-item>
|
</td>
|
<td><el-form-item>
|
<el-input v-model="state.tableData.三天饮食记录表.透析日2.晚餐" placeholder="" />
|
</el-form-item>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
19.每餐就餐时间:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.每餐就餐时间.type">
|
<el-radio value="小于5分钟">A.小于5分钟</el-radio>
|
<el-radio value="5-10分钟">B.5-10分钟</el-radio>
|
<el-radio value="10-20分钟">C.10-20分钟 </el-radio>
|
<el-radio value="20-30分钟">D.20-30分钟 </el-radio>
|
<el-radio value="30分钟">E.30分钟 </el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
20.你如何调节自己的饮食:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.你如何调节自己的饮食.type">
|
<el-radio value="随心所欲">A.随心所欲</el-radio>
|
<el-radio value="家人安排">B.家人安排</el-radio>
|
<el-radio value="自己合理控制">C.自己合理控制 </el-radio>
|
<el-radio value="仿照别人">D.仿照别人 </el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td>
|
21.你对合理膳食的基本要求知道多少:
|
</td>
|
<td colspan="5">
|
<el-form-item>
|
<el-radio-group class="elradiozdi"
|
v-model="state.tableData.你对合理膳食的基本要求知道多少.type">
|
<el-radio value="全知道">A.全知道</el-radio>
|
<el-radio value="基本知道">B.基本知道</el-radio>
|
<el-radio value="知道较少">C.知道较少 </el-radio>
|
<el-radio value="不了解">D.不了解 </el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</td>
|
|
</tr>
|
<tr>
|
<td style="background-color: antiquewhite;">
|
饮食指导建议:
|
</td>
|
|
<td colspan="5" style="background-color: antiquewhite;">
|
<!-- <textarea style="width: 100%;" row="3" col="4" placeholder="请输入"></textarea> -->
|
<el-form-item>
|
<el-input v-model="state.tableData.备注.input1" type="textarea"
|
:autosize="{ minRows: 2, maxRows: 6 }" placeholder="请饮食指导建议" />
|
</el-form-item>
|
</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="'#printFrom2'">
|
<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 } 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: {
|
表名: '营养膳食调查表',
|
初次调查日期: "",
|
填表日期: '',
|
更新日期: '',
|
记录者: '陈银成',
|
常吃的主食: {
|
type: '', //只能选择独居或者家庭
|
input1: '',
|
input2: '',
|
},
|
常吃的蔬菜: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
蔬菜日食用量: {
|
type: '',
|
input1: '',
|
},
|
水果食用量及频率: {
|
input1: '',
|
input2: '',
|
input3: ''
|
},
|
常吃的肉类: {
|
type: '',
|
input1: '',
|
input2: ''
|
},
|
常吃的大豆及其制品是: {
|
type: '',
|
input1: '',
|
input2: ''
|
},
|
坚果摄入量: {
|
type: '',
|
input1: '',
|
input2: ''
|
},
|
每天食用奶类的量: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
每日饮水量种类: {
|
type: '',
|
input1: '',
|
},
|
日食盐量: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
烹饪油: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
经常使用的烹饪方法: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
是否食用零食: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
三餐怎么安排: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
中晚餐如何搭配: {
|
type: '',
|
input1: '',
|
input2: '',
|
input3: '',
|
input4: '',
|
},
|
每日膳食搭配: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
一日三餐能按时: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
一日三餐中饮食结构最合理的是: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
是否加餐: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
|
三天饮食记录表: {
|
透析日1: { 日期: '', 早餐: '', 加餐1: '', 午餐: "", 加餐2: '', 晚餐: '' },
|
非透析日: { 日期: '', 早餐: '', 加餐1: '', 午餐: "", 加餐2: '', 晚餐: '' },
|
透析日2: { 日期: '', 早餐: '', 加餐1: '', 午餐: "", 加餐2: '', 晚餐: '' }
|
},
|
每餐就餐时间: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
你如何调节自己的饮食: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
你对合理膳食的基本要求知道多少: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
过敏食物: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
过敏症状表现为以下哪些: { type: '', input1: '', },
|
人员构成: {
|
type: '', //只能选择独居或者家庭
|
input1: '',
|
},
|
烹饪主要操作者: {
|
type: '',
|
input1: '',
|
},
|
食材采购: {
|
type: '',
|
input1: '',
|
},
|
食物偏好: {
|
type: '',
|
input1: '',
|
},
|
|
|
是否吸烟: { type: '', input1: '' },
|
是否饮酒: { type: '', input1: '', input2: '', input3: '' },
|
周运动频率: { type: '', input1: '', input2: '', input3: '' },
|
作息时间: { type: '', input1: '', input2: '' },
|
排便情况: { type: '', input1: '' },
|
备注: { type: '', input1: '' }
|
|
},
|
loading: false,
|
viewInfo: {
|
id: 0,
|
code: '',
|
surveryFormType: 0,
|
clientCode: userInfos.value.clientCode,
|
patientCode: patientsInfo.value.code,
|
surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
|
surveryPerson: userInfos.value.code,
|
surveryJsonBody: '',
|
suveryFormName: '营养膳食调查表',
|
updateTime: ''
|
}
|
|
})
|
|
const funhui = () => {
|
state.dialogTableVisible = false
|
}
|
const generatePDF=()=> {
|
const element = document.getElementById('printFrom2');
|
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();
|
|
}
|
const onSubmit = () => {
|
console.log('submit!')
|
console.log(state.tableData)
|
const info: tiaochabiaoInfo = {
|
id: state.viewInfo.id,
|
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: '营养膳食调查表',
|
surveryFormType: 0,
|
updateTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
|
}
|
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') {
|
getPageInfo()
|
state.dialogTableVisible = true
|
}
|
else if (type === 'update') {
|
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 = {
|
表名: '营养膳食调查表',
|
初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
|
填表日期: '',
|
更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
|
记录者: userInfos.value.userName,
|
常吃的主食: {
|
type: '', //只能选择独居或者家庭
|
input1: '',
|
input2: '',
|
},
|
常吃的蔬菜: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
蔬菜日食用量: {
|
type: '',
|
input1: '',
|
},
|
水果食用量及频率: {
|
input1: '',
|
input2: '',
|
input3: ''
|
},
|
常吃的肉类: {
|
type: '',
|
input1: '',
|
input2: ''
|
},
|
常吃的大豆及其制品是: {
|
type: '',
|
input1: '',
|
input2: ''
|
},
|
坚果摄入量: {
|
type: '',
|
input1: '',
|
input2: ''
|
},
|
每天食用奶类的量: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
每日饮水量种类: {
|
type: '',
|
input1: '',
|
},
|
日食盐量: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
烹饪油: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
经常使用的烹饪方法: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
是否食用零食: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
三餐怎么安排: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
中晚餐如何搭配: {
|
type: '',
|
input1: '',
|
input2: '',
|
input3: '',
|
input4: '',
|
},
|
每日膳食搭配: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
一日三餐能按时: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
一日三餐中饮食结构最合理的是: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
是否加餐: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
|
三天饮食记录表: {
|
透析日1: { 日期: '', 早餐: '', 加餐1: '', 午餐: "", 加餐2: '', 晚餐: '' },
|
非透析日: { 日期: '', 早餐: '', 加餐1: '', 午餐: "", 加餐2: '', 晚餐: '' },
|
透析日2: { 日期: '', 早餐: '', 加餐1: '', 午餐: "", 加餐2: '', 晚餐: '' }
|
},
|
每餐就餐时间: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
你如何调节自己的饮食: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
你对合理膳食的基本要求知道多少: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
过敏食物: {
|
type: '',
|
input1: '',
|
input2: '',
|
},
|
过敏症状表现为以下哪些: { type: '', input1: '', },
|
人员构成: {
|
type: '', //只能选择独居或者家庭
|
input1: '',
|
},
|
烹饪主要操作者: {
|
type: '',
|
input1: '',
|
},
|
食材采购: {
|
type: '',
|
input1: '',
|
},
|
食物偏好: {
|
type: '',
|
input1: '',
|
},
|
|
备注: { type: '', input1: '' },
|
是否吸烟: { type: '', input1: '' },
|
是否饮酒: { type: '', input1: '', input2: '', input3: '' },
|
周运动频率: { type: '', input1: '', input2: '', input3: '' },
|
作息时间: { type: '', input1: '', input2: '' },
|
排便情况: { type: '', input1: '' },
|
}
|
state.viewInfo= {
|
id: 0,
|
code: '',
|
surveryFormType: 0,
|
clientCode: userInfos.value.clientCode,
|
patientCode: patientsInfo.value.code,
|
surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
|
surveryPerson: userInfos.value.code,
|
surveryJsonBody: '',
|
suveryFormName: '营养膳食调查表',
|
updateTime: ''
|
}
|
}
|
|
// 第二步:暴露方法
|
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;
|
border-color: #666666;
|
background-color: #a4b0e2;
|
}
|
|
.gridtable td {
|
border-width: 1px;
|
padding: 8px;
|
border-style: solid;
|
border-color: #666666;
|
background-color: #ffffff;
|
}
|
</style>
|