393 lines
9.1 KiB
Vue
Raw Normal View History

2024-05-23 20:06:14 +08:00
<template>
<view>
<headers class="fixedheader" :showBack="true">
<view class="headerName">
{{info.itemName}}
</view>
2024-05-24 21:53:53 +08:00
<!-- <view class="right" @click="getScanCode()">
2024-05-23 20:06:14 +08:00
<image class="scancode" src="@/static/scancode.png" mode=""></image>
2024-05-24 21:53:53 +08:00
</view> -->
2024-05-23 20:06:14 +08:00
</headers>
2024-05-24 19:01:59 +08:00
<view class="content" :style="{ 'padding-top': (statusBarHeight+52) + 'px' }">
2024-05-23 20:06:14 +08:00
<view class="coordinate">
<view class="coordinate-header">
<view>
2024-05-24 15:45:40 +08:00
<image src="@/static/inspecteIcon-normal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
已巡检-正常
</view>
2024-05-24 15:45:40 +08:00
<view class="abnormal">
<image src="@/static/inspectelcon-abnormal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
已巡检-异常
</view>
<view>
2024-05-24 15:45:40 +08:00
<image src="@/static/inspectelcon-not.png" mode=""></image>
2024-05-23 20:06:14 +08:00
未巡检
</view>
</view>
<view class="coordinate-item">
2024-05-24 21:53:53 +08:00
<view :class="{'abnormal':item.inspectStatus == 2}" @click="onClickSelect(item)"
v-for="item in checkingList" :key="item.id">
2024-05-24 19:01:59 +08:00
<image :src="statusList[item.inspectStatus].image" mode=""></image>
<text>{{item.checkingPointName}}</text>
</view>
<!-- <view class="abnormal">
<image src="@/static/inspectelcon-abnormal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
<text>1号巡检点</text>
</view>
<view>
2024-05-24 19:01:59 +08:00
<image src="@/static/inspecteIcon-normal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
<text>1号巡检点</text>
</view>
<view>
2024-05-24 19:01:59 +08:00
<image src="@/static/inspecteIcon-normal.png" mode=""></image>
<text>1号巡检555555555555点</text>
2024-05-23 20:06:14 +08:00
</view>
<view>
2024-05-24 19:01:59 +08:00
<image src="@/static/inspecteIcon-normal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
<text>1号巡检点</text>
</view>
<view>
2024-05-24 19:01:59 +08:00
<image src="@/static/inspecteIcon-normal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
<text>1号巡检点</text>
</view>
<view>
2024-05-24 19:01:59 +08:00
<image src="@/static/inspecteIcon-normal.png" mode=""></image>
2024-05-23 20:06:14 +08:00
<text>1号巡检点</text>
2024-05-24 19:01:59 +08:00
</view> -->
2024-05-23 20:06:14 +08:00
</view>
</view>
2024-05-24 21:53:53 +08:00
2024-05-24 19:01:59 +08:00
<view class="detail-main" v-for="item in checkingInfoList" :key="item.id">
2024-05-23 20:06:14 +08:00
<view class="title">
2024-05-24 19:01:59 +08:00
{{item.checkingPointName}}
2024-05-23 20:06:14 +08:00
</view>
<view class="detail-content">
2024-05-24 19:01:59 +08:00
<view>巡检点名称:{{item.checkingPointName}}</view>
2024-05-24 22:13:09 +08:00
<view>巡检点位置:{{item.position}}</view>
2024-05-24 19:01:59 +08:00
<view>巡检人员:{{item.checkingPointUserName}}</view>
<view>巡检通知人员:{{item.noticeUserNames}}</view>
<view>状态:{{item.status == 1 ? '正常' : '异常'}}</view>
<view>巡检时间:{{item.createDate}}</view>
2024-05-24 22:13:09 +08:00
<view>巡检详情:{{item.alarmDetails}}</view>
<!-- v-if="item.status == 2" -->
<view class="detail-image">
巡检图片:
2024-05-24 21:53:53 +08:00
<view v-if="item.alarmImage && JSON.parse(item.alarmImage).length > 0">
<image v-for="ele in JSON.parse(item.alarmImage)"
@click="previewImage(url_config+'image/'+ele.url)" :src="url_config+'image/'+ele.url"
mode=""></image>
2024-05-24 19:01:59 +08:00
</view>
</view>
2024-05-23 20:06:14 +08:00
</view>
</view>
2024-05-24 21:53:53 +08:00
2024-05-28 15:58:10 +08:00
<view v-if="checkingInfoList.length == 0 && btnAuth" class="scancodebtn" @click="getScanCode()">
2024-05-24 21:53:53 +08:00
扫码巡检
</view>
2024-05-23 20:06:14 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
2024-05-24 19:01:59 +08:00
info: {},
checkingList: [],
statusList: [{
id: 1,
statusName: "未巡检",
image: "/static/inspectelcon-not.png",
}, {
id: 2,
statusName: "正常",
image: "/static/inspecteIcon-normal.png",
}, {
id: 3,
statusName: "异常",
image: "/static/inspectelcon-abnormal.png",
}],
2024-05-24 21:53:53 +08:00
checkingInfoList: [],
checkingInfoDetail: {
id: "",
2024-05-24 21:04:45 +08:00
},
2024-05-24 21:53:53 +08:00
statusBarHeight: 0,
2024-05-24 21:04:45 +08:00
pageNo: 1,
pageSize: 10,
2024-05-28 15:58:10 +08:00
btnAuth: true
2024-05-23 20:06:14 +08:00
}
},
onLoad(options) {
2024-05-28 15:58:10 +08:00
this.btnAuth = this.checkPermission({key: 'selfInspect_scanCheck', menuPath: '/project/inspecPoint/selfInspect'})
2024-05-23 20:06:14 +08:00
this.info = JSON.parse(options.info);
this.statusBarHeight = uni.getStorageSync('systemInfo').statusBarHeight
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
2024-05-24 22:39:46 +08:00
console.log(this.info);
2024-05-24 22:13:09 +08:00
},
onShow(){
2024-05-23 20:06:14 +08:00
this.getcheckingList();
},
2024-05-24 21:04:45 +08:00
//上拉触底时间
onReachBottom() {
2024-05-24 22:13:09 +08:00
// this.pageNo = this.pageNo + 1;
// this.getcheckingInfo();
2024-05-24 21:04:45 +08:00
},
2024-05-23 20:06:14 +08:00
methods: {
getcheckingList() {
let that = this;
//获取我整改的巡查记录数量
this.sendRequest({
url: 'xmgl/checkingPoint/selectPage',
2024-05-24 15:45:40 +08:00
method: 'post',
2024-05-23 20:06:14 +08:00
data: {
projectSn: this.projectSn,
2024-05-24 19:01:59 +08:00
xzCheckingRouteTaskId: this.info.id,
// checkingPointUserId: this.info.xzCheckingRoute.inspectUserIds,
pageNo: 1,
pageSize: 99999,
2024-05-23 20:06:14 +08:00
},
success: res => {
2024-05-24 19:01:59 +08:00
console.log(res.result.records);
that.checkingList = res.result.records;
2024-05-24 22:39:46 +08:00
this.checkingInfoDetail = res.result.records.length > 0 ? res.result.records[0] : {};
2024-05-24 21:45:09 +08:00
this.getcheckingInfo();
2024-05-23 20:06:14 +08:00
}
})
},
2024-05-24 21:53:53 +08:00
onClickSelect(item) {
this.pageNo = 1;
this.pageSize = 10;
2024-05-24 21:04:45 +08:00
this.checkingInfoList = [];
this.checkingInfoDetail = item;
this.getcheckingInfo();
},
2024-05-23 20:06:14 +08:00
getcheckingInfo() {
let that = this;
2024-05-24 21:53:53 +08:00
2024-05-24 15:45:40 +08:00
//获取我整改的巡查记录详情
2024-05-23 20:06:14 +08:00
this.sendRequest({
url: 'xmgl/checkingPointInfo/selectPage',
2024-05-24 15:45:40 +08:00
method: 'post',
2024-05-23 20:06:14 +08:00
data: {
projectSn: this.projectSn,
2024-05-24 21:45:09 +08:00
xzCheckingRouteTaskId: this.info.id,
2024-05-24 21:53:53 +08:00
checkingPointId: this.checkingInfoDetail.id,
2024-05-24 21:45:09 +08:00
// checkingPointUserId: this.checkingInfoDetail.inspectUserIds,
2024-05-24 21:04:45 +08:00
pageNo: that.pageNo,
2024-05-24 21:53:53 +08:00
pageSize: that.pageSize,
2024-05-23 20:06:14 +08:00
},
success: res => {
console.log(res);
2024-05-24 22:13:09 +08:00
that.checkingInfoList = res.result.records;
2024-05-23 20:06:14 +08:00
}
})
},
2024-05-24 19:01:59 +08:00
getScanCode() {
2024-05-24 21:04:45 +08:00
const that = this;
2024-05-23 20:06:14 +08:00
uni.scanCode({
scanType: ['qrCode'],
success: function(res) {
console.log('扫一扫得到的数据:' + res.result)
uni.navigateTo({
2024-05-24 21:04:45 +08:00
url: `../scan/saoSao?data=${res.result}&id=${that.info.id}`
2024-05-23 20:06:14 +08:00
})
2024-05-24 19:01:59 +08:00
2024-05-23 20:06:14 +08:00
// let qrcodeVal=JSON.parse(res.result)
// let param={
// checkingPointId:qrcodeVal.checkingPointId,
// checkingPointName:qrcodeVal.checkingPointName,
// checkingPointUserId:that.userInfo.userId,
// checkingPointUserName:that.userInfo.realName||that.userInfo.account,
// position:qrcodeVal.position
// }
2024-05-24 19:01:59 +08:00
2024-05-23 20:06:14 +08:00
// that.sendRequest({
// url: "xmgl/checkingPointInfo/add",
// data:param,
// method: "POST",
// success(res) {
// console.log(res,'res');
// console.log(param,'===')
// that.qrCode=param;
// that.$refs.popupqrcode.open();
// setTimeout(item=>{
// that.$refs.popupqrcode.close();
// },5000)
// }
// })
}
})
2024-05-24 19:01:59 +08:00
},
//预览图片
previewImage(url) {
uni.previewImage({
urls: [url]
})
},
2024-05-23 20:06:14 +08:00
}
}
</script>
<style lang="less" scoped>
.fixedheader {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 2;
2024-05-24 19:01:59 +08:00
/deep/ .backImg {
2024-05-23 20:06:14 +08:00
color: #fff !important;
}
/deep/.headerBox {
background: #2b8df3;
color: #fff;
}
/deep/ .right {
font-size: 24rpx;
position: absolute;
right: 20rpx;
top: 50%;
z-index: 4;
transform: translateY(-50%);
2024-05-24 19:01:59 +08:00
2024-05-23 20:06:14 +08:00
.scancode {
width: 56rpx;
height: 56rpx;
}
}
}
2024-05-24 21:53:53 +08:00
.scancodebtn {
padding: 20rpx 20rpx;
background-color: #2b8df3;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: white;
border-radius: 16rpx;
margin-top: 160rpx;
}
2024-05-23 20:06:14 +08:00
.content {
2024-05-24 19:01:59 +08:00
padding: 0 26rpx 15%;
2024-05-23 20:06:14 +08:00
box-sizing: border-box;
width: 100%;
.coordinate {
padding: 22rpx 28rpx 54rpx 12rpx;
background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(198, 220, 255, 0.2) 100%);
box-shadow: 0 8rpx 32rpx -8rpx rgba(42, 60, 106, 0.24);
border-radius: 34rpx;
position: relative;
margin-top: 22rpx;
font-size: 24rpx;
color: #000;
.coordinate-header {
display: flex;
justify-content: center;
>view:not(:last-child) {
margin-right: 14rpx;
}
>view {
display: flex;
align-items: center;
2024-05-24 19:01:59 +08:00
2024-05-23 20:06:14 +08:00
>image {
width: 50rpx;
height: 60rpx;
margin-right: 8rpx;
}
}
2024-05-24 19:01:59 +08:00
}
.abnormal {
>image {
width: 60rpx !important;
height: 60rpx;
2024-05-24 15:45:40 +08:00
}
2024-05-23 20:06:14 +08:00
}
.coordinate-item {
display: flex;
flex-wrap: wrap;
margin-top: 18rpx;
>view {
display: flex;
flex-direction: column;
align-items: center;
margin-left: 28rpx;
margin-top: 18rpx;
>image {
width: 50rpx;
height: 60rpx;
margin-right: 8rpx;
}
2024-05-24 19:01:59 +08:00
>text {
width: 107rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
2024-05-23 20:06:14 +08:00
}
}
}
.detail-main {
padding: 22rpx 48rpx 0;
color: #000000;
.title {
font-weight: bold;
font-size: 36rpx;
display: flex;
justify-content: center;
position: relative;
}
.title::before {
content: "";
border-bottom: 6rpx solid #3A7BFF;
position: absolute;
bottom: 0;
bottom: -12rpx;
width: 190rpx;
}
.detail-content {
margin-top: 60rpx;
>view:not(:first-child) {
margin-top: 32rpx;
}
>view {
font-size: 28rpx;
}
2024-05-24 19:01:59 +08:00
.detail-image {
display: flex;
image {
width: 128rpx;
height: 112rpx;
margin-left: 8rpx;
}
}
2024-05-23 20:06:14 +08:00
}
}
}
</style>