ZhiYeJianKang_QiYe_APP/pages/Health/Health.vue
2025-02-20 15:38:43 +08:00

233 lines
4.8 KiB
Vue

<template>
<view class="app">
<view class="score">
增加量化得分:{{this.scores.score}}
</view>
<view class="derive">
<view class="level">
级别:{{this.scores.level}}
</view>
<view class="download" @tap="derive()">
<image src="../../static/download.png" mode=""></image>
下载
</view>
</view>
<view class="occupationlist">
<view class="items" v-for="(item,index) in listhrrm" :key='index' @tap="datalists(item.id)">
{{item.xmName}}
</view>
</view>
</view>
</template>
<script>
import {
list,
exportApp,
delPgFile
} from '@/api/Health/Health.js'
import baseUrl from '@/api/baseurl.js'
export default {
data() {
return {
eid: '',
parentId: '0',
listhrrm: [],
scores:[],
Id: '',
}
},
onShow() {
this.listinfo();
},
methods: {
// 列表
listinfo() {
this.parentId = 0
list(this.eid, this.parentId).then(res => {
console.log(res, '66')
this.listhrrm = res.body.list
this.scores = res.body.scores
this.listhrrm.forEach((e) => {
this.Id = e.id
console.log('22', this.Id)
});
})
},
// 详细信息
datalists(id) {
this.parentId = id
console.log(this.parentId, '66')
list(this.eid, this.parentId).then(res => {
if(res.body.list){
}
this.tablelist = res.body.list
res.body.list.forEach((e) => {
e.children.forEach((el) => {
res.body.checkedList.forEach((ele) => {
if (el.zcJudgeType == ele.judgeType && el.parentId == ele
.zrzcId) {
e.obj1 = ele
e.obj = el
// console.log(e.obj, '66')
// console.log(e.obj1, '22')
}
})
})
});
})
uni.navigateTo({
url: `/pages/comprehensive/comprehensive?parentId=${this.parentId}`,
})
},
// 下载
derive(){
exportApp().then(res=>{
console.log(('dayin',res))
this.filePath = res
uni.downloadFile({
url: baseUrl + `/dzzyb` + res,
success: (data) => {
console.log(data)
if (data.statusCode == 200) {
//文件保存到本地
uni.saveFile({
tempFilePath: data.tempFilePath, //临时路径
success: function(res) {
console.log(res)
// uni.showToast({
// icon: 'none',
// mask: true,
// title: '文件已保存:' + res
// .savedFilePath, //保存路径
// duration: 3000,
// });
// console.log(res)
// setTimeout(() => {
// //打开文档查看
// }, 3000)
}
});
uni.openDocument({
filePath: data.tempFilePath,
success: function(res) {
// console.log('打开文档成功');
},
fail: function() {
uni.showToast({
title: '暂不支持此类型',
duration: 2000,
icon: "none",
});
}
});
if (this.filePath) {
delPgFile(this.filePath).then(res => {
})
};
}
},
})
})
},
},
}
</script>
<style lang="scss">
//css函数 声明函数
@function tovmin($rpx) {
//$rpx为需要转换的字号
@return #{$rpx * 100 / 750}vmin;
}
::v-deep .uni-page-wrapper{
// background: red;
}
.app {
/* font-family: DengXian; */
color: #C3C1C1;
font-weight: 400;
background: #F4F4F4 ;
height: 100vh;
.score{
// display: inline-block;
width: 93%;
height:tovmin(80);
line-height: tovmin(80);
// background-color: red;
margin: 0 auto;
// text-align: center;
font-size: tovmin(28);
color: #000000;
font-family: 黑体;
}
.occupationlist {
width: 93%;
margin: tovmin(0) auto;
// width: 706px;
// height: 844px;
background: #FFFFFF;
border:tovmin(1) solid #DADADA;
border-radius: tovmin(10);
.items {
display: flex;
align-items: center;
height: tovmin(90);
line-height: tovmin(90);
// vertical-align: middle;
font-size: tovmin(28);
border-bottom: tovmin(1) #EBEBEB solid;
font-family: 黑体;
color: #010000;
padding-left: tovmin(30);
}
}
.derive{
display: flex;
justify-content: space-between;
font-size:tovmin(30);
height: tovmin(90);
background: #FFFFFF;
border: tovmin(1) solid #DADADA;
border-radius: tovmin(10);
padding-left: tovmin(30);
// display: inline-block;
width: 93%;
margin: tovmin(0) auto;
color: #000000;
font-family: 黑体;
line-height: tovmin(90);
.level{
}
.download{
font-family: 黑体;
color: #4179C3;
padding-right:tovmin(27);
image{
width: tovmin(23);
height:tovmin(23);
margin-right: tovmin(10);
}
}
}
}
</style>