|
@@ -1,41 +1,48 @@
|
|
|
<template>
|
|
|
<view class="history-container">
|
|
|
<view class="tabs">
|
|
|
+ <view class="tab" :class="tabIdx===3?'active':''" @click="tabclick(3)">满意度评价</view>
|
|
|
+ <view class="tab" :class="tabIdx===2?'active':''" @click="tabclick(2)">隐患记录</view>
|
|
|
<view class="tab" :class="tabIdx===1?'active':''" @click="tabclick(1)">安全巡检</view>
|
|
|
- <view class="tab" :class="tabIdx===2?'active':''" @click="tabclick(2)">隐患记录</view>
|
|
|
- <view class="tab" :class="tabIdx===3?'active':''" @click="tabclick(3)">满意度评价</view>
|
|
|
+ <view class="tab" :class="tabIdx===4?'active':''" @click="tabclick(4)">危险源</view>
|
|
|
</view>
|
|
|
- <view class="item-list" v-if="total>0">
|
|
|
- <view class="check" v-if="tabIdx===1">
|
|
|
- <uni-list :border="true">
|
|
|
- <uni-list-item v-for="(item,index) in items" :key="index"
|
|
|
- :title="item.checklistTitle"
|
|
|
- :note="item.recordTime"
|
|
|
- :rightText="item.accountName"
|
|
|
- @click="showDangerDetail(item)"
|
|
|
- clickable/>
|
|
|
- </uni-list>
|
|
|
+ <view class="item-list-wrap" v-if="total>0">
|
|
|
+ <view class="item-list basics" v-if="tabIdx===1||tabIdx===4">
|
|
|
+ <view class="basics-item" v-for="(item,idx) in items" :key="idx" @click="showDetail(item)">
|
|
|
+ <view class="basics-title">{{item.checklistTitle}}</view>
|
|
|
+ <view class="basics-body">
|
|
|
+ <view class="lf">
|
|
|
+ <text class="time">{{item.recordTime}}</text>
|
|
|
+ <text class="user">{{item.accountName||'微信用户'}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="status">{{checklistStatus(item.status)}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <view class="check" v-if="tabIdx===2">
|
|
|
- <uni-list :border="true">
|
|
|
- <view class="item" v-for="(item,index) in items" :key="index">
|
|
|
- <uni-list-chat
|
|
|
- :avatar-circle="true"
|
|
|
- :title="item.dangerTitle"
|
|
|
- :avatar="item.scenePhoto"
|
|
|
- :note="item.curAccountName"
|
|
|
- clickable @click="linkTo(item)">
|
|
|
- <view class="chat-custom-right">
|
|
|
- <text class="chat-custom-text">{{item.dangerDeadLine}}</text>
|
|
|
- <view class="bottom">
|
|
|
- <text class="status" :class="'status'+item.status">{{dangerStatus(item.status)}}</text>
|
|
|
- <text class="level" :class="'level-'+item.dangerLevel">{{dangerLevelFilter(item.dangerLevel)}}</text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </uni-list-chat>
|
|
|
+ <view class="item-list basics danger" v-if="tabIdx===2">
|
|
|
+ <view class="basics-item" v-for="(danger,dangerIdx) in items" :key="dangerIdx" @click="linkTo(danger)">
|
|
|
+ <view class="basics-title">{{danger.dangerTitle}}</view>
|
|
|
+ <view class="basics-body">
|
|
|
+ <view class="lf">
|
|
|
+ <text class="time">{{danger.dangerDeadLine}}</text>
|
|
|
+ <text class="user">{{danger.curAccountName}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="status">{{dangerStatus(danger.status)}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="item-list satisfaction" v-if="tabIdx===3">
|
|
|
+ <view class="uni-table">
|
|
|
+ <view class="uni-table-tr">
|
|
|
+ <view class="uni-table-th">姓名</view>
|
|
|
+ <view class="uni-table-th" style="80px;text-align:right;">评分</view>
|
|
|
</view>
|
|
|
- </uni-list>
|
|
|
- </view>
|
|
|
+ <view class="uni-table-tr" v-for="(item,index) in items" :key="index" @click="showDetail(item)">
|
|
|
+ <view class="uni-table-td">{{item.accountName||'微信用户'}}</view>
|
|
|
+ <view class="uni-table-td" style="80px;text-align:right;">{{item.score===null?'--':item.score}}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<template v-else>
|
|
|
<view class="isEmpty" >
|
|
@@ -44,10 +51,9 @@
|
|
|
</template>
|
|
|
</view>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
import {getDangerByPage} from '@/api/aqpt/dangerApi.js'
|
|
|
- import {getchecklistByPage} from '@/api/openApi.js'
|
|
|
+ import { getchecklistByPage} from '@/api/aqpt/checklistPoint.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -57,7 +63,7 @@
|
|
|
},
|
|
|
total:0,
|
|
|
items:[],
|
|
|
- tabIdx:1
|
|
|
+ tabIdx:3
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
@@ -66,7 +72,8 @@
|
|
|
onLoad() {
|
|
|
uni.$on('type',(tabIdx)=>{
|
|
|
if(tabIdx){
|
|
|
- this.tabclick(tabIdx)
|
|
|
+ this.tabIdx=tabIdx
|
|
|
+ // this.tabclick(tabIdx)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -79,6 +86,11 @@
|
|
|
return '已撤销'
|
|
|
}
|
|
|
},
|
|
|
+ checklistStatus(val){
|
|
|
+ if(val===-1)return "巡检异常"
|
|
|
+ const strs = ['未开始','未完成','完成']
|
|
|
+ return strs[val]
|
|
|
+ },
|
|
|
dangerLevelFilter(val){
|
|
|
let levels=['未知','一般隐患','重大隐患'];
|
|
|
return levels[val]
|
|
@@ -98,19 +110,24 @@
|
|
|
this.init()
|
|
|
},
|
|
|
getData(){
|
|
|
- if(this.tabIdx===1){
|
|
|
- getchecklistByPage(this.conditions).then((res)=>{
|
|
|
+ if(this.tabIdx===2){
|
|
|
+ getDangerByPage(this.conditions).then((res)=>{
|
|
|
let items=JSON.parse(JSON.stringify(this.items))
|
|
|
this.items=items.concat(res.data)
|
|
|
this.total=res.total
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
- if(this.tabIdx===2){
|
|
|
- getDangerByPage(this.conditions).then((res)=>{
|
|
|
+ if(this.tabIdx===1||this.tabIdx===3||this.tabIdx===4){
|
|
|
+ let checklistTypeId=undefined;
|
|
|
+ let enums={1:2,3:3,4:1}
|
|
|
+ getchecklistByPage({
|
|
|
+ ...this.conditions,
|
|
|
+ checklistTypeId:enums[this.tabIdx]
|
|
|
+ }).then((res)=>{
|
|
|
let items=JSON.parse(JSON.stringify(this.items))
|
|
|
this.items=items.concat(res.data)
|
|
|
this.total=res.total
|
|
|
- })
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
changePageNumber({type,current}){
|
|
@@ -128,10 +145,20 @@
|
|
|
url:'/pages/history/detail/detail'
|
|
|
})
|
|
|
},
|
|
|
- showDangerDetail(item){
|
|
|
+ showDetail(item){
|
|
|
+ let pageUrl="";
|
|
|
+ if(this.tabIdx===1){
|
|
|
+ pageUrl="/pages/app_views/checkList/index/index"
|
|
|
+ }
|
|
|
+ if(this.tabIdx===3){
|
|
|
+ pageUrl="/pages/app_views/satisfaction_evaluation/satisfaction_evaluation"
|
|
|
+ }
|
|
|
+ if(this.tabIdx===4){
|
|
|
+ pageUrl="/pages/app_views/hazard/index/index"
|
|
|
+ }
|
|
|
uni.navigateTo({
|
|
|
- url:`/pages/app_views/checkList/index/index?type=history&id=${item.checklistId}&recordId=${item.recordId}`
|
|
|
- })
|
|
|
+ url:`${pageUrl}?type=history&id=${item.checklistId}&recordId=${item.recordId}`
|
|
|
+ })
|
|
|
},
|
|
|
isEmpty(val){
|
|
|
if(val!=="undefined"&&val!==undefined&&val!==""&&val!==null){
|
|
@@ -158,16 +185,26 @@
|
|
|
<style lang="scss" scoped>
|
|
|
.history-container{
|
|
|
padding-bottom: 100rpx;
|
|
|
+ min-height: 100vh;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #F5F6F8;
|
|
|
.tabs{
|
|
|
- padding: 10rpx 0;
|
|
|
+ overflow-x: auto;
|
|
|
+ display: flex;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 16rpx;
|
|
|
.tab{
|
|
|
+ height: 88rpx;
|
|
|
+ line-height: 88rpx;
|
|
|
display: inline-block;
|
|
|
- padding: 10rpx 15rpx;
|
|
|
- background-color: #6e94ce;
|
|
|
- color: #fff;
|
|
|
- margin-left: 20rpx;
|
|
|
+ padding: 0 32rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #35364F;
|
|
|
&.active{
|
|
|
- background-color: #3384FF;
|
|
|
+ font-size: 34rpx;
|
|
|
+ color: #4D73FF;
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -194,47 +231,126 @@
|
|
|
letter-spacing: 2rpx;
|
|
|
}
|
|
|
}
|
|
|
-.item-list{
|
|
|
- .chat-custom-right{
|
|
|
- .chat-custom-text{
|
|
|
- font-size: 24rpx;
|
|
|
- font-family: PingFang SC;
|
|
|
- font-weight: 400;
|
|
|
- line-height: 28rpx;
|
|
|
- color: #666666;
|
|
|
- }
|
|
|
- .bottom{
|
|
|
- text-align: right;
|
|
|
- padding-top: 10rpx;
|
|
|
- .status{
|
|
|
- font-size: 28rpx;
|
|
|
- line-height: 1;
|
|
|
- display: inline-block;
|
|
|
- border: 1px solid #13ce66;
|
|
|
- color: #13ce66;
|
|
|
- padding: 8rpx 10rpx;
|
|
|
- border-radius: 4rpx;
|
|
|
+
|
|
|
+.item-list-wrap{
|
|
|
+ padding: 0 20rpx;
|
|
|
+ background-color: #F5F6F8;
|
|
|
+ margin-top: 18rpx;
|
|
|
+ .item-list{
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ overflow: hidden;
|
|
|
+ .chat-custom-right{
|
|
|
+ .chat-custom-text{
|
|
|
+ font-size: 24rpx;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 28rpx;
|
|
|
+ color: #666666;
|
|
|
}
|
|
|
- .level{
|
|
|
- line-height: 1;
|
|
|
- display: inline-block;
|
|
|
- font-size: 28rpx;
|
|
|
- color: #666666;
|
|
|
- margin-left: 10rpx;
|
|
|
- border: 1px solid transparent;
|
|
|
- padding: 8rpx 10rpx;
|
|
|
- border-radius: 4rpx;
|
|
|
- &-1{
|
|
|
- color:#13ce66 ;
|
|
|
- border-color: #13ce66;
|
|
|
+ .bottom{
|
|
|
+ text-align: right;
|
|
|
+ padding-top: 10rpx;
|
|
|
+ .status{
|
|
|
+ font-size: 28rpx;
|
|
|
+ line-height: 1;
|
|
|
+ display: inline-block;
|
|
|
+ border: 1px solid #13ce66;
|
|
|
+ color: #13ce66;
|
|
|
+ padding: 8rpx 10rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
}
|
|
|
- &-2{
|
|
|
- color: red;
|
|
|
- border-color: red;
|
|
|
+ .level{
|
|
|
+ line-height: 1;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #666666;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ border: 1px solid transparent;
|
|
|
+ padding: 8rpx 10rpx;
|
|
|
+ border-radius: 4rpx;
|
|
|
+ &-1{
|
|
|
+ color:#13ce66 ;
|
|
|
+ border-color: #13ce66;
|
|
|
+ }
|
|
|
+ &-2{
|
|
|
+ color: red;
|
|
|
+ border-color: red;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ &.basics{
|
|
|
+ background-color: #F5F6F8;
|
|
|
+ .basics-item{
|
|
|
+ padding:30rpx 40rpx ;
|
|
|
+ border-radius: 16rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ background-color: #fff;
|
|
|
+ .basics-title{
|
|
|
+ font-size: 32rpx;
|
|
|
+ line-height: 48rpx;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #212121;
|
|
|
+ }
|
|
|
+ .basics-body{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding-top: 32rpx;
|
|
|
+ .lf{
|
|
|
+ flex: 1;
|
|
|
+ .time{
|
|
|
+ font-size: 24rpx;
|
|
|
+ line-height: 48rpx;
|
|
|
+ color: #999999;
|
|
|
+ padding-left: 34rpx;
|
|
|
+ background-position: center left;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 24rpx 24rpx;
|
|
|
+ background-image: url('/static/time.png');
|
|
|
+ }
|
|
|
+ .user{
|
|
|
+ margin-left:24rpx ;
|
|
|
+ font-size: 24rpx;
|
|
|
+ line-height: 48rpx;
|
|
|
+ color: #999999;
|
|
|
+ padding-left: 34rpx;
|
|
|
+ background-position: center left;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 24rpx 24rpx;
|
|
|
+ background-image: url('/static/user.png');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .status{
|
|
|
+ font-size: 28rpx;
|
|
|
+ line-height: 48rpx;
|
|
|
+ color: #4D73FF;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ &.satisfaction{
|
|
|
+ padding: 10rpx 24rpx;
|
|
|
+ &::v-deep{
|
|
|
+ .uni-table-td,.uni-table-th{
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.custom-item-footer{
|
|
|
+ .name{
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #333;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .status{
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #666;
|
|
|
+ text-align: right;
|
|
|
+ padding-top: 10rpx;
|
|
|
}
|
|
|
}
|
|
|
</style>
|