|
|
@@ -470,7 +470,7 @@
|
|
|
<el-button v-if="!isDetail" type="primary" @click="submitForm">保存</el-button>
|
|
|
<el-button v-if="!isDetail" @click="handleClosed">取消</el-button>
|
|
|
<el-button v-if="isDetail" @click="handleClosed">关闭</el-button>
|
|
|
-<!-- <el-button v-if="isDetail" type="primary" @click="handleExport">打印</el-button>-->
|
|
|
+ <el-button v-if="isDetail" type="primary" @click="handleExport">打印</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-drawer>
|
|
|
@@ -775,7 +775,400 @@ const handleClosed = () => {
|
|
|
}
|
|
|
|
|
|
const handleExport = () => {
|
|
|
- message.info('打印功能开发中')
|
|
|
+ // 创建打印窗口
|
|
|
+ const printWindow = window.open('', '_blank')
|
|
|
+ if (!printWindow) {
|
|
|
+ message.error('请允许弹出窗口')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 初筛项目数据
|
|
|
+ const initialItems = [
|
|
|
+ { name: '1. BMI', options: [{ score: 0, text: 'BMI<19 或 BMI≥28' }, { score: 1, text: '19≤BMI<21 或 26≤BMI<28' }, { score: 2, text: '21≤BMI<23 或 24≤BMI<26' }, { score: 3, text: '23≤BMI≤24' }] },
|
|
|
+ { name: '2. 近3个月体重变化', options: [{ score: 0, text: '减少或增加≥3Kg' }, { score: 1, text: '不知道' }, { score: 2, text: '1Kg≤减少<3Kg 或 1Kg≤增加<3Kg' }, { score: 3, text: '0Kg<减少<1Kg 或 0Kg<增加<1Kg' }] },
|
|
|
+ { name: '3. 活动能力', options: [{ score: 0, text: '卧床' }, { score: 1, text: '需要依赖工具活动' }, { score: 2, text: '独立户外活动' }, { score: null, text: '—' }] },
|
|
|
+ { name: '4. 牙齿状况', options: [{ score: 0, text: '全口或半口缺' }, { score: 1, text: '用义齿' }, { score: 2, text: '正常' }, { score: null, text: '—' }] },
|
|
|
+ { name: '5. 神经精神疾病', options: [{ score: 0, text: '严重认知障碍或抑郁' }, { score: 1, text: '轻度认知障碍或抑郁' }, { score: 2, text: '无认知障碍或抑郁' }, { score: null, text: '—' }] },
|
|
|
+ { name: '6. 近三个月有无饮食量变化', options: [{ score: 0, text: '严重增加或减少' }, { score: 1, text: '增加或减少' }, { score: 2, text: '无变化' }, { score: null, text: '—' }] }
|
|
|
+ ]
|
|
|
+
|
|
|
+ // 评估项目数据
|
|
|
+ const assessItems = [
|
|
|
+ { name: '7. 患慢性病数>3种', options: [{ score: 0, text: '是' }, { score: null, text: '—' }, { score: 1, text: '否' }, { score: null, text: '—' }] },
|
|
|
+ { name: '8. 服药时间在一个月以上的药物种类>3种', options: [{ score: 0, text: '是' }, { score: null, text: '—' }, { score: 1, text: '否' }, { score: null, text: '—' }] },
|
|
|
+ { name: '9. 是否独居', options: [{ score: 0, text: '是' }, { score: null, text: '—' }, { score: 1, text: '否' }, { score: null, text: '—' }] },
|
|
|
+ { name: '10. 睡眠时间', options: [{ score: 0, text: '<5h/d' }, { score: null, text: '—' }, { score: 1, text: '≥5h/d' }, { score: null, text: '—' }] },
|
|
|
+ { name: '11. 户外独立活动时间', options: [{ score: 0, text: '<1h/d' }, { score: null, text: '—' }, { score: 1, text: '≥1h/d' }, { score: null, text: '—' }] },
|
|
|
+ { name: '12. 文化程度', options: [{ score: 0, text: '小学及以下' }, { score: null, text: '—' }, { score: 1, text: '中学及以上' }, { score: null, text: '—' }] },
|
|
|
+ { name: '13. 自我感觉经济状况', options: [{ score: 0, text: '差' }, { score: 0.5, text: '一般' }, { score: 1, text: '良好' }, { score: null, text: '—' }] },
|
|
|
+ { name: '14. 进食能力', options: [{ score: 0, text: '依靠别人' }, { score: null, text: '—' }, { score: 1, text: '自行进食稍有困难' }, { score: 2, text: '自行进食' }] },
|
|
|
+ { name: '15. 一天餐次', options: [{ score: 0, text: '1次' }, { score: null, text: '—' }, { score: 1, text: '2次' }, { score: 2, text: '3次及以上' }] },
|
|
|
+ { name: '16. 每天摄入奶类/豆制品/鱼肉类', options: [{ score: 0, text: '0-1项' }, { score: 0.5, text: '2项' }, { score: 1, text: '3项' }, { score: null, text: '—' }] },
|
|
|
+ { name: '17. 每天烹调油摄入量', options: [{ score: 0, text: '≥25g' }, { score: null, text: '—' }, { score: 1, text: '<25g' }, { score: null, text: '—' }] },
|
|
|
+ { name: '18. 是否每天吃蔬菜水果500g及以上', options: [{ score: 0, text: '否' }, { score: null, text: '—' }, { score: 1, text: '是' }, { score: null, text: '—' }] },
|
|
|
+ { name: '19. 小腿围', options: [{ score: 0, text: '<31cm' }, { score: null, text: '—' }, { score: 1, text: '≥31cm' }, { score: null, text: '—' }] },
|
|
|
+ { name: '20. 腰围', options: [{ score: '男>90cm/女>80cm', text: '0分' }, { score: null, text: '—' }, { score: '男≤90cm/女≤80cm', text: '1分' }, { score: null, text: '—' }] }
|
|
|
+ ]
|
|
|
+
|
|
|
+ // 构建打印内容
|
|
|
+ const printContent = `
|
|
|
+ <!DOCTYPE html>
|
|
|
+ <html>
|
|
|
+ <head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <title>营养风险评估表 - ${dataForm.elderName || ''}</title>
|
|
|
+ <style>
|
|
|
+ @media print {
|
|
|
+ @page { size: A4 portrait; margin: 15mm; }
|
|
|
+ }
|
|
|
+ body {
|
|
|
+ font-family: 'SimSun', 'Microsoft YaHei', serif;
|
|
|
+ font-size: 8pt;
|
|
|
+ line-height: 1.2;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ .header {
|
|
|
+ text-align: center;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ border-bottom: 2px solid #333;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ }
|
|
|
+ .header h1 {
|
|
|
+ font-size: 14pt;
|
|
|
+ margin: 0;
|
|
|
+ letter-spacing: 2px;
|
|
|
+ }
|
|
|
+ .info-section {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid #999;
|
|
|
+ background: #fafafa;
|
|
|
+ }
|
|
|
+ .info-row {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 20px;
|
|
|
+ }
|
|
|
+ .info-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .info-item .label {
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 8px;
|
|
|
+ color: #555;
|
|
|
+ }
|
|
|
+ .info-item .value {
|
|
|
+ border-bottom: 1px solid #333;
|
|
|
+ min-width: 60px;
|
|
|
+ padding: 0 5px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .subsection-title {
|
|
|
+ font-size: 11pt;
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 15px 0 10px 0;
|
|
|
+ padding: 5px 10px;
|
|
|
+ background: #e8e8e8;
|
|
|
+ border-left: 4px solid #409eff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .assessment-table {
|
|
|
+ width: 100%;
|
|
|
+ border-collapse: collapse;
|
|
|
+ margin-bottom: 15px;
|
|
|
+ font-size: 7.5pt;
|
|
|
+ }
|
|
|
+ .assessment-table th, .assessment-table td {
|
|
|
+ border: 1px solid #333;
|
|
|
+ padding: 4px;
|
|
|
+ text-align: center;
|
|
|
+ vertical-align: middle;
|
|
|
+ }
|
|
|
+ .assessment-table th {
|
|
|
+ background: #e8e8e8;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .assessment-table .col-item {
|
|
|
+ width: 20%;
|
|
|
+ font-weight: bold;
|
|
|
+ background: #f5f5f5;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .assessment-table .col-score {
|
|
|
+ width: 20%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .initial-tip {
|
|
|
+ margin: 10px 0;
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid #999;
|
|
|
+ background: #fff3cd;
|
|
|
+ font-size: 9pt;
|
|
|
+ }
|
|
|
+ .score-value {
|
|
|
+ color: #d9534f;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 12pt;
|
|
|
+ }
|
|
|
+
|
|
|
+ .score-summary {
|
|
|
+ margin: 15px 0;
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid #999;
|
|
|
+ background: #fafafa;
|
|
|
+ }
|
|
|
+ .summary-item {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ }
|
|
|
+ .summary-item .label {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .summary-item .value {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .summary-item .value.total {
|
|
|
+ color: #d9534f;
|
|
|
+ font-size: 14pt;
|
|
|
+ }
|
|
|
+
|
|
|
+ .scoring-standard {
|
|
|
+ margin: 15px 0;
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid #999;
|
|
|
+ background: #fafafa;
|
|
|
+ }
|
|
|
+ .standard-title {
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+ .standard-content {
|
|
|
+ font-size: 8pt;
|
|
|
+ line-height: 1.5;
|
|
|
+ }
|
|
|
+ .standard-content p {
|
|
|
+ margin: 3px 0;
|
|
|
+ }
|
|
|
+ .current-result {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding-top: 10px;
|
|
|
+ border-top: 1px solid #ccc;
|
|
|
+ }
|
|
|
+ .result-label {
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .assessor-section {
|
|
|
+ margin: 15px 0;
|
|
|
+ padding: 10px;
|
|
|
+ border: 1px solid #999;
|
|
|
+ background: #fafafa;
|
|
|
+ }
|
|
|
+ .assessor-row {
|
|
|
+ display: flex;
|
|
|
+ gap: 30px;
|
|
|
+ }
|
|
|
+ .assessor-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ .assessor-item .label {
|
|
|
+ font-weight: bold;
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+ .assessor-item .value {
|
|
|
+ border-bottom: 1px solid #333;
|
|
|
+ min-width: 120px;
|
|
|
+ padding: 0 5px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div class="header">
|
|
|
+ <h1>营养风险评估表</h1>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="info-section">
|
|
|
+ <div class="info-row">
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">长者姓名:</span>
|
|
|
+ <span class="value">${dataForm.elderName || ''}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">性别:</span>
|
|
|
+ <span class="value">${dataForm.elderSex || ''}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">年龄:</span>
|
|
|
+ <span class="value">${dataForm.elderAge || ''}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">床位号:</span>
|
|
|
+ <span class="value">${dataForm.bedName || ''}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">评估日期:</span>
|
|
|
+ <span class="value">${form.assessDate || ''}</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">身高:</span>
|
|
|
+ <span class="value">${form.height || ''} m</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">体重:</span>
|
|
|
+ <span class="value">${form.weight || ''} Kg</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">BMI:</span>
|
|
|
+ <span class="value">${form.bmi ? form.bmi.toFixed(1) : ''}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 初筛部分 -->
|
|
|
+ <div class="subsection-title">初筛(满分14分)</div>
|
|
|
+ <table class="assessment-table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th class="col-item">项目</th>
|
|
|
+ <th class="col-score">0分</th>
|
|
|
+ <th class="col-score">1分</th>
|
|
|
+ <th class="col-score">2分</th>
|
|
|
+ <th class="col-score">3分</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ ${initialItems.map((item, index) => `
|
|
|
+ <tr>
|
|
|
+ <td class="col-item">${item.name}</td>
|
|
|
+ ${item.options.map(opt => `
|
|
|
+ <td class="col-score">${form.initialScores[index] === opt.score ? '☑' : '☐'} ${opt.text}</td>
|
|
|
+ `).join('')}
|
|
|
+ </tr>
|
|
|
+ `).join('')}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <div class="initial-tip">
|
|
|
+ <p>总分14分,<12分提示有营养不良风险,继续以下评估;≥12分提示无营养不良风险,无需以下评估。</p>
|
|
|
+ <p>初筛分数(小计满分14分):<span class="score-value">${form.initialScore}</span> 分</p>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 评估部分 -->
|
|
|
+ <div class="subsection-title">评估(满分16分)</div>
|
|
|
+ <table class="assessment-table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th class="col-item">项目</th>
|
|
|
+ <th class="col-score">0分</th>
|
|
|
+ <th class="col-score">0.5分</th>
|
|
|
+ <th class="col-score">1分</th>
|
|
|
+ <th class="col-score">2分</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ ${assessItems.map((item, index) => `
|
|
|
+ <tr>
|
|
|
+ <td class="col-item">${item.name}</td>
|
|
|
+ ${item.options.map((opt, optIndex) => {
|
|
|
+ let isSelected = false
|
|
|
+ if (index < 11) {
|
|
|
+ isSelected = form.assessScores[index] === opt.score
|
|
|
+ } else if (index === 11) {
|
|
|
+ isSelected = form.measureScores[0] === opt.score
|
|
|
+ } else if (index === 12) {
|
|
|
+ isSelected = form.measureScores[1] === opt.score
|
|
|
+ } else if (index === 13) {
|
|
|
+ // 腰围特殊处理
|
|
|
+ if (optIndex === 0) isSelected = form.waistScore === 0 || form.waistScore === 2
|
|
|
+ if (optIndex === 2) isSelected = form.waistScore === 1 || form.waistScore === 3
|
|
|
+ }
|
|
|
+ return `<td class="col-score">${isSelected ? '☑' : '☐'} ${opt.text}</td>`
|
|
|
+ }).join('')}
|
|
|
+ </tr>
|
|
|
+ `).join('')}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <!-- 测量值 -->
|
|
|
+ <div class="info-section">
|
|
|
+ <div class="info-row">
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">小腿围:</span>
|
|
|
+ <span class="value">${form.calfCircumference || ''} cm</span>
|
|
|
+ </div>
|
|
|
+ <div class="info-item">
|
|
|
+ <span class="label">腰围:</span>
|
|
|
+ <span class="value">${form.waistCircumference || ''} cm</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 分数汇总 -->
|
|
|
+ <div class="score-summary">
|
|
|
+ <div class="summary-item">
|
|
|
+ <span class="label">初筛分数(小计满分14分):</span>
|
|
|
+ <span class="value">${form.initialScore} 分</span>
|
|
|
+ </div>
|
|
|
+ <div class="summary-item">
|
|
|
+ <span class="label">评估分数(小计满分16分):</span>
|
|
|
+ <span class="value">${form.assessScore + form.measureScore} 分</span>
|
|
|
+ </div>
|
|
|
+ <div class="summary-item">
|
|
|
+ <span class="label">年龄调整(≥70岁加1分):</span>
|
|
|
+ <span class="value">${form.ageAdjust} 分</span>
|
|
|
+ </div>
|
|
|
+ <div class="summary-item">
|
|
|
+ <span class="label">量表总分(满分30分):</span>
|
|
|
+ <span class="value total">${form.totalScore} 分</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 评分标准 -->
|
|
|
+ <div class="scoring-standard">
|
|
|
+ <div class="standard-title">评分标准:</div>
|
|
|
+ <div class="standard-content">
|
|
|
+ <p>若初筛总分≥12分提示无营养不良风险,无需评估;</p>
|
|
|
+ <p>若初筛总分<12分提示有营养不良风险,继续评估;</p>
|
|
|
+ <p>若营养不良风险评估总分(初筛+评估)≥24分,表示营养状况良好;</p>
|
|
|
+ <p>若营养不良风险评估总分(初筛+评估)>24分,当BMI≥24(或男性腰围>90cm,女性腰围>80cm)时,提示可能是肥胖/超重型营养不良或有营养不良风险;</p>
|
|
|
+ <p>若营养不良风险评估总分(初筛+评估)17分~24分,表示有营养不良风险;</p>
|
|
|
+ <p>若营养不良风险评估总分(初筛+评估)≤17分,表示有营养不良。</p>
|
|
|
+ </div>
|
|
|
+ ${form.resultLevel ? `
|
|
|
+ <div class="current-result">
|
|
|
+ <span class="result-label">当前评估结果:</span>
|
|
|
+ <span class="score-value">${getResultText(form.resultLevel)}</span>
|
|
|
+ </div>
|
|
|
+ ` : ''}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 评估人签名 -->
|
|
|
+ <div class="assessor-section">
|
|
|
+ <div class="assessor-row">
|
|
|
+ <div class="assessor-item">
|
|
|
+ <span class="label">评估人签名:</span>
|
|
|
+ <span class="value">${form.assessor || ''}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </body>
|
|
|
+ </html>
|
|
|
+ `
|
|
|
+
|
|
|
+ // 写入内容并打印
|
|
|
+ printWindow.document.write(printContent)
|
|
|
+ printWindow.document.close()
|
|
|
+
|
|
|
+ // 延迟打印,确保样式加载完成
|
|
|
+ setTimeout(() => {
|
|
|
+ printWindow.print()
|
|
|
+ }, 500)
|
|
|
}
|
|
|
|
|
|
const rules = {
|