From 81ced3885266779c3a3813a0e4687962375b1d62 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 09 六月 2025 19:16:43 +0800
Subject: [PATCH] gx

---
 src/views/home/components/pingubiao/editDietary.vue |   51 ++++++++++++++++++++++++++-------------------------
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/src/views/home/components/pingubiao/editDietary.vue b/src/views/home/components/pingubiao/editDietary.vue
index 44673c0..77c77b4 100644
--- a/src/views/home/components/pingubiao/editDietary.vue
+++ b/src/views/home/components/pingubiao/editDietary.vue
@@ -1,7 +1,7 @@
 <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">
+		<el-dialog v-model="state.dialogTableVisible" title="NRS-2002" :fullscreen="true" width="100%">
+			<div style="width: 100%; height: 100%; overflow: auto">
 				<div id="pinggu1">
 					<div>
 						<el-form size="small">
@@ -146,7 +146,7 @@
 										</td>
 									</tr>
 									<tr>
-										<td colspan="4">小于70 岁</td>
+										<td colspan="4">< 70 岁</td>
 										<td colspan="1">0分</td>
 										<td colspan="1">
 											<el-radio-group class="elradiozdi" v-model="state.tableData.年龄评分.type">
@@ -155,7 +155,7 @@
 										</td>
 									</tr>
 									<tr>
-										<td colspan="4">大于、等于70 岁</td>
+										<td colspan="4">>=70 岁</td>
 										<td colspan="1">1分</td>
 										<td colspan="1">
 											<el-radio-group class="elradiozdi" v-model="state.tableData.年龄评分.type">
@@ -172,8 +172,8 @@
 											<br />
 											<br />
 											<br />
-											<div style="color: blue">
-												最后得分:{{ sum }}, {{ sum >= 3 ? '患者存在营养风险,应进行营养评定,并制定和实施营养支持治疗计划。' : '无营养风险' }}
+											<div style="color: blue" v-if="sum.value" :style="{color:sum.color}">
+												最后得分:{{ sum.value }}, {{ sum.label }}
 											</div>
 
 											<br />
@@ -224,7 +224,7 @@
 const state = reactive({
 	dialogTableVisible: false,
 	tableData: {
-		表名: '营养风险筛查表(NRS2002)',
+		表名: 'NRS-2002',
 		初次调查日期: '',
 		填表日期: '',
 		更新日期: '',
@@ -253,12 +253,17 @@
 		surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
 		surveryPerson: userInfos.value.code,
 		surveryJsonBody: '',
-		suveryFormName: '营养风险筛查表(NRS2002)',
+		suveryFormName: 'NRS-2002',
 		surveryFormType: 1,
 		updateTime: '',
 	},
 });
 const sum = computed(() => {
+	const res={
+        value:'',
+        label:'',
+        color:''
+    }
 	let x = 0;
 	for (let key in state.tableData) {
 		console.log(key + 'key==' + state.tableData[key]?.type);
@@ -266,7 +271,15 @@
 			x += Number(state.tableData[key]?.type);
 		}
 	}
-	return x;
+	res.value=x
+	if(x>=3){
+		res.label='存在营养风险'
+		res.color='#F56C6C'
+	}else{
+		res.label='无营养风险'
+		res.color='#303133'
+	}
+	return res;
 });
 const funhui = () => {
 	state.dialogTableVisible = false;
@@ -274,19 +287,7 @@
 const onSubmit = () => {
 	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.结果='无营养风险'
-    }
-    
+    state.tableData.结果=sum.value
 	const info: tiaochabiaoInfo = {
 		id: state.viewInfo.id,
 		surveryFormType: 1,
@@ -296,7 +297,7 @@
 		surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
 		surveryPerson: userInfos.value.code,
 		surveryJsonBody: JSON.stringify(state.tableData),
-		suveryFormName: '营养风险筛查表(NRS2002)',
+		suveryFormName: 'NRS-2002',
 		updateTime: '',
 	};
 	console.log(info);
@@ -342,7 +343,7 @@
 };
 const getPageInfo = () => {
 	state.tableData = {
-		表名: '营养风险筛查表(NRS2002)',
+		表名: 'NRS-2002',
 		初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
 		填表日期: '',
 		更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
@@ -370,7 +371,7 @@
 		surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'),
 		surveryPerson: userInfos.value.code,
 		surveryJsonBody: '',
-		suveryFormName: '营养风险筛查表(NRS2002)',
+		suveryFormName: 'NRS-2002',
 		surveryFormType: 1,
 		updateTime: '',
 	};

--
Gitblit v1.8.0