| | |
| | | <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='printFrom2'> |
| | | <div id='printMe'> |
| | | <div> |
| | | <el-form size="small"> |
| | | <div style="width: 100%"> |
| | |
| | | <el-button type="primary" @click="onSubmit"> |
| | | 保存 |
| | | </el-button> |
| | | <el-button v-if="state.viewInfo.id" type="primary" v-print="'#printFrom2'"> |
| | | <el-button v-if="state.viewInfo.id" type="primary" v-print="'#printMe'"> |
| | | <el-icon><Printer /></el-icon> |
| | | 打印 |
| | | 打印ddd |
| | | </el-button> |
| | | <el-button type="primary" v-if="state.viewInfo.id" @click="generatePDF"> |
| | | <el-icon><Position /></el-icon> |
| | |
| | | state.dialogTableVisible = false |
| | | } |
| | | const generatePDF=()=> { |
| | | const element = document.getElementById('printFrom2'); |
| | | const element = document.getElementById('printMe'); |
| | | const opt = { |
| | | margin: 10, |
| | | filename: `${state.tableData.表名}.pdf`, |
| | |
| | | |
| | | |
| | | <style scoped lang="scss"> |
| | | @media print { |
| | | body * { |
| | | visibility: hidden; |
| | | } |
| | | #printMe, #printMe * { |
| | | visibility: visible; |
| | | } |
| | | #printMe { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: auto; |
| | | } |
| | | |
| | | /* 控制分页 */ |
| | | .page-break { |
| | | page-break-before: always; |
| | | } |
| | | } |
| | | .gridtable { |
| | | font-family: verdana, arial, sans-serif; |
| | | font-size: 11px; |