Browse Source

提交

Jyt
douzhuo 2 years ago
parent
commit
5e8fb5ca0a
2 changed files with 136 additions and 112 deletions
  1. +118
    -108
      pages/mine/equipment/index.vue
  2. +18
    -4
      pages/mine/reception/addreception.vue

+ 118
- 108
pages/mine/equipment/index.vue View File

@@ -2,9 +2,10 @@
<view class="cented"> <view class="cented">
<view class="header"> <view class="header">
<view style="width: 690rpx;margin: 0 auto;margin-top: 20rpx;"> <view style="width: 690rpx;margin: 0 auto;margin-top: 20rpx;">
<u-search @search='shecs()' :show-action='false' placeholder="请输入设备编号或领用人进行搜索" v-model="imei"></u-search>
<u-search @search='shecs()' :show-action='false' placeholder="请输入设备编号或领用人进行搜索" v-model="imei">
</u-search>
</view> </view>
<view class="tab-box"> <view class="tab-box">
<!-- <view class="tab-item-wrap"> <!-- <view class="tab-item-wrap">
<view v-for="(item, index) in tablist" :key="index" :class="activeClass == index ? 'bottom' : ''" @tap="clocktab(index)"> <view v-for="(item, index) in tablist" :key="index" :class="activeClass == index ? 'bottom' : ''" @tap="clocktab(index)">
@@ -12,13 +13,14 @@
<view class="bottomLine" v-if="activeClass == index"></view> <view class="bottomLine" v-if="activeClass == index"></view>
</view> </view>
</view> --> </view> -->
<u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="700" :current="activeClass" @change="clocktab()"
inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist" :is-scroll="true">
<u-tabs-swiper ref="tabs" font-size="30" :bold="true" swiper-width="700" :current="activeClass"
@change="clocktab()" inactive-color="#b1b1b1" active-color="#008ef2" :list="tablist"
:is-scroll="true">
</u-tabs-swiper> </u-tabs-swiper>
</view> </view>
</view> </view>
<view class="infoet"> <view class="infoet">
<view class="infoviewbox" v-for="(item,index) in newListdata" :key="index"> <view class="infoviewbox" v-for="(item,index) in newListdata" :key="index">
<view class="infobox1"> <view class="infobox1">
@@ -30,23 +32,29 @@
<view class="you11" v-if="item.electricity<20"> <view class="you11" v-if="item.electricity<20">
<view class="youimg" :style="{ height: item.electricity + '%' }"></view> <view class="youimg" :style="{ height: item.electricity + '%' }"></view>
</view> </view>
<view class="you2">电量:
<view class="you2">电量:
<text v-if="item.electricity>20">{{item.electricity}}%</text> <text v-if="item.electricity>20">{{item.electricity}}%</text>
<text v-if="item.electricity<20" style="color: red;">{{item.electricity}}%</text> <text v-if="item.electricity<20" style="color: red;">{{item.electricity}}%</text>
</view> </view>
<view class="you3"> <view class="you3">
<image v-if="item.signalDevice==''" class="youimg" src="../../../static/images/newimg/xinhao0.png" mode=""></image>
<image v-if="item.signalDevice<20 && item.signalDevice>0" class="youimg" src="../../../static/images/newimg/xinhao1.png" mode=""></image>
<image v-if="item.signalDevice<50 && item.signalDevice>20" class="youimg" src="../../../static/images/newimg/xinhao2.png" mode=""></image>
<image v-if="item.signalDevice<70 && item.signalDevice>50" class="youimg" src="../../../static/images/newimg/xinhao3.png" mode=""></image>
<image v-if="item.signalDevice<90 && item.signalDevice>70" class="youimg" src="../../../static/images/newimg/xinhao4.png" mode=""></image>
<image v-if="item.signalDevice<=100 && item.signalDevice>90" class="youimg" src="../../../static/images/newimg/xinhao5.png" mode=""></image>
<image v-if="item.signalDevice==''" class="youimg"
src="../../../static/images/newimg/xinhao0.png" mode=""></image>
<image v-if="item.signalDevice<20 && item.signalDevice>0" class="youimg"
src="../../../static/images/newimg/xinhao1.png" mode=""></image>
<image v-if="item.signalDevice<50 && item.signalDevice>20" class="youimg"
src="../../../static/images/newimg/xinhao2.png" mode=""></image>
<image v-if="item.signalDevice<70 && item.signalDevice>50" class="youimg"
src="../../../static/images/newimg/xinhao3.png" mode=""></image>
<image v-if="item.signalDevice<90 && item.signalDevice>70" class="youimg"
src="../../../static/images/newimg/xinhao4.png" mode=""></image>
<image v-if="item.signalDevice<=100 && item.signalDevice>90" class="youimg"
src="../../../static/images/newimg/xinhao5.png" mode=""></image>
</view> </view>
<view class="you4" v-if="item.signalDevice=='' ">信号:0</view> <view class="you4" v-if="item.signalDevice=='' ">信号:0</view>
<view class="you4" v-else>信号:{{item.signalDevice}}</view> <view class="you4" v-else>信号:{{item.signalDevice}}</view>
</view> </view>
</view> </view>
<view class="infobox2"> <view class="infobox2">
<view class="box2-zuo">设备编号</view> <view class="box2-zuo">设备编号</view>
@@ -55,8 +63,8 @@
<view class="infobox2"> <view class="infobox2">
<view class="box2-zuo">录音状态</view> <view class="box2-zuo">录音状态</view>
<view class="box2-you" v-if="item.audioStatus=='false'">关闭</view> <view class="box2-you" v-if="item.audioStatus=='false'">关闭</view>
<view class="box2-you" v-if="item.audioStatus=='true'">开启</view>
<view class="box2-you" v-if="item.audioStatus=='' ">关闭</view>
<view class="box2-you" v-if="item.audioStatus=='true'">开启</view>
<view class="box2-you" v-if="!item.audioStatus">关闭</view>
</view> </view>
<view class="infobox2"> <view class="infobox2">
<view class="box2-zuo">待上传</view> <view class="box2-zuo">待上传</view>
@@ -66,7 +74,7 @@
<template v-else> <template v-else>
<text class="box2-you">0</text> <text class="box2-you">0</text>
</template> </template>
<!-- <view class="box2-you" v-if="item.audioUploadStatus=='false'">无上传</view>
<!-- <view class="box2-you" v-if="item.audioUploadStatus=='false'">无上传</view>
<view class="box2-you" v-if="item.audioUploadStatus=='true'">上传中</view> <view class="box2-you" v-if="item.audioUploadStatus=='true'">上传中</view>
<view class="box2-you" v-if="item.audioUploadStatus=='' ">无上传</view> --> <view class="box2-you" v-if="item.audioUploadStatus=='' ">无上传</view> -->
</view> </view>
@@ -91,8 +99,7 @@
export default { export default {
data() { data() {
return { return {
tablist: [
{
tablist: [{
name: "全部(0)", name: "全部(0)",
}, },
{ {
@@ -109,35 +116,35 @@
} }
], ],
activeClass: 0, activeClass: 0,
pageNum:1,
pageSize:20,
imei:"",
orgcode:"",
newListdata:[],
buildingID:'',
jump:''
pageNum: 1,
pageSize: 20,
imei: "",
orgcode: "",
newListdata: [],
buildingID: '',
jump: ''
}; };
}, },
onReachBottom() { onReachBottom() {
this.pageNum +=1;
this.pageNum += 1;
this.init() this.init()
}, },
onPullDownRefresh(){
onPullDownRefresh() {
this.init() this.init()
setTimeout(function () {
uni.stopPullDownRefresh();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000); }, 1000);
}, },
onLoad(options) { onLoad(options) {
if(options.active){
this.activeClass=options.active
}else{
this.activeClass=0
if (options.active) {
this.activeClass = options.active
} else {
this.activeClass = 0
} }
this.newListdata=[]
this.pageNum=1;
this.pageSize=20;
this.init()
this.newListdata = []
this.pageNum = 1;
this.pageSize = 20;
this.init()
}, },
filters: { filters: {
formatDate: (dateTimeStamp) => { formatDate: (dateTimeStamp) => {
@@ -147,113 +154,114 @@
var day = hour * 24; var day = hour * 24;
var halfamonth = day * 15; var halfamonth = day * 15;
var month = day * 30; var month = day * 30;
var now = new Date().getTime();
var now = new Date().getTime();
var diffValue = now - newDate; var diffValue = now - newDate;
if(diffValue < 0){return;}
var monthC =diffValue/month;
var weekC =diffValue/(7*day);
var dayC =diffValue/day;
var hourC =diffValue/hour;
var minC =diffValue/minute;
var result = '';
if(weekC>=1){
result= "1周前";
}else if(dayC>=1){
result=""+ parseInt(dayC) +"天前";
} else if(hourC>=1){
result=""+ parseInt(hourC) +"小时前";
if (diffValue < 0) {
return;
} }
else if(minC>=1){
result=""+ parseInt(minC) +"分钟前";
}else{
result="刚刚";
var monthC = diffValue / month;
var weekC = diffValue / (7 * day);
var dayC = diffValue / day;
var hourC = diffValue / hour;
var minC = diffValue / minute;
var result = '';
if (weekC >= 1) {
result = "1周前";
} else if (dayC >= 1) {
result = "" + parseInt(dayC) + "天前";
} else if (hourC >= 1) {
result = "" + parseInt(hourC) + "小时前";
} else if (minC >= 1) {
result = "" + parseInt(minC) + "分钟前";
} else {
result = "刚刚";
} }
return result; return result;
} }
}, },
methods: { methods: {
shecs(){
this.newListdata=[]
this.pageNum=1;
this.pageSize=20;
this.init()
shecs() {
this.newListdata = []
this.pageNum = 1;
this.pageSize = 20;
this.init()
}, },
// tab // tab
clocktab(index) { clocktab(index) {
this.activeClass=index;
this.newListdata=[]
this.pageNum=1;
this.pageSize=20;
this.activeClass = index;
this.newListdata = []
this.pageNum = 1;
this.pageSize = 20;
this.init() this.init()
}, },
init(){
this.buildingID=uni.getStorageSync('buildingID').id;
init() {
this.buildingID = uni.getStorageSync('buildingID').id;
const parames = { const parames = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
query:{
imei:this.imei,
onLine:this.activeClass,
propertyId:this.buildingID,
orderType:1
query: {
imei: this.imei,
onLine: this.activeClass,
propertyId: this.buildingID,
orderType: 1
} }
} }
if(this.activeClass==0){
parames.query.onLine=null
if (this.activeClass == 0) {
parames.query.onLine = null
} }
this.$u.post("/equipment/apiFindByPage", parames).then(res => { this.$u.post("/equipment/apiFindByPage", parames).then(res => {
this.tablist[0].name="全部("+res.allCount+")";
this.tablist[1].name="在线("+res.eqOnLineCount+")";
this.tablist[2].name="低电量("+res.lowElectricityCount+")";
this.tablist[3].name="今日活跃("+res.activeCount+")";
this.tablist[4].name="离线("+res.eqOffLineCount+")";
if(res.obj.list.results==null){
if (this.pageNum == 1){
this.tablist[0].name = "全部(" + res.allCount + ")";
this.tablist[1].name = "在线(" + res.eqOnLineCount + ")";
this.tablist[2].name = "低电量(" + res.lowElectricityCount + ")";
this.tablist[3].name = "今日活跃(" + res.activeCount + ")";
this.tablist[4].name = "离线(" + res.eqOffLineCount + ")";
if (res.obj.list.results == null) {
if (this.pageNum == 1) {
return return
}else{
} else {
uni.showToast({ uni.showToast({
title: '已经到底了!',
duration: 2000
title: '已经到底了!',
duration: 2000
}); });
} }
}else{
res.obj.list.results.forEach(item=>{
if(item.onLine==0){
item.signalDevice=0
} else {
res.obj.list.results.forEach(item => {
if (item.onLine == 0) {
item.signalDevice = 0
} }
if(item.electricity==''){
item.electricity=0
if (item.electricity == '') {
item.electricity = 0
} }
if(item.electricity>100){
item.electricity=100
if (item.electricity > 100) {
item.electricity = 100
} }
let num=this.ascformatDate(item.updateTime)
if(num>12){
item.electricity=0
let num = this.ascformatDate(item.updateTime)
if (num > 12) {
item.electricity = 0
} }
}) })
if (this.pageNum == 1) { if (this.pageNum == 1) {
this.newListdata=res.obj.list.results
this.newListdata = res.obj.list.results
} else { } else {
this.newListdata = [...this.newListdata, ...res.obj.list.results];
this.newListdata = [...this.newListdata, ...res.obj.list.results];
} }
} }
}) })
}, },
ascformatDate(dateTimeStamp){
ascformatDate(dateTimeStamp) {
let newDate = new Date(dateTimeStamp.replace(/-/g, '/')).getTime(); let newDate = new Date(dateTimeStamp.replace(/-/g, '/')).getTime();
let minute = 1000 * 60; let minute = 1000 * 60;
let hour = minute * 60; let hour = minute * 60;
let day = hour * 24; let day = hour * 24;
let halfamonth = day * 15; let halfamonth = day * 15;
let month = day * 30; let month = day * 30;
let now = new Date().getTime();
let now = new Date().getTime();
let diffValue = now - newDate; let diffValue = now - newDate;
let result =diffValue/hour;
let result = diffValue / hour;
return result; return result;
} }
}, },
@@ -265,7 +273,7 @@
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
background: #FFFFFF; background: #FFFFFF;
.header { .header {
position: sticky; position: sticky;
top: var(--window-top); top: var(--window-top);
@@ -384,6 +392,7 @@
background-color: #333333; background-color: #333333;
} }
} }

