ZhiYeJianKang_QiYe_APP/pages/homepage/homepage.vue

604 lines
15 KiB
Vue
Raw Normal View History

2025-02-20 15:38:43 +08:00
<template>
<view class="app">
<view class="submit">
<view class="charts-box">
<qiun-data-charts type="arcbar" v-show="!!opts.title.name" :opts="opts" :chartData="chartData"
:errorReload="true" :reshow="true" />
</view>
</view>
<view class="items">
<view class="title" @click="open">
职业卫生资料缺失提示函,请查收
</view>
<uni-table border stripe emptyText="暂无更多数据">
<!-- 表头行 -->
<uni-tr>
</uni-tr>
<!-- 表格数据行 -->
<uni-tr v-for="(item,index) in list" :key='index'>
<uni-td width='37' align="center">{{index+1}}</uni-td>
<uni-td align="center">{{item.careerProfilename}}</uni-td>
<uni-td align="center" width='100'>
<view class="" @tap="handleitem(item)">
<span
:style="{color:item.docstatusremark==='首次未提交' || item.docstatusremark==='到期未提交' ? 'red' : '#606266'}">{{item.docstatusremark}}</span>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
<view class="modallist" v-if='maskshow'>
<u-modal v-model="show" width="90%" height="50%" :show-title='false' :show-cancel-button='false'
:show-confirm-button="false" style="height: 50%;">
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="scroll">
<view class="" v-for="(item,index) in list" :key='index' v-if="item.docstatus!=1">
<view class="zheye" v-if="item.daycount <= 3">
<view class="titledata">
职业卫生资料缺失提示函
</view>
<view class="test">
{{item.enterprisename }}
</view>
<view class="item">
你的单位<span>{{item.careerProfilename}}</span>资料未按照要求上传请于收到提醒后3日内上传相关资料或者证明否则信息将推送{{item.areaname}}卫生健康局
</view>
<view class="city">
{{item.city}}市职业健康管理中心
</view>
<view class="time">
{{item.riqi}}
</view>
</view>
<view class="zheye" v-if="item.docstatus!=1 && item.daycount <= 5 && item.daycount > 3">
<view class="titledata">
职业卫生资料缺失提示函
</view>
<view class="test">
{{item.enterprisename}}
</view>
<view class="item">
你的单位<span>{{item.careerProfilename}}</span>资料未按照要求上传请于收到提醒后2日内上传相关资料或者证明否则信息将推送{{item.city}}市卫生综合执法支队
</view>
<view class="city">
{{ item.areaname}}卫生健康局
</view>
<view class="time">
{{item.riqi}}
</view>
</view>
<view class="zheye" v-if="item.docstatus!=1 && item.daycount > 5">
<view class="titledata">
职业卫生资料缺失提示函
</view>
<view class="test">
{{item.enterprisename }}:
</view>
<view class="item">
&nbsp;&nbsp;你的单位<span>{{ item.careerProfilename }}</span>资料未按照要求上传请于收到提醒后2日内上传相关资料或者证明否则{{item.city}}市卫生综合执法支队将进行现场检查
</view>
<view class="city">
{{item.city}}市卫生综合执法支队
</view>
<view class="time">
{{item.riqi}}
</view>
</view>
</view>
</scroll-view>
<view class="button" @tap='logininfo'>
关闭
</view>
</u-modal>
</view>
</view>
</template>
<script>
import {
GetDocStatusForEnterpriselist,
} from '@/api/homepage/index.js';
import params from '@/api/common/params.js'
export default {
data() {
return {
scrollTop: 0,
chartData: {},
show: false,
maskshow: false,
list: [],
valuelist1: null,
Subscript: null,
// value:null
// content: '东临碣石,以观沧海'
opts: {
update: false,
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: undefined,
title: {
name: "80%",
fontSize: 17,
color: "#4179C3"
},
subtitle: {
name: "资料提交率",
fontSize: 10,
color: "#666666"
},
extra: {
arcbar: {
type: "circle",
width: 10,
backgroundColor: "#E9E9E9",
startAngle: 1.5,
endAngle: 0.25,
gap: 2,
lineCap: "butt",
// borderWidth:'30'
}
}
}
}
},
// 下拉刷新
onPullDownRefresh() {
this.open();
this.infolist();
this.getServerData();
console.log('refresh');
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
onShow() {
// console.log(change, '1111')
// this.$emit('change', files);
//是否显示提示函
setTimeout(function() {
}, 5000);
this.$nextTick(() => {
this.getServerData();
})
},
onReady() {
this.infolist();
},
// onReady() {},
mounted() {},
onLoad() {
uni.$on('update', (data) => {
if(data=='1'){
this.infolist();
}
// console.log('监听到事件来自 update ,携带参数 为:', data);
// this.list = data
});
this.show = params.isShowTiShiHan;
// #ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary');
// #endif
},
methods: {
upper: function(e) {
// console.log(e);
},
lower: function(e) {
// console.log(e);
},
scroll: function(e) {
// console.log(e);
// this.old.scrollTop = e.detail.scrollTop;
},
goTop: function(e) {
this.scrollTop = this.old.scrollTop;
this.$nextTick(function() {
this.scrollTop = 0;
});
uni.showToast({
icon: "none",
title: "纵向滚动 scrollTop 值已被修改为 0"
});
},
// 首次未提交
handleitem(item) {
// console.log(item)
if (item.careerProfilename == "工作场所职业病危害因素检测报告" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/upload/upload"
})
} else if (item.careerProfilename == "建设项目职业病危害现状评价报告" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/StatusReport/StatusReport"
})
} else if (item.careerProfilename == "劳动者上岗前培训" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/cultivate/cultivate?type=1"
})
} else if (item.careerProfilename == "在岗期间定期培训" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/cultivate/cultivate?type=2"
})
} else if (item.careerProfilename == "用人单位主要负责人、职业卫生管理人员培训" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交") ) {
uni.navigateTo({
url: "/pages/cultivate/cultivate?type=3"
})
} else if (item.careerProfilename == "用人单位职业健康监护档案" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/Custodyfile/Custodyfile"
})
} else if (item.careerProfilename == "职业病危害项目申报表及回执" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=1"
})
} else if (item.careerProfilename == "个人防护用品的购买、发放使用记录" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=4"
})
} else if (item.careerProfilename == "劳动者个人监护档案" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=10"
})
} else if (item.careerProfilename == "职业病防治年度计划及实施方案" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=5"
})
}
// 无下次报告书时间
else if (item.careerProfilename == "职业卫生管理机构成立文件" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=2"
})
} else if (item.careerProfilename == "职业病危害事故应急救援预案" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=7"
})
} else if (item.careerProfilename == "职业病危害警示标识及告知" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=11"
})
} else if (item.careerProfilename == "职业卫生管理制度及重点岗位职业卫生操作规程" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=3"
})
} else if (item.careerProfilename == "确诊职业病和疑似职业病报告" && (item.docstatusremark == "首次未提交" || item
.docstatusremark == "到期未提交")) {
uni.navigateTo({
url: "/pages/purchase/purchase?purchasetypeid=6"
})
}
},
getServerData() {
// var aaa = 33.87
// var bbb = Math.round(aaa)
// console.log(bbb)
//模拟从服务器获取数据时的延时
setTimeout(() => {
//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
var value = this.valuelist1 / 100
// console.log(value)
let res = {
series: [{
name: "资料提交率",
color: "#4179C3",
data: value
}]
};
this.opts.title.name = Math.round(this.valuelist1) + '%'
this.chartData = JSON.parse(JSON.stringify(res));
}, 1000);
},
infolist() {
GetDocStatusForEnterpriselist().then(res => {
// console.log(res)
this.list = res
let num = 0
this.list.forEach((item) => {
if (item.docstatus === '1') {
num++
}
if (item.docstatusremark != '已提交') {
this.maskshow = true
// this.show=true
}
// if (item.docstatusremark == '首次未提交' || item.docstatusremark == '到期未提交') {
// this.maskshow = true
// }
});
let num1 = 0
this.list.forEach((item) => {
if (item.docstatus === '0' || item.docstatus === '2') {
num1++
}
});
this.Subscript = num1
// #ifdef APP-PLUS
plus.runtime.setBadgeNumber(this.Subscript);
// #endif
const valuelist = (num / this.list.length) * 100;
this.valuelist1 = parseFloat(valuelist).toFixed(2);
})
},
open() {
this.show = true;
},
logininfo() {
this.show = false;
}
}
}
</script>
<style lang="scss">
.app {
/* font-family: DengXian; */
color: #C3C1C1;
font-weight: 400;
// height: 100vh;
background: #F7F5F5;
padding: 10rpx;
::v-deep .u-mode-center-box {
width: 90%;
height: 80%;
// background: red;
}
/* #ifdef MP-ALIPAY */
.uni-badge {
margin-left: 20rpx;
}
/* #endif */
.example-body {
flex-direction: row;
justify-content: flex-start;
}
.uni-badge-left-margin {
margin-left: 10px;
}
.uni-badge-absolute {
margin-left: 40px;
}
.box {
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
background-color: #DCDFE6;
color: #fff;
font-size: 12px;
}
.box-text {
text-align: center;
color: #fff;
font-size: 12px;
}
.scroll-Y {
// white-space: nowrap;
height: 1000rpx;
overflow: scroll // width: 100%;
}
.modallist {
width: 95%;
height: 50%;
}
.submit {
width: 95%;
height: 300rpx;
background-color: #fff;
margin: 0 auto;
.charts-box {
top: 5%;
position: absolute;
width: 95%;
height: 200rpx;
// background-color: #fff;
// margin-top: 20rpx;
// margin-bottom: 90rpx;
}
}
.data {
position: absolute;
width: 53%;
height: 90rpx;
line-height: 90rpx;
text-align: center;
top: 3%;
background-color: #4D7BC9;
font-size: 40rpx;
left: 26%;
color: #fff;
// border-radius: 20%;
}
.button {
width: 100rpx;
background-color: #3C9CFF;
color: #fff;
text-align: center;
border-radius: 10%;
margin-top: 40rpx;
// position: fixed;
// left: 75%;
// margin-top: 50rpx;
// top:-5%;
// right: 0;
margin-bottom: 4%;
font-size: 32rpx;
height: 70rpx;
line-height: 70rpx;
margin-left: 70%;
}
.items {
width: 95%;
height: 100%;
// height: ;
background-color: #fff;
margin: 0 auto;
// margin: 0 auto;
// background-color: red;
// padding-bottom: 0rpx;
}
// .uni-group {
// display: flex;
// align-items: center;
// }
.title {
// position: absolute;
font-size: 35rpx;
color: red;
padding-top: 20rpx;
margin-left: 2%;
margin-top: 5%;
margin-bottom: 5%;
// left: 8%;
}
.tabledata {
width: 95%;
position: absolute;
// font-size: 30rpx;
// color: red;
top: 18%;
left: 3%;
}
.zheye {
border: 1rpx solid #F0F0F0;
position: relative;
height: 250px;
width: 97%;
left: 2%;
margin-top: 10%;
margin-bottom: 10%;
.titledata {
position: absolute;
font-size: 29rpx;
color: #676A6C;
left: 20%;
font-weight: 700;
top: 6%;
// margin: 0 auto;
}
.test {
font-weight: 700;
font-size: 30rpx;
position: absolute;
top: 18%;
left: 2%;
color: #676A6C;
}
.item {
// font-weight: 700;
font-size: 30rpx;
line-height: 50rpx;
position: absolute;
top: 28%;
color: #76797A;
text-indent: 2em;
padding: 10rpx;
span {
font-weight: 700;
}
// left: 5%;
}
.city {
font-size: 30rpx;
line-height: 50rpx;
position: absolute;
left: 40%;
top: 75%;
color: #76797A;
}
.time {
font-size: 30rpx;
line-height: 50rpx;
position: absolute;
left: 40%;
top: 87%;
color: #76797A;
}
}
}
</style>