Browse Source

1102提交,完成数据优化

master
xiaoheiiskinder 1 year ago
parent
commit
e08ad93068
7 changed files with 470 additions and 144 deletions
  1. +0
    -3
      src/views/UnlockRecord.vue
  2. +1
    -1
      src/views/dataScreen/Tourist.vue
  3. +51
    -32
      src/views/dataScreen/leftChartBottom.vue
  4. +30
    -3
      src/views/lockReport.vue
  5. +168
    -26
      src/views/room.vue
  6. +2
    -1
      src/views/thirdPartyDocking.vue
  7. +218
    -78
      src/views/visualization/flatsIndex.vue

+ 0
- 3
src/views/UnlockRecord.vue View File

@ -198,7 +198,6 @@
}, },
// //
checkNode(e) { checkNode(e) {
console.log(e)
// this.checkNodeId = e[e.length-1] // this.checkNodeId = e[e.length-1]
if(e.length>0){ if(e.length>0){
var options = this.options var options = this.options
@ -299,7 +298,6 @@
this.openRoom = true; this.openRoom = true;
}, },
handleChange(value) { handleChange(value) {
console.log(value);
this.selectRoomId = value[value.length - 1]; this.selectRoomId = value[value.length - 1];
}, },
// //
@ -391,7 +389,6 @@
var str = this.getOpenType(li.openType); var str = this.getOpenType(li.openType);
var compli = this.comparison(li.deviceNum); var compli = this.comparison(li.deviceNum);
var name = utils.findIndexArray(this.options, li.roomId, []) var name = utils.findIndexArray(this.options, li.roomId, [])
console.log(name, this.options, li.roomId);
var path = '' var path = ''
if (name) { if (name) {
path = name.join('/') path = name.join('/')


+ 1
- 1
src/views/dataScreen/Tourist.vue View File

@ -237,7 +237,7 @@ export default {
this.shebei[0].total = statisticsDate.seriesData.total this.shebei[0].total = statisticsDate.seriesData.total
this.shebei[1].total = statisticsDate.seriesData.isAppBind this.shebei[1].total = statisticsDate.seriesData.isAppBind
this.shebei[2].total = statisticsDate.seriesData.batteryLevel1 this.shebei[2].total = statisticsDate.seriesData.batteryLevel1
this.shebei[3].total = statisticsDate.seriesData.offlineTotal
// this.shebei[3].total = statisticsDate.seriesData.offlineTotal
// this.collectUS = statisticsDate.collectUS // this.collectUS = statisticsDate.collectUS
// this.sumProjects = statisticsDate.seriesData.projects // this.sumProjects = statisticsDate.seriesData.projects
for (let t in statisticsDate.collectUS) { for (let t in statisticsDate.collectUS) {


+ 51
- 32
src/views/dataScreen/leftChartBottom.vue View File

@ -1,12 +1,12 @@
<template> <template>
<div class="leftChartBottom"> <div class="leftChartBottom">
<div class="leftchartbottom-title">房屋空置情况</div>
<div class="leftchartbottom-title">各楼栋房间数</div>
<div id="leftChartBottom" :style="{ height: '250px', width: '100%' }"></div> <div id="leftChartBottom" :style="{ height: '250px', width: '100%' }"></div>
</div> </div>
</template> </template>
<script> <script>
import { httpPost } from '../../api';
import { httpGet } from '../../api';
import moment from 'moment'; import moment from 'moment';
import echarts from 'echarts'; import echarts from 'echarts';
export default { export default {
@ -25,7 +25,7 @@ export default {
{ {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: [],
splitLine: { splitLine: {
show: false show: false
} }
@ -42,7 +42,7 @@ export default {
series: [ series: [
{ {
type: 'line', type: 'line',
name: '空置数',
name: '房间数',
lineStyle: { lineStyle: {
normal: { normal: {
width: 2, width: 2,
@ -63,42 +63,60 @@ export default {
]) ])
}, },
smooth: true, smooth: true,
data: [0, 0, 0, 0, 0, 0, 0]
data: []
}, },
] ]
} }
} }
}, },
mounted() { mounted() {
let charts = this.chartsBottom
let data = {
"orderBy": "create_time desc",
"q": JSON.stringify({
status: '1'
})
}
let list = []
for (let i = 1; i <= 7; i++) {
list.unshift(moment().subtract(i, 'days').format('MM-DD'))
}
charts.xAxis[0].data = list
httpPost(data, this.$api.postLeasesList).then(res => {
console.log("111", res)
if (res.success) {
res.data.list.map(li => {
li.createTime = moment().format("MM-DD")
for (let i = 0; i < 7; i++) {
if (list[i] == li.createTime) {
charts.series[0].data[i] += 1
}
}
httpGet('', this.$api.getRoomStatistics).then(async res => {
if (res.code === 200) {
let roomList = [], percentage = []
res.data = res.data.sort((a, b) => a.total - b.total)
res.data.map(async li => {
roomList.push(li.name)
percentage.push(li.total)
}) })
let leftChartBottom = this.chartsBottom
leftChartBottom.xAxis[0].data = roomList
leftChartBottom.series[0].data = percentage
this.leftChartBottom = leftChartBottom
let myMiddleChartObjOne = this.$echarts.init(
document.getElementById("leftChartBottom")
);
myMiddleChartObjOne.setOption(leftChartBottom, true);
} }
let chartsObj2 = this.$echarts.init(
document.getElementById('leftChartBottom')
)
chartsObj2.setOption(charts, true)
}) })
// let data = {
// "orderBy": "create_time desc",
// "q": JSON.stringify({
// status: '1'
// })
// }
// let list = []
// for (let i = 1; i <= 7; i++) {
// list.unshift(moment().subtract(i, 'days').format('MM-DD'))
// }
// charts.xAxis[0].data = list
// httpPost(data, this.$api.postLeasesList).then(res => {
// console.log("111", res)
// if (res.success) {
// res.data.list.map(li => {
// li.createTime = moment().format("MM-DD")
// for (let i = 0; i < 7; i++) {
// if (list[i] == li.createTime) {
// charts.series[0].data[i] += 1
// }
// }
// })
// }
// let chartsObj2 = this.$echarts.init(
// document.getElementById('leftChartBottom')
// )
// chartsObj2.setOption(charts, true)
// })
// let chartsObj2 = this.$echarts.init( // let chartsObj2 = this.$echarts.init(
// document.getElementById('leftChartBottom') // document.getElementById('leftChartBottom')
// ) // )
@ -111,7 +129,8 @@ export default {
.leftChartBottom { .leftChartBottom {
margin-top: 30px; margin-top: 30px;
} }
.leftchartbottom-title{
.leftchartbottom-title {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;


+ 30
- 3
src/views/lockReport.vue View File

@ -15,8 +15,9 @@
<el-button type="primary" style="background: #FA8E00; border: none;" size="small" <el-button type="primary" style="background: #FA8E00; border: none;" size="small"
class=" mb-1 mx-1">查询</el-button> class=" mb-1 mx-1">查询</el-button>
</div> </div>
<!-- @selection-change="handleSelectionChange" -->
<el-table :data="tableList" border stripe class="table mt-2" ref="multipleTable" <el-table :data="tableList" border stripe class="table mt-2" ref="multipleTable"
@selection-change="handleSelectionChange" header-cell-class-name="table-header" height="650px" empty-text="无">
header-cell-class-name="table-header" height="650px" empty-text="无">
<el-table-column prop="number" label="住户名" align="center"></el-table-column> <el-table-column prop="number" label="住户名" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column> <el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="room" label="房间名称" align="center"></el-table-column> <el-table-column prop="room" label="房间名称" align="center"></el-table-column>
@ -78,7 +79,32 @@ export default {
status: '已维修', status: '已维修',
shuoming: '面板不亮数字密码', shuoming: '面板不亮数字密码',
} }
]
],
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
},
} }
} }
} }
@ -97,4 +123,5 @@ export default {
.d-inlie-block { .d-inlie-block {
margin-top: 1px; margin-top: 1px;
}</style>
}
</style>

+ 168
- 26
src/views/room.vue View File

@ -82,7 +82,7 @@
<el-col :span="colNum_4" class="mb-2"> <el-col :span="colNum_4" class="mb-2">
<el-card shadow="hover" class="cardrelative aftercolor5"> <el-card shadow="hover" class="cardrelative aftercolor5">
<div class="contentc"> <div class="contentc">
<div class="contenttitle">未绑定门锁</div>
<div class="contenttitle">未绑定房间</div>
<!-- <div class="contentnum">{{ unboundNum }}</div> --> <!-- <div class="contentnum">{{ unboundNum }}</div> -->
<div class="font-size-24 contentnum"> <div class="font-size-24 contentnum">
<NumberGrow :value="unboundNum" class="color-333"></NumberGrow> <NumberGrow :value="unboundNum" class="color-333"></NumberGrow>
@ -907,7 +907,148 @@ export default {
drawerTitle: '', drawerTitle: '',
allRoomList: [], allRoomList: [],
AboutDevice: [], AboutDevice: [],
selectRoomId: ''
selectRoomId: '',
statisticsDateDefault: {
"cdata": ["0", "0", "0", "0", "0"],
"seriesData": {
"abnormalTotal": 0,
"batteryLevel1": 0,
"batteryLevel2": 0,
"batteryLevel3": 0,
"batteryLevel4": 0,
"batteryLevel5": 0,
"closeTotal": 0,
"offlineTotal": 0,
"onlineTotal": 0,
"openTotal": 0,
"projects": 0,
"total": 0
},
"collectUS": {
"card300": 0,
"site200": 0,
"card200": 0,
"userCount": 0,
"site300": 0,
"lock300": 0,
"site400": 0,
"lock200": 0,
"houseSensor400": 0
},
"collectOpenLock": {
"week300": [{
"count": 0,
"order": "2022-05-15"
}, {
"count": 0,
"order": "2022-05-16"
}, {
"count": 0,
"order": "2022-05-17"
}, {
"count": 0,
"order": "2022-05-18"
}, {
"count": 0,
"order": "2022-05-19"
}, {
"count": 0,
"order": "2022-05-20"
}, {
"count": 0,
"order": "2022-05-21"
}, {
"count": 0,
"order": "2022-05-22"
}, {
"count": 0,
"order": "2022-05-23"
}, {
"count": 0,
"order": "2022-05-24"
}, {
"count": 0,
"order": "2022-05-25"
}, {
"count": 0,
"order": "2022-05-26"
}],
"week200": [{
"count": 0,
"order": "2022-05-19"
}, {
"count": 0,
"order": "2022-05-20"
}, {
"count": 0,
"order": "2022-05-21"
}, {
"count": 0,
"order": "2022-05-22"
}, {
"count": 0,
"order": "2022-05-23"
}, {
"count": 0,
"order": "2022-05-24"
}, {
"count": 0,
"order": "2022-05-25"
}, {
"count": 0,
"order": "2022-05-26"
}],
"allCount300": 0,
"allCount200": 0
},
"weekopenlock": [{
"order": "2022-05-19",
"count": 0
}, {
"order": "2022-05-20",
"count": 0
}, {
"order": "2022-05-21",
"count": 0
}, {
"order": "2022-05-22",
"count": 0
}, {
"order": "2022-05-23",
"count": 0
}, {
"order": "2022-05-24",
"count": 0
}, {
"order": "2022-05-25",
"count": 0
}, {
"order": "2022-05-26",
"count": 0
}],
"addDeviceWeek": [{
"order": "2022/05/20",
"count": 0
}, {
"order": "2022/05/21",
"count": 0
}, {
"order": "2022/05/22",
"count": 0
}, {
"order": "2022/05/23",
"count": 0
}, {
"order": "2022/05/24",
"count": 0
}, {
"order": "2022/05/25",
"count": 0
}, {
"order": "2022-05-26",
"count": 0
}]
},
}; };
}, },
components: { components: {
@ -957,20 +1098,20 @@ export default {
} }
})() })()
} }
let data = {
pageNum: 1,
pageSize: 10,
q: JSON.stringify({
lockType: 1,
unBind: 1
})
}
httpPost(data, this.$api.getDeviceItems).then(res => {
console.log(res);
if (res.success) {
this.unboundNum = res.data.total
}
})
// let data = {
// pageNum: 1,
// pageSize: 10,
// q: JSON.stringify({
// lockType: 1,
// unBind: 1
// })
// }
// httpPost(data, this.$api.getDeviceItems).then(res => {
// console.log(res);
// if (res.success) {
// this.unboundNum = res.data.total
// }
// })
}, },
methods: { methods: {
checkNode(e) { checkNode(e) {
@ -1570,7 +1711,6 @@ export default {
q: JSON.stringify(q), q: JSON.stringify(q),
}; };
httpGet(data, this.$api.getSiteList).then((res) => { httpGet(data, this.$api.getSiteList).then((res) => {
console.log(res);
this.Building = res.data.list.total; this.Building = res.data.list.total;
}); });
}, },
@ -1590,21 +1730,20 @@ export default {
var buildingNum = 0 var buildingNum = 0
var checkin = 0 var checkin = 0
res.data.list.list.map((li, index) => { res.data.list.list.map((li, index) => {
let countNum = res.data.tenants.filter(item => item.id == li.id)[0]
if (countNum) {
li.count = countNum.quantityB
} else {
li.count = 0
}
// //
if (li.pid % 10 == 1 && li.type == 1) {
if (li.name.includes('栋')) {
buildingNum++ buildingNum++
} }
// //
if (li.isRoom == 1 && li.count != 0) {
if (li.isRoom == 1 && li.count > 0) {
checkin++ checkin++
} }
//
let countNum = res.data.tenants.filter(item => item.id == li.id)[0]
if (countNum) {
li.count = countNum.count
} else {
li.count = 0
}
// if (li.expand) { // if (li.expand) {
// if (JSON.parse(li.expand).type == "0") { // if (JSON.parse(li.expand).type == "0") {
// if (li.layout != null) { // if (li.layout != null) {
@ -2410,6 +2549,9 @@ export default {
} else { } else {
li.count = 0 li.count = 0
} }
if(li.isRoom == '1' && !li.imei) {
this.unboundNum++
}
}); });
this.pageuserlist = pageuserlist; this.pageuserlist = pageuserlist;
var userlist = [] var userlist = []


+ 2
- 1
src/views/thirdPartyDocking.vue View File

@ -4,8 +4,9 @@
<div class="box1">客户码d39eaa7fc1f34190869608259133d2fb</div> <div class="box1">客户码d39eaa7fc1f34190869608259133d2fb</div>
<div class="box2">Nbdevkey: cf9dcf79-b36c-4adf-be3c-de74099c21f3<span class="box3">生成</span></div> <div class="box2">Nbdevkey: cf9dcf79-b36c-4adf-be3c-de74099c21f3<span class="box3">生成</span></div>
<div class="tableee"> <div class="tableee">
<!-- @selection-change="handleSelectionChange" -->
<el-table :data="tableList" border stripe class="table mt-2" ref="multipleTable" <el-table :data="tableList" border stripe class="table mt-2" ref="multipleTable"
@selection-change="handleSelectionChange" header-cell-class-name="table-header" height="650px"
header-cell-class-name="table-header" height="650px"
empty-text="无"> empty-text="无">
<el-table-column prop="number" label="序号" align="center"></el-table-column> <el-table-column prop="number" label="序号" align="center"></el-table-column>
<el-table-column prop="phone" label="回调类型" align="center"></el-table-column> <el-table-column prop="phone" label="回调类型" align="center"></el-table-column>


+ 218
- 78
src/views/visualization/flatsIndex.vue View File

@ -26,7 +26,8 @@
<div class="color-00000073 font-size-16 font-weight-700" <div class="color-00000073 font-size-16 font-weight-700"
:class="item.lable === '已签约' ? 'color-03A9F4' : 'color-FF3D00'">{{ item.lable }}</div> :class="item.lable === '已签约' ? 'color-03A9F4' : 'color-FF3D00'">{{ item.lable }}</div>
<div class="font-size-24 mt-2" v-if="item.lable !== ''"> <div class="font-size-24 mt-2" v-if="item.lable !== ''">
<NumberGrow :value="item.total" :class="item.lable === '已签约' ? 'color-03A9F4' : 'color-FF3D00'" v-if="item.label != ''">
<NumberGrow :value="item.total" :class="item.lable === '已签约' ? 'color-03A9F4' : 'color-FF3D00'"
v-if="item.label != ''">
</NumberGrow><span class="font-size-16 color-00000073 ml-1" v-if="item.label != ''"></span> </NumberGrow><span class="font-size-16 color-00000073 ml-1" v-if="item.label != ''"></span>
</div> </div>
</div> </div>
@ -129,7 +130,7 @@
<el-progress type="circle" :percentage="Occupancyrate" color="rgb(250, 142, 0)"></el-progress> <el-progress type="circle" :percentage="Occupancyrate" color="rgb(250, 142, 0)"></el-progress>
</div> </div>
<div class="ruzhu"> <div class="ruzhu">
<div class="ruzhu-title">房间过期</div>
<div class="ruzhu-title">房间欠费</div>
<el-progress type="circle" :percentage="expirerate" color="rgb(250, 142, 0)"></el-progress> <el-progress type="circle" :percentage="expirerate" color="rgb(250, 142, 0)"></el-progress>
</div> </div>
</div> </div>
@ -137,13 +138,23 @@
<el-card shadow="never" class="mb33"> <el-card shadow="never" class="mb33">
<!-- <div id="myMiddleChartTwo" :style="{ height: '400px', width: '100%' }"></div> --> <!-- <div id="myMiddleChartTwo" :style="{ height: '400px', width: '100%' }"></div> -->
<div class="leaseslog" :style="{ height: '400px', width: '100%' }"> <div class="leaseslog" :style="{ height: '400px', width: '100%' }">
<div class="leases-title"><i class="gongyu gy-qianyuequerenqianyuedianziqianyue"></i>签约信息</div>
<div class="leases-list">
<div class="leases-item" v-for="item in leasesList" :key="item.id">
<span class="leases-ruzhu">{{ item.name }} 签约成功</span>
<span class="leases-date">{{ item.signingTime }}</span>
</div>
<div class="leases-title"><i class="gongyu gy-qianyuequerenqianyuedianziqianyue"></i>入住信息</div>
<div class="leases-header">
<span>入住人</span>
<span>入住房间</span>
</div> </div>
<ul class="leases-list" :class="{ anim: animate }" @mouseenter="Stop()" @mouseleave="Up()">
<li class="leases-item" v-for="item in leasesList" :key="item.id">
<span class="leases-ruzhu">{{ item.name }}</span>
<span class="leases-date" v-if="item.rommNameText != ''">{{ item.rommNameText }}</span>
<span class="leases-date" v-if="item.rommNameText == ''">未绑定房间</span>
</li>
<!-- <div class="leases-item" v-for="item in leasesList" :key="item.id" :class="{ anim: animate }" @mouseenter="Stop()" @mouseleave="Up()">
<span class="leases-ruzhu">{{ item.name }}</span>
<span class="leases-date" v-if="item.rommNameText != ''">{{ item.rommNameText }}</span>
<span class="leases-date" v-if="item.rommNameText == ''">未绑定房间</span>
</div> -->
</ul>
</div> </div>
</el-card> </el-card>
</el-col> </el-col>
@ -154,6 +165,8 @@
<script> <script>
import moment from "moment"; import moment from "moment";
import utils from "../../utils/util";
import { ztreeToElementTree2 } from '../../utils/index'
import { httpGet, httpPost } from "../../api"; import { httpGet, httpPost } from "../../api";
import NumberGrow from "../../components/visualizcomponent/NumberGrow.vue"; import NumberGrow from "../../components/visualizcomponent/NumberGrow.vue";
import echarts from 'echarts' import echarts from 'echarts'
@ -170,6 +183,9 @@ export default {
name: "flatsIndex", name: "flatsIndex",
data() { data() {
return { return {
animate: false,
intNum: null,
roomlistZNodes: [],
leasesList: [], leasesList: [],
outroom: 0, outroom: 0,
Occupancyrate: 0, Occupancyrate: 0,
@ -356,7 +372,7 @@ export default {
middleChartExtendOne: { middleChartExtendOne: {
title: { title: {
text: '楼栋入住率排行榜(%)'
text: '各小区房间数(间)'
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -387,7 +403,7 @@ export default {
}, },
series: [ series: [
{ {
name: '入住率',
name: '房间数',
type: 'bar', type: 'bar',
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
@ -404,7 +420,7 @@ export default {
title: { title: {
x: '10', x: '10',
top: '10', top: '10',
text: '房间入住分析',
text: '新增房间数(间)',
textStyle: { textStyle: {
color: '#333', color: '#333',
fontSize: '22' fontSize: '22'
@ -443,28 +459,12 @@ export default {
], ],
series: [ series: [
{ {
name: '已入住',
name: '新增房间数',
type: 'bar', type: 'bar',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
itemStyle: { itemStyle: {
color: '#00FA9A' color: '#00FA9A'
} }
},
{
name: '未入住',
type: 'bar',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
itemStyle: {
color: '#1E90FF'
}
},
{
name: '总计',
type: 'line',
data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
itemStyle: {
color: '#FFD700'
}
} }
] ]
}, },
@ -670,6 +670,9 @@ export default {
this.$store.commit('settenantid') this.$store.commit('settenantid')
}, },
async created() { async created() {
this.ScrollUp()
this.getAboutRoom()
var total = 0
httpGet('', this.$api.getCommunityrentStatistics).then(res => { }) httpGet('', this.$api.getCommunityrentStatistics).then(res => { })
// //
let datadevice = { let datadevice = {
@ -680,7 +683,7 @@ export default {
}) })
} }
httpPost(datadevice, this.$api.getDeviceItems).then(res => { httpPost(datadevice, this.$api.getDeviceItems).then(res => {
if(res.success){
if (res.success) {
this.deviceTotal = res.data.total this.deviceTotal = res.data.total
} }
}) })
@ -694,22 +697,32 @@ export default {
}) })
} }
httpPost(dataerror, this.$api.screenStatisticsItems).then(res => { httpPost(dataerror, this.$api.screenStatisticsItems).then(res => {
if(res.success){
if (res.success) {
this.deviceerror = res.data.length this.deviceerror = res.data.length
} }
}) })
httpGet('', this.$api.getSiteList).then((res) => { httpGet('', this.$api.getSiteList).then((res) => {
console.log(res); console.log(res);
if(res.success) {
if (res.success) {
var zNodes = JSON.parse(JSON.stringify(res.data.list.list));
var array = utils.uniqueArray(zNodes, "id");
this.roomlistZNodes = ztreeToElementTree2(array, []);
res.data.list.list.map(li => { res.data.list.list.map(li => {
if (li.isRoom == 1 && li.count != 0) {
this.checkin++
}
if(li.isRoom == 1) {
let countNum = res.data.tenants.filter(item => item.id == li.id)[0]
if (countNum) {
li.count = countNum.quantityB
} else {
li.count = 0
}
if (li.isRoom == 1 && li.count > 0) {
this.checkin++
}
if (li.isRoom == 1) {
this.roomsum++ this.roomsum++
} }
}) })
this.Occupancyrate = Number((this.checkin / this.roomsum).toFixed(2)*100)
this.Occupancyrate = Number((this.checkin / this.roomsum).toFixed(2) * 100)
this.expirerate = Number((this.roomInArrears / this.roomsum).toFixed(2) * 100)
} }
}) })
this.$store.commit('setUser1') this.$store.commit('setUser1')
@ -747,7 +760,7 @@ export default {
this.alertTotal += statisticsDate.collectUS[t] this.alertTotal += statisticsDate.collectUS[t]
} }
} }
httpGet('', this.$api.getCommonStatistics).then(async res => {
await httpGet('', this.$api.getCommonStatistics).then(async res => {
console.log(res) console.log(res)
if (res.success) { if (res.success) {
let list = res.data let list = res.data
@ -764,8 +777,8 @@ export default {
} else if (li.status === 3) { } else if (li.status === 3) {
li.lable = '已退租' li.lable = '已退租'
this.outroom += li.total this.outroom += li.total
// } else if (li.status === 4) {
// li.lable = ''
// } else if (li.status === 4) {
// li.lable = ''
} else { } else {
li.lable = '' li.lable = ''
} }
@ -791,10 +804,6 @@ export default {
}, },
mounted() { mounted() {
this.$store.commit('getSumTotal') this.$store.commit('getSumTotal')
setTimeout(() => {
this.expirerate = Number((this.roomInArrears / this.roomsum).toFixed(2)*100)
this.sumTotal = this.$store.state.sumTotal
}, 1000)
window.onresize = () => { window.onresize = () => {
return (() => { return (() => {
if (document.documentElement.clientWidth < 1080) { if (document.documentElement.clientWidth < 1080) {
@ -806,22 +815,113 @@ export default {
} }
})() })()
} }
let data = {
"orderBy": "create_time desc",
"q": JSON.stringify({
status: '1'
})
}
httpPost(data, this.$api.postLeasesList).then(res => {
if (res.success) {
res.data.list.map(li => {
li.signingTime = moment().format("YYYY-MM-DD HH:mm:ss")
})
this.leasesList = res.data.list
setTimeout(() => {
let data = {
orderBy: "create_time desc",
pageNum: 1,
pageSize: 20,
q: JSON.stringify({})
} }
})
var leasesList = []
httpPost(data, this.$api.getlistNum).then((res) => {
if (res.success) {
res.data.list.map((li, index) => {
let userTelephone = JSON.parse(li.info) ? JSON.parse(li.info).userTelephone : ''
let str = {
imei: li.imei,
userTelephone: userTelephone,
password: "",
operateMode: 1,
};
this.$store.commit("increment", 1);
li.status = 3;
li['rommNameText'] = this.screenRoomName(li.id)
li['rommNameText'] = li['rommNameText'].split('、')[0]
if(li['rommNameText'] != ''){
leasesList.push(li)
}
console.log(li['rommNameText']);
})
console.log(res.data.list);
this.leasesList = leasesList
}
})
}, 1500)
// let data = {
// "orderBy": "create_time desc",
// "q": JSON.stringify({
// status: '1'
// })
// }
// httpPost(data, this.$api.postLeasesList).then(res => {
// if (res.success) {
// res.data.list.map(li => {
// li.signingTime = moment().format("YYYY-MM-DD HH:mm:ss")
// })
// this.leasesList = res.data.list
// }
// })
}, },
methods: { methods: {
ScrollUp() {
this.intNum = setInterval(() => {
this.animate = true // css
setTimeout(() => {
this.leasesList.push(this.leasesList[0])
this.leasesList.shift()
this.animate = false
}, 500)
}, 3000)
},
Stop() {
clearInterval(this.intNum)
},
Up() {
this.ScrollUp()
},
getAboutRoom() {
let data = {
orderBy: "create_time desc",
pageNum: 0,
pageSize: 0,
q: JSON.stringify({
name: '',
number: '',
cardId: ''
})
}
let data1 = []
httpPost(data, this.$api.getlistNum).then((res) => {
console.log("123", res);
if (res.success) {
res.data.list.map(li => {
data1.push(li.id)
})
let data2 = {
cardIds: data1
}
httpPost(data2, this.$api.onlyTenant).then((res1) => {
console.log(res1);
this.$store.commit("getAboutRoom", res1.data.list);
this.getlist();
});
}
})
},
screenRoomName(id) {
let roomAbout = this.$store.state.roomAbout
var arr = ''
roomAbout.map(lt => {
if (id == lt.cardId) {
var name = utils.findIndexArray(this.roomlistZNodes, lt.roomId, [])
if (name) {
var path = name.join('/')
arr += path + '、'
}
}
})
return arr
},
// //
getSumTotal() { getSumTotal() {
let date = new Date(); let date = new Date();
@ -839,19 +939,19 @@ export default {
// let arr = new Array(0).fill(this.sumRoom) // let arr = new Array(0).fill(this.sumRoom)
// console.log(arr); // console.log(arr);
// middleChartExtend.series[2].data = arr // middleChartExtend.series[2].data = arr
if (res.data.leases.length != 0) {
res.data.leases.map(li => {
middleChartExtend.series[0].data[li.order - 1] = li.count
})
}
// if (res.data.leases.length != 0) {
// res.data.leases.map(li => {
// middleChartExtend.series[0].data[li.order - 1] = li.count
// })
// }
if (res.data.site.length != 0) { if (res.data.site.length != 0) {
res.data.site.map(li => { res.data.site.map(li => {
middleChartExtend.series[2].data[li.order - 1] = li.count
middleChartExtend.series[0].data[li.order - 1] = li.count
}) })
} }
middleChartExtend.series[2].data.map((li, index) => {
middleChartExtend.series[1].data[index] = middleChartExtend.series[2].data[index] - middleChartExtend.series[0].data[index]
})
// middleChartExtend.series[2].data.map((li, index) => {
// middleChartExtend.series[1].data[index] = middleChartExtend.series[2].data[index] - middleChartExtend.series[0].data[index]
// })
let myMiddleChartObj = this.$echarts.init( let myMiddleChartObj = this.$echarts.init(
document.getElementById("myMiddleChart") document.getElementById("myMiddleChart")
); );
@ -951,19 +1051,22 @@ export default {
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
let roomList = [], percentage = [] let roomList = [], percentage = []
res.data = res.data.sort((a, b) => a.total - b.total)
res.data.map(async li => { res.data.map(async li => {
roomList.push(li.name) roomList.push(li.name)
let arr = commonStatisticsList.filter(item => item.status == 1 && item.name == li.name)
if (arr && arr.length > 0) {
let sum = arr.reduce((prev, item) => {
prev += item.total * 1
return prev
}, 0)
let jg = Number((parseInt(sum) / parseInt(li.total) * 100).toFixed(2))
percentage.push(jg)
} else {
percentage.push(0)
}
// let arr = commonStatisticsList.filter(item => item.status == 1 && item.name == li.name)
// if (arr && arr.length > 0) {
// let sum = arr.reduce((prev, item) => {
// prev += item.total * 1
// return prev
// }, 0)
// let jg = Number((parseInt(sum) / parseInt(li.total) * 100).toFixed(2))
// percentage.push(jg)
percentage.push(li.total)
// percentage = percentage.sort((a,b) => a-b)
// } else {
// percentage.push(0)
// }
}) })
let middleChartExtendOne = this.middleChartExtendOne let middleChartExtendOne = this.middleChartExtendOne
middleChartExtendOne.yAxis.data = roomList middleChartExtendOne.yAxis.data = roomList
@ -1045,16 +1148,53 @@ export default {
height: 10%; height: 10%;
font-size: 20px; font-size: 20px;
} }
.leases-header{
width: 100%;
height: 45px;
font-size: 18px;
padding: 0 10px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
font-weight: bold;
}
@keyframes animtran {
0% {
transform: translateY(0%);
}
100% {
transform: translateY(-12.5%);
}
}
.anim {
animation: animtran .5s linear;
/* transition: all 1s linear; */
margin-top: -45px;
}
.leases-list { .leases-list {
line-height: 45px;
/* height: 260px; */
width: 100%; width: 100%;
padding: 0 10px;
height: 90%; height: 90%;
margin-top: 5px; margin-top: 5px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
} }
.leases-ruzhu{
width: 30%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.leases-date{
width: 55%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.leases-item { .leases-item {
width: 100%; width: 100%;
height: 45px; height: 45px;


Loading…
Cancel
Save