| | |
| | | import { NextLoading } from '/@/utils/loading'; |
| | | import { useUserInfo } from '/@/stores/userInfo'; |
| | | import { usePatientsInfo } from '/@/stores/patientsInfo'; |
| | | import dayjs from 'dayjs'; |
| | | const storesPat = usePatientsInfo(); |
| | | import { Add, update, deleteId, tiaochabiaoInfo } from '/@/api/tiaochabiao/index' |
| | | import { storeToRefs } from 'pinia'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { getPatData } from '/@/api/Patients'; |
| | | import { ElLoading, ElMessage } from 'element-plus'; |
| | | import { getPatData,getLisResults } from '/@/api/Patients'; |
| | | import { number } from 'echarts'; |
| | | const stores = useUserInfo(); |
| | | const { patientsInfo } = storeToRefs(storesPat); |
| | |
| | | |
| | | } |
| | | // 打开查看或者编辑明细 |
| | | 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 |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | const getPageInfo = async () => { |
| | | const res = await getPatData({ patCode: patientsInfo.value.code, }) |
| | | console.log(res.data, '----') |
| | | state.tableData = { |
| | | 表名: 'GNRI', |
| | | 初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'), |
| | | 填表日期: '', |
| | | 更新日期: formatDate(new Date(), 'YYYY-mm-dd'), |
| | | 记录者: userInfos.value.userName, |
| | | 身高: res.data.身高, |
| | | 体重: res.data.身高.上一次透前体重, |
| | | 理想体重: '', |
| | | 血清白蛋白浓度: '', |
| | | 无法测量身高: false, |
| | | 膝高: '', |
| | | 结果:'' |
| | | const loading = ElLoading.service({ |
| | | lock: true, |
| | | text: 'Loading', |
| | | background: 'rgba(0, 0, 0, 0.7)', |
| | | }) |
| | | try{ |
| | | const pam2 = { |
| | | clientCode: userInfos.value.clientCode, |
| | | patCode: patientsInfo.value.code, |
| | | date1: dayjs().add(-30, 'day').format('YYYY-MM-DD'), |
| | | date2: dayjs().format('YYYY-MM-DD'), |
| | | } |
| | | |
| | | const res = await getPatData({ patCode: patientsInfo.value.code, }) |
| | | const res2= await getLisResults(pam2) |
| | | loading.close() |
| | | console.log(res2.data, '-1111---') |
| | | let x=-1 |
| | | // 默认白蛋白 |
| | | if(res2.data.length>0){ |
| | | x=res2.data.findIndex(e=>{return e.item_name==='白蛋白'}) |
| | | } |
| | | |
| | | console.log(x) |
| | | state.tableData = { |
| | | 表名: 'GNRI', |
| | | 初次调查日期: formatDate(new Date(), 'YYYY-mm-dd'), |
| | | 填表日期: '', |
| | | 更新日期: formatDate(new Date(), 'YYYY-mm-dd'), |
| | | 记录者: userInfos.value.userName, |
| | | 身高: res.data.身高, |
| | | 体重: res.data.上一次透前体重, |
| | | 理想体重: '', |
| | | 血清白蛋白浓度: x===-1?'':res2.data[x].item_result, |
| | | 无法测量身高: false, |
| | | 膝高: '', |
| | | 结果:'' |
| | | |
| | | } |
| | | console.log(state.tableData ) |
| | | 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:'GNRI', |
| | | surveryFormType:1, |
| | | updateTime: '' |
| | | } |
| | | }catch(err){ |
| | | loading.close() |
| | | } |
| | | 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:'GNRI', |
| | | surveryFormType:1, |
| | | updateTime: '' |
| | | } |
| | | |
| | | } |
| | | const generatePDF=()=> { |
| | | const element = document.getElementById('pinggu5'); |
| | |
| | | background: yellow; |
| | | } |
| | | </style> |
| | | |
| | | function dayjs() { |
| | | throw new Error('Function not implemented.'); |
| | | } |