From 9bbb2946699515807256dfb30ab57359f4fdf563 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 24 三月 2025 16:09:43 +0800
Subject: [PATCH] gx优化

---
 src/views/home/components/pingubiao/editDietary2.vue |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/views/home/components/pingubiao/editDietary2.vue b/src/views/home/components/pingubiao/editDietary2.vue
index 45a7faf..5a8cbd5 100644
--- a/src/views/home/components/pingubiao/editDietary2.vue
+++ b/src/views/home/components/pingubiao/editDietary2.vue
@@ -456,6 +456,7 @@
 import { storeToRefs } from 'pinia';
 import { useRoute, useRouter } from 'vue-router';
 import { ElMessage } from 'element-plus';
+import { getPatData } from '/@/api/Patients';
 const stores = useUserInfo();
 const { patientsInfo } = storeToRefs(storesPat);
 const { userInfos } = storeToRefs(stores);
@@ -637,14 +638,14 @@
 
 }
 // 打开查看或者编辑明细
-const openShow = (type: string, mode: tiaochabiaoInfo) => {
+const openShow = async (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()
+        await getPageInfo()
         state.dialogTableVisible = true
     }
     else if (type === 'update') {
@@ -660,14 +661,15 @@
     }
 
 }
-const getPageInfo = () => {
+const getPageInfo = async () => {
+    const res = await getPatData({ patCode: patientsInfo.value.code, })
     state.tableData = {
         表名: 'SGA',
         初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'),
         填表日期: '',
         更新日期: formatDate(new Date(), 'YYYY-mm-dd'),
         记录者: userInfos.value.userName,
-        您目前体重: '',
+        您目前体重:  res.data.上一次透前体重,
         体重改变1: {
             type: '',
             input1: '',

--
Gitblit v1.8.0