.you11 { .you11 {
width: 20rpx; width: 20rpx;
height: 28rpx; height: 28rpx;
@@ -392,7 +401,7 @@
background-size: 100% 100%; background-size: 100% 100%;
display: flex; display: flex;
flex-direction: column-reverse; flex-direction: column-reverse;
.youimg { .youimg {
width: 100%; width: 100%;
background-color: red; background-color: red;
@@ -407,6 +416,7 @@
color: #333333; color: #333333;
margin-left: 6rpx; margin-left: 6rpx;
} }

.you22 { .you22 {
width: 114rpx; width: 114rpx;
height: 30rpx; height: 30rpx;
@@ -463,7 +473,7 @@
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
text-indent: 30rpx; text-indent: 30rpx;
.stayupload { .stayupload {
color: #F41313; color: #F41313;
} }


+ 18
- 4
pages/mine/reception/addreception.vue View File

@@ -125,10 +125,16 @@
canceltext: '2', //取消文字 canceltext: '2', //取消文字
daitiReceptionobj: {}, daitiReceptionobj: {},
isShow: false, // 默认隐藏该权限 isShow: false, // 默认隐藏该权限
userInfo: {}, // 用户信息
}; };
}, },
onLoad() {
this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
console.log(this.userInfo, 'adkljsakldjaskljdklasjdklsajdklasjdklasjdlk')
},

