228 lines
5.6 KiB
Vue
Raw Normal View History

2024-05-14 18:16:51 +08:00
<template>
<view class="dangerbig-list">
<headers class="fixedheader" :themeType="true" :showBack="true">
<view class="headerName">
动火作业
</view>
</headers>
<view :style="{ 'padding-top': statusBarHeight + 45 + 'px' }">
2024-05-16 04:10:40 +08:00
<view class="list" v-if="workList && workList.length>0">
<view class="list-item" v-for="(item,index) in workList" :key="index" @click="checkItem(item)">
2024-05-14 18:16:51 +08:00
<view class="list-title">
2024-05-15 18:15:05 +08:00
<!-- 未销项 -->
2024-05-14 18:16:51 +08:00
<view>
2024-05-16 16:54:07 +08:00
<text class="tag" v-if="item.hiddenDangerNum > 0">未销项{{item.hiddenDangerNum}}</text>
2024-05-16 17:32:53 +08:00
作业票编号{{item.workTicketCode}}
2024-05-16 16:54:07 +08:00
</view>
2024-05-17 06:36:51 +08:00
<!-- <view :class="{'status2': item.engineeringState === 2,'status4': item.engineeringState === 4}"> -->
2024-05-18 03:34:25 +08:00
<!-- <view :class="{'status2': item.engineeringState === 2 || item.engineeringState === 3,'status4': item.engineeringState === 4}"> -->
<view :class="{'status2': item.engineeringState !== 4, 'status4': item.engineeringState === 4}">
2024-05-17 06:36:51 +08:00
<!-- {{item.engineeringState === 2 ? "在施" : item.engineeringState === 4 ? "已完工" : ""}} -->
2024-05-18 03:34:25 +08:00
<!-- {{item.engineeringState === 1 ? "在施" : item.engineeringState === 2 ? "在施" : item.engineeringState === 3 ? "在施" : item.engineeringState === 4 ? "已完工" : ""}} -->
{{item.engineeringState === 4 ? "已完工" : "在施"}}
2024-05-14 18:16:51 +08:00
</view>
2024-05-15 18:15:05 +08:00
<!-- <view :class="{'status1': item.finalAcceptanceStatus == 1,'status2': item.finalAcceptanceStatus == 2}">
2024-05-14 18:16:51 +08:00
{{item.finalAcceptanceStatus == 1 ? "在施" : item.finalAcceptanceStatus == 2 ? "已完工" : ""}}
2024-05-15 18:15:05 +08:00
</view> -->
2024-05-14 18:16:51 +08:00
</view>
<view class="list-content">
<view class="list-info">
2024-05-15 18:15:05 +08:00
<!-- 类别{{item.engineeringTypeName}} -->
2024-05-16 16:54:07 +08:00
作业负责人{{item.assignmentPersonInChargeName}}
2024-05-15 18:15:05 +08:00
<!-- <view class="info-status" v-if="item.issuperdanger">超危</view> -->
2024-05-14 18:16:51 +08:00
</view>
</view>
</view>
<view class="loadMoreBox" v-if="isLoadMore">
<uni-load-more :status="loadStatus" iconType="auto"></uni-load-more>
</view>
</view>
<view class="no-data" v-else>
<image class="img" src="/static/noData.png"></image>
<text class="txt">暂无数据</text>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
statusBarHeight: 0,
pageNo: 1,
pageSize: 10,
projectSn: "",
listData:[],
isLoadMore: false,
2024-05-15 18:15:05 +08:00
loadStatus: 'more',
2024-05-16 04:10:40 +08:00
workList: [],
2024-05-14 18:16:51 +08:00
}
},
onShow(){
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight;
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
},
onLoad(){
this.projectSn = JSON.parse(uni.getStorageSync('userInfo')).sn
2024-05-16 04:10:40 +08:00
// this.initData()
this.getWorkList()
2024-05-14 18:16:51 +08:00
},
onReachBottom() {
console.log(1)
if(!this.isLoadMore){ //此处判断,上锁,防止重复请求
this.isLoadMore=true
this.pageNo+=1
2024-05-16 12:14:42 +08:00
this.getWorkList()
2024-05-14 18:16:51 +08:00
}
},
onPullDownRefresh() {
console.log(2)
this.pageNo=1
this.listData=[]
2024-05-16 04:10:40 +08:00
this.getWorkList()
2024-05-14 18:16:51 +08:00
},
methods:{
2024-05-16 04:10:40 +08:00
getWorkList(){
2024-05-15 18:15:05 +08:00
let data = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectSn: this.projectSn
}
this.sendRequest({
url:'xmgl/xzSpecialOperationFireSafety/page',
method:'get',
data:data,
success:res=>{
uni.hideLoading()
if(res.code==200){
2024-05-16 04:10:40 +08:00
console.log("workList======================",res)
2024-05-15 18:15:05 +08:00
// this.listData = res.result.records
2024-05-16 04:10:40 +08:00
// this.workList=this.workList.concat(res.result)
this.workList=this.workList.concat(res.result.records)
2024-05-15 18:15:05 +08:00
if(res.result.records.length<this.pageSize){ //判断接口返回数据量小于请求数据量则表示此为最后一页
this.isLoadMore=true
this.loadStatus='nomore'
}else{
this.isLoadMore=false
// that.loadStatus='more'
}
uni.stopPullDownRefresh()
}
}
})
},
2024-05-14 18:16:51 +08:00
checkItem(val){
console.log(val)
uni.navigateTo({
2024-05-16 04:10:40 +08:00
url:'./detail?id='+val.id
2024-05-14 18:16:51 +08:00
})
2024-05-16 12:14:42 +08:00
}
2024-05-14 18:16:51 +08:00
}
}
</script>
<style lang="scss" scoped>
.dangerbig-list{
min-height: 100%;
background: #F6F6F6;
.fixedheader{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
.headerName{
z-index: 1;
}
}
.list{
padding:20rpx 0;
.list-item{
background: #fff;
margin-bottom: 20rpx;
.list-title{
padding: 20rpx;
border-bottom: 2px solid #F6F6F6;
display: flex;
align-items: center;
justify-content: space-between;
.tag{
background: #F0AD4E;
color: #fff;
padding: 4rpx 8rpx;
font-size: 12px;
margin-right: 20rpx;
margin-left: -20rpx;
height: 32rpx;
}
.status1{
2024-05-16 16:54:07 +08:00
background: #2b8df3;
2024-05-14 18:16:51 +08:00
color: #fff;
padding: 4rpx 8rpx;
font-size: 12px;
}
.status2{
2024-05-16 16:54:07 +08:00
background: #F0AD4E;
color: #fff;
padding: 4rpx 8rpx;
font-size: 12px;
}
.status3{
background: #B22222;
color: #fff;
padding: 4rpx 8rpx;
font-size: 12px;
}
.status4{
2024-05-17 06:36:51 +08:00
background: #ccc;
2024-05-14 18:16:51 +08:00
color: #fff;
padding: 4rpx 8rpx;
font-size: 12px;
}
}
.list-info{
display: flex;
padding: 20rpx;
font-size: 14px;
}
.info-status{
padding:0 10rpx;
border: 1px solid #DD524D;
border-radius: 6rpx;
color: #DD524D;
margin-left: 10rpx;
}
}
}
.btn{
height: 96rpx;
width: 100%;
line-height: 96rpx;
text-align: center;
background: #4181FE;
color: #fff;
position: fixed;
bottom: 0;
left: 0;
}
.no-data{
text-align: center;
.img{
display: block;
height: 200rpx;
width: 200rpx;
margin: 0 auto;
2024-05-16 16:54:07 +08:00
margin-top: 560rpx;
2024-05-14 18:16:51 +08:00
margin-bottom: 60rpx;
}
.txt{
2024-05-16 20:51:10 +08:00
color: #CFC8CC;
2024-05-14 18:16:51 +08:00
}
}
}
</style>