From 1d545776591f101c8aa33e1a893db0045bbc24b6 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期六, 08 二月 2025 17:28:10 +0800
Subject: [PATCH] 改bug
---
admin/src/views/roomStatus/index.vue | 270 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 162 insertions(+), 108 deletions(-)
diff --git a/admin/src/views/roomStatus/index.vue b/admin/src/views/roomStatus/index.vue
index 33d9a28..ac4fd77 100644
--- a/admin/src/views/roomStatus/index.vue
+++ b/admin/src/views/roomStatus/index.vue
@@ -17,7 +17,8 @@
<span class="custom-tree-node" style="width: 100%; display: flex; align-items: center; justify-content: space-between;" slot-scope="{ node, data }">
<span>{{ data.name }}</span>
<span style="color: #2080f7;" v-if="data.lv === 3">
- {{data.leaseStatus === 0 ? '寰呯璧�' : data.leaseStatus === 1 ? '宸茬璧�' : data.leaseStatus === 2 ? '鏈紑鍚璧�' : ''}}
+ <img src="@/assets/icons/ic_key_green.png" style="width: 16px; height: 16px;" v-if="data.leaseStatus === 1" />
+<!-- <img src="@/assets/icons/ic_key_yellow.png" style="width: 16px; height: 16px;" v-else-if="data.leaseStatus === 2" />-->
</span>
</span>
</el-tree>
@@ -33,34 +34,30 @@
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="椤圭洰姒傚喌" name="first" v-if="lv === 0">
<div class="xm">
- <el-card>
- <div class="xm_one">
- <div class="xm_one_row">
- <span>鍦ㄧ鍚堝悓鏁�</span>
- <span>{{projectNums.leaseContractAmount}}</span>
- <span>鍦ㄧ鎴挎簮鏁帮細{{projectNums.leaseRoomAmount}}</span>
- </div>
- <div class="xm_one_row">
- <span>鍙嫑鍟嗛潰绉�</span>
- <span>{{projectNums.investmentArea}}銕�</span>
- <span>鍙嫑鍟嗘埧婧愭暟锛歿{projectNums.investmentRoomAmount}}</span>
- </div>
- <div class="xm_one_row">
- <span>鍦ㄧ瀹炴椂鍧囦环</span>
- <span>{{projectNums.leasePrice}}鍏�/m虏路澶�</span>
- <span>鍦ㄧ闈㈢Н锛歿{projectNums.leaseArea}}m虏</span>
- </div>
- <div class="xm_one_row">
- <span>鍑虹鐜�</span>
- <span>{{rentalRate()}}%</span>
- <span>寰呯闈㈢Н锛歿{projectNums.investmentArea - projectNums.leaseArea}}m虏</span>
- </div>
+ <div class="xm_one">
+ <div class="xm_one_row">
+ <span>鍦ㄧ鍚堝悓鏁�</span>
+ <span>{{projectNums.leaseContractAmount}}</span>
+ <span>鍦ㄧ鎴挎簮鏁帮細{{projectNums.leaseRoomAmount}}</span>
</div>
- </el-card>
- <el-card style="margin-top: 20px;">
- <div slot="header" class="clearfix">
- <span>椤圭洰淇℃伅</span>
+ <div class="xm_one_row">
+ <span>鍙嫑鍟嗛潰绉�</span>
+ <span>{{projectNums.investmentArea}}銕�</span>
+ <span>鍙嫑鍟嗘埧婧愭暟锛歿{projectNums.investmentRoomAmount}}</span>
</div>
+ <div class="xm_one_row">
+ <span>鍦ㄧ瀹炴椂鍧囦环</span>
+ <span>{{projectNums.leasePrice}}鍏�/m虏路澶�</span>
+ <span>鍦ㄧ闈㈢Н锛歿{projectNums.leaseArea}}m虏</span>
+ </div>
+ <div class="xm_one_row">
+ <span>鍑虹鐜�</span>
+ <span>{{rentalRate()}}%</span>
+ <span>寰呯闈㈢Н锛歿{projectNums.investmentArea - projectNums.leaseArea}}m虏</span>
+ </div>
+ </div>
+ <div style="margin-top: 20px;">
+ <div style="font-size: 16px; color: #000000; font-weight: 500; margin-bottom: 20px;">椤圭洰淇℃伅</div>
<div class="xm_info">
<div class="xm_info_row" style="width: 25%;">
<span>椤圭洰鍚嶇О</span>
@@ -79,11 +76,9 @@
<span>{{projectInfo.remark}}</span>
</div>
</div>
- </el-card>
- <el-card style="margin-top: 20px;">
- <div slot="header" class="clearfix">
- <span>褰撳墠鍦ㄧ鍚堝悓</span>
- </div>
+ </div>
+ <div style="margin-top: 20px;">
+ <div style="font-size: 16px; color: #000000; font-weight: 500; margin-bottom: 20px;">褰撳墠鍦ㄧ鍚堝悓</div>
<div class="xm_table">
<div style="display: flex; align-items: center; margin-bottom: 15px;">
<el-input v-model="form.code" style="width: 150px; margin-right: 15px;" placeholder="璇疯緭鍏ュ悎鍚岀紪鍙�"></el-input>
@@ -98,7 +93,7 @@
<el-table-column
label="鍚堝悓缂栧彿">
<template slot-scope="{row}">
- <el-button type="text">{{row.code}}</el-button>
+ <el-button type="text" @click="$refs.ContractDetailRef.open('鍚堝悓璇︽儏', row.id)">{{row.code}}</el-button>
</template>
</el-table-column>
<el-table-column
@@ -146,7 +141,7 @@
</el-pagination>
</div>
</div>
- </el-card>
+ </div>
</div>
</el-tab-pane>
<el-tab-pane label="鎴挎簮淇℃伅" name="houseinfo" v-if="[3].includes(lv)">
@@ -217,7 +212,7 @@
<el-table-column
label="鍚堝悓缂栧彿">
<template slot-scope="{row}">
- <el-button type="text">{{row.code}}</el-button>
+ <el-button type="text" @click="$refs.ContractDetailRef.open('鍚堝悓璇︽儏', row.id)">{{row.code}}</el-button>
</template>
</el-table-column>
<el-table-column
@@ -293,14 +288,18 @@
</div>
</div>
<div class="xm_house_list_right">
- <div class="xm_house_list_right_row" :style="{ width: ifWidth(child.roomRentArea), backgroundColor: ifBackground(child.roomStatus) }" v-for="(child, i) in item.ywRoomStatusDataVOList" :key="i">
+ <div class="xm_house_list_right_row" :style="{ width: child.width + 'px', backgroundColor: ifBackground(child.roomStatus) }" v-for="(child, i) in item.ywRoomStatusDataVOList" :key="i">
<div class="ft">
<span>{{child.roomCode}}</span>
<span>锛坽{child.roomRentArea}}銕★級</span>
</div>
<div class="xm_house_list_right_row_info" v-if="child.roomStatus !== 0">
- <span>{{child.customerName}}</span>
- <span>{{child.overData.substring(0, 10)}}鍒版湡</span>
+ <div style="display: flex; align-items: center;">
+ <span style="margin-right: 5px;">{{child.customerName}}</span>
+ <img src="@/assets/icons/ic_key_green.png" style="width: 16px; height: 16px;" v-if="child.roomStatus === 1" />
+ <img src="@/assets/icons/ic_key_yellow.png" style="width: 16px; height: 16px;" v-else-if="child.roomStatus === 2" />
+ </div>
+ <span :style="{ color: returnColor(child.overData.substring(0, 10)) ? 'red' : '' }">{{child.overData.substring(0, 10)}}{{returnColor(child.overData.substring(0, 10)) ? '宸�' : ''}}鍒版湡</span>
</div>
<div class="xm_house_list_right_row_day" v-if="child.roomStatus === 0">鏈嚭绉燂綔绌虹疆{{child.freeDayAmount}}澶�</div>
</div>
@@ -555,10 +554,14 @@
<div class="xm">
<div class="xm_chat">
<el-card class="xm_chat_row">
- <div id="chat1"></div>
+ <div class="xm_chat_row_info">
+ <span>鎬昏</span>
+ <span>{{amount}}</span>
+ </div>
+ <div id="chat1" v-if="activeName === 'third'"></div>
</el-card>
<el-card class="xm_chat_row">
- <div id="chat2"></div>
+ <div id="chat2" v-if="activeName === 'third'"></div>
</el-card>
</div>
<el-card style="margin-top: 20px;">
@@ -702,7 +705,9 @@
roomInfo: {},
loading: false,
lv: 0,
- leaseStatus: ''
+ leaseStatus: '',
+ amount: 0,
+ project: ''
}
},
created () {
@@ -728,6 +733,7 @@
if (e.lv === 0) {
this.activeName = 'first'
this.form.project = e.id
+ this.project = e.id
this.getProjectByIds()
} else if (e.lv === 1) {
this.activeName = 'house'
@@ -743,6 +749,21 @@
this.leaseStatus = e.leaseStatus
this.roomDetailByIds()
}
+ },
+ returnColor(date) {
+ let date1 = Number(date.replace(/-/g, ''))
+ let date2 = Number(this.getDay().replace(/-/g, ''))
+ return date2 > date1
+ },
+ getDay() {
+ const now = new Date();
+ const year = now.getFullYear();
+ let month = now.getMonth() + 1; // 鏈堜唤浠�0寮�濮嬶紝鎵�浠ヨ鍔�1
+ let day = now.getDate();
+ const padZero = (num) => num < 10 ? '0' + num : num;
+ month = padZero(month);
+ day = padZero(day);
+ return `${year}-${month}-${day}`;
},
// 鎼滅储鏍�
filterNode(value, data) {
@@ -800,7 +821,16 @@
buildingId: this.form.buildingId,
floor: this.form.floorId
}).then(res => {
+ res.forEach(item => {
+ let num = item.ywRoomStatusDataVOList.map(item => item.roomRentArea)
+ let total = num.reduce((sum, value) => sum + value, 0)
+ item.ywRoomStatusDataVOList.forEach(child => {
+ // let percentage = (child.roomRentArea / total) * 100; // 璁$畻姣忎釜鍊肩殑鍗犳瘮
+ child.width = (child.roomRentArea / total) * 854
+ })
+ })
this.roomStatus = res
+ console.log(this.roomStatus)
})
},
// 鑾峰彇璁惧鐘舵��
@@ -818,6 +848,7 @@
{ value: res.exceptionAmount || 0, name: '寮傚父' },
{ value: res.errAmount || 0, name: '鎶ュ簾' }
]
+ this.amount = res.amount
this.reand()
})
})
@@ -836,9 +867,10 @@
})
})
},
- handleEdit(row) {
+ handleEdit() {
this.showEdit1 = true
this.$nextTick(() => {
+ this.$refs.EditRef.param.projectId = this.project
this.$refs.EditRef.isShowModal = true
})
},
@@ -975,7 +1007,8 @@
buildingId: this.form.buildingId,
floorId: this.form.floorId,
roomId: this.form.roomId,
- code: this.form.code
+ code: this.form.code,
+ statusList: [0,1,2,3]
}
}).then(res => {
this.tableData = res.records
@@ -989,6 +1022,7 @@
.then(res => {
this.addParamToArray(res)
this.form.project = res[0].id
+ this.project = res[0].id
this.title = res[0].name
this.houseList = res
this.getProjectByIds()
@@ -1023,13 +1057,7 @@
{
name: '璁惧鐘舵��',
type: 'pie',
- radius: ['40%', '80%'],
- label: {
- show: true,
- position: 'center',
- fontWeight: 'bold',
- fontSize: 22
- },
+ radius: ['50%', '80%'],
data: this.deviceList
}
]
@@ -1040,53 +1068,25 @@
var chartDom = document.getElementById('chat2');
var myChart = echarts.init(chartDom);
var option;
- const rawData = [
- [100, 302, 301, 334, 390, 330, 320],
- [320, 132, 101, 134, 90, 230, 210],
- [220, 182, 191, 234, 290, 330, 310],
- [150, 212, 201, 154, 190, 330, 410],
- [820, 832, 901, 934, 1290, 1330, 1320]
- ];
- const totalData = [];
- for (let i = 0; i < rawData[0].length; ++i) {
- let sum = 0;
- for (let j = 0; j < rawData.length; ++j) {
- sum += rawData[j][i];
- }
- totalData.push(sum);
- }
- const series = [
- 'Direct',
- 'Mail Ad',
- 'Affiliate Ad',
- 'Video Ad',
- 'Search Engine'
- ].map((name, sid) => {
- return {
- name,
- type: 'bar',
- stack: 'total',
- barWidth: '60%',
- data: rawData[sid].map((d, did) =>
- totalData[did] <= 0 ? 0 : d / totalData[did]
- )
- };
- });
- let seriesArr = this.categaryList.map(item => {
- return {
- name: item.cateName,
- type: 'bar',
- stack: 'total',
- barWidth: '60%',
- data: item.ywDeviceCateDataVOList.map((child) =>
- child.deviceAmount
- )
- }
+ let seriesArr = []
+ this.categaryList.forEach((one, index) => {
+ one.ywDeviceCateDataVOList.forEach(two => {
+ let data = []
+ this.categaryList.forEach(item => {
+ data.push(0)
+ })
+ data[index] = two.deviceAmount
+ seriesArr.push({
+ name: two.cateName,
+ type: 'bar',
+ barGap:-1,
+ stack: one.cateName,
+ data
+ })
+ })
})
let xAxisData = this.categaryList.map(item => item.cateName)
- console.log(series)
console.log(seriesArr)
- console.log(xAxisData)
option = {
title: {
text: '璁惧鏁伴噺鍒嗙被缁熻'
@@ -1101,15 +1101,30 @@
trigger: 'axis',
axisPointer: {
type: 'shadow'
+ },
+ formatter: params => {
+ var res = `${params[0].name} <br/>`
+ for (const item of params) {
+ if (item.value !== 0) {
+ res += `<span style="background: ${item.color}; height:10px; width: 10px; border-radius: 50%;display: inline-block;margin-right:10px;"></span> ${item.seriesName} 锛�${item.value}<br/>`
+ }
+ }
+ return res
}
},
- yAxis: {
- type: 'value'
- },
- xAxis: {
- type: 'category',
- data: xAxisData
- },
+ xAxis: [
+ {
+ type: 'category',
+ position: 'bottom',
+ data: xAxisData
+ }
+ ],
+ yAxis: [
+ {
+ type: 'value',
+ data: Array.from({ length: 100 }, (_, i) => i + 1)
+ }
+ ],
series: seriesArr
};
@@ -1260,6 +1275,7 @@
}
}
.xm_house_list_right {
+ width: 854px;
display: flex;
align-items: center;
.xm_house_list_right_row {
@@ -1342,6 +1358,28 @@
.xm_chat_row {
width: 49%;
height: 300px;
+ position: relative;
+ .xm_chat_row_info {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ span {
+ &:nth-child(1) {
+ font-size: 20px;
+ color: #222222;
+ }
+ &:nth-child(2) {
+ font-size: 28px;
+ color: #222222;
+ font-weight: bold;
+ }
+ }
+ }
#chat1 {
width: 100%;
height: 260px;
@@ -1359,17 +1397,30 @@
justify-content: space-between;
.xm_one_row {
flex: 1;
+ margin-right: 20px;
display: flex;
flex-direction: column;
+ justify-content: space-between;
+ height: 120px;
+ background: #F4F7FC;
+ border-radius: 8px;
+ padding: 15px 20px;
+ box-sizing: border-box;
+ &:last-child {
+ margin: 0;
+ }
span {
font-size: 16px;
color: black;
&:nth-child(2) {
- font-weight: bold;
- margin: 15px 0;
+ font-weight: 600;
+ font-size: 24px;
+ color: #3E80EF;
}
&:nth-child(3) {
- color: #666666;
+ font-weight: 400;
+ font-size: 14px;
+ color: #888888;
}
}
}
@@ -1419,13 +1470,16 @@
display: flex;
flex-direction: column;
span {
- font-size: 16px;
&:nth-child(1) {
- color: #666666;
+ font-weight: 400;
+ font-size: 13px;
+ color: #888888;
}
&:nth-child(2) {
- color: #000000;
- margin-top: 15px;
+ font-weight: 400;
+ font-size: 14px;
+ color: #222222;
+ margin-top: 7px;
}
}
}
--
Gitblit v1.9.3