| | |
| | | <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='printFrom2'> |
| | | <div style="width: 100%; height: 100%;overflow: auto;"> |
| | | <div id='printMe'> |
| | | <div> |
| | | <el-form size="small"> |
| | | <div style="width: 100%"> |
| | |
| | | 1.常吃的主食 |
| | | </td> |
| | | <td colspan="5"> |
| | | <el-form :inline="true" size="small" > |
| | | <el-form-item> |
| | | <el-radio-group class="elradiozdi" |
| | | <el-form-item> |
| | | <el-radio-group |
| | | v-model="state.tableData.常吃的主食.type"> |
| | | <el-checkbox value="精米面类">A.精米面类</el-checkbox> |
| | | <el-checkbox value="杂豆类">B.杂豆类</el-checkbox> |
| | |
| | | <el-checkbox value="其它">E.其它</el-checkbox> |
| | | |
| | | </el-radio-group> |
| | | <span> |
| | | <el-input v-model="state.tableData.常吃的主食.input1" |
| | | style="max-width: 150px" placeholder=""> |
| | | <template #append>次/周</template> |
| | | </el-input> |
| | | </span> |
| | | <span>食用份量</span> |
| | | <span> |
| | | <el-input v-model="state.tableData.常吃的主食.input2" |
| | | style="max-width: 150px" placeholder=""> |
| | | <template #append>g/天</template> |
| | | </el-input> |
| | | </span> |
| | | </el-form-item> |
| | | <el-form-item label="食用频率"> |
| | | <el-input v-model="state.tableData.常吃的主食.input1" |
| | | style="max-width: 150px" placeholder=""> |
| | | <template #append>次/周</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="食用份量"> |
| | | <el-input v-model="state.tableData.常吃的主食.input2" |
| | | style="max-width: 150px" placeholder=""> |
| | | <template #append>g/天</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </td> |
| | | |
| | | </tr> |
| | |
| | | 2.常吃的蔬菜 |
| | | </td> |
| | | <td colspan="5"> |
| | | |
| | | <el-form :inline="true" size="small" > |
| | | <el-form-item> |
| | | <el-radio-group class="elradiozdi" v-model="state.tableData.常吃的蔬菜.type"> |
| | | <el-radio-group v-model="state.tableData.常吃的蔬菜.type"> |
| | | <el-checkbox value="叶菜">A.叶菜</el-checkbox> |
| | | <el-checkbox value="根茎类">B.根茎类</el-checkbox> |
| | | <el-checkbox value="瓜茄">C.瓜茄</el-checkbox> |
| | |
| | | <el-form-item> |
| | | <el-radio-group class="elradiozdi" |
| | | v-model="state.tableData.蔬菜日食用量.type"> |
| | | <el-radio value="小于300g">A.小于300g </el-radio> |
| | | <el-radio value="<300g">A.< 300g </el-radio> |
| | | <el-radio value="300g-500g">B.300g-500g</el-radio> |
| | | <el-radio value="于500g">C.大于500g</el-radio> |
| | | <el-radio value=">500g">C.> 500g</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | |
| | |
| | | <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> |
| | |
| | | surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'), |
| | | surveryPerson: userInfos.value.code, |
| | | surveryJsonBody: '', |
| | | suveryFormName: '营养膳食调查表', |
| | | suveryFormName: '膳食调查表', |
| | | updateTime: '' |
| | | } |
| | | |
| | |
| | | state.dialogTableVisible = false |
| | | } |
| | | const generatePDF=()=> { |
| | | const element = document.getElementById('printFrom2'); |
| | | const element = document.getElementById('printMe'); |
| | | const opt = { |
| | | margin: 10, |
| | | filename: `${state.tableData.表名}.pdf`, |
| | |
| | | surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'), |
| | | surveryPerson: userInfos.value.code, |
| | | surveryJsonBody: JSON.stringify(state.tableData), |
| | | suveryFormName: '营养膳食调查表', |
| | | suveryFormName: '膳食调查表', |
| | | surveryFormType: 0, |
| | | updateTime: '' |
| | | updateTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'), |
| | | } |
| | | console.log(info) |
| | | if (info.id === 0) { |
| | |
| | | console.log(mode) |
| | | state.viewInfo = mode |
| | | state.tableData = JSON.parse(mode.surveryJsonBody) |
| | | state.tableData.初次调查日期=mode.surveryTime |
| | | state.tableData.更新日期=mode.updateTime |
| | | state.dialogTableVisible = true |
| | | |
| | | |
| | |
| | | 作息时间: { type: '', input1: '', input2: '' }, |
| | | 排便情况: { type: '', input1: '' }, |
| | | } |
| | | state.viewInfo= { |
| | | id: 0, |
| | | code: '', |
| | | surveryFormType: 0, |
| | | clientCode: userInfos.value.clientCode, |
| | | patientCode: patientsInfo.value.code, |
| | | surveryTime: formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS'), |
| | | surveryPerson: userInfos.value.code, |
| | | surveryJsonBody: '', |
| | | suveryFormName: '膳食调查表', |
| | | updateTime: '' |
| | | } |
| | | } |
| | | |
| | | // 第二步:暴露方法 |
| | |
| | | |
| | | |
| | | <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; |