chenyc
2024-11-20 028fddd36cc3189a042f0f8cb7d906477e5a4856
加方案功能
9个文件已修改
2个文件已添加
3249 ■■■■■ 已修改文件
src/views/home/components/editDietary.vue 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/editDietary2.vue 154 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/fangAn/editDietary.vue 1036 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/fangAn/index.vue 274 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/pingubiao/editDietary.vue 770 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/pingubiao/editDietary2.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/pingubiao/editDietary3.vue 859 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/pingubiao/editDietary4.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/pingubiao/editDietary5.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/pingubiao/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/home/components/editDietary.vue
@@ -41,8 +41,8 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.人员构成.type">
                                                    <el-radio value="A">A:独居</el-radio>
                                                    <el-radio value="B">B:家族</el-radio>
                                                    <el-radio value="独居">A:独居</el-radio>
                                                    <el-radio value="家族">B:家族</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -64,9 +64,9 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.烹饪主要操作者.type">
                                                    <el-radio value="A">A:自己</el-radio>
                                                    <el-radio value="B">B:配偶</el-radio>
                                                    <el-radio value="C">C:其他</el-radio>
                                                    <el-radio value="自己">A:自己</el-radio>
                                                    <el-radio value="配偶">B:配偶</el-radio>
                                                    <el-radio value="其他">C:其他</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -87,9 +87,9 @@
                                        <td colspan="3">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.食材采购.type">
                                                    <el-radio value="A">A:外采</el-radio>
                                                    <el-radio value="B">B:家种</el-radio>
                                                    <el-radio value="C">C:其他</el-radio>
                                                    <el-radio value="外采">A:外采</el-radio>
                                                    <el-radio value="家种">B:家种</el-radio>
                                                    <el-radio value="其他">C:其他</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -108,8 +108,8 @@
                                        <td colspan="3">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.食物偏好.type">
                                                    <el-radio value="A">A:有</el-radio>
                                                    <el-radio value="B">B:无</el-radio>
                                                    <el-radio value="有">A:有</el-radio>
                                                    <el-radio value="无">B:无</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -239,8 +239,8 @@
                                        <td colspan="3">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.外吃.type">
                                                    <el-radio value="A">A:有</el-radio>
                                                    <el-radio value="B">B:无</el-radio>
                                                    <el-radio value="有">A:有</el-radio>
                                                    <el-radio value="无">B:无</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -327,8 +327,8 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.运动.type">
                                                    
                                                    <el-radio value="B">B:无</el-radio>
                                                    <el-radio value="A">A:有</el-radio>
                                                    <el-radio value="无">B:无</el-radio>
                                                    <el-radio value="有">A:有</el-radio>
                                                </el-radio-group>
                                                <span>
                                                <el-input v-model="state.tableData.运动.input1" type="textarea"
@@ -355,8 +355,8 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.是否吸烟.type">
                                                    
                                                    <el-radio value="B">B:无</el-radio>
                                                    <el-radio value="A">A:有</el-radio>
                                                    <el-radio value="无">B:无</el-radio>
                                                    <el-radio value="有">A:有</el-radio>
                                                </el-radio-group>
                                                <span>
                                                    <el-input v-model="state.tableData.是否吸烟.input1" type="textarea"
@@ -372,8 +372,8 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.是否饮酒.type">
                                                    
                                                    <el-radio value="B">B:无</el-radio>
                                                    <el-radio value="A">A:有</el-radio>
                                                    <el-radio value="无">B:无</el-radio>
                                                    <el-radio value="有">A:有</el-radio>
                                                </el-radio-group>
                                                <span>
                                                    <el-input v-model="state.tableData.是否饮酒.input1" type="textarea"
@@ -395,8 +395,8 @@
                                        <td colspan="3">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.易过敏体质.type">
                                                    <el-radio value="A">A:否</el-radio>
                                                    <el-radio value="B">B:是</el-radio>
                                                    <el-radio value="有">A:否</el-radio>
                                                    <el-radio value="是">B:是</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -416,8 +416,8 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.胃肠道紊乱者.type">
                                                    <el-radio value="A">A:否</el-radio>
                                                    <el-radio value="B">B:是</el-radio>
                                                    <el-radio value="否">A:否</el-radio>
                                                    <el-radio value="是">B:是</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -435,14 +435,13 @@
                                        </td>
                                        <td colspan="3">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.过敏食物.type">
                                                <el-checkbox-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-checkbox-group>
                                              
                                            </el-form-item>
@@ -461,8 +460,8 @@
                                        <td colspan="3">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.宗教信仰.type">
                                                    <el-radio value="A">A:否</el-radio>
                                                    <el-radio value="B">B:是</el-radio>
                                                    <el-radio value="否">A:否</el-radio>
                                                    <el-radio value="是">B:是</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -638,7 +637,7 @@
        是否饮酒:{ type: '',input1: ''},
        易过敏体质: {type: '', input1: '',},
        胃肠道紊乱者: {type: '', input1: '',},
        过敏食物: {type: '', input1: '',},
        过敏食物: {type: [], input1: '',},
        宗教信仰: {type: '', input1: '',},
        过敏症状表现为以下哪些: {type: '', input1: '',},
        您是如何知道自己食物过敏: {type: '', input1: '',},
@@ -763,7 +762,7 @@
        是否饮酒:{ type: '',input1: ''},
        易过敏体质: {type: '', input1: '',},
        胃肠道紊乱者: {type: '', input1: '',},
        过敏食物: {type: '', input1: '',},
        过敏食物: {type: [], input1: '',},
        宗教信仰: {type: '', input1: '',},
        过敏症状表现为以下哪些: {type: '', input1: '',},
        您是如何知道自己食物过敏: {type: '', input1: '',},
src/views/home/components/editDietary2.vue
@@ -46,11 +46,11 @@
                                                <el-form-item>
                                                    <el-radio-group class="elradiozdi"
                                                        v-model="state.tableData.常吃的主食.type">
                                                        <el-checkbox value="A">A.精米面类</el-checkbox>
                                                        <el-checkbox value="B">B.杂豆类</el-checkbox>
                                                        <el-checkbox value="C">C.粗粮</el-checkbox>
                                                        <el-checkbox value="D">B.薯类</el-checkbox>
                                                        <el-checkbox value="E">E.其它</el-checkbox>
                                                        <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>
@@ -79,11 +79,11 @@
                                            <el-form :inline="true" size="small" >
                                                <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.常吃的蔬菜.type">
                                                    <el-checkbox value="A">A.叶菜</el-checkbox>
                                                    <el-checkbox value="B">B.根茎类</el-checkbox>
                                                    <el-checkbox value="C">C.瓜茄</el-checkbox>
                                                    <el-checkbox value="D">B.鲜豆</el-checkbox>
                                                    <el-checkbox value="E">E.菌藻</el-checkbox>
                                                    <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>
    
@@ -113,9 +113,9 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.蔬菜日食用量.type">
                                                    <el-radio value="A">A.小于300g </el-radio>
                                                    <el-radio value="B">B.300g-500g</el-radio>
                                                    <el-radio value="C">C.大于500g</el-radio>
                                                    <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>
@@ -149,11 +149,11 @@
                                        <td colspan="5">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.常吃的肉类.type">
                                                    <el-checkbox value="A">A.畜产品</el-checkbox>
                                                    <el-checkbox value="B">B.禽产品</el-checkbox>
                                                    <el-checkbox value="C">C.水产品类</el-checkbox>
                                                    <el-checkbox value="D">D.蛋类</el-checkbox>
                                                    <el-checkbox value="E">E.其他</el-checkbox>
                                                    <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>
@@ -185,12 +185,12 @@
                                        <td colspan="5">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.常吃的肉类.type">
                                                    <el-checkbox value="A">A.大豆类,具体为:
                                                    <el-checkbox value="大豆类">A.大豆类,具体为:
                                                        <el-input v-model="state.tableData.常吃的大豆及其制品是.input1"
                                                            style="max-width: 100px" placeholder="" />
                                                    </el-checkbox>
                                                    <el-checkbox value="B">B.非发酵豆制品</el-checkbox>
                                                    <el-checkbox value="C">C.发酵豆制品</el-checkbox>
                                                    <el-checkbox value="非发酵豆制品">B.非发酵豆制品</el-checkbox>
                                                    <el-checkbox value="发酵豆制品">C.发酵豆制品</el-checkbox>
                                                </el-radio-group>
                                            </el-form-item>
@@ -251,17 +251,17 @@
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.每天食用奶类的量.type">
                                                    <el-radio value="A">A.液态奶 具体为:
                                                    <el-radio value="液态奶">A.液态奶 具体为:
                                                        <el-input v-model="state.tableData.每天食用奶类的量.input1"
                                                            style="max-width: 100px" placeholder="" />
                                                    </el-radio>
                                                    <el-radio value="B">B.酸奶</el-radio>
                                                    <el-radio value="C">C.奶粉 具体为:
                                                    <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">D.奶酪</el-radio>
                                                    <el-radio value="E">D.无</el-radio>
                                                    <el-radio value="奶酪">D.奶酪</el-radio>
                                                    <el-radio value="无">D.无</el-radio>
                                                </el-radio-group>
                                            </el-form-item>
@@ -322,11 +322,11 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.烹饪油.type">
                                                    <el-checkbox value="A">A.植物油,具体是:
                                                    <el-checkbox value="植物油">A.植物油,具体是:
                                                        <el-input v-model="state.tableData.烹饪油.input1"
                                                            style="max-width: 100px" placeholder="" />
                                                    </el-checkbox>
                                                    <el-checkbox value="B">B.动物油,具体是:
                                                    <el-checkbox value="动物油">B.动物油,具体是:
                                                        <el-input v-model="state.tableData.烹饪油.input2"
                                                            style="max-width: 100px" placeholder="" />
                                                    </el-checkbox>
