From 83ef13dab87cb59fccf0514d7d47f2ca0cae9f0f Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期六, 21 十二月 2024 23:06:11 +0800
Subject: [PATCH] 更新

---
 src/views/home/components/fangAn/editDietary.vue |   50 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/src/views/home/components/fangAn/editDietary.vue b/src/views/home/components/fangAn/editDietary.vue
index 1bf8873..7219e2c 100644
--- a/src/views/home/components/fangAn/editDietary.vue
+++ b/src/views/home/components/fangAn/editDietary.vue
@@ -1,8 +1,8 @@
 <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 class="container" style="width: 100%; height: 100%;overflow: auto;" >
+                <div id="printFrom1" class="print-section">
                     <div>
                         <el-form size="small">
                             <div style="width: 100%">
@@ -12,7 +12,7 @@
                                             <el-row>
                                                 <el-col :span="12">
                                                     <el-form-item label="实施日期">
-                                                        <el-date-picker v-model="state.tableData.初次调查日期" type="date"
+                                                        <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>
@@ -20,7 +20,7 @@
                                                 <el-col :span="12">
                                                     <div style="text-align:right;width: 100%">
 
-                                                        <span>营养师:</span> <el-input v-model="state.tableData.记录者"
+                                                        <span>营养师:</span> <el-input v-model="state.tableData.记录者" readonly
                                                             style="width: 100px;" placeholder="" />
 
                                                     </div>
@@ -31,6 +31,7 @@
 
                                         </th>
                                     </tr>
+                                   
                                     <tr>
                                         <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                             S:询问饮食营养状况、生活习惯</td>
@@ -296,7 +297,7 @@
                                                 placeholder="" />
                                         </td>
                                     </tr>
-
+                                    <tr class="page-break"></tr>
                                     <tr>
                                         <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                             P:饮食营养方案及食谱,定期随访并及时调整</td>
@@ -490,6 +491,7 @@
                                             </el-input>
                                         </td>
                                     </tr>
+                                    
                                     <tr>
                                         <td colspan="8" style=" background-color: rgb(250, 236, 216);font-weight:800 ;">
                                             食物替换法</td>
@@ -604,6 +606,8 @@
 <script setup lang="ts" name="visualizingLinkDemo2">
 import { Check } from '@element-plus/icons-vue'
 import html2pdf from 'html2pdf.js';
+import html2canvas from 'html2canvas';
+import { jsPDF } from 'jspdf';
 import { reactive, onMounted, onUnmounted, ref } from 'vue';
 import { formatDate } from '/@/utils/formatTime';
 import { NextLoading } from '/@/utils/loading';
@@ -631,7 +635,7 @@
     innerVisible:false,
     tableData: {
         表名: '患者方案表',
-        初次调查日期: "",
+        实施日期: "",
         填表日期: '',
         更新日期: '',
         记录者: '陈银成',
@@ -821,7 +825,7 @@
 const generatePDF = () => {
     const element = document.getElementById('printFrom1');
     const opt = {
-        margin: 10,
+        margin: 0,
         filename: `${state.tableData.表名}.pdf`,
         image: { type: 'jpeg', quality: 0.98 },
         html2canvas: { scale: 2 },
@@ -865,7 +869,7 @@
 const getPageInfo = async () => {
     state.tableData = {
         表名: '患者方案表',
-        初次调查日期: "",
+        实施日期: formatDate(new Date(),'YYYY-mm-dd'),
         填表日期: '',
         更新日期: '',
         记录者: userInfos.value.userName,
@@ -969,6 +973,18 @@
             其他: '1克盐=6.5克酱油=10克蚝油 水果 互相替换,如苹果/梨/西瓜/桃子/火龙果等'
         }
     }
+    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: 2,
+        updateTime: ''
+	};
     const from1 = await getFrom1()
     const from2 = await getFrom2()
     const from3 = await getFrom3()
@@ -1066,6 +1082,8 @@
         console.log(mode)
         state.viewInfo = mode
         state.tableData = JSON.parse(mode.surveryJsonBody)
+        state.tableData.实施日期=mode.surveryTime
+        state.tableData.更新日期=mode.updateTime
         state.dialogTableVisible = true
 
 
@@ -1114,4 +1132,20 @@
 .lvse {
     background-color: rgb(239.8, 248.9, 235.3);
 }
+@media print, screen {
+  .print-section {
+    width: auto !important;
+    max-width: none !important;
+    overflow: visible !important;
+  }
+
+  .print-section > * {
+    page-break-inside: avoid;
+  }
+
+  .page-break {
+    display: block;
+    page-break-after: always;
+  }
+}
 </style>

--
Gitblit v1.8.0