onShow() { onShow() {
let newmenulist= uni.getStorageSync('weapp_session_Menu_data');
let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
this.isShow = newmenulist.jd_zp this.isShow = newmenulist.jd_zp
this.parames.projectId = uni.getStorageSync('buildingID').id; this.parames.projectId = uni.getStorageSync('buildingID').id;
this.getFreeList(); this.getFreeList();
@@ -254,6 +260,9 @@
this.parames.howMany = num; this.parames.howMany = num;
}, },
clickShowhid() { clickShowhid() {
if (this.userInfo.userRoleType == 6) {
return
}
if (this.freeList.length == 0) { if (this.freeList.length == 0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
@@ -286,16 +295,21 @@
//获取顾问列表 //获取顾问列表
getFreeList() { getFreeList() {
this.$u.get("/zkAgentPool/freeList?itemId=" + this.parames.projectId).then(res => { this.$u.get("/zkAgentPool/freeList?itemId=" + this.parames.projectId).then(res => {
this.freeList = res;
this.freeList = res;
this.freeList.forEach(item => { this.freeList.forEach(item => {
console.log(item, '顾问')
if (item.onLine == 0) { if (item.onLine == 0) {
item.label = item.name + "(离线)"; item.label = item.name + "(离线)";
} else if (item.onLine == 1) { } else if (item.onLine == 1) {
item.label = item.name + "(在线)";
item.label = item.name + "(在线)";
} else { } else {
item.label = item.name + "(无设备)";
item.label = item.name + "(无设备)";
} }
item.value = item.agentId item.value = item.agentId
if (this.userInfo.accountId == item.agentId) {
this.text = item.label
this.parames.agentId = item.agentId;
}
}) })
}) })
}, },


Loading…
Cancel
Save