xinelu-applet-ui/pagesB/screeningResult/screeningResult.vue

372 lines
11 KiB
Vue
Raw Normal View History

2023-10-08 14:48:39 +08:00
<template>
<view class="screeningResult">
<view class="conTop">
<view style="display: flex;align-items: center;">
<view style="background-color: #4DC2A8;height: 20px;width: 3px;margin-right: 5px;"></view>
<view style="color: #7C7C7C;">
筛查日期{{ screeningResultData.screeningDate ? screeningResultData.screeningDate : '无' }}</view>
</view>
<view style="color: #2968F1;" @click="goToScreeningRecord" v-show="type != '1'">筛查记录</view>
</view>
<view class="tabbarCon">
2023-10-13 10:17:42 +08:00
<view style="text-align: center;color: #26A888;" v-if="screeningResultData.projectName">
2023-10-11 15:13:02 +08:00
{{screeningResultData.projectName}}
</view>
2023-10-08 14:48:39 +08:00
<uni-segmented-control :current="Inv" :values="items" @clickItem="onClickItem" styleType="text"
activeColor="#4AC4AB"></uni-segmented-control>
<view class="content">
<view v-show="Inv == 0">
<view style="text-align: center;">
2023-10-11 15:13:02 +08:00
<view class="" v-if="screeningResultData.fileType=='docx'||screeningResultData.fileType=='doc'">
<view class="btn" @click="lookpath" v-if="screeningResultData.attachment">
查看报告
</view>
</view>
<view class="" v-else>
<view v-if="screeningResultData.attachment && screeningResultData.attachment != '找不到指定文件!'">
<view style="display: flex;justify-content: space-around;">
<view style="width: 49%;" @click="xxbClick(screeningResultData.attachment)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.attachment"></image>
</view>
<view style="width: 49%;" @click="picClick1(screeningResultData.attachmentTwo)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.attachmentTwo"></image>
</view>
</view>
</view>
</view>
<view v-else style="margin: 10px auto; ">
<u-empty text="暂无照片" mode="data"></u-empty>
</view>
<!-- <view style="text-align: center;">
2023-10-08 14:48:39 +08:00
<view v-if="screeningResultData.attachment && screeningResultData.attachment != '找不到指定文件!'">
<view style="display: flex;justify-content: space-around;">
<view style="width: 49%;" @click="xxbClick(screeningResultData.attachment)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.attachment"></image>
</view>
<view style="width: 49%;" @click="picClick1(screeningResultData.attachmentTwo)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.attachmentTwo"></image>
</view>
</view>
</view>
<view v-else style="margin: 10px auto; ">
<u-empty text="暂无照片" mode="data"></u-empty>
2023-10-11 15:13:02 +08:00
</view> -->
2023-10-08 14:48:39 +08:00
</view>
</view>
<!-- <view v-show="Inv == 0">
<view style="text-align: center;">
<view
v-if="screeningResultData.projectRecordList[0].attachment && screeningResultData.projectRecordList[0].attachment != '找不到指定文件!'">
<view style="display: flex;justify-content: space-around;">
<view style="width: 49%;" @click="xxbClick(screeningResultData.projectRecordList[0].attachment)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.projectRecordList[0].attachment"></image>
</view>
<view style="width: 49%;" @click="picClick1(screeningResultData.projectRecordList[0].attachmentTwo)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.projectRecordList[0].attachmentTwo"></image>
</view>
</view>
</view>
<view v-else style="margin: 10px auto; ">
<u-empty text="暂无照片" mode="data"></u-empty>
</view>
</view>
</view> -->
<view v-show="Inv == 1">
<view>
<view
v-if="screeningResultData.projectRecordList[1].attachment && screeningResultData.projectRecordList[1].attachment != '找不到指定文件!'">
<view style="width: 50%;"
@click="xxbClick(screeningResultData.projectRecordList[1].attachment)">
<image style="width: 100%;height: 100px;"
:src="'data:image/jpeg;base64' + screeningResultData.projectRecordList[1].attachment">
</image>
</view>
</view>
<view v-else style="margin: 10px;">
<u-empty text="暂无照片" mode="data"></u-empty>
</view>
</view>
</view>
<view v-show="Inv == 2">
<view style="text-align: center;">
<!-- <u-grid :border="false" col="3">
<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex">
<view style="width: 100%;">
<image style="width: 90%;" :src="baseListItem.src" mode="widthFix"></image>
</view>
</u-grid-item>
</u-grid> -->
</view>
<!-- <view>
<view style="font-size: 32rpx;font-weight: bold;color: #323232;">诊断结果</view>
基底动脉血流速度减低,左右大脑中动脉血流速度加快
</view> -->
</view>
</view>
</view>
<u-popup :show="show" @close="close" @open="open" mode="center">
<view style="text-align: center;">
<image :src="'data:image/jpeg;base64' + fileImgSrc" mode="widthFix"></image>
</view>
</u-popup>
<u-popup :show="show1" @close="close1" mode="center">
<view style="text-align: center;">
<image :src="'data:image/jpeg;base64' + fileImgSrc1" mode="widthFix"></image>
</view>
</u-popup>
<u-popup :show="show2" @close="close2" mode="center">
<view style="text-align: center;">
<image :src="'data:image/jpeg;base64' + fileImgSrc2" mode="widthFix"></image>
</view>
</u-popup>
<view style="margin: 10px;">
<view style="font-size: 32rpx;font-weight: bold;color: #323232;">诊断结果</view>
<view style="background-color: #fff;margin-top:10px;padding: 10px;">
<!-- {{ myResultInfo ? myResultInfo : '无' }} -->
{{ screeningResultData.diagnosticResult ? screeningResultData.diagnosticResult : '无' }}
</view>
</view>
</view>
</view>
</template>
<script>
import {
lastScreeningResult,
screeningResultDetail
} from '@/api/pagesB/screeningResult/screeningResult.js'
2023-10-11 15:13:02 +08:00
import baseurl from '@/api/baseurl.js'
2023-10-08 14:48:39 +08:00
export default {
data() {
return {
myResultInfo: '',
show: false,
show1: false,
show2: false,
Inv: 0,
// items: ['眼底病变筛查', '血小板功能筛查', '动脉粥样筛查'],
2023-10-08 15:54:14 +08:00
//'糖尿病眼底病变筛查', '糖尿病血小板功能筛查',
2023-10-08 14:48:39 +08:00
items: [],
baseList: [{
src: '../../static/ydPic.png'
}, {
src: '../../static/xxbPic.png'
}, {
src: '../../static/ydPic.png'
}, {
src: '../../static/ydPic.png'
}],
baseList1: [{
src: '../../static/xxbPic.png'
}],
screeningResultData: '',
type: '',
fileImgSrc: '',
fileImgSrc1: '',
fileImgSrc2: '',
2023-10-11 15:13:02 +08:00
registerId: "",
baseurl:'',
2023-10-08 14:48:39 +08:00
};
},
2023-10-11 15:13:02 +08:00
// onLoad(e) {
// console.log(e);
// // this.type = e.type
// if(e) {
// this.registerId=e.projectId
// // this.patientld=uni.getStorageSync('patientId);
// this.patientld=52;
// this.getLastScreeningResult()
// // this.registerId= e.registerId
// }
// if (e.screeningId) {
// screeningResultDetail(e.screeningId).then(res => {
// this.items.push(res.data.data.projectName)
// this.screeningResultData = res.data.data
// })
// } else {
// // this.patientld= uni.getStorageSync('patientld');
// this.patientld=52;
// this.getLastScreeningResult()
// }
// },
onShow() {
this.baseurl=baseurl
console.log(baseurl)
2023-10-13 10:17:42 +08:00
2023-10-11 15:13:02 +08:00
},
2023-10-08 14:48:39 +08:00
onLoad(e) {
2023-10-13 10:17:42 +08:00
console.log(e);
2023-10-11 15:13:02 +08:00
this.type = e.type
if (e) {
this.registerId = e.registerId
2023-10-13 10:17:42 +08:00
this.projectId = e.projectId
2023-10-11 15:13:02 +08:00
}
2023-10-08 14:48:39 +08:00
if (e.screeningId) {
screeningResultDetail(e.screeningId).then(res => {
2023-10-11 15:13:02 +08:00
this.items.push(res.data.projectName)
console.log(this.items, '111')
this.screeningResultData = res.data
console.log(this.screeningResultData, '000000')
2023-10-08 14:48:39 +08:00
})
} else {
2023-10-13 10:40:42 +08:00
// this.patientld = 52;
this.userinfo= uni.getStorageSync('userinfo');
2023-10-13 18:13:31 +08:00
this.patientld = this.userinfo.id;
2023-10-11 15:13:02 +08:00
this.getLastScreeningResult()
2023-10-08 14:48:39 +08:00
}
},
methods: {
2023-10-11 15:13:02 +08:00
lookpath() {
var that = this
2023-10-13 10:17:42 +08:00
var url = that.baseurl + `/nurseApplet/screening/record/fileview/${that.screeningResultData.attachment}`
2023-10-11 15:13:02 +08:00
console.log(url,'1')
uni.downloadFile({
url: url,
responseType: 'blob',
success: function(resp) {
var filePath = resp.tempFilePath;
uni.openDocument({
filePath: filePath,
fileType: that.screeningResultData.fileType.toLowerCase(),
showMenu: true,
success: function(respp) {
console.log(respp)
},
fail(err) {
console.log(err)
}
});
}
})
},
2023-10-08 14:48:39 +08:00
onClickItem(e) {
if (this.Inv != e.currentIndex) {
this.Inv = e.currentIndex;
this.getLastScreeningResult()
// this.isResult(this.Inv)
}
},
isResult(inv) {
2023-10-11 15:13:02 +08:00
console.log(this.screeningResultData.projectRecordList, '555')
2023-10-08 14:48:39 +08:00
for (let item in this.screeningResultData.projectRecordList) {
if (this.screeningResultData.projectRecordList[item].projectName == (inv == 0 ? '糖尿病-眼底病变筛查' : (inv ==
1 ?
'糖尿病-血小板筛查' : ''))) {
this.myResultInfo = this.screeningResultData.projectRecordList[item].diagnosticResult
return
}
}
},
picClick(e) {
this.show = true
this.fileImgSrc = e
},
picClick1(e) {
this.show1 = true
this.fileImgSrc1 = e
},
xxbClick(e) {
this.show2 = true
this.fileImgSrc2 = e
},
close1() {
this.show1 = false
// console.log('close');
},
close2() {
this.show2 = false
},
open() {
// console.log('open');
},
close() {
this.show = false
// console.log('close');
},
// 获取最新的筛查结果
getLastScreeningResult() {
2023-10-13 10:17:42 +08:00
console.log(this.registerId,'999')
lastScreeningResult(this.patientld,this.projectId).then(res => {
2023-10-08 14:48:39 +08:00
// console.log(res);
2023-10-11 15:13:02 +08:00
this.items.push(res.data.projectName)
this.screeningResultData = res.data
2023-10-08 14:48:39 +08:00
this.isResult(this.Inv)
})
},
changeTab(Inv) {
that.navIdx = Inv;
},
goToScreeningRecord() {
uni.navigateTo({
2023-10-08 15:54:14 +08:00
// url: `../screeningRecord/screeningRecord?registerId=${this.registerId}`
2023-10-10 17:35:36 +08:00
url: `/pagesB/screeningRecord/screeningRecord?registerId=${this.patientld}`
2023-10-08 14:48:39 +08:00
})
}
}
}
</script>
<style lang="scss">
.screeningResult {
width: 96%;
margin: 0 auto;
.conTop {
margin-top: 10px;
display: flex;
background-color: #F6F6F6;
justify-content: space-between;
align-items: center;
}
}
/deep/ .segmented-control__text {
font-size: 16px !important;
}
.tabbarCon {
margin-top: 10px;
background-color: #fff;
}
.content {
padding: 30rpx 25rpx;
}
.inv-h-w {
background-color: #FFFFFF;
height: 100upx;
display: flex;
margin-bottom: 40rpx
}
.inv-h {
font-size: 26rpx;
flex: 1;
text-align: center;
color: #747474;
height: 100upx;
line-height: 100upx;
position: relative;
}
.inv-h-se {
font-family: PingFang SC;
font-weight: bold;
font-size: 28rpx;
color: #393939;
border-bottom: 3px solid #4DC2A8;
}
2023-10-13 10:17:42 +08:00
</style>