123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <!-- 隐患记录 -->
- <template>
- <view class="hiddenDangerRecord">
- <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
- <view class="tip">此检查项在当前实验室累计出现 {{total}} 次隐患</view>
- <view class="list">
- <view class="list-li" v-for="(item,index) in dataList" @click="clickInfo(item)">
- <view>{{item.flagType==1?'检查时间':'上报时间'}}</view>
- <view>{{item.checkTime}}
- <img src="@/pages_safetyCheck/images/icon_wd_gd@1x.png">
- </view>
- </view>
- </view>
- <view class="get-data-null-p" v-if="getDataType">- 没有更多数据 -</view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- config
- } from '@/api/request/config.js'
- import {} from '@/pages/api/index.js'
- import {
- securityAppCheckDangerGetCheckDangerBySub
- } from '@/pages_safetyCheck/api/index.js'
- export default {
- name: "hiddenDangerRecord",
- components: {
- },
- data() {
- return {
- baseUrl: config.base_url,
- pageType: 0,
- // 查询参数
- queryParams: {
- page: 1,
- pageSize: 10,
- },
- total:0,
- getDataType: false,
- optionData:null,
- dataList: [{
- name: '检查时间',
- time: '2024-09-06',
- },
- {
- name: '检查时间',
- time: '2024-09-06',
- },
- {
- name: '检查时间',
- time: '2024-09-06',
- },
- ]
- }
- },
- onLoad(option) {
- let optionData = JSON.parse(decodeURIComponent(option.infoData));
- uni.setNavigationBarTitle({
- title: optionData.subName + '(' + (optionData.pageType == 0 ? optionData.roomNum : optionData
- .subRoom) + ')'
- })
- this.$set(this, 'optionData', optionData);
- },
- onShow() {
- },
- mounted() {
- this.getList();
- },
- methods: {
- //滚动事件
- scrollGet() {
- let self = this;
- if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- } else {
- this.queryParams.page += 1;
- this.$nextTick(() => {
- this.getList();
- })
- }
- },
- clickInfo(row){
- let infoData = this.optionData;
- if(row.flagType==1){
- //检查时间
- uni.navigateTo({
- url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
- encodeURIComponent(JSON
- .stringify(infoData))
- });
- }else if(row.flagType==2){
- //上报时间
- let infoData=this.optionData;
- uni.redirectTo({
- url: '/pages_safetyCheck/views/snapshotManage/snapshotDetail?infoData=' + encodeURIComponent(JSON.stringify(infoData))
- });
- }
- },
- async getList() {
- let self = this;
- let obj = JSON.parse(JSON.stringify(this.queryParams))
- obj.hazardCheckPro = this.optionData.hazardCheckPro;
- obj.subId = this.optionData.subId;
- const {
- data
- } = await securityAppCheckDangerGetCheckDangerBySub(obj);
- if (data.code == 200) {
- if (self.queryParams.page == 1) {
- this.dataList = data.data.records;
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- } else {
- this.dataList = [...this.dataList, ...data.data.records]
- this.total = data.data.total;
- if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
- this.$set(this, 'getDataType', true);
- }
- }
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- .hiddenDangerRecord {
- height: 100%;
- display flex;
- .tip {
- width: 750rpx;
- height: 80rpx;
- background: rgba(255, 140, 0, 0.2);
- border-radius: 0rpx 0rpx 0rpx 0rpx;
- font-size: 30rpx;
- color: #FF8C00;
- line-height: 80rpx;
- text-align: center;
- }
- .list {
- width: 690rpx;
- background: #FFFFFF;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- margin: 20rpx 30rpx 0;
- .list-li {
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1rpx solid #E0E0E0;
- padding: 0 30rpx;
- box-sizing: border-box;
- >view:nth-of-type(1) {
- font-size: 30rpx;
- color: #333333;
- line-height: 100rpx;
- text-align: left;
- }
- >view:nth-of-type(2) {
- font-size: 28rpx;
- color: #666666;
- line-height: 100rpx;
- text-align: left;
- display: flex;
- justify-content: space-between;
- align-items: center;
- >img {
- width: 24rpx;
- height: 24rpx;
- margin-left: 10rpx;
- }
- }
- }
- .list-li:last-of-type {
- border: none;
- }
- }
- .get-data-null-p {
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- }
- }
- </style>
|