@@ -344,12 +344,12 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.经常使用的烹饪方法.type">
                                                    <el-checkbox value="A">A.煎炸</el-checkbox>
                                                    <el-checkbox value="B">B.烧煮</el-checkbox>
                                                    <el-checkbox value="C">C.炖煨</el-checkbox>
                                                    <el-checkbox value="D">D.滑炒</el-checkbox>
                                                    <el-checkbox value="E">E.熏烤</el-checkbox>
                                                    <el-checkbox value="F">F.其它:
                                                    <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>
@@ -367,17 +367,17 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.是否食用零食.type">
                                                    <el-checkbox value="A">A.烟熏食品</el-checkbox>
                                                    <el-checkbox value="B">B.油炸食品</el-checkbox>
                                                    <el-checkbox value="C">C.腌腊食品</el-checkbox>
                                                    <el-checkbox value="D">D.饼干</el-checkbox>
                                                    <el-checkbox value="E">E.膨化食品</el-checkbox>
                                                    <el-checkbox value="F">F.快餐</el-checkbox>
                                                    <el-checkbox value="G">G.方便面</el-checkbox>
                                                    <el-checkbox value="H">H.火腿肠</el-checkbox>
                                                    <el-checkbox value="I">I.碳酸饮料</el-checkbox>
                                                    <el-checkbox value="J">J.辛辣食品</el-checkbox>
                                                    <el-checkbox value="K">K.其它:
                                                    <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>
@@ -395,11 +395,11 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.三餐怎么安排.type">
                                                    <el-checkbox value="A">A.不吃</el-checkbox>
                                                    <el-checkbox value="B">B.在外面凑合吃</el-checkbox>
                                                    <el-checkbox value="C">C.在家中简单吃</el-checkbox>
                                                    <el-checkbox value="D">D.在家中吃得近丰盛</el-checkbox>
                                                    <el-checkbox value="F">F.其它:
                                                    <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>
@@ -418,11 +418,11 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.每日膳食搭配.type">
                                                    <el-radio value="A">A.以荤为主</el-radio>
                                                    <el-radio value="B">B.荤素各半</el-radio>
                                                    <el-radio value="C">C.以素为主</el-radio>
                                                    <el-radio value="D">D.不吃素菜</el-radio>
                                                    <el-radio value="E">E.全素食
                                                    <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>
@@ -438,10 +438,10 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.一日三餐能按时.type">
                                                    <el-radio value="A">A.按时</el-radio>
                                                    <el-radio value="B">B.基本按时</el-radio>
                                                    <el-radio value="C">C.很难按时</el-radio>
                                                    <el-radio value="D">D.不按时</el-radio>
                                                    <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>
@@ -456,9 +456,9 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.一日三餐中饮食结构最合理的是.type">
                                                    <el-radio value="A">A.早餐</el-radio>
                                                    <el-radio value="B">B.中餐</el-radio>
                                                    <el-radio value="C">C.晚餐</el-radio>
                                                    <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>
@@ -471,8 +471,8 @@
                                        <td colspan="5">
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi" v-model="state.tableData.是否加餐.type">
                                                    <el-radio value="A">A.是</el-radio>
                                                    <el-radio value="B">
                                                    <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="">
@@ -612,11 +612,11 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.每餐就餐时间.type">
                                                    <el-radio value="A">A.小于5分钟</el-radio>
                                                    <el-radio value="B">B.5-10分钟</el-radio>
                                                    <el-radio value="C">C.10-20分钟 </el-radio>
                                                    <el-radio value="D">D.20-30分钟 </el-radio>
                                                    <el-radio value="E">E.30分钟 </el-radio>
                                                    <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>
@@ -630,10 +630,10 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.你如何调节自己的饮食.type">
                                                    <el-radio value="A">A.随心所欲</el-radio>
                                                    <el-radio value="B">B.家人安排</el-radio>
                                                    <el-radio value="C">C.自己合理控制 </el-radio>
                                                    <el-radio value="D">D.仿照别人 </el-radio>
                                                    <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>
@@ -647,10 +647,10 @@
                                            <el-form-item>
                                                <el-radio-group class="elradiozdi"
                                                    v-model="state.tableData.你对合理膳食的基本要求知道多少.type">
                                                    <el-radio value="A">A.全知道</el-radio>
                                                    <el-radio value="B">B.基本知道</el-radio>
                                                    <el-radio value="C">C.知道较少 </el-radio>
                                                    <el-radio value="D">D.不了解 </el-radio>
                                                    <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>
