Ver código fonte

【阶段提交】完成部分功能

程志平 4 anos atrás
pai
commit
63dd4c1017

+ 3 - 4
config/index.js

@@ -6,15 +6,14 @@ const path = require('path')
 
 module.exports = {
 	dev: {
-
 		// Paths
 		assetsSubDirectory: 'static',
 		assetsPublicPath: '/',
 		// 后端请求地址代理,配置后testIp再之后的页面调用时就直接指代 http://197.82.15.15:8088
 		proxyTable: {
 			'/api': {
-				// target: 'https://jtishfw.ncjti.edu.cn/jxch-smartmp/', // 你请求的第三方接口
-				target: 'http://baibai.natapp1.cc/', // 你请求的第三方接口
+				target: 'https://jtishfw.ncjti.edu.cn/jxch-smartmp/', // 你请求的第三方接口
+				// target: 'http://baibai.natapp1.cc', // 你请求的第三方接口
 				changeOrigin: true, // 在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
 				pathRewrite: { // 路径重写,
 					'^/api': '/' // 替换target中的请求地址,也就是说以后你在请求http://api.douban.com/v2/XXXXX这个地址的时候直接写成/api即可。
@@ -23,7 +22,7 @@ module.exports = {
 		},
 
 		// Various Dev Server settings
-		host: '127.0.0.1', // can be overwritten by process.env.HOST
+		host: 'localhost', // can be overwritten by process.env.HOST
 		port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
 		autoOpenBrowser: false,
 		errorOverlay: true,

+ 1 - 1
package-lock.json

@@ -9390,7 +9390,7 @@
     },
     "moment": {
       "version": "2.29.1",
-      "resolved": "https://registry.nlark.com/moment/download/moment-2.29.1.tgz",
+      "resolved": "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz?cache=0&sync_timestamp=1601983320283&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmoment%2Fdownload%2Fmoment-2.29.1.tgz",
       "integrity": "sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M="
     },
     "move-concurrently": {

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
   "dependencies": {
     "ant-design-vue": "^1.7.7",
     "axios": "^0.21.1",
+    "echarts": "^5.1.2",
     "element-ui": "^2.15.5",
     "vue": "^2.5.2",
     "vue-router": "^3.0.1"

+ 1 - 1
src/App.vue

@@ -16,7 +16,7 @@
 	#app {
 		padding: 0;
 		margin: 0;
-		height: 100%;
+		height: calc(100vh);
 		width: 100%;
 		background-color: #eaeaea;
 	}

+ 30 - 2
src/components/balance/Balance.vue

@@ -7,7 +7,7 @@
 		</el-row>
 		<el-row>
 			<el-col :span="24" class="second-row">
-				<div class="total_balance">余额共计:15898元</div>
+				<div class="total_balance">余额共计:{{total_amount}}元</div>
 				<el-form :inline="true" :model="formInline" class="demo-form-inline">
 					<el-form-item label="姓名:" class="shuibiaoId">
 						<el-input v-model="formInline.user" placeholder="请输入姓名"></el-input>
@@ -43,7 +43,8 @@
 		<el-row>
 			<el-col :span="24" class="forth-row">
 				<!-- 编辑对话框 -->
-				<el-dialog title="充值记录" :visible.sync="editdialogFormVisible" width="640px" top="0vh" class="my-dialog">
+				<el-dialog title="充值记录" :visible.sync="editdialogFormVisible" :close-on-click-modal="false"
+					:close-on-press-escape="false" width="640px" top="0vh" class="my-dialog">
 					<hr
 						style="width: 100%; position: absolute; top: 60px; left: 0px;background-color: #CCCCCC;height: 1px;border: 0;">
 					<div class="right-tip">共计:14578元</div>
@@ -78,6 +79,7 @@
 	export default {
 		data() {
 			return {
+				total_amount: 0.0.toFixed(2),
 				editdialogFormVisible: false,
 				delDialogVisible: false,
 				form: {
@@ -133,7 +135,33 @@
 				multipleSelection: []
 			}
 		},
+		created() {
+			// 获取总金额
+			this.get_total_amount('/HotWaters/waterfindMoneyTotal.action')
+		},
 		methods: {
+			/**
+			 * 获取总金额
+			 * @param {Object} url
+			 */
+			get_total_amount(url) {
+				var _this = this
+				this.$axios.get('/api' + url)
+					.then(res => {
+						// console.log(res.data);
+						if (typeof(res.data.money) != 'undefined' && res.data.money != '' && JSON.stringify(res.data) !='{}') {
+							// _this.$message.success('数据加载成功!');
+							let amount = res.data.money
+							_this.total_amount = parseFloat(amount).toFixed(2)
+						} else {
+							_this.$message.success('总金额暂无数据!');
+						}
+					})
+					.catch(err => {
+						// console.log(err);
+						_this.$message.error('请求异常: ' + err);
+					})
+			},
 			onSubmit() {
 				console.log('submit!')
 			},

+ 63 - 31
src/components/dev_mgr/DevMgr.vue

@@ -4,10 +4,12 @@
 			<el-col :span="24" class="first-row">
 				<div class="tag">设备管理</div>
 				<span class="right-btn">
-					<el-upload class="upload-demo" action="" :http-request="uploadXLS" :show-file-list="false">
+					<el-upload class="upload-demo" action="" accept=".xls" :http-request="uploadXLS"
+						:show-file-list="false">
 						<el-button type="primary" size="small">表格导入</el-button>
 					</el-upload>
-					<el-link type="primary" href="http://baibai.natapp1.cc/HotWaters/download/模板.xls">模板下载</el-link>
+					<el-link type="primary" href="https://jtishfw.ncjti.edu.cn/jxch-smartmp/HotWaters/download/模板.xls">
+						模板下载</el-link>
 				</span>
 			</el-col>
 		</el-row>
@@ -57,7 +59,8 @@
 				</el-table>
 				<div style="margin-top: 20px" class="table-footer">
 					<div class="pages">
-						<el-pagination layout="prev, pager, next" :page-size="8" :total="rows_total"
+						<el-pagination layout="prev, pager, next" :current-page.sync="currentPage"
+							:hide-on-single-page="true" :page-size="pageRows" :total="rows_total"
 							@current-change="handleCurrentChange"></el-pagination>
 					</div>
 					<div class="export-table">
@@ -142,20 +145,39 @@
 			}
 			// 更新表格
 			this.updateTable('/HotWaters/waterlist.action', params)
-			// 
-			this.getBuilds('/HotWaters/watergetBuilds.action')
+			// 取得楼栋号,填充下拉列表
+			this.getBuildsFillSelect()
 		},
 		methods: {
+			/**
+			 * 取得楼栋号,填充下拉列表
+			 */
+			getBuildsFillSelect() {
+				// 获取楼栋号,填充下拉列表
+				this.getBuilds('/HotWaters/watergetBuilds.action')
+			},
+			/**
+			 * 导入设备xls文件
+			 * @param {Object} param
+			 */
 			uploadXLS(param) {
 				console.log(param);
-				const formData = new FormData()
-				formData.append('file', param.file)
-				const url = 'https://jtishfw.ncjti.edu.cn/jxch-smartmp/api/HotWaters/upload'
-				this.$axios.post(url, formData).then(data => {
-					this.$message.success('导入成功!')
-				}).catch(response => {
-					this.$message.error('导入成功!')
-				})
+				let form = new FormData();
+				form.append('file', param.file);
+				this.$axios({
+						method: "post",
+						url: "/api/HotWaters/upload",
+						headers: {
+							'Content-type': 'multipart/form-data'
+						},
+						data: form
+					})
+					.then(res => {
+						this.$message.success('导入成功!')
+					})
+					.catch(err => {
+						this.$message.error('导入失败1')
+					})
 			},
 			/**
 			 * 获取楼栋号,填充下拉列表
@@ -165,7 +187,8 @@
 				this.$axios.get('/api' + url)
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '') {
+						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON.stringify(res
+								.data) != '{}') {
 							this.form_select.builds = [{
 								value: 0,
 								label: '全部'
@@ -192,13 +215,14 @@
 			updateTable(url, params) {
 				var _this = this
 				_this.tableData = []
-				_this.rows_total = 0
+				// _this.rows_total = 0
 				this.$axios.get('/api' + url, {
 						params: params
 					})
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '') {
+						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !=
+							'{}') {
 							// _this.$message.success('数据加载成功!');
 							_this.tableData = res.data.rows
 							_this.rows_total = res.data.total
@@ -224,21 +248,21 @@
 				// console.log(obj);
 				this.form_select.value = obj.value
 				this.form_select.label = obj.label
+				var params = {}
 				if (this.form_select.value == 0) {
-					let params = {
+					params = {
 						page: this.currentPage,
 						rows: this.pageRows
 					}
-					this.updateTable('/HotWaters/waterlist.action', params)
 				} else {
-					let params = {
+					params = {
 						build: this.form_select.label,
 						page: 1,
-						rows: 8
+						rows: this.pageRows
 					}
-					// 查询该栋的信息
-					this.updateTable('/HotWaters/waterquerylist.action', params)
 				}
+				// 查询该栋的信息
+				this.updateTable('/HotWaters/waterquerylist.action', params)
 			},
 			/**
 			 * 改变页码
@@ -246,30 +270,32 @@
 			 */
 			handleCurrentChange(val) {
 				this.currentPage = val
+				var params = {}
 				if (this.form_select.value == 0) {
-					let params = {
+					params = {
 						page: this.currentPage,
 						rows: this.pageRows
 					}
-					this.updateTable('/HotWaters/waterlist.action', params)
 				} else {
-					let params = {
+					params = {
 						build: this.form_select.label,
 						page: this.currentPage,
-						rows: 8
+						rows: this.pageRows
 					}
-					// 查询该栋的信息
-					this.updateTable('/HotWaters/waterquerylist.action', params)
 				}
+				// 查询该栋的信息
+				this.updateTable('/HotWaters/waterquerylist.action', params)
 			},
 			/**
 			 * 导出表格
 			 */
 			handleDownloadTable() {
+				var _this = this
 				this.$axios.get('/api/HotWaters/watertoExcel.action')
 					.then(res => {
 						console.log(res.data.downurl);
-						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '') {
+						if (typeof(res.data.downurl) != 'undefined' && res.data.downurl != '' && JSON.stringify(res
+								.data) != '{}') {
 							window.open('https://jtishfw.ncjti.edu.cn/jxch-smartmp' + res.data.downurl)
 						} else {
 							_this.$message.error('未获取到表格!');
@@ -302,13 +328,16 @@
 					})
 					.then(res => {
 						// console.log(res.data);
-						if (typeof(res.data.msg) != 'undefined' && res.data.msg != '' && res.data.msg == '删除成功') {
+						if (typeof(res.data.msg) != 'undefined' && res.data.msg != '' && res.data.msg == '删除成功' && JSON
+							.stringify(res.data) != '{}') {
 							_this.$message.success('数据删除成功!');
 							let params = {
 								page: this.currentPage,
 								rows: this.pageRows
 							}
 							this.updateTable('/HotWaters/waterlist.action', params)
+							// 取得楼栋号,填充下拉列表
+							this.getBuildsFillSelect()
 						} else {
 							_this.$message.error('数据删除失败!');
 						}
@@ -347,13 +376,16 @@
 					})
 					.then(res => {
 						console.log(res.data);
-						if (typeof(res.data.msg) != 'undefined' && res.data.msg != '' && res.data.msg == '修改成功') {
+						if (typeof(res.data.msg) != 'undefined' && res.data.msg != '' && res.data.msg == '修改成功' && JSON
+							.stringify(res.data) != '{}') {
 							_this.$message.success('数据修改成功!');
 							let params = {
 								page: this.currentPage,
 								rows: this.pageRows
 							}
 							this.updateTable('/HotWaters/waterlist.action', params)
+							// 取得楼栋号,填充下拉列表
+							this.getBuildsFillSelect()
 						} else {
 							_this.$message.error('数据修改失败!');
 						}

+ 5 - 1
src/components/index/Index.css

@@ -98,12 +98,14 @@
 	background: url(../../../static/images/feilvshezhi.png) center center no-repeat;
 	background-size: cover;
 }
+
 .el-menu-item .el-icon-zhgl {
 	width: 27px;
 	height: 27px;
 	background: url(../../../static/images/yonghuguanli.png) center center no-repeat;
 	background-size: cover;
 }
+
 .diwen {
 	position: fixed;
 	left: 76px;
@@ -112,7 +114,7 @@
 	height: 145px;
 	background: url(../../../static/images/diwen.png) no-repeat;
 	background-size: 176px 145px;
-	z-index: 9999;
+	/* z-index: 9999; */
 }
 
 /* menu */
@@ -180,6 +182,7 @@
 	background-size: 29px 29px;
 	cursor: pointer;
 }
+
 /* top */
 
 /* main */
@@ -190,4 +193,5 @@
 	height: 790px;
 	background: #FFFFFF;
 }
+
 /* main */

+ 293 - 144
src/components/shangjiaduizhang/shangjiaduizhang.vue

@@ -7,29 +7,30 @@
 		</el-row>
 		<el-row>
 			<el-col :span="24" class="second-row">
-				<div class="total_balance">当日消费:14879元</div>
-				<el-link type="primary" class="xiaofei" @click="handleEdit()">年/月消费</el-link>
+				<div class="total_balance">当日消费:{{today_xiaofei}}元</div>
+				<el-link type="primary" class="xiaofei" @click="showxiaofeiDialog">年/月消费</el-link>
 				<el-form :inline="true" class="demo-form-inline">
 					<el-form-item label="楼栋号:" class="shuibiaoId">
-						<el-select v-model="drom_value" placeholder="请选择" class="my-select">
-							<el-option v-for="item in drom_options" :key="item.value" :label="item.label"
+						<el-select v-model="drom_options.value" @change="selectGetBuild(drom_options.value)"
+							placeholder="请选择楼栋号" class="my-select">
+							<el-option v-for="item in drom_options.builds" :key="item.value" :label="item.label"
 								:value="item.value">
 							</el-option>
 						</el-select>
 					</el-form-item>
 					<el-form-item label="宿舍号:" class="shuibiaoId">
-						<el-select v-model="room_value" placeholder="请选择" class="my-select">
-							<el-option v-for="item in room_options" :key="item.value" :label="item.label"
+						<el-select v-model="room_options.room_value" @change="selectGetroom(room_options.room_value)"
+							placeholder="请选择宿舍号" class="my-select">
+							<el-option v-for="item in room_options.rooms" :key="item.value" :label="item.label"
 								:value="item.value">
 							</el-option>
 						</el-select>
 					</el-form-item>
 					<el-form-item label="日期:" class="shuibiaoId">
-						<el-select v-model="date_value" placeholder="请选择" class="my-select">
-							<el-option v-for="item in date_options" :key="item.value" :label="item.label"
-								:value="item.value">
-							</el-option>
-						</el-select>
+						<div class="block">
+							<el-date-picker v-model="select_riqi.select_day" :editable="false" @change="selectGetDate"
+								value-format="yyyy-MM-dd" type="date" placeholder="当天日期"></el-date-picker>
+						</div>
 					</el-form-item>
 				</el-form>
 			</el-col>
@@ -43,8 +44,9 @@
 					<el-table-column label="学号" align="center">
 						<template slot-scope="scope">{{ scope.row.id }}</template>
 					</el-table-column>
-					<el-table-column prop="stuName" label="姓名" align="center" ></el-table-column>
-					<el-table-column prop="balance" label="消费金额(元)" align="center" show-overflow-tooltip></el-table-column>
+					<el-table-column prop="stuName" label="姓名" align="center"></el-table-column>
+					<el-table-column prop="balance" label="消费金额(元)" align="center" show-overflow-tooltip>
+					</el-table-column>
 					<el-table-column prop="drom" label="楼栋号" align="center" show-overflow-tooltip></el-table-column>
 					<el-table-column prop="room" label="宿舍号" align="center" show-overflow-tooltip></el-table-column>
 					<el-table-column prop="dt" label="消费时间" align="center" show-overflow-tooltip></el-table-column>
@@ -62,13 +64,14 @@
 		<el-row>
 			<el-col :span="24" class="forth-row">
 				<!-- 编辑对话框 -->
-				<el-dialog title="消费情况" :visible.sync="editdialogFormVisible" width="640px" top="0vh" class="my-dialog">
+				<el-dialog title="消费情况" :visible.sync="xiaofeiDialog" :close-on-click-modal="false"
+					:close-on-press-escape="false" width="640px" top="0vh" class="my-dialog">
 					<hr
 						style="width: 100%; position: absolute; top: 60px; left: 0px;background-color: #CCCCCC;height: 1px;border: 0;">
-						<div class="view-balance">当日消费:{{ day_balance }}元</div>
-						<div class="view-balance">当月消费:{{ month_balance }}元</div>
-						<div class="view-balance">当年消费:{{ year_balance }}元</div>
-						<div class="view-balance"></div>
+					<div class="view-balance">当日消费:{{ xiaofei.day_balance }}元</div>
+					<div class="view-balance">当月消费:{{ xiaofei.month_balance }}元</div>
+					<div class="view-balance">当年消费:{{ xiaofei.year_balance }}元</div>
+					<div class="view-balance"></div>
 				</el-dialog>
 			</el-col>
 		</el-row>
@@ -79,129 +82,277 @@
 	export default {
 		data() {
 			return {
-				day_balance: 88888,
-				month_balance: 888888,
-				year_balance: 8888888,
-				drom_options: [{
-					value: '0',
-					label: '全部'
-				},{
-					value: '1',
-					label: '1栋'
-				}, {
-					value: '2',
-					label: '2栋'
-				}, {
-					value: '3',
-					label: '3栋'
-				}, {
-					value: '4',
-					label: '4栋'
-				}],
-				room_options: [{
-					value: '0',
-					label: '全部'
-				}, {
-					value: '1102',
-					label: '1102'
-				}, {
-					value: '1103',
-					label: '1103'
-				}, {
-					value: '1104',
-					label: '1104'
-				}],
-				date_options: [{
-					value: '0',
-					label: '当天日期'
-				}, {
-					value: '2021-08-10',
-					label: '2021-08-10'
-				}, {
-					value: '2021-09-20',
-					label: '2021-09-20'
-				}, {
-					value: '2021-10-19',
-					label: '2021-10-19'
-				}],
-				drom_value: '0',
-				room_value: '0',
-				date_value: '0',
-				editdialogFormVisible: false,
-				delDialogVisible: false,
-				formLabelWidth: '120px',
-				formInline: {
-					user: '',
-					options: [{
-						value: '选项1',
+				// 今日消费
+				today_xiaofei: 0.0.toFixed(2),
+				// 年月日的消费
+				xiaofei: {
+					day_balance: 0.0.toFixed(2),
+					month_balance: 0.0.toFixed(2),
+					year_balance: 0.0.toFixed(2),
+				},
+				// 楼栋号下拉列表
+				drom_options: { // 下拉列表的数据绑定
+					builds: [{
+						value: 0,
 						label: '全部'
-					}, {
-						value: '选项2',
-						label: '黄金糕'
 					}],
-					value: '选项1'
+					value: 0,
+					label: ''
+				},
+				// 宿舍号下拉列表
+				room_options: {
+					rooms: [{
+						value: 0,
+						label: '全部'
+					}],
+					room_value: 0,
+					room_label: ''
+				},
+				select_riqi: {
+					// 选择日期:年-月-日
+					select_day: '',
+					// 选择日期:年-月
+					select_month: '',
+					// 选择日期:年
+					select_year: ''
 				},
-				tableData: [{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				},{
-					id: '20140309010103',
-					stuName: '吴亦凡',
-					balance: '188',
-					drom: '1栋',
-					room: '1101',
-					dt: '2021-01-01'
-				}],
-				multipleSelection: []
+				// 控制消费对话框显示隐藏
+				xiaofeiDialog: false,
+				// 表格数据
+				tableData: [],
+				// 表格参数
+				table: {
+					currentPage: 1, // 当前所在页码
+					pageRows: 8, // 每页显示的行数
+				},
+				// 多选后,选择的所有行的数据数组
+				// multipleSelection: []
+			}
+		},
+		created() {
+			// 获取当天日期
+			var myDate = this.getNowFormatDate();
+			let params = {
+				page: this.table.currentPage,
+				rows: this.table.pageRows,
+				begin_time: myDate
+				// begin_time: '2021-08-10'
 			}
+			// 获取当日消费列表
+			this.getTodayXiaofei(params)
+			// 获取年月日消费总金额
+			this.get_year_month_amount('/HotWaters/watertotalFeel.action')
+			// 取得楼栋号,填充下拉列表
+			this.getBuildsFillSelect()
 		},
 		methods: {
+			// 日期下拉列表选择日期
+			selectGetDate(val) {
+				console.log(val);
+				this.select_riqi.select_day = ''
+				this.select_riqi.select_month = ''
+				this.select_riqi.select_year = ''
+				if (val) {
+					this.select_riqi.select_year = val.split('-')[0]
+					this.select_riqi.select_month = val.split('-')[1]
+				} else {
+					this.filters.year = ""
+					this.filters.month = ""
+				}
+			},
+			//获取当前时间,格式YYYY-MM-DD
+			getNowFormatDate() {
+				var date = new Date();
+				var seperator1 = "-";
+				var year = date.getFullYear();
+				var month = date.getMonth() + 1;
+				var strDate = date.getDate();
+				if (month >= 1 && month <= 9) {
+					month = "0" + month;
+				}
+				if (strDate >= 0 && strDate <= 9) {
+					strDate = "0" + strDate;
+				}
+				var currentdate = year + seperator1 + month + seperator1 + strDate;
+				return currentdate;
+			},
+			/**
+			 * 获取宿舍号,填充宿舍号下拉列表
+			 */
+			getRooms() {
+				var _this = this
+				let params = {
+					params: {
+						build: this.drom_options.label
+					}
+				}
+				this.$axios.get('/api/HotWaters/watergetdoms.action', params)
+					.then(res => {
+						console.log(res.data);
+						if (typeof(res.data.doms) != 'undefined' && res.data.doms != '' && JSON.stringify(res.data) !='{}') {
+							this.room_options.rooms = [{
+								value: 0,
+								label: '全部'
+							}]
+							for (var i = 0; i < res.data.doms.length; i++) {
+								let tmp = {
+									value: i + 1,
+									label: res.data.doms[i]
+								}
+								this.room_options.rooms.push(tmp)
+							}
+						} else {
+							_this.$message.success('宿舍号暂无数据!');
+						}
+					})
+					.catch(err => {
+						// console.log(err);
+						_this.$message.error('请求异常: ' + err);
+					})
+			},
+			/**
+			 * 获取楼栋号下拉列表选择的id,并刷新表格
+			 * @param {Object} vId
+			 */
+			selectGetBuild(vId) {
+				// console.log(vId);
+				let obj = {};
+				obj = this.drom_options.builds.find((item) => {
+					return item.value === vId; //筛选出匹配数据
+				});
+				console.log(obj);
+				this.drom_options.value = obj.value
+				this.drom_options.label = obj.label
+
+				// 获取宿舍号,填充宿舍号下拉列表
+				this.getRooms()
+				// 组合参数
+				this.selectParams()
+			},
+			/**
+			 * 获取宿舍号下拉列表选择的id,并刷新表格
+			 * @param {Object} vId
+			 */
+			selectGetroom(vId) {
+				// console.log(vId);
+				let obj = {};
+				obj = this.room_options.rooms.find((item) => {
+					return item.value === vId; //筛选出匹配数据
+				});
+				console.log(obj);
+				this.room_options.room_value = obj.value
+				this.room_options.room_label = obj.label
+
+				// 组合参数
+				this.selectParams()
+			},
+			/**
+			 * 组合参数
+			 */
+			selectParams() {
+				var params = {}
+				params.page = 1
+				params.rows = this.table.pageRows
+				if (this.drom_options.value != 0) {
+					params.build = this.drom_options.label
+				}
+				if (this.room_options.room_value != 0) {
+					params.dom = this.room_options.room_label
+				}
+				if (this.select_riqi.select_day != '') {
+					params.begin_time = this.select_riqi.select_day
+				}
+				// 查询该栋的信息
+				this.getTodayXiaofei(params)
+			},
+			/**
+			 * 获取当日消费列表
+			 * @param {Object} params
+			 */
+			getTodayXiaofei(params) {
+				var _this = this
+				this.$axios.get('/api/HotWaters/waterfindConsume.action', {
+						params: params
+					})
+					.then(res => {
+						// console.log(res.data);
+						if (typeof(res.data.rows) != 'undefined' && res.data.rows != '' && JSON.stringify(res.data) !='{}') {
+							this.tableData = []
+							for (var i = 0; i < res.data.rows.length; i++) {
+								let tmp = {
+									id: res.data.rows[i].stu_number,
+									stuName: res.data.rows[i].user_name,
+									balance: res.data.rows[i].use_amount,
+									drom: '1栋',
+									room: '1101',
+									dt: res.data.rows[i].begin_time,
+								}
+								this.tableData.push(tmp)
+							}
+						} else {
+							_this.$message.success('当日消费暂无数据!');
+						}
+					})
+					.catch(err => {
+						// console.log(err);
+						_this.$message.error('请求异常: ' + err);
+					})
+			},
+			/**
+			 * 取得楼栋号,填充下拉列表
+			 */
+			getBuildsFillSelect() {
+				// 获取楼栋号,填充下拉列表
+				var _this = this
+				this.$axios.get('/api/HotWaters/watergetBuilds.action')
+					.then(res => {
+						// console.log(res.data);
+						if (typeof(res.data.builds) != 'undefined' && res.data.builds != '' && JSON.stringify(res.data) !='{}') {
+							this.drom_options.builds = [{
+								value: 0,
+								label: '全部'
+							}]
+							for (var i = 0; i < res.data.builds.length; i++) {
+								let tmp = {
+									value: i + 1,
+									label: res.data.builds[i]
+								}
+								this.drom_options.builds.push(tmp)
+							}
+						} else {
+							_this.$message.success('楼栋号暂无数据!');
+						}
+					})
+					.catch(err => {
+						// console.log(err);
+						_this.$message.error('请求异常: ' + err);
+					})
+			},
+			/**
+			 * 获取年月日消费总金额
+			 * @param {Object} url
+			 */
+			get_year_month_amount(url) {
+				var _this = this
+				this.$axios.get('/api' + url)
+					.then(res => {
+						// console.log(res.data);
+						if (typeof(res.data) != 'undefined' && res.data != '' && JSON.stringify(res.data) !='{}') {
+							// _this.$message.success('数据加载成功!');
+							this.xiaofei.day_balance = parseFloat(res.data.money_day).toFixed(2)
+							this.xiaofei.month_balance = parseFloat(res.data.money_month).toFixed(2)
+							this.xiaofei.year_balance = parseFloat(res.data.money_year).toFixed(2)
+
+							this.today_xiaofei = parseFloat(res.data.money_day).toFixed(2)
+						} else {
+							_this.$message.success('年月消费暂无数据!');
+						}
+					})
+					.catch(err => {
+						// console.log(err);
+						_this.$message.error('请求异常: ' + err);
+					})
+			},
 			onSubmit() {
 				console.log('submit!');
 			},
@@ -220,16 +371,14 @@
 					this.$refs.multipleTable.clearSelection();
 				}
 			},
-			handleSelectionChange(val) {
-				this.multipleSelection = val;
-			},
-			handleEdit(index, row) {
-				this.editdialogFormVisible = true
-				console.log(index, row);
+			// 显示消费对话框
+			showxiaofeiDialog() {
+				this.xiaofeiDialog = true
 			},
-			handleDelete(index, row) {
-				this.delDialogVisible = true
-				console.log(index, row);
+			// 点击多选按钮获取的行数据数组
+			handleSelectionChange(val) {
+				// this.multipleSelection = val
+				// console.log(val);
 			}
 		}
 	}

+ 3 - 3
src/main.js

@@ -7,18 +7,18 @@ import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
 import echarts from 'echarts'
 import axios from "axios"
-import qs from "qs"
+// import qs from "qs"
 
 // axios.defaults.timeout = 3000 //响应时间
 // axios.defaults.headers.post['Content-Type'] = 'multipart/form-data'; //配置请求头
 // axios.defaults.baseURL = process.env.NODE_HOST; // 配置接口地址
-// axios.defaults.baseURL='http://baibai.natapp1.cc'
+// axios.defaults.baseURL='https://jtishfw.ncjti.edu.cn/jxch-smartmp'
 console.log(process.env.NODE_ENV)
 // alert('环境:' + process.env.NODE_ENV)
 
 Vue.use(ElementUI);
 
-Vue.prototype.$qs = qs;
+// Vue.prototype.$qs = qs;
 Vue.prototype.$axios = axios;
 Vue.prototype.$echarts = echarts