soft5566 3 anni fa
parent
commit
3b05b04147
2 ha cambiato i file con 48 aggiunte e 26 eliminazioni
  1. 42 24
      src/views/rechargeRecord/index.vue
  2. 6 2
      src/views/serveAC/index.vue

+ 42 - 24
src/views/rechargeRecord/index.vue

@@ -7,10 +7,8 @@
 						<div class="title-left">
 						<div class="title-left">
 							<div class="title">充值记录</div>
 							<div class="title">充值记录</div>
 							<div class="title-detail">总余额:{{total_balance}}元</div>
 							<div class="title-detail">总余额:{{total_balance}}元</div>
-							<div class="title-detail">总充值:{{total_recharge}}元</div>
-							<div class="title-detail">线上:{{online_recharge}}元</div>
-							<div class="title-detail">线下:{{offline_recharge}}元</div>
-							<div class="title-detail">总交易笔数:{{total_number}}笔</div>
+							<div class="title-detail">总充值:{{recharge.total}}元【线上:{{recharge.online}}元,线下:{{recharge.offline}}元】</div>
+							<div class="title-detail">总交易笔数:{{number.total}}笔【线上:{{number.online}}笔,线下:{{number.offline}}笔】</div>
 						</div>
 						</div>
 						<div class="title-right">
 						<div class="title-right">
 							<el-button type="primary" @click="handler_download_excel">导出表单</el-button>
 							<el-button type="primary" @click="handler_download_excel">导出表单</el-button>
@@ -25,9 +23,8 @@
 								<el-button type="warning" @click="btn_search">查询</el-button>
 								<el-button type="warning" @click="btn_search">查询</el-button>
 							</el-form-item>
 							</el-form-item>
 							<el-form-item label="时间筛选:">
 							<el-form-item label="时间筛选:">
-								<el-date-picker v-model="search_datatime" type="datetimerange" align="right"
-									start-placeholder="开始日期" end-placeholder="结束日期" @change="search_datetime_change"
-									:default-time="['12:00:00', '08:00:00']" value-format="yyyy-MM-dd HH:mm:ss"
+								<el-date-picker v-model="search_datatime" type="datetimerange" align="right" start-placeholder="开始日期" end-placeholder="结束日期"
+									@change="search_datetime_change" :default-time="['12:00:00', '08:00:00']" value-format="yyyy-MM-dd HH:mm:ss"
 									format="yyyy-MM-dd HH:mm:ss" clearable>
 									format="yyyy-MM-dd HH:mm:ss" clearable>
 								</el-date-picker>
 								</el-date-picker>
 							</el-form-item>
 							</el-form-item>
@@ -42,8 +39,8 @@
 								</el-select>
 								</el-select>
 							</el-form-item>
 							</el-form-item>
 						</el-form>
 						</el-form>