src/views/home/components/fangAn/editDietary.vue
New file
@@ -0,0 +1,1036 @@
<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="printFrom1">
                    <div>
                        <el-form size="small">
                            <div style="width: 100%">
                                <table id="tabledome" class="gridtable">
                                    <tr>
                                        <th colspan="8">
                                            <el-row>
                                                <el-col :span="12">
                                                    <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>
                                                </el-col>
                                                <el-col :span="12">
                                                    <div style="text-align:right;width: 100%">
                                                        <span>营养师:</span> <el-input v-model="state.tableData.记录者"
                                                            style="width: 100px;" placeholder="" />
                                                    </div>
                                                </el-col>
                                            </el-row>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                            S:询问饮食营养状况、生活习惯</td>
                                    </tr>
                                    <tr>
                                        <td class="htr">食物过敏原</td>
                                        <td colspan="7">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.食物过敏原" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="食物过敏原" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">胃肠功能状况</td>
                                        <td colspan="7">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.胃肠功能状况" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="胃肠功能状况" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">蛋白粉补充情况</td>
                                        <td colspan="7">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.蛋白粉补充情况" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="蛋白粉补充情况" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">饮食回顾时间</td>
                                        <td class="htr">早餐</td>
                                        <td class="htr">加餐</td>
                                        <td class="htr">午餐</td>
                                        <td class="htr">加餐</td>
                                        <td class="htr">晚餐</td>
                                        <td class="htr">加餐</td>
                                        <td class="htr">其他</td>
                                    </tr>
                                    <tr>
                                        <td class="htr">透析日</td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.早餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.早加餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.午餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.午加餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.晚餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.加餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.透析日.其他" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">非透析日</td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.早餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.早加餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.午餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.午加餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.晚餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.加餐" placeholder="" />
                                        </td>
                                        <td>
                                            <el-input v-model="state.tableData.非透析日.其他" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">饮食问题</td>
                                        <td colspan="7">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.饮食问题" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="饮食问题" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr" rowspan="2">生活习惯</td>
                                        <td>大小便</td>
                                        <td>
                                            <el-input v-model="state.tableData.生活习惯.大小便" placeholder="" />
                                        </td>
                                        <td>睡眠</td>
                                        <td>
                                            <el-input v-model="state.tableData.生活习惯.睡眠" placeholder="" />
                                        </td>
                                        <td>运动</td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.生活习惯.运动" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>烟酒</td>
                                        <td>
                                            <el-input v-model="state.tableData.生活习惯.烟酒" placeholder="" />
                                        </td>
                                        <td>吞咽咀嚼功能</td>
                                        <td>
                                            <el-input v-model="state.tableData.生活习惯.吞咽咀嚼功能" placeholder="" />
                                        </td>
                                        <td>其他</td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.生活习惯.其他" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                            O:体格、生化营养状况检查</td>
                                    </tr>
                                    <tr>
                                        <td class="htr" rowspan="2">营养筛查评估</td>
                                        <td>营养风险筛查结果</td>
                                        <td colspan="6">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.营养筛查评估.营养风险筛查结果" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>营养评估结果</td>
                                        <td colspan="6">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.营养筛查评估.营养评估结果" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">异常生化指标</td>
                                        <td colspan="7">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.异常生化指标" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                            A:营养评估结果,计算所需摄入量</td>
                                    </tr>
                                    <tr>
                                        <td class="htr">营养指导初期目标</td>
                                        <td colspan="7">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.营养指导初期目标" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 3 }" placeholder="" />
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr" rowspan="6">营养师指导建议</td>
                                        <td rowspan="3">透析饮食指导</td>
                                        <td>能量</td>
                                        <td> <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.能量" placeholder="" />
                                        </td>
                                        <td>蛋白质</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.蛋白质" placeholder="" />
                                        </td>
                                        <td>优质蛋白</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.优质蛋白" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>钠</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.钠" placeholder="" />
                                        </td>
                                        <td>钾</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.钾" placeholder="" />
                                        </td>
                                        <td>磷</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.磷" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>饮水量</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.饮水量" placeholder="" />
                                        </td>
                                        <td>食物种类</td>
                                        <td colspan="3">
                                            <el-input v-model="state.tableData.营养师指导建议.透析饮食指导.食物种类" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td rowspan="3">特殊饮食指导</td>
                                        <td>高血压</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.高血压" placeholder="" />
                                        </td>
                                        <td>低蛋白血症</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.低蛋白血症" placeholder="" />
                                        </td>
                                        <td>贫血</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.贫血" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>高血糖</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.高血糖" placeholder="" />
                                        </td>
                                        <td>高磷血症</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.高磷血症" placeholder="" />
                                        </td>
                                        <td>低钙血症</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.低钙血症" placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>高尿酸</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.高尿酸" placeholder="" />
                                        </td>
                                        <td>高钾血症</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.高钾血症" placeholder="" />
                                        </td>
                                        <td>蛋白质能量摄入不足</td>
                                        <td>
                                            <el-input v-model="state.tableData.营养师指导建议.特殊饮食指导.蛋白质能量摄入不足"
                                                placeholder="" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                            P:饮食营养方案及食谱,定期随访并及时调整</td>
                                    </tr>
                                    <tr>
                                        <td class="htr">烹饪技巧</td>
                                        <td colspan="6">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.烹饪技巧" type="textarea"
                                                    :autosize="{ minRows: 2, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td>
                                            <el-button type="primary" :icon="Edit">模版</el-button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">食材选择</td>
                                        <td colspan="6">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.食材选择" type="textarea"
                                                    :autosize="{ minRows: 2, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td>
                                            <el-button type="primary" :icon="Edit">模版</el-button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">少盐控油</td>
                                        <td colspan="6">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.少盐控油" type="textarea"
                                                    :autosize="{ minRows: 2, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td>
                                            <el-button type="primary" :icon="Edit">模版</el-button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">适量饮水,量出为入</td>
                                        <td colspan="6">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.适量饮水量出为入" type="textarea"
                                                    :autosize="{ minRows: 2, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td>
                                            <el-button type="primary" :icon="Edit">模版</el-button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                            三天食谱(参考)</td>
                                    </tr>
                                    <tr>
                                        <td class="htr" colspan="2"></td>
                                        <td class="htr" colspan="2">第一天(透析日)</td>
                                        <td class="htr" colspan="2">第二天(非透析日)</td>
                                        <td class="htr" colspan="2">第三天(透析日)</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="htr">早餐</td>
                                        <td colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第一天.早餐" type="textarea"
                                                    :autosize="{ minRows: 2, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.第二天.早餐" type="textarea"
                                                :autosize="{ minRows: 2, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.第三天.早餐" type="textarea"
                                                :autosize="{ minRows: 2, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="lvse" colspan="2">加餐</td>
                                        <td class="lvse" colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第一天.早加餐" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td class="lvse" colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第二天.早加餐" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td class="lvse" colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第三天.早加餐" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="htr">午餐</td>
                                        <td colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第一天.午餐" type="textarea"
                                                    :autosize="{ minRows: 2, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.第二天.午餐" type="textarea"
                                                :autosize="{ minRows: 2, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.第三天.午餐" type="textarea"
                                                :autosize="{ minRows: 2, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="lvse" colspan="2">加餐</td>
                                        <td class="lvse" colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第一天.午加餐" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td class="lvse" colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第二天.午加餐" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td class="lvse" colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第三天.午加餐" type="textarea"
                                                    :autosize="{ minRows: 1, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="htr">晚餐</td>
                                        <td colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.第一天.晚餐" type="textarea"
                                                    :autosize="{ minRows: 3, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.第二天.晚餐" type="textarea"
                                                :autosize="{ minRows: 3, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.第三天.晚餐" type="textarea"
                                                :autosize="{ minRows: 3, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="htr">全天用油量</td>
                                        <td colspan="2">
                                            <el-form-item>
                                                <el-input v-model="state.tableData.三天食补参考.全天用油量" type="textarea"
                                                    :autosize="{ minRows: 3, maxRows: 6 }">
                                                </el-input>
                                            </el-form-item>
                                        </td>
                                        <td colspan="2" class="htr">
                                            全天食盐量
                                        </td>
                                        <td colspan="2">
                                            <el-input v-model="state.tableData.三天食补参考.全天食盐量" type="textarea"
                                                :autosize="{ minRows: 3, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                            食物替换法</td>
                                    </tr>
                                    <tr>
                                        <td class="htr">
                                            肉类
                                        </td>
                                        <td colspan="3">
                                            <el-input v-model="state.tableData.食物替换法.肉类" type="textarea"
                                                :autosize="{ minRows: 1, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                        <td class="htr">
                                            瓜菜
                                        </td>
                                        <td colspan="3">
                                            <el-input v-model="state.tableData.食物替换法.瓜菜" type="textarea"
                                                :autosize="{ minRows: 1, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="htr">
                                            肉类与豆腐、鸡蛋白
                                        </td>
                                        <td colspan="3">
                                            <el-input v-model="state.tableData.食物替换法.肉类与豆腐鸡蛋白" type="textarea"
                                                :autosize="{ minRows: 1, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                        <td class="htr">
                                            绿叶菜
                                        </td>
                                        <td colspan="3">
                                            <el-input v-model="state.tableData.食物替换法.绿叶菜" type="textarea"
                                                :autosize="{ minRows: 1, maxRows: 6 }">
                                            </el-input>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="font-weight: 800">
                                            1克盐=6.5克酱油=10克蚝油
                                        </td>
                                        <td class="htr">
                                            水果
                                        </td>
                                        <td colspan="3">
                                            <el-input v-model="state.tableData.食物替换法.水果" type="textarea"
                                                :autosize="{ minRows: 1, maxRows: 6 }">
                                            </el-input>
                                        </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="'#printFrom1'">
                        <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 { Edit } from '@element-plus/icons-vue'
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, list } 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: {
        表名: '患者方案表',
        初次调查日期: "",
        填表日期: '',
        更新日期: '',
        记录者: '陈银成',
        食物过敏原: "",
        胃肠功能状况: "",
        蛋白粉补充情况: "",
        透析日: {
            早餐: '',
            早加餐: '',
            午餐: '',
            午加餐: '',
            晚餐: '',
            加餐: '',
            其他: ''
        },
        非透析日: {
            早餐: '',
            早加餐: '',
            午餐: '',
            午加餐: '',
            晚餐: '',
            加餐: '',
            其他: ''
        },
        饮食问题: '',
        生活习惯: {
            大小便: '',
            睡眠: '',
            运动: '',
            烟酒: '',
            吞咽咀嚼功能: '',
            其他: ''
        },
        //O:体格、生化营养状况检查
        营养筛查评估: {
            营养风险筛查结果: '',
            营养评估结果: ''
        },
        异常生化指标: '',
        // A:营养评估结果,计算所需摄入量
        营养指导初期目标: '',//优先改善( )的问题,遵循血透饮食低磷低钾优质蛋白充足能量的饮食原则
        营养师指导建议: {
            透析饮食指导: {
                能量: "",
                蛋白质: '',//g
                优质蛋白: '',//g
                钠: '',
                钾: '',
                磷: '',
                饮水量: '',
                食物种类: '',
            },
            特殊饮食指导: {
                高血压: '',
                低蛋白血症: '',
                贫血: '',
                高血糖: '',
                高磷血症: '',
                低钙血症: '',
                高尿酸: '',
                高钾血症: '',
                蛋白质能量摄入不足: ''
            }
        },
        // P:饮食营养方案及食谱,定期随访并及时调整
        烹饪技巧: '',
        食材选择: '',
        少盐控油: '',
        适量饮水量出为入: '',
        三天食补参考: {
            第一天: {
                早餐: '',
                早加餐: '',
                午餐: '',
                午加餐: '',
                晚餐: '',
            },
            第二天: {
                早餐: '',
                早加餐: '',
                午餐: '',
                午加餐: '',
                晚餐: '',
            },
            第三天: {
                早餐: '',
                早加餐: '',
                午餐: '',
                午加餐: '',
                晚餐: '',
            },
            全天用油量: '',
            全天食盐量: '',
        },
        食物替换法: {
            肉类: '同等重量的瘦猪肉、瘦牛肉、鸡肉替换',
            瓜菜: '互相替换,如冬瓜、丝瓜、青瓜、节瓜',
            肉类与豆腐鸡蛋白: '',
            绿叶菜: '互相替换,如生菜、小白菜、红薯叶、油菜',
            水果: '互相替换,如苹果/梨/西瓜/桃子/火龙果等',
            其他: '1克盐=6.5克酱油=10克蚝油 水果 互相替换,如苹果/梨/西瓜/桃子/火龙果等'
        }
    },
    loading: false,
    viewInfo: {
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName: '营养指导报告',
        surveryFormType: 2,
        updateTime: ''
    }
})
const funhui = () => {
    state.dialogTableVisible = false
}
// 打印
const onPrint = () => {
}
const generatePDF = () => {
    const element = document.getElementById('printFrom1');
    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,
        surveryFormType: 2,
        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: '营养指导报告',
        updateTime: ''
    }
    console.log(info)
    if (info.id === 0) {
        Add(info).then(re => {
            console.log(re.data)
            state.dialogTableVisible = false
            emit('shuaxin')
        })
    } else if (info.id > 0) {
        info.surveryTime = state.viewInfo.surveryTime
        update(info).then(re => {
            console.log(re.data)
            state.dialogTableVisible = false
            emit('shuaxin')
        })
    }
}
const getPageInfo = async () => {
    state.tableData = {
        表名: '患者方案表',
        初次调查日期: "",
        填表日期: '',
        更新日期: '',
        记录者: '陈银成',
        食物过敏原: "",
        胃肠功能状况: "",
        蛋白粉补充情况: "",
        透析日: {
            早餐: '',
            早加餐: '',
            午餐: '',
            午加餐: '',
            晚餐: '',
            加餐: '',
            其他: ''
        },
        非透析日: {
            早餐: '',
            早加餐: '',
            午餐: '',
            午加餐: '',
            晚餐: '',
            加餐: '',
            其他: ''
        },
        饮食问题: '',
        生活习惯: {
            大小便: '',
            睡眠: '',
            运动: '',
            烟酒: '',
            吞咽咀嚼功能: '',
            其他: ''
        },
        //O:体格、生化营养状况检查
        营养筛查评估: {
            营养风险筛查结果: '',
            营养评估结果: ''
        },
        异常生化指标: '',
        // A:营养评估结果,计算所需摄入量
        营养指导初期目标: '',//优先改善( )的问题,遵循血透饮食低磷低钾优质蛋白充足能量的饮食原则
        营养师指导建议: {
            透析饮食指导: {
                能量: "",
                蛋白质: '',//g
                优质蛋白: '',//g
                钠: '',
                钾: '',
                磷: '',
                饮水量: '',
                食物种类: '',
            },
            特殊饮食指导: {
                高血压: '',
                低蛋白血症: '',
                贫血: '',
                高血糖: '',
                高磷血症: '',
                低钙血症: '',
                高尿酸: '',
                高钾血症: '',
                蛋白质能量摄入不足: ''
            }
        },
        // P:饮食营养方案及食谱,定期随访并及时调整
        烹饪技巧: '',
        食材选择: '',
        少盐控油: '',
        适量饮水量出为入: '',
        三天食补参考: {
            第一天: {
                早餐: '',
                早加餐: '',
                午餐: '',
                午加餐: '',
                晚餐: '',
            },
            第二天: {
                早餐: '',
                早加餐: '',
                午餐: '',
                午加餐: '',
                晚餐: '',
            },
            第三天: {
                早餐: '',
                早加餐: '',
                午餐: '',
                午加餐: '',
                晚餐: '',
            },
            全天用油量: '',
            全天食盐量: '',
        },
        食物替换法: {
            肉类: '同等重量的瘦猪肉、瘦牛肉、鸡肉替换',
            瓜菜: '互相替换,如冬瓜、丝瓜、青瓜、节瓜',
            肉类与豆腐鸡蛋白: '',
            绿叶菜: '互相替换,如生菜、小白菜、红薯叶、油菜',
            水果: '互相替换,如苹果/梨/西瓜/桃子/火龙果等',
            其他: '1克盐=6.5克酱油=10克蚝油 水果 互相替换,如苹果/梨/西瓜/桃子/火龙果等'
        }
    }
    const from1 = await getFrom1()
    const from2 = await getFrom2()
    const from3 = await getFrom3()
    if (from1.data.list.length >= 1) {
        const from1Json = JSON.parse(from1.data.list[0].surveryJsonBody)
        console.log(from1Json)
        state.tableData.食物过敏原= from1Json.过敏食物.type.join()
        state.tableData.胃肠功能状况=from1Json.胃肠道紊乱者.input1
        state.tableData.生活习惯.大小便=from1Json.排便情况.input1
        state.tableData.生活习惯.睡眠=from1Json.睡眠.input1
        state.tableData.生活习惯.吞咽咀嚼功能=from1Json.排便情况.input1
        state.tableData.生活习惯.烟酒=from1Json.是否吸烟.type+''+from1Json.是否饮酒.type
        state.tableData.生活习惯.运动=from1Json.运动.input1
        state.tableData.透析日.早餐=from1Json.三天饮食记录表.透析日1.早餐
        state.tableData.透析日.早加餐=from1Json.三天饮食记录表.透析日1.加餐1
        state.tableData.透析日.午餐=from1Json.三天饮食记录表.透析日1.午餐
        state.tableData.透析日.午加餐=from1Json.三天饮食记录表.透析日1.加餐2
        state.tableData.透析日.晚餐=from1Json.三天饮食记录表.透析日1.晚餐
        state.tableData.非透析日.早餐=from1Json.三天饮食记录表.非透析日.早餐
        state.tableData.非透析日.早加餐=from1Json.三天饮食记录表.非透析日.加餐1
        state.tableData.非透析日.午餐=from1Json.三天饮食记录表.非透析日.午餐
        state.tableData.非透析日天.午加餐=from1Json.三天饮食记录表.非透析日.加餐2
        state.tableData.非透析日.晚餐=from1Json.三天饮食记录表.非透析日.晚餐
    }
    if (from2.data.list.length >= 1) {
        const from2Json = JSON.parse(from2.data.list[0].surveryJsonBody)
        console.log(from2Json)
        state.tableData.营养筛查评估.营养风险筛查结果=from2Json.结果
    }
    if (from3.data.list.length >= 1) {
        const from3Json = JSON.parse(from3.data.list[0].surveryJsonBody)
        state.tableData.营养筛查评估.营养评估结果=from3Json.结果
        console.log(from3Json)
    }
}
// 获取膳食调查表
const getFrom1 = async () => {
    const pasm = {
        page: 0,
        size: 1,
        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: 1,
        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: 1,
        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
}
// 第一步:定义子组件里面的方法
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.dialogTableVisible = true
    }
}
// 第二步:暴露方法
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;
    text-align: center;
}
.htr {
    background-color: rgb(250, 236, 216);
    font-weight: 800;
}
.lvse {
    background-color: rgb(239.8, 248.9, 235.3);
}
</style>
src/views/home/components/fangAn/index.vue
New file
@@ -0,0 +1,274 @@
<template>
    <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.surveryTime?.substring(0,11)}}
                        </template>
                    </el-table-column>
                    <el-table-column  prop="surveryTime" label="调查表名称" show-overflow-tooltip >
                        <template #default="scope">
                            {{scope.row.suveryFormName}}
                        </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  @shuaxin="onSubmit" ref="editDietaryRef"></editDietary>
    </div>
