程志平 3 years ago
parent
commit
2fff2cd59c

+ 1 - 0
src/api/consumptionRecord.js

@@ -63,6 +63,7 @@ export function downloadExcel(forData) {
 	if (typeof forData.state != 'undefined') {
 	if (typeof forData.state != 'undefined') {
 		data.append('state', forData.state)
 		data.append('state', forData.state)
 	}
 	}
+	// console.log(forData);
 	return request({
 	return request({
 		url: '/airManage/consumetoExcel.action',
 		url: '/airManage/consumetoExcel.action',
 		method: 'post',
 		method: 'post',

+ 30 - 23
src/views/consumptionRecord/index.vue

@@ -173,9 +173,9 @@
 			 * 下载Excel表格
 			 * 下载Excel表格
 			 */
 			 */
 			handler_download_excel() {
 			handler_download_excel() {
-				let data = this.cond_data;
+				this.get_condition();
 				// 开始发送请求,获取配置数据
 				// 开始发送请求,获取配置数据
-				downloadExcel(data).then((res) => {
+				downloadExcel(this.cond_data).then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (typeof res.code == 'undefined' || res.code == '') {
 					if (typeof res.code == 'undefined' || res.code == '') {
 						this.$message.error('返回数据格式问题,code未获取到!')
 						this.$message.error('返回数据格式问题,code未获取到!')
@@ -221,27 +221,14 @@
 			 */
 			 */
 			get_table_data(param) {
 			get_table_data(param) {
 				this.loading = true
 				this.loading = true
-				let data = {
-					page: this.pagination.currentPage,
-					rows: this.pagination.pageSize
-				}
+				this.get_condition();
+				
+				let data = this.cond_data;
+				
 				if (param == 'search') {
 				if (param == 'search') {
 					data.page = 1;
 					data.page = 1;
 					this.pagination.currentPage = 1;
 					this.pagination.currentPage = 1;
 				}
 				}
-				if (this.formInline.user !== '') {
-					data.name_card = this.formInline.user;
-				}
-				if (this.formInline.startTime !== '') {
-					data.start_time = this.formInline.startTime;
-				}
-				if (this.formInline.endTime !== '') {
-					data.end_time = this.formInline.endTime;
-				}
-				if (this.formInline.state !== '') {
-					data.state = this.formInline.state;
-				}
-				this.cond_data = data;
 				// console.log(data);
 				// console.log(data);
 				getTableData(data).then((res) => {
 				getTableData(data).then((res) => {
 					// console.log(res);
 					// console.log(res);
@@ -284,8 +271,8 @@
 			 * 获取3个数据
 			 * 获取3个数据
 			 */
 			 */
 			get_three_data() {
 			get_three_data() {
-				let data = this.cond_data;
-				getThreeData(data).then((res) => {
+				this.get_condition();
+				getThreeData(this.cond_data).then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (res.code == 200) {
 					if (res.code == 200) {
 						this.total_balance = res.TotalYe.toFixed(2) // 总余额
 						this.total_balance = res.TotalYe.toFixed(2) // 总余额
@@ -298,8 +285,28 @@
 					// console.log(err);
 					// console.log(err);
 					this.$message.error(err.message)
 					this.$message.error(err.message)
 				});
 				});
-				
-				this.cond_data = {};
+			},
+			/**
+			 * 条件
+			 */
+			get_condition() {
+				let data = {
+					page: this.pagination.currentPage,
+					rows: this.pagination.pageSize
+				}
+				if (this.formInline.user !== '') {
+					data.name_card = this.formInline.user;
+				}
+				if (this.formInline.startTime !== '') {
+					data.start_time = this.formInline.startTime;
+				}
+				if (this.formInline.endTime !== '') {
+					data.end_time = this.formInline.endTime;
+				}
+				if (this.formInline.state !== '') {
+					data.state = this.formInline.state;
+				}
+				this.cond_data = data;
 			},
 			},
 			/**
 			/**
 			 * 搜索
 			 * 搜索

+ 31 - 21
src/views/rechargeRecord/index.vue

@@ -159,9 +159,9 @@
 			 * 下载Excel表格
 			 * 下载Excel表格
 			 */
 			 */
 			handler_download_excel() {
 			handler_download_excel() {
-				let data = this.cond_data;
+				this.get_condtion();
 				// 开始发送请求,获取配置数据
 				// 开始发送请求,获取配置数据
-				downloadExcel(data).then((res) => {
+				downloadExcel(this.cond_data).then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (typeof res.code == 'undefined' || res.code == '') {
 					if (typeof res.code == 'undefined' || res.code == '') {
 						this.$message.error('返回数据格式问题,code未获取到!')
 						this.$message.error('返回数据格式问题,code未获取到!')
@@ -206,8 +206,9 @@
 			 * 获取3个数据
 			 * 获取3个数据
 			 */
 			 */
 			get_three_data() {
 			get_three_data() {
-				let data = this.cond_data;
-				getThreeData(data).then((res) => {
+				this.get_condtion();
+				
+				getThreeData(this.cond_data).then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (res.code == 200) {
 					if (res.code == 200) {
 						this.total_balance = res.TotalYe.toFixed(2) // 总余额
 						this.total_balance = res.TotalYe.toFixed(2) // 总余额
@@ -226,27 +227,13 @@
 			 */
 			 */
 			get_table_data(param) {
 			get_table_data(param) {
 				this.loading = true
 				this.loading = true
-				let data = {
-					page: this.pagination.currentPage,
-					rows: this.pagination.pageSize
-				}
+				this.get_condtion();
+				
+				let data = this.cond_data;
 				if (param == 'search') {
 				if (param == 'search') {
 					data.page = 1
 					data.page = 1
 					this.pagination.currentPage = 1
 					this.pagination.currentPage = 1
 				}
 				}
-				if (this.formInline.user !== '') {
-					data.name_card = this.formInline.user
-				}
-				if (this.formInline.startTime !== '') {
-					data.start_time = this.formInline.startTime
-				}
-				if (this.formInline.endTime !== '') {
-					data.end_time = this.formInline.endTime
-				}
-				if (this.formInline.state !== '') {
-					data.state = this.formInline.state
-				}
-				this.cond_data = data;
 				// console.log(data);
 				// console.log(data);
 				getTableData(data).then((res) => {
 				getTableData(data).then((res) => {
 					// console.log(res);
 					// console.log(res);
@@ -271,6 +258,29 @@
 				}
 				}
 			},
 			},
 			/**
 			/**
+			 * 条件
+			 */
+			get_condtion() {
+				let data = {
+					page: this.pagination.currentPage,
+					rows: this.pagination.pageSize
+				}
+				if (this.formInline.user !== '') {
+					data.name_card = this.formInline.user
+				}
+				if (this.formInline.startTime !== '') {
+					data.start_time = this.formInline.startTime
+				}
+				if (this.formInline.endTime !== '') {
+					data.end_time = this.formInline.endTime
+				}
+				if (this.formInline.state !== '') {
+					data.state = this.formInline.state
+				}
+				
+				this.cond_data = data;
+			},
+			/**
 			 * 搜索
 			 * 搜索
 			 */
 			 */
 			btn_search() {
 			btn_search() {

+ 36 - 29
src/views/serveAC/index.vue

@@ -62,7 +62,7 @@
 							<el-button :class="btnActive == 'powerOff' ? 'btn-active':'btn-no-active'" type="primary"
 							<el-button :class="btnActive == 'powerOff' ? 'btn-active':'btn-no-active'" type="primary"
 								size="medium" round @click="top_btn_click('powerOff')">关机</el-button>
 								size="medium" round @click="top_btn_click('powerOff')">关机</el-button>
 							<el-button :class="btnActive == 'abnormal' ? 'btn-active':'btn-no-active'" type="primary"
 							<el-button :class="btnActive == 'abnormal' ? 'btn-active':'btn-no-active'" type="primary"
-								size="medium" round @click="top_btn_click('abnormal')">异常</el-button>
+								size="medium" round @click="top_btn_click('abnormal')">离线</el-button>
 						</div>
 						</div>
 						<el-row>
 						<el-row>
 							<el-col :span="12">
 							<el-col :span="12">
@@ -118,13 +118,13 @@
 											</el-table-column>
 											</el-table-column>
 											<el-table-column label="开关状态" align="center">
 											<el-table-column label="开关状态" align="center">
 												<template slot-scope="scope">
 												<template slot-scope="scope">
-													<span v-if="scope.row.onOffStatus == 0"
+													<span v-if="scope.row.onOffStatus == 0" title="已关机"
 														@click="open_close_airs(0, scope.$index, scope.row, 'open')">
 														@click="open_close_airs(0, scope.$index, scope.row, 'open')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-off" />
 													</span>
 													</span>
-													<span v-else class="txt-cell-blue"
+													<span v-else class="txt-cell-blue" title="已开机"
 														@click="open_close_airs(0, scope.$index, scope.row, 'close')">
 														@click="open_close_airs(0, scope.$index, scope.row, 'close')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-on" />
 													</span>
 													</span>
 												</template>
 												</template>
 											</el-table-column>
 											</el-table-column>
@@ -198,13 +198,13 @@
 											</el-table-column>
 											</el-table-column>
 											<el-table-column label="开关状态" align="center">
 											<el-table-column label="开关状态" align="center">
 												<template slot-scope="scope">
 												<template slot-scope="scope">
-													<span v-if="scope.row.onOffStatus == 0"
+													<span v-if="scope.row.onOffStatus == 0" title="已关机"
 														@click="open_close_airs(1, scope.$index, scope.row, 'open')">
 														@click="open_close_airs(1, scope.$index, scope.row, 'open')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-off" />
 													</span>
 													</span>
-													<span v-else class="txt-cell-blue"
+													<span v-else class="txt-cell-blue" title="已开机"
 														@click="open_close_airs(1, scope.$index, scope.row, 'close')">
 														@click="open_close_airs(1, scope.$index, scope.row, 'close')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-on" />
 													</span>
 													</span>
 												</template>
 												</template>
 											</el-table-column>
 											</el-table-column>
@@ -280,13 +280,13 @@
 											</el-table-column>
 											</el-table-column>
 											<el-table-column label="开关状态" align="center">
 											<el-table-column label="开关状态" align="center">
 												<template slot-scope="scope">
 												<template slot-scope="scope">
-													<span v-if="scope.row.onOffStatus == 0"
+													<span v-if="scope.row.onOffStatus == 0" title="已关机"
 														@click="open_close_airs(2, scope.$index, scope.row, 'open')">
 														@click="open_close_airs(2, scope.$index, scope.row, 'open')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-off" />
 													</span>
 													</span>
-													<span v-else class="txt-cell-blue"
+													<span v-else class="txt-cell-blue" title="已开机"
 														@click="open_close_airs(2, scope.$index, scope.row, 'close')">
 														@click="open_close_airs(2, scope.$index, scope.row, 'close')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-on" />
 													</span>
 													</span>
 												</template>
 												</template>
 											</el-table-column>
 											</el-table-column>
@@ -360,13 +360,13 @@
 											</el-table-column>
 											</el-table-column>
 											<el-table-column label="开关状态" align="center">
 											<el-table-column label="开关状态" align="center">
 												<template slot-scope="scope">
 												<template slot-scope="scope">
-													<span v-if="scope.row.onOffStatus == 0"
+													<span v-if="scope.row.onOffStatus == 0" title="已关机"
 														@click="open_close_airs(3, scope.$index, scope.row, 'open')">
 														@click="open_close_airs(3, scope.$index, scope.row, 'open')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-off" />
 													</span>
 													</span>
-													<span v-else class="txt-cell-blue"
+													<span v-else class="txt-cell-blue" title="已开机"
 														@click="open_close_airs(3, scope.$index, scope.row, 'close')">
 														@click="open_close_airs(3, scope.$index, scope.row, 'close')">
-														<svg-icon icon-class="power" class="power-icon" />
+														<svg-icon icon-class="power" class="power-icon-on" />
 													</span>
 													</span>
 												</template>
 												</template>
 											</el-table-column>
 											</el-table-column>
@@ -904,7 +904,7 @@
 							} else {
 							} else {
 								this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
 								this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
 									'alarmStatus',
 									'alarmStatus',
-									'异常')
+									'离线')
 							}
 							}
 							// let _this = this;
 							// let _this = this;
 							// setTimeout(() => {
 							// setTimeout(() => {
@@ -942,7 +942,7 @@
 							} else {
 							} else {
 								this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
 								this.$set(this.currentData.rooms[roomIndex].tableData[rowIndex],
 									'alarmStatus',
 									'alarmStatus',
-									'异常')
+									'离线')
 							}
 							}
 							// let _this = this;
 							// let _this = this;
 							// setTimeout(() => {
 							// setTimeout(() => {
@@ -1221,7 +1221,7 @@
 										building: data[i].build, // 楼栋
 										building: data[i].build, // 楼栋
 										device: data[i].air_config, // 空调配置
 										device: data[i].air_config, // 空调配置
 										userTime: data[i].duration_use, // 使用时长
 										userTime: data[i].duration_use, // 使用时长
-										alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+										alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 										onOffStatus: data[i].is_on, // 是否开启
 										onOffStatus: data[i].is_on, // 是否开启
 										userName: data[i].cao, // 操作员
 										userName: data[i].cao, // 操作员
 										contact: '待接口返回,待优化' // 联系方式
 										contact: '待接口返回,待优化' // 联系方式
@@ -1233,7 +1233,7 @@
 										building: data[i].build, // 楼栋
 										building: data[i].build, // 楼栋
 										device: data[i].air_config, // 空调配置
 										device: data[i].air_config, // 空调配置
 										userTime: data[i].duration_use, // 使用时长
 										userTime: data[i].duration_use, // 使用时长
-										alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+										alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 										onOffStatus: data[i].is_on, // 是否开启
 										onOffStatus: data[i].is_on, // 是否开启
 										userName: data[i].cao, // 操作员
 										userName: data[i].cao, // 操作员
 										contact: '待接口返回,待优化' // 联系方式
 										contact: '待接口返回,待优化' // 联系方式
@@ -1245,7 +1245,7 @@
 										building: data[i].build, // 楼栋
 										building: data[i].build, // 楼栋
 										device: data[i].air_config, // 空调配置
 										device: data[i].air_config, // 空调配置
 										userTime: data[i].duration_use, // 使用时长
 										userTime: data[i].duration_use, // 使用时长
-										alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+										alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 										onOffStatus: data[i].is_on, // 是否开启
 										onOffStatus: data[i].is_on, // 是否开启
 										userName: data[i].cao, // 操作员
 										userName: data[i].cao, // 操作员
 										contact: '待接口返回,待优化' // 联系方式
 										contact: '待接口返回,待优化' // 联系方式
@@ -1257,7 +1257,7 @@
 										building: data[i].build, // 楼栋
 										building: data[i].build, // 楼栋
 										device: data[i].air_config, // 空调配置
 										device: data[i].air_config, // 空调配置
 										userTime: data[i].duration_use, // 使用时长
 										userTime: data[i].duration_use, // 使用时长
-										alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+										alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 										onOffStatus: data[i].is_on, // 是否开启
 										onOffStatus: data[i].is_on, // 是否开启
 										userName: data[i].cao, // 操作员
 										userName: data[i].cao, // 操作员
 										contact: '待接口返回,待优化' // 联系方式
 										contact: '待接口返回,待优化' // 联系方式
@@ -1447,7 +1447,7 @@
 											building: data[i].build, // 楼栋
 											building: data[i].build, // 楼栋
 											device: data[i].air_config, // 空调配置
 											device: data[i].air_config, // 空调配置
 											userTime: data[i].duration_use, // 使用时长
 											userTime: data[i].duration_use, // 使用时长
-											alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+											alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 											onOffStatus: data[i].is_on, // 是否开启
 											onOffStatus: data[i].is_on, // 是否开启
 											userName: data[i].cao, // 操作员
 											userName: data[i].cao, // 操作员
 											contact: '待接口返回,待优化' // 联系方式
 											contact: '待接口返回,待优化' // 联系方式
@@ -1459,7 +1459,7 @@
 											building: data[i].build, // 楼栋
 											building: data[i].build, // 楼栋
 											device: data[i].air_config, // 空调配置
 											device: data[i].air_config, // 空调配置
 											userTime: data[i].duration_use, // 使用时长
 											userTime: data[i].duration_use, // 使用时长
-											alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+											alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 											onOffStatus: data[i].is_on, // 是否开启
 											onOffStatus: data[i].is_on, // 是否开启
 											userName: data[i].cao, // 操作员
 											userName: data[i].cao, // 操作员
 											contact: '待接口返回,待优化' // 联系方式
 											contact: '待接口返回,待优化' // 联系方式
@@ -1471,7 +1471,7 @@
 											building: data[i].build, // 楼栋
 											building: data[i].build, // 楼栋
 											device: data[i].air_config, // 空调配置
 											device: data[i].air_config, // 空调配置
 											userTime: data[i].duration_use, // 使用时长
 											userTime: data[i].duration_use, // 使用时长
-											alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+											alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 											onOffStatus: data[i].is_on, // 是否开启
 											onOffStatus: data[i].is_on, // 是否开启
 											userName: data[i].cao, // 操作员
 											userName: data[i].cao, // 操作员
 											contact: '待接口返回,待优化' // 联系方式
 											contact: '待接口返回,待优化' // 联系方式
@@ -1483,7 +1483,7 @@
 											building: data[i].build, // 楼栋
 											building: data[i].build, // 楼栋
 											device: data[i].air_config, // 空调配置
 											device: data[i].air_config, // 空调配置
 											userTime: data[i].duration_use, // 使用时长
 											userTime: data[i].duration_use, // 使用时长
-											alarmStatus: data[i].is_normal == 1 ? '正常' : '异常', // 是否正常
+											alarmStatus: data[i].is_normal == 1 ? '正常' : '离线', // 是否正常
 											onOffStatus: data[i].is_on, // 是否开启
 											onOffStatus: data[i].is_on, // 是否开启
 											userName: data[i].cao, // 操作员
 											userName: data[i].cao, // 操作员
 											contact: '待接口返回,待优化' // 联系方式
 											contact: '待接口返回,待优化' // 联系方式
@@ -2366,9 +2366,16 @@
 												border: 1px solid #2B4CFE;
 												border: 1px solid #2B4CFE;
 											}
 											}
 
 
-											.power-icon {
-												font-size: 20px;
+											.power-icon-on {
+												font-size: 22px;
+												cursor: pointer;
+												color: #00ff00;
+											}
+											
+											.power-icon-off {
+												font-size: 22px;
 												cursor: pointer;
 												cursor: pointer;
+												color: #ff0000;
 											}
 											}
 										}
 										}
 									}
 									}

+ 23 - 13
src/views/userMgr/index.vue

@@ -389,9 +389,10 @@
 			 * 下载Excel表格
 			 * 下载Excel表格
 			 */
 			 */
 			handler_download_excel() {
 			handler_download_excel() {
-				let data = this.cond_data;
+				this.get_condition();
+				
 				// 开始发送请求,获取配置数据
 				// 开始发送请求,获取配置数据
-				downloadExcel(data).then((res) => {
+				downloadExcel(this.cond_data).then((res) => {
 					// console.log(res);
 					// console.log(res);
 					if (typeof res.code == 'undefined' || res.code == '') {
 					if (typeof res.code == 'undefined' || res.code == '') {
 						this.$message.error('返回数据格式问题,code未获取到!')
 						this.$message.error('返回数据格式问题,code未获取到!')
@@ -506,21 +507,13 @@
 			 */
 			 */
 			get_user_list(param) {
 			get_user_list(param) {
 				this.loading = true
 				this.loading = true
-				let data = {
-					page: this.pagination.currentPage,
-					rows: this.pagination.pageSize
-				}
+				this.get_condition();
+				
+				let data = this.cond_data;
 				if (param == 'search') {
 				if (param == 'search') {
 					data.page = 1;
 					data.page = 1;
 					this.pagination.currentPage = 1;
 					this.pagination.currentPage = 1;
 				}
 				}
-				if (this.formInline.user !== '') {
-					data.name_card = this.formInline.user;
-				}
-				if (this.formInline.category !== '') {
-					data.classfy = this.formInline.category;
-				}
-				this.cond_data = data;
 				// 开始发送请求,获取配置数据
 				// 开始发送请求,获取配置数据
 				getUserList(data).then((res) => {
 				getUserList(data).then((res) => {
 					// console.log(res.rows);
 					// console.log(res.rows);
@@ -542,6 +535,23 @@
 				this.loading = false;
 				this.loading = false;
 			},
 			},
 			/**
 			/**
+			 * 条件
+			 */
+			get_condition() {
+				let data = {
+					page: this.pagination.currentPage,
+					rows: this.pagination.pageSize
+				}
+				if (this.formInline.user !== '') {
+					data.name_card = this.formInline.user;
+				}
+				if (this.formInline.category !== '') {
+					data.classfy = this.formInline.category;
+				}
+				
+				this.cond_data = data;
+			},
+			/**
 			 * 查询
 			 * 查询
 			 */
 			 */
 			btn_search() {
 			btn_search() {