-						<el-table :data="tableData" height="510" style="width: 100%" :cell-style="cell_style"
-							v-loading="loading" :header-cell-style="header_cell_style">
+						<el-table :data="tableData" height="510" style="width: 100%" :cell-style="cell_style" v-loading="loading"
+							:header-cell-style="header_cell_style">
 							<el-table-column label="序号" align="center" width="100">
 							<el-table-column label="序号" align="center" width="100">
 								<template slot-scope="scope">
 								<template slot-scope="scope">
 									<span>{{(pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1}}</span>
 									<span>{{(pagination.currentPage - 1) * pagination.pageSize + scope.$index + 1}}</span>
@@ -101,8 +98,7 @@
 							</el-table-column>
 							</el-table-column>
 						</el-table>
 						</el-table>
 						<div class="pagination-table">
 						<div class="pagination-table">
-							<el-pagination @current-change="currentPageChange"
-								:current-page.sync="pagination.currentPage" :page-size="pagination.pageSize"
+							<el-pagination @current-change="currentPageChange" :current-page.sync="pagination.currentPage" :page-size="pagination.pageSize"
 								layout="prev, pager, next, jumper" :total="pagination.total">
 								layout="prev, pager, next, jumper" :total="pagination.total">
 							</el-pagination>
 							</el-pagination>
 						</div>
 						</div>
@@ -123,10 +119,16 @@
 		data() {
 		data() {
 			return {
 			return {
 				total_balance: 0.0.toFixed(2), // 总余额
 				total_balance: 0.0.toFixed(2), // 总余额
-				total_recharge: 0.0.toFixed(2), // 总充值
-				online_recharge: 0.0.toFixed(2), // 线上充值
-				offline_recharge: 0.0.toFixed(2), // 线下充值
-				total_number: 0, // 总交易笔数
+				recharge: {
+					online: 0.0.toFixed(2), // 线上充值
+					offline: 0.0.toFixed(2), // 线下充值
+					total: 0.0.toFixed(2) // 线上+线下 的总充值
+				},
+				number: {
+					online: 0, // 线上总笔数
+					offline: 0, // 线下总笔试
+					total: 0 // 线上+线下 的总交易笔数
+				},
 				formLabelWidth: '120px',
 				formLabelWidth: '120px',
 				// 表格单元格样式
 				// 表格单元格样式
 				cell_style: {
 				cell_style: {
@@ -222,19 +224,35 @@
 			 */
 			 */
 			get_three_data() {
 			get_three_data() {
 				this.get_condtion();
 				this.get_condtion();
-				
+
 				getThreeData(this.cond_data).then((res) => {
 				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_recharge = res.zongRecharge.toFixed(2) // 总消费
-						this.total_number = res.zongRecord // 总交易笔数
+						if (typeof res.zongRo == 'undefined') {
+							res.zongRo = 0; // 测试数据,以防undefined,上线需删除
+						}
+						if (typeof res.zongRo == 'undefined') {
+							res.numRo = 0; // 测试数据,以防undefined,上线需删除
+						}
+						this.total_balance = res.TotalYe.toFixed(2); // 总余额
+						// 总充值
+						this.recharge = {
+							online: res.zongRecharge.toFixed(2), // 线上总充值
+							offline: res.zongRo.toFixed(2), // 线下总充值
+							total: res.zongRecharge + res.zongRo // 线上+线下 的总充值
+						};
+						// 总交易笔数
+						this.number = {
+							online: res.zongRecord, // 线上总交易笔数
+							offline: res.numRo, // 线下总交易笔数
+							total: res.zongRecord + res.numRo // 线上+线下 的总交易笔数
+						};
 					} else {
 					} else {
-						this.$message.error(res.message)
+						this.$message.error(res.message);
 					}
 					}
 				}).catch((err) => {
 				}).catch((err) => {
 					// console.log(err);
 					// console.log(err);
-					this.$message.error(err.message)
+					this.$message.error(err.message);
 				})
 				})
 			},
 			},
 			/**
 			/**
@@ -243,7 +261,7 @@
 			get_table_data(param) {
 			get_table_data(param) {
 				this.loading = true
 				this.loading = true
 				this.get_condtion();
 				this.get_condtion();
-				
+
 				let data = this.cond_data;
 				let data = this.cond_data;
 				if (param == 'search') {
 				if (param == 'search') {
 					data.page = 1
 					data.page = 1
@@ -292,7 +310,7 @@
 				if (this.formInline.state !== '') {
 				if (this.formInline.state !== '') {
 					data.state = this.formInline.state
 					data.state = this.formInline.state
 				}
 				}
-				
+
 				this.cond_data = data;
 				this.cond_data = data;
 			},
 			},
 			/**
 			/**
@@ -521,4 +539,4 @@
 			}
 			}
 		}
 		}
 	}
 	}
-</style>
+</style>

+ 6 - 2
src/views/serveAC/index.vue

@@ -1594,11 +1594,15 @@
 
 
 					if (res.code == 200) {
 					if (res.code == 200) {
 						// 填充数据
 						// 填充数据
-						this.open_number = res.onNum;
-						this.warning_number = res.stateNum;
+						this.open_number = res.onNum; // 已开启
+						this.warning_number = res.stateNum; // 预警台数
+						// this.offline_device_number = res.​offlineNum; // 离线数量
+						// this.shutdown_device_number = res.​shutDownNum​​; // 关机数量
 					} else {
 					} else {
 						this.open_number = 0;
 						this.open_number = 0;
 						this.warning_number = 0;
 						this.warning_number = 0;
+						this.offline_device_number = 0;
+						this.shutdown_device_number = 0;
 						// this.$message.error(res.message);
 						// this.$message.error(res.message);
 					}
 					}
 				}).catch((err) => {
 				}).catch((err) => {