</template>
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { usePatientsInfo } from '/@/stores/patientsInfo';
import {list,tiaochabiaoInfo,deleteId} from '/@/api/tiaochabiao/index'
import { computed, reactive, ref } from 'vue';
import editDietary from './editDietary.vue'
import { useRoute,useRouter } from 'vue-router';
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus';
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: [],
    page:1,
    size:10,
    total:0,
    loading: false,
    formInline:{
        user: '',
        formTableName:'',
        date: [],
    },
    dialogTableVisible:false
})
const tableHe = computed(() => {
    return (props.tableHeight-200)+'px'
})
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=2 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
        state.total=re.data.total
    }).finally(()=>{
        loading.close()
    })
}
const addItem=()=>{
    editDietaryRef.value.openShow('add')
}
// 第一步:定义子组件里面的方法
const getData = (str: string) => {
    const pasm = {
        page: 1,
        size: 10,
        wherecondition:`survery_form_type=2 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=>{
        console.log(re)
        state.tableData=re.data.list
        state.total=re.data.total
    }).finally(()=>{
        loading.close()
    })
    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">
    .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>
src/views/home/components/pingubiao/editDietary.vue
@@ -1,288 +1,197 @@
<template>
    <div class="dietarySurvey-item">
        <el-dialog  v-model="state.dialogTableVisible" title="营养风险筛查表(NRS2002)" :fullscreen="true" width="100%">
            <div class="container" style="width: 100%; height: 100%;overflow: auto;">
                <div>
                    <div>
                        <el-form size="small">
                            <div style="width: 100%">
                                <table id="tabledome" class="gridtable">
    <div class="dietarySurvey-item">
        <el-dialog v-model="state.dialogTableVisible" title="营养风险筛查表(NRS2002)" :fullscreen="true" width="100%">
            <div class="container" style="width: 100%; height: 100%; overflow: auto">
                <div>
                    <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="2">患者姓名:{{ patientsInfo.patientName }}</th>
                                        <th colspan="2">年龄:{{ patientsInfo.age }}</th>
                                        <th colspan="2">性别:{{ patientsInfo.patientGenderText }}</th>
                                    </tr>
                                    <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="2">
                                           患者姓名:{{patientsInfo.patientName}}
                                        </th>
                                        <th colspan="2">
                                            年龄:{{patientsInfo.age}}
                                        </th>
                                        <th colspan="2">性别:{{patientsInfo.patientGenderText}}</th>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="text-align: center;background-color: antiquewhite;">
                                            A、疾病状态(选最大分值)
                                        </td>
                                        <td colspan="1" style="text-align: center;background-color: antiquewhite;">
                                            分数
                                        </td>
                                        <td colspan="1" style="text-align: center;background-color: antiquewhite;">
                                            打分
                                            <!-- <el-radio-group class="elradiozdi"
                                    <tr>
                                        <td colspan="4" style="text-align: center; background-color: antiquewhite">A、疾病状态(选最大分值)</td>
                                        <td colspan="1" style="text-align: center; background-color: antiquewhite">分数</td>
                                        <td colspan="1" style="text-align: center; background-color: antiquewhite">
                                            打分
                                            <!-- <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.烹饪主要操作者.type">
                                                <el-radio value="1">打分</el-radio>
                                            </el-radio-group> -->
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            1:需要量轻度增加:一般恶性肿瘤、髋部骨折、长期血液透、糖尿病、慢性疾病有急性并发症(肝硬化、慢性阻塞性肺病)
                                        </td>
                                        <td colspan="1">
                                            1分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.疾病状态.type">
                                                <!-- <el-radio value="1">打分</el-radio> -->
                                                <el-radio value="1">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            2:需要量中度增加:腹部大手术,卒中,重度肺炎,血液恶性肿瘤
                                        </td>
                                        <td colspan="1">
                                            2分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.疾病状态.type">
                                                <!-- <el-radio value="2">打分</el-radio> -->
                                                <el-radio value="2">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            3:需要量明显增加;颅脑损伤、骨髓移植、重症监护
                                        </td>
                                        <td colspan="1">
                                            3分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.疾病状态.type">
                                                <!-- <el-radio value="3">打分</el-radio> -->
                                                <el-radio value="3">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="text-align: center;background-color: antiquewhite;">
                                            B、营养状态指标(选最大分值)
                                        </td>
                                        <td colspan="1" style="text-align: center;background-color: antiquewhite;">
                                            分数
                                        </td>
                                        <td colspan="1" style="text-align: center;background-color: antiquewhite;">
                                            打分
                                            <!-- <el-radio-group class="elradiozdi"
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">1:需要量轻度增加:一般恶性肿瘤、髋部骨折、长期血液透、糖尿病、慢性疾病有急性并发症(肝硬化、慢性阻塞性肺病)</td>
                                        <td colspan="1">1分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.疾病状态.type">
                                                <!-- <el-radio value="1">打分</el-radio> -->
                                                <el-radio value="1">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">2:需要量中度增加:腹部大手术,卒中,重度肺炎,血液恶性肿瘤</td>
                                        <td colspan="1">2分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.疾病状态.type">
                                                <!-- <el-radio value="2">打分</el-radio> -->
                                                <el-radio value="2">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">3:需要量明显增加;颅脑损伤、骨髓移植、重症监护</td>
                                        <td colspan="1">3分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.疾病状态.type">
                                                <!-- <el-radio value="3">打分</el-radio> -->
                                                <el-radio value="3">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="text-align: center; background-color: antiquewhite">B、营养状态指标(选最大分值)</td>
                                        <td colspan="1" style="text-align: center; background-color: antiquewhite">分数</td>
                                        <td colspan="1" style="text-align: center; background-color: antiquewhite">
                                            打分
                                            <!-- <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.烹饪主要操作者.type">
                                                <el-radio value="1">打分</el-radio>
                                            </el-radio-group> -->
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            1:正常营养状态
                                        </td>
                                        <td colspan="1">
                                            0分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.营养状态.type">
                                                <el-radio value="0">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            2:3个月内体重丢失>5%或者食物摄入比正常需要量低25%~50%
                                        </td>
                                        <td colspan="1">
                                            1分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.营养状态.type">
                                                <el-radio value="1">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            3:一般情况差或2个月内体重丢失>5%或者食物摄入比正常需要量低
                                        </td>
                                        <td colspan="1">
                                            2分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.营养状态.type">
                                                <el-radio value="2">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            4:BMI<18.5kg/m2,且一般情况差或1个月内体重丢失>5%
                                        </td>
                                        <td colspan="1">
                                            3分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.营养状态.type">
                                                <el-radio value="3">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="text-align: center;background-color: antiquewhite;">
                                            C、年龄评分
                                        </td>
                                        <td colspan="1" style="text-align: center;background-color: antiquewhite;">
                                            分数
                                        </td>
                                        <td colspan="1" style="text-align: center;background-color: antiquewhite;">
                                            打分
                                            <!-- <el-radio-group class="elradiozdi"
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">1:正常营养状态</td>
                                        <td colspan="1">0分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.营养状态.type">
                                                <el-radio value="0">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">2:3个月内体重丢失>5%或者食物摄入比正常需要量低25%~50%</td>
                                        <td colspan="1">1分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.营养状态.type">
                                                <el-radio value="1">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">3:一般情况差或2个月内体重丢失>5%或者食物摄入比正常需要量低</td>
                                        <td colspan="1">2分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.营养状态.type">
                                                <el-radio value="2">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">4:BMI<18.5kg/m2,且一般情况差或1个月内体重丢失>5%</td>
                                        <td colspan="1">3分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.营养状态.type">
                                                <el-radio value="3">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4" style="text-align: center; background-color: antiquewhite">C、年龄评分</td>
                                        <td colspan="1" style="text-align: center; background-color: antiquewhite">分数</td>
                                        <td colspan="1" style="text-align: center; background-color: antiquewhite">
                                            打分
                                            <!-- <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.烹饪主要操作者.type">
                                                <el-radio value="1">打分</el-radio>
                                            </el-radio-group> -->
                                        </td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">小于70 岁</td>
                                        <td colspan="1">0分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.年龄评分.type">
                                                <el-radio value="0">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">大于、等于70 岁</td>
                                        <td colspan="1">1分</td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.年龄评分.type">
                                                <el-radio value="1">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">营养风险筛查总分</td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="font-weight: 600">
                                            注:NRS-2002评分=A+B+C。如患者NRS-2002评分>=3分,则提示患者存在营养风险,应进行营养评定,并制定和实施营养支持治疗计划。
                                            <br />
                                            <br />
                                            <br />
                                            <div style="color: blue">
                                                最后得分:{{ sum }}, {{ sum >= 3 ? '患者存在营养风险,应进行营养评定,并制定和实施营养支持治疗计划。' : '无营养风险' }}
                                            </div>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            小于70 岁
                                        </td>
                                        <td colspan="1">
                                            0分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.年龄评分.type">
                                                <el-radio value="0">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4">
                                            大于、等于70 岁
                                        </td>
                                        <td colspan="1">
                                            1分
                                        </td>
                                        <td colspan="1">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.年龄评分.type">
                                                <el-radio value="1">✔</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                            营养风险筛查总分
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="font-weight: 600;">
                                            注:NRS-2002评分=A+B+C。如患者NRS-2002评分>=3分,则提示患者存在营养风险,应进行营养评定,并制定和实施营养支持治疗计划。
                                            <br>
                                            <br>
                                            <br>
                                            <div style="color: blue;">
                                                最后得分:{{sum}},  {{sum>=3?'患者存在营养风险,应进行营养评定,并制定和实施营养支持治疗计划。':'无营养风险'}}
                                            </div>
                                            <br>
                                            <span></span>
                                        </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>
                </div>
            </template>
        </el-dialog>
    </div>
                                            <br />
                                            <span></span>
                                        </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>
                </div>
            </template>
        </el-dialog>
    </div>
</template>
<script setup lang="ts" name="visualizingLinkDemo2">
@@ -292,180 +201,197 @@
import { useUserInfo } from '/@/stores/userInfo';
import { usePatientsInfo } from '/@/stores/patientsInfo';
const storesPat = usePatientsInfo();
import {Add,update,deleteId,tiaochabiaoInfo} from '/@/api/tiaochabiao/index'
import { Add, update, deleteId, tiaochabiaoInfo } from '/@/api/tiaochabiao/index';
import { storeToRefs } from 'pinia';
import { useRoute,useRouter } from 'vue-router';
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 router = useRouter();
const emit = defineEmits(['shuaxin']);
const state = reactive({
    dialogTableVisible:false,
    tableData: {
        表名: '营养风险筛查表(NRS2002)',
        初次调查日期:"",
        填表日期: '',
        更新日期: '',
        记录者: '陈银成',
        疾病状态: {
            type: '',
            input1: '',
        },
        营养状态: {
            type: '',
            input1: '',
        },
        年龄评分:{
            type: '',
            input1: '',
        }
    },
    loading: false,
    viewInfo:{
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName:'营养风险筛查表(NRS2002)',
        surveryFormType:1,
        updateTime: ''
    }
    dialogTableVisible: false,
    tableData: {
        表名: '营养风险筛查表(NRS2002)',
        初次调查日期: '',
        填表日期: '',
        更新日期: '',
        记录者: '陈银成',
        疾病状态: {
            type: '',
            input1: '',
        },
        营养状态: {
            type: '',
            input1: '',
        },
})
        年龄评分: {
            type: '',
            input1: '',
        },
        结果: '',
    },
    loading: false,
    viewInfo: {
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName: '营养风险筛查表(NRS2002)',
        surveryFormType: 1,
        updateTime: '',
    },
});
const sum = computed(() => {
    let x=0
    for(let key in state.tableData){
        console.log(key+'key=='+state.tableData[key]?.type)
        if(Number(state.tableData[key]?.type)){
            x+=Number(state.tableData[key]?.type)
        }
    }
    return x
})
const funhui=()=>{
    state.dialogTableVisible=false
}
    let x = 0;
    for (let key in state.tableData) {
        console.log(key + 'key==' + state.tableData[key]?.type);
        if (Number(state.tableData[key]?.type)) {
            x += Number(state.tableData[key]?.type);
        }
    }
    return x;
});
const funhui = () => {
    state.dialogTableVisible = false;
};
const onSubmit = () => {
  console.log('submit!')
  console.log(state.tableData)
  const info:tiaochabiaoInfo={
    id: state.viewInfo.id,
    surveryFormType:1,
    code: state.viewInfo.code,
    clientCode: userInfos.value.clientCode,
    patientCode: patientsInfo.value.code,
    surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
    surveryPerson: userInfos.value.code,
    surveryJsonBody: JSON.stringify(state.tableData),
    suveryFormName:'营养风险筛查表(NRS2002)',
    updateTime: ''
  }
  console.log(info)
  if(info.id===0){
    Add(info).then(re=>{
        console.log(re.data)
        state.dialogTableVisible=false
        emit('shuaxin')
    })
  }else if(info.id>0){
    info.surveryTime=state.viewInfo.surveryTime
    update(info).then(re=>{
        console.log(re.data)
        state.dialogTableVisible=false
        emit('shuaxin')
    })
  }
}
    console.log('submit!');
    console.log(state.tableData);
    let x = 0;
    for (let key in state.tableData) {
        console.log(key + 'key==' + state.tableData[key]?.type);
        if (Number(state.tableData[key]?.type)) {
            x += Number(state.tableData[key]?.type);
        }
    }
    if(x>=3){
        state.tableData.结果= '患者存在营养风险,应进行营养评定,并制定和实施营养支持治疗计划。'
    }else{
        state.tableData.结果='无营养风险'
    }
    const info: tiaochabiaoInfo = {
        id: state.viewInfo.id,
        surveryFormType: 1,
        code: state.viewInfo.code,
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: JSON.stringify(state.tableData),
        suveryFormName: '营养风险筛查表(NRS2002)',
        updateTime: '',
    };
    console.log(info);
    if (info.id === 0) {
        Add(info).then((re) => {
            console.log(re.data);
            state.dialogTableVisible = false;
            emit('shuaxin');
        });
    } else if (info.id > 0) {
        info.surveryTime = state.viewInfo.surveryTime;
        update(info).then((re) => {
            console.log(re.data);
            state.dialogTableVisible = false;
            emit('shuaxin');
        });
    }
};
// 第一步:定义子组件里面的方法
const getData = (str: string) => {
    console.log("子组件获取显示数据!" + str);
    state.loading = true
}
    console.log('子组件获取显示数据!' + str);
    state.loading = true;
};
// 打开查看或者编辑明细
const openShow = (type: string,mode:tiaochabiaoInfo) => {
    console.log(type)
    if(type==='add'){
        state.tableData.初次调查日期=formatDate(new Date(),'YYYY-mm-dd')
        state.tableData.更新日期=formatDate(new Date(),'YYYY-mm-dd')
        state.tableData.记录者=userInfos.value.userName
        getPageInfo()
        state.dialogTableVisible = true
    }
    else if(type==='update'){
        console.log('------------------------3333333333333333')
        console.log(mode)
        state.viewInfo=mode
        state.tableData=JSON.parse(mode.surveryJsonBody)
        state.dialogTableVisible = true
const openShow = (type: string, mode: tiaochabiaoInfo) => {
    console.log(type);
    if (type === 'add') {
        state.tableData.初次调查日期 = formatDate(new Date(), 'YYYY-mm-dd');
        state.tableData.更新日期 = formatDate(new Date(), 'YYYY-mm-dd');
        state.tableData.记录者 = userInfos.value.userName;
        getPageInfo();
        console.log(state.tableData);
        state.dialogTableVisible = true;
    } else if (type === 'update') {
        console.log('------------------------3333333333333333');
        console.log(mode);
        state.viewInfo = mode;
        state.tableData = JSON.parse(mode.surveryJsonBody);
        state.dialogTableVisible = true;
    }
};
const getPageInfo = () => {
    state.tableData = {
        表名: '营养风险筛查表(NRS2002)',
        初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
        填表日期: '',
        更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
        记录者: userInfos.value.userName,
        疾病状态: {
            type: '',
            input1: '',
        },
        营养状态: {
            type: '',
            input1: '',
        },
    }
}
const getPageInfo=()=>{
    state.tableData={
        表名: '营养风险筛查表(NRS2002)',
        初次调查日期:formatDate(new Date(),'YYYY-mm-dd'),
        填表日期: '',
        更新日期: formatDate(new Date(),'YYYY-mm-dd'),
        记录者: userInfos.value.userName,
        疾病状态: {
            type: '',
            input1: '',
        },
        营养状态: {
            type: '',
            input1: '',
        },
        年龄评分:{
            type: patientsInfo.value.age<70?'0':'1',
            input1: '',
        }
    }
}
        年龄评分: {
            type: patientsInfo.value.age < 70 ? '0' : '1',
            input1: '',
        },
        结果: '',
    };
    state.viewInfo = {
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName: '营养风险筛查表(NRS2002)',
        surveryFormType: 1,
        updateTime: '',
    };
};
// 第二步:暴露方法
defineExpose({ getData, openShow })
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;
    font-family: verdana, arial, sans-serif;
    font-size: 11px;
    color: #333333;
    border-width: 1px;
    border-color: #666666;
    border-collapse: collapse;
}
.gridtable th {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    text-align: left;
    border-color: #666666;
    background-color: #a4b0e2;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    text-align: left;
    border-color: #666666;
    background-color: #a4b0e2;
}
.gridtable td {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #ffffff;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #ffffff;
}
</style>
src/views/home/components/pingubiao/editDietary2.vue
@@ -707,6 +707,18 @@
            input1: '',
        }
    }
    state.viewInfo={
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName: '主观全面评定(SGA)评价',
        surveryFormType: 1,
        updateTime: ''
    }
}
// 第二步:暴露方法
src/views/home/components/pingubiao/editDietary3.vue
@@ -1,258 +1,203 @@
<template>
    <div class="dietarySurvey-item">
        <el-dialog  v-model="state.dialogTableVisible" title="营养不良炎症评分表(MIS)" :fullscreen="true" width="100%">
            <div class="container" style="width: 100%; height: 100%;overflow: auto;">
                <div>
                    <div>
                        <el-form size="small">
                            <div style="width: 100%">
                                <table id="tabledome" class="gridtable">
    <div class="dietarySurvey-item">
        <el-dialog v-model="state.dialogTableVisible" title="营养不良炎症评分表(MIS)" :fullscreen="true" width="100%">
            <div class="container" style="width: 100%; height: 100%; overflow: auto">
                <div>
                    <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="2">患者姓名:{{ patientsInfo.patientName }}</th>
                                        <th colspan="2">年龄:{{ patientsInfo.age }}</th>
                                        <th colspan="2">性别:{{ patientsInfo.patientGenderText }}</th>
                                    </tr>
                                    <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>
                                    <tr>
                                        <td colspan="3" style="text-align: center; background-color: antiquewhite">一、患者的相关病史</td>
                                        <td colspan="3" style="text-align: center; background-color: antiquewhite">评分(ABCD=0123)</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">1:干体重在过去的3-6个月总的变化</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.患者的相关病史.type">
                                                <el-radio value="0">A:干体重没有减少或体重丢失<0.5kg</el-radio>
                                                <el-radio value="1">B:体重丢失大于等于0.5kg,但<1kg</el-radio>
                                                <el-radio value="2">C:体重丢失大于等于1kg,但<5%体重评分结果</el-radio>
                                                <el-radio value="3">D:体重丢失大于等于5%体重</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">2:膳食摄入</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.膳食摄入.type">
                                                <el-radio value="0">A:食欲很好,膳食模式没有改变</el-radio>
                                                <el-radio value="1">B:固体食物摄入欠佳</el-radio>
                                                <el-radio value="2">C:饮食中度减少,完全流质饮食</el-radio>
                                                <el-radio value="3">D:低能量流质饮食,甚至饥饿</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">3:胃肠道症状</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.胃肠道症状.type">
                                                <el-radio value="0">A:没有症状,食欲良好</el-radio>
                                                <el-radio value="1">B:轻微的症状,偶尔恶心或呕吐</el-radio>
                                                <el-radio value="2">C:有时呕吐,中度的胃肠道症状</el-radio>
                                                <el-radio value="3">D:频繁腹泻、呕吐或严重的厌食症</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">4:营养相关损害</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.营养相关损害.type">
                                                <el-radio value="0">A:正常,功能能力良好</el-radio>
                                                <el-radio value="1">B:偶尔步行困难,经常感到疲惫</el-radio>
                                                <el-radio value="2">C:独立活动困难(如去厕所)</el-radio>
                                                <el-radio value="3">D:卧床或轮椅,或几乎没有身体活动能力</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">5:并发症和血透年限</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.并发症和血透年限.type">
                                                <el-radio value="0">A:透析时间<1年,无其他疾病</el-radio>
                                                <el-radio value="1">B:透析时间1-4年,轻度并发症(不包括多种慢性病:MCC)</el-radio>
                                                <el-radio value="2">C:透析时间>4年,中度患其他疾病(包括一种)</el-radio>
                                                <el-radio value="3">D:任何严重疾病,患有多种慢性病(大于等于2种)</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="text-align: center; background-color: antiquewhite">二、身体测量(根据SGA的资料)</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">6:脂肪存量减少或皮下脂肪减少(眼球下方三头肌、二头肌、胸部)</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.脂肪存量减少或皮下脂肪减少.type">
                                                <el-radio value="0">A:正常(没有变化)</el-radio>
                                                <el-radio value="1">B:轻度</el-radio>
                                                <el-radio value="2">C:中度</el-radio>
                                                <el-radio value="3">D:重度</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">7:肌肉消耗的迹象(太阳穴、锁骨、肩胛骨肋骨、股四头肌、膝关节、骨节)</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.肌肉消耗的迹象.type">
                                                <el-radio value="0">A:正常(没有变化)</el-radio>
                                                <el-radio value="1">B:轻度</el-radio>
                                                <el-radio value="2">C:中度</el-radio>
                                                <el-radio value="3">D:重度</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">8:体重指数(BMI)</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.体重指数BMI.type">
                                                <el-radio value="0">A:BMI>20</el-radio>
                                                <el-radio value="1">B:BM1:16-17.99</el-radio>
                                                <el-radio value="2">C:BMI:18-19.99</el-radio>
                                                <el-radio value="3">D:BMI<16</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="text-align: center; background-color: antiquewhite">三、实验室数据</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">9:血清白蛋白</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.血清白蛋白.type">
                                                <el-radio value="0">A:大于等于4.0g/dl</el-radio>
                                                <el-radio value="1">B:3.5-3.9g/dl</el-radio>
                                                <el-radio value="2">C:3.0-3.4g/dl</el-radio>
                                                <el-radio value="3">D:小于3.0g/dl</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">10:血清总铁结合力(TIBC))/血清转铁蛋白(TRF)</td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi" v-model="state.tableData.血清总铁结合力.type">
                                                <el-radio value="0">A:TIBC>250mg/dl或TRF>200mg/dl</el-radio>
                                                <el-radio value="1">B:TIBC200-249mg/dl或TRF170-199mg/dl</el-radio>
                                                <el-radio value="2">C:TIBC150-199mg/dl或TRF150-169mg/dl</el-radio>
                                                <el-radio value="3">D:TIBC &lt; 150mg/dl或TRF &lt;150mg/dl</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="font-weight: 600">评分结果</td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="font-weight: 600">
                                            评分标准:&lt;8分 轻度营养不良;9-18分 中度营养不良;>18分 重度营养不良;正常分值范围:0-30分。
                                            <br />
                                            <br />
                                            <br />
                                            <div style="color: blue">
                                                最后得分:{{ sum }} ,评价:
                                                <span v-if="sum <= 8">轻度营养不良</span>
                                                <span v-if="sum > 8 && sum < 18">中度营养不良</span>
                                                <span v-if="sum >= 18">重度营养不良</span>
                                            </div>
                                        </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="2">
                                           患者姓名:{{patientsInfo.patientName}}
                                        </th>
                                        <th colspan="2">
                                            年龄:{{patientsInfo.age}}
                                        </th>
                                        <th colspan="2">性别:{{patientsInfo.patientGenderText}}</th>
                                    </tr>
                                    <tr>
                                        <td colspan="3" style="text-align: center;background-color: antiquewhite;">
                                            一、患者的相关病史
                                        </td>
                                        <td colspan="3" style="text-align: center;background-color: antiquewhite;">
                                            评分(ABCD=0123)
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            1:干体重在过去的3-6个月总的变化
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.患者的相关病史.type">
                                                <el-radio value="0">A:干体重没有减少或体重丢失<0.5kg</el-radio>
                                                <el-radio value="1">B:体重丢失大于等于0.5kg,但<1kg</el-radio>
                                                <el-radio value="2">C:体重丢失大于等于1kg,但<5%体重评分结果</el-radio>
                                                <el-radio value="3">D:体重丢失大于等于5%体重</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            2:膳食摄入
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.膳食摄入.type">
                                                <el-radio value="0">A:食欲很好,膳食模式没有改变</el-radio>
                                                <el-radio value="1">B:固体食物摄入欠佳</el-radio>
                                                <el-radio value="2">C:饮食中度减少,完全流质饮食</el-radio>
                                                <el-radio value="3">D:低能量流质饮食,甚至饥饿</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            3:胃肠道症状
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.胃肠道症状.type">
                                                <el-radio value="0">A:没有症状,食欲良好</el-radio>
                                                <el-radio value="1">B:轻微的症状,偶尔恶心或呕吐</el-radio>
                                                <el-radio value="2">C:有时呕吐,中度的胃肠道症状</el-radio>
                                                <el-radio value="3">D:频繁腹泻、呕吐或严重的厌食症</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            4:营养相关损害
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.营养相关损害.type">
                                                <el-radio value="0">A:正常,功能能力良好</el-radio>
                                                <el-radio value="1">B:偶尔步行困难,经常感到疲惫</el-radio>
                                                <el-radio value="2">C:独立活动困难(如去厕所)</el-radio>
                                                <el-radio value="3">D:卧床或轮椅,或几乎没有身体活动能力</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            5:并发症和血透年限
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.并发症和血透年限.type">
                                                <el-radio value="0">A:透析时间<1年,无其他疾病</el-radio>
                                                <el-radio value="1">B:透析时间1-4年,轻度并发症(不包括多种慢性病:MCC)</el-radio>
                                                <el-radio value="2">C:透析时间>4年,中度患其他疾病(包括一种)</el-radio>
                                                <el-radio value="3">D:任何严重疾病,患有多种慢性病(大于等于2种)</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="text-align: center;background-color: antiquewhite;">
                                            二、身体测量(根据SGA的资料)
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            6:脂肪存量减少或皮下脂肪减少(眼球下方三头肌、二头肌、胸部)
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.脂肪存量减少或皮下脂肪减少.type">
                                                <el-radio value="0">A:正常(没有变化)</el-radio>
                                                <el-radio value="1">B:轻度</el-radio>
                                                <el-radio value="2">C:中度</el-radio>
                                                <el-radio value="3">D:重度</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            7:肌肉消耗的迹象(太阳穴、锁骨、肩胛骨肋骨、股四头肌、膝关节、骨节)
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.肌肉消耗的迹象.type">
                                                <el-radio value="0">A:正常(没有变化)</el-radio>
                                                <el-radio value="1">B:轻度</el-radio>
                                                <el-radio value="2">C:中度</el-radio>
                                                <el-radio value="3">D:重度</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            8:体重指数(BMI)
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.体重指数BMI.type">
                                                <el-radio value="0">A:BMI>20</el-radio>
                                                <el-radio value="1">B:BM1:16-17.99</el-radio>
                                                <el-radio value="2">C:BMI:18-19.99</el-radio>
                                                <el-radio value="3">D:BMI<16</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="text-align: center;background-color: antiquewhite;">
                                            三、实验室数据
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            9:血清白蛋白
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.血清白蛋白.type">
                                                <el-radio value="0">A:大于等于4.0g/dl</el-radio>
                                                <el-radio value="1">B:3.5-3.9g/dl</el-radio>
                                                <el-radio value="2">C:3.0-3.4g/dl</el-radio>
                                                <el-radio value="3">D:小于3.0g/dl</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3">
                                            10:血清总铁结合力(TIBC))/血清转铁蛋白(TRF)
                                        </td>
                                        <td colspan="3">
                                            <el-radio-group class="elradiozdi"
                                                v-model="state.tableData.血清总铁结合力.type">
                                                <el-radio value="0">A:TIBC>250mg/dl或TRF>200mg/dl</el-radio>
                                                <el-radio value="1">B:TIBC200-249mg/dl或TRF170-199mg/dl</el-radio>
                                                <el-radio value="2">C:TIBC150-199mg/dl或TRF150-169mg/dl</el-radio>
                                                <el-radio value="3">D:TIBC &lt; 150mg/dl或TRF &lt;150mg/dl</el-radio>
                                            </el-radio-group>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="font-weight: 600;">评分结果</td>
                                    </tr>
                                    <tr>
                                        <td colspan="6" style="font-weight: 600;">
                                            评分标准:<8分 轻度营养不良;9-18分 中度营养不良;>18分 重度营养不良;正常分值范围:0-30分。
                                            <br>
                                            <br>
                                            <br>
                                            <div style="color: blue;">
                                                最后得分:{{sum}} ,评价:
                                                <span v-if="sum<=8">轻度营养不良</span>
                                                <span v-if="sum>8&&sum<18">中度营养不良</span>
                                                <span v-if="sum>=18">重度营养不良</span>
                                            </div>
                                            <br>
                                            <span></span>
                                        </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>
                </div>
            </template>
        </el-dialog>
    </div>
                                            <br />
                                            <span></span>
                                        </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>
                </div>
            </template>
        </el-dialog>
    </div>
</template>
<script setup lang="ts" name="visualizingLinkDemo2">
@@ -262,234 +207,236 @@
import { useUserInfo } from '/@/stores/userInfo';
import { usePatientsInfo } from '/@/stores/patientsInfo';
const storesPat = usePatientsInfo();
import {Add,update,deleteId,tiaochabiaoInfo} from '/@/api/tiaochabiao/index'
import { Add, update, deleteId, tiaochabiaoInfo } from '/@/api/tiaochabiao/index';
import { storeToRefs } from 'pinia';
import { useRoute,useRouter } from 'vue-router';
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 router = useRouter();
const emit = defineEmits(['shuaxin']);
const state = reactive({
    dialogTableVisible:false,
    tableData: {
        表名: '营养不良炎症评分表(MIS)',
        初次调查日期:"",
        填表日期: '',
        更新日期: '',
        记录者: '陈银成',
        患者的相关病史: {
            type: '',
            input1: '',
        },
        膳食摄入: {
            type: '',
            input1: '',
        },
        胃肠道症状:{
            type: '',
            input1: '',
        },
        营养相关损害:{
            type: '',
            input1: '',
        },
        并发症和血透年限:{
            type: '',
            input1: '',
        },
        脂肪存量减少或皮下脂肪减少:{
            type: '',
            input1: '',
        },
        肌肉消耗的迹象:{
            type: '',
            input1: '',
        },
        体重指数BMI:{
            type: '',
            input1: '',
        },
        血清白蛋白:{
            type: '',
            input1: '',
        },
        血清总铁结合力:{
            type: '',
            input1: '',
        }
    },
    loading: false,
    viewInfo:{
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName:'营养风险筛查表(NRS2002)',
        surveryFormType:1,
        updateTime: ''
    }
})
    dialogTableVisible: false,
    tableData: {
        表名: '营养不良炎症评分表(MIS)',
        初次调查日期: '',
        填表日期: '',
        更新日期: '',
        记录者: '陈银成',
        患者的相关病史: {
            type: '',
            input1: '',
        },
        膳食摄入: {
            type: '',
            input1: '',
        },
        胃肠道症状: {
            type: '',
            input1: '',
        },
        营养相关损害: {
            type: '',
            input1: '',
        },
        并发症和血透年限: {
            type: '',
            input1: '',
        },
        脂肪存量减少或皮下脂肪减少: {
            type: '',
            input1: '',
        },
        肌肉消耗的迹象: {
            type: '',
            input1: '',
        },
        体重指数BMI: {
            type: '',
            input1: '',
        },
        血清白蛋白: {
            type: '',
            input1: '',
        },
        血清总铁结合力: {
            type: '',
            input1: '',
        },
    },
    loading: false,
    viewInfo: {
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName: '',
        surveryFormType: 1,
        updateTime: '',
    },
});
const sum = computed(() => {
    let x=0
    for(let key in state.tableData){
        console.log(key+'key=='+state.tableData[key]?.type)
        if(Number(state.tableData[key]?.type)){
            x+=Number(state.tableData[key]?.type)
        }
    }
    return x
})
const funhui=()=>{
    state.dialogTableVisible=false
}
    let x = 0;
    for (let key in state.tableData) {
        console.log(key + 'key==' + state.tableData[key]?.type);
        if (Number(state.tableData[key]?.type)) {
            x += Number(state.tableData[key]?.type);
        }
    }
    return x;
});
const funhui = () => {
    state.dialogTableVisible = false;
};
const onSubmit = () => {
  console.log('submit!')
  console.log(state.tableData)
  const info:tiaochabiaoInfo={
    id: state.viewInfo.id,
    surveryFormType:1,
    code: state.viewInfo.code,
    clientCode: userInfos.value.clientCode,
    patientCode: patientsInfo.value.code,
    surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
    surveryPerson: userInfos.value.code,
    surveryJsonBody: JSON.stringify(state.tableData),
    suveryFormName:'营养不良炎症评分表(MIS)',
    updateTime: ''
  }
  console.log(info)
  if(info.id===0){
    Add(info).then(re=>{
        console.log(re.data)
        state.dialogTableVisible=false
        emit('shuaxin')
    })
  }else if(info.id>0){
    info.surveryTime=state.viewInfo.surveryTime
    update(info).then(re=>{
        console.log(re.data)
        state.dialogTableVisible=false
        emit('shuaxin')
    })
  }
}
    console.log('submit!');
    console.log(state.tableData);
    const info: tiaochabiaoInfo = {
        id: state.viewInfo.id,
        surveryFormType: 1,
        code: state.viewInfo.code,
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: JSON.stringify(state.tableData),
        suveryFormName: '营养不良炎症评分表(MIS)',
        updateTime: '',
    };
    console.log(info);
    if (info.id === 0) {
        Add(info).then((re) => {
            console.log(re.data);
            state.dialogTableVisible = false;
            emit('shuaxin');
        });
    } else if (info.id > 0) {
        info.surveryTime = state.viewInfo.surveryTime;
        update(info).then((re) => {
            console.log(re.data);
            state.dialogTableVisible = false;
            emit('shuaxin');
        });
    }
};
// 第一步:定义子组件里面的方法
const getData = (str: string) => {
    console.log("子组件获取显示数据!" + str);
    state.loading = true
}
    console.log('子组件获取显示数据!' + str);
    state.loading = true;
};
// 打开查看或者编辑明细
const openShow = (type: string,mode:tiaochabiaoInfo) => {
    console.log(type)
    if(type==='add'){
        state.tableData.初次调查日期=formatDate(new Date(),'YYYY-mm-dd')
        state.tableData.更新日期=formatDate(new Date(),'YYYY-mm-dd')
        state.tableData.记录者=userInfos.value.userName
        getPageInfo()
        state.dialogTableVisible = true
    }
    else if(type==='update'){
        console.log('------------------------3333333333333333')
        console.log(mode)
        state.viewInfo=mode
        state.tableData=JSON.parse(mode.surveryJsonBody)
        state.dialogTableVisible = true
const openShow = (type: string, mode: tiaochabiaoInfo) => {
    console.log(type);
    }
}
const getPageInfo=()=>{
    state.tableData={
        表名: '营养不良炎症评分表(MIS)',
        初次调查日期:formatDate(new Date(),'YYYY-mm-dd'),
        填表日期: '',
        更新日期: formatDate(new Date(),'YYYY-mm-dd'),
        记录者: userInfos.value.userName,
        患者的相关病史: {
            type: '',
            input1: '',
        },
        膳食摄入: {
            type: '',
            input1: '',
        },
        胃肠道症状:{
            type: '',
            input1: '',
        },
        营养相关损害:{
            type: '',
            input1: '',
        },
        并发症和血透年限:{
            type: '',
            input1: '',
        },
        脂肪存量减少或皮下脂肪减少:{
            type: '',
            input1: '',
        },
        肌肉消耗的迹象:{
            type: '',
            input1: '',
        },
        体重指数BMI:{
            type: '',
            input1: '',
        },
        血清白蛋白:{
            type: '',
            input1: '',
        },
        血清总铁结合力:{
            type: '',
            input1: '',
        }
    }
}
    if (type === 'add') {
        state.tableData.初次调查日期 = formatDate(new Date(), 'YYYY-mm-dd');
        state.tableData.更新日期 = formatDate(new Date(), 'YYYY-mm-dd');
        state.tableData.记录者 = userInfos.value.userName;
        getPageInfo();
        state.dialogTableVisible = true;
    } else if (type === 'update') {
        console.log('------------------------3333333333333333');
        console.log(mode);
        state.viewInfo = mode;
        state.tableData = JSON.parse(mode.surveryJsonBody);
        state.dialogTableVisible = true;
    }
};
const getPageInfo = () => {
    state.tableData = {
        表名: '营养不良炎症评分表(MIS)',
        初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
        填表日期: '',
        更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
        记录者: userInfos.value.userName,
        患者的相关病史: {
            type: '',
            input1: '',
        },
        膳食摄入: {
            type: '',
            input1: '',
        },
        胃肠道症状: {
            type: '',
            input1: '',
        },
        营养相关损害: {
            type: '',
            input1: '',
        },
        并发症和血透年限: {
            type: '',
            input1: '',
        },
        脂肪存量减少或皮下脂肪减少: {
            type: '',
            input1: '',
        },
        肌肉消耗的迹象: {
            type: '',
            input1: '',
        },
        体重指数BMI: {
            type: '',
            input1: '',
        },
        血清白蛋白: {
            type: '',
            input1: '',
        },
        血清总铁结合力: {
            type: '',
            input1: '',
        },
    };
    state.viewInfo = {
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName: '',
        surveryFormType: 1,
        updateTime: '',
    };
};
// 第二步:暴露方法
defineExpose({ getData, openShow })
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;
    font-family: verdana, arial, sans-serif;
    font-size: 11px;
    color: #333333;
    border-width: 1px;
    border-color: #666666;
    border-collapse: collapse;
}
.gridtable th {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    text-align: left;
    border-color: #666666;
    background-color: #a4b0e2;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    text-align: left;
    border-color: #666666;
    background-color: #a4b0e2;
}
.gridtable td {
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #ffffff;
    border-width: 1px;
    padding: 8px;
    border-style: solid;
    border-color: #666666;
    background-color: #ffffff;
}
</style>
src/views/home/components/pingubiao/editDietary4.vue
@@ -294,6 +294,18 @@
            input1: '肌肉量丢失(3个月内>5%或半年内>10%),上臂肌围减少(减少>10%参照群体第50个百分位数)',
        }
    }
    state.viewInfo={
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName:'PEW(蛋白质能量消耗评估)',
        surveryFormType:1,
        updateTime: ''
    }
}
// 第二步:暴露方法
src/views/home/components/pingubiao/editDietary5.vue
@@ -73,7 +73,7 @@
                                        </td>
                                        <td colspan="2" rowspan="3" style="text-align: center;font-size: 18px;">
                                            {{ sum }}
                                            <div v-if="sum">
                                            <!-- <div v-if="sum">
                                                
                                                <span v-if="sum<82">高营养风险</span>
@@ -81,7 +81,7 @@
                                                <span v-if="sum>=92&&sum<98">低营养风险</span>
                                                <span v-if="sum>98">无营养风险</span>
                                            </div>
                                            <br>
                                            <br> -->
                                        </td>
                                    </tr>
@@ -130,8 +130,8 @@
                                            GNIR营养评估分为4个等级:<br>
                                            高营养风险(GNIR&lt;82<br>
                                            中营养风险(82≤GNIR<92)<br>
                                                低营养风险(92≤GNIR≤98)<br>
                                                无营养风险(GNIR>98)
                                            低营养风险(92≤GNIR≤98)<br>
                                            无营养风险(GNIR>98)
                                        </td>
@@ -192,7 +192,8 @@
        理想体重: '',
        血清白蛋白浓度: '',
        无法测量身高: false,
        膝高: ''
        膝高: '',
        结果:''
@@ -231,20 +232,56 @@
    }
})
const sum = computed(() => {
    let data=0
    if (isNumeric(state.tableData.体重) && isNumeric(state.tableData.身高) && isNumeric(state.tableData.血清白蛋白浓度)) {
        if (Number(state.tableData.体重) <= Number(state.tableData.理想体重)) {
            return Number(((1.498 * Number(state.tableData.血清白蛋白浓度)) + (41.7 * ((Number(state.tableData.体重) / Number(state.tableData.理想体重))))).toFixed(2))
            data= Number(((1.498 * Number(state.tableData.血清白蛋白浓度)) + (41.7 * ((Number(state.tableData.体重) / Number(state.tableData.理想体重))))).toFixed(2))
        } else {
            return Number(((1.498 * Number(state.tableData.血清白蛋白浓度)) + 41.7).toFixed(2))
            data= Number(((1.498 * Number(state.tableData.血清白蛋白浓度)) + 41.7).toFixed(2))
        }
        if(data<82){
           return `${data} 高营养风险`
        }else if(data>=82&&data<92){
           return `${data} 中营养风险`
        }else if(data>=92&&data<98){
           return `${data} 低营养风险`
        }else if(data>=98){
           return `${data} 无营养风险`
        }else{
            return ''
        }
    } else{
        return ''
    }
})
const sumtest=()=>{
    let data=0
    if (isNumeric(state.tableData.体重) && isNumeric(state.tableData.身高) && isNumeric(state.tableData.血清白蛋白浓度)) {
        if (Number(state.tableData.体重) <= Number(state.tableData.理想体重)) {
            data= Number(((1.498 * Number(state.tableData.血清白蛋白浓度)) + (41.7 * ((Number(state.tableData.体重) / Number(state.tableData.理想体重))))).toFixed(2))
        } else {
            data= Number(((1.498 * Number(state.tableData.血清白蛋白浓度)) + 41.7).toFixed(2))
        }
        if(data<82){
           return `GNIR营养评估分:${data} 高营养风险`
        }else if(data>=82&&data<92){
           return `GNIR营养评估分:${data} 中营养风险`
        }else if(data>=92&&data<98){
           return `GNIR营养评估分:${data} 低营养风险`
        }else if(data>=98){
           return `GNIR营养评估分:${data} 无营养风险`
        }else{
            return ''
        }
    } else{
        return ''
    }
}
const funhui = () => {
    state.dialogTableVisible = false
}
const onSubmit = () => {
    state.tableData.结果=sumtest()
    console.log('submit!')
    console.log(state.tableData)
    const info: tiaochabiaoInfo = {
@@ -316,9 +353,22 @@
        理想体重: '',
        血清白蛋白浓度: '',
        无法测量身高: false,
        膝高: ''
        膝高: '',
        结果:''
    }
    state.viewInfo={
        id: 0,
        code: '',
        clientCode: userInfos.value.clientCode,
        patientCode: patientsInfo.value.code,
        surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
        surveryPerson: userInfos.value.code,
        surveryJsonBody: '',
        suveryFormName:'GNIR营养评估分',
        surveryFormType:1,
        updateTime: ''
    }
}
// 第二步:暴露方法
src/views/home/components/pingubiao/index.vue
@@ -82,7 +82,7 @@
                />
        </div>
        <el-empty v-if="!patientsInfo.id" description="无数据,请先选择患者"></el-empty>
        <editDietary  @shuaxin="onSubmit" ref="editDietaryRef"></editDietary>
        <editDietary   @shuaxin="onSubmit" ref="editDietaryRef"></editDietary>
        <editDietary2  @shuaxin="onSubmit" ref="editDietaryRef2"></editDietary2>
        <editDietary3  @shuaxin="onSubmit" ref="editDietaryRef3"></editDietary3>
        <editDietary4  @shuaxin="onSubmit" ref="editDietaryRef4"></editDietary4>
@@ -140,6 +140,7 @@
    },
  },
]
const state = reactive({
    tableData: [],
    page:1,
src/views/home/index.vue
@@ -101,7 +101,7 @@
                                <span style="margin-left: 5px">方案</span>
                            </span>
                        </template>
                        <el-empty  description="该功能未开发"></el-empty>
                        <!-- <el-empty  description="该功能未开发"></el-empty>  -->
                    </el-tab-pane>
                    <el-tab-pane label="随访记录" name="随访记录">
                        <template #label>
@@ -124,6 +124,7 @@
                    </MedicationRecords>
                    <dietarySurvey ref="dietarySurveyRef" v-show="state.activeName === '膳食调查'"  :tableHeight="state.tableHeight.detailRight"></dietarySurvey>
                    <pinggubiao ref="pinggubiaoRef" v-show="state.activeName === '营养筛查评估'"  :tableHeight="state.tableHeight.detailRight"></pinggubiao>
                    <fangAn ref="fangAnRef" v-show="state.activeName === '方案'"  :tableHeight="state.tableHeight.detailRight"></fangAn>
                </div>
@@ -159,6 +160,8 @@
import lisUi from './components/lis_.ui.vue'
// 评估表
import pinggubiao from './components/pingubiao/index.vue'
// 方案
import fangAn from './components/fangAn/index.vue'
interface User {
    code: string,
    patientName: string
@@ -171,6 +174,7 @@
const lisUiRef = ref()
const pinggubiaoRef=ref()
const dietarySurveyRef=ref()// 膳食调查
const fangAnRef=ref()
const state = reactive({
    global: {
        homeChartOne: null,