|
@@ -12,7 +12,8 @@
|
|
|
tooltipFormat="tooltipDemo1" />
|
|
tooltipFormat="tooltipDemo1" />
|
|
|
</view>
|
|
</view>
|
|
|
<view class="select-show">
|
|
<view class="select-show">
|
|
|
- <button class="first-button">月</button>
|
|
|
|
|
|
|
+ <button class="first-button" @tap="getEnergyConsumption('day')">日</button>
|
|
|
|
|
+ <button class="first-button" @tap="getEnergyConsumption('month')">月</button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="show-item-date">
|
|
<view class="show-item-date">
|
|
@@ -105,7 +106,7 @@
|
|
|
// console.log(this.stu_number);
|
|
// console.log(this.stu_number);
|
|
|
// console.log(this.roomSelect);
|
|
// console.log(this.roomSelect);
|
|
|
// 能耗记录
|
|
// 能耗记录
|
|
|
- this.get_nenghaojilu()
|
|
|
|
|
|
|
+ this.getEnergyConsumption('month')
|
|
|
// 缴费记录
|
|
// 缴费记录
|
|
|
this.get_jiaofeijilu()
|
|
this.get_jiaofeijilu()
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -114,6 +115,13 @@
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 按日、月获取能耗
|
|
|
|
|
+ */
|
|
|
|
|
+ getEnergyConsumption(dayOrMonth) {
|
|
|
|
|
+ // 按日、月显示能耗
|
|
|
|
|
+ this.get_nenghaojilu(dayOrMonth)
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
* 获取选择日期
|
|
* 获取选择日期
|
|
|
*/
|
|
*/
|
|
|
bindDateChange: function(e) {
|
|
bindDateChange: function(e) {
|
|
@@ -168,19 +176,35 @@
|
|
|
/**
|
|
/**
|
|
|
* 能耗记录
|
|
* 能耗记录
|
|
|
*/
|
|
*/
|
|
|
- async get_nenghaojilu() {
|
|
|
|
|
|
|
+ async get_nenghaojilu(dayOrMonth) {
|
|
|
|
|
+ // console.log(this.roomSelect);
|
|
|
if (this.roomSelect != '' && typeof(this.roomSelect) != 'undefined') {
|
|
if (this.roomSelect != '' && typeof(this.roomSelect) != 'undefined') {
|
|
|
- const res = await this.$myRequest({
|
|
|
|
|
- host: this.ceshi,
|
|
|
|
|
- url: '/HotWaters/buildgetMonthBill.action',
|
|
|
|
|
- method: 'POST',
|
|
|
|
|
- header: {
|
|
|
|
|
- 'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
|
- },
|
|
|
|
|
- data: {
|
|
|
|
|
- 'roomSelect': this.roomSelect
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ let res = null;
|
|
|
|
|
+ if (dayOrMonth == 'day') {
|
|
|
|
|
+ res = await this.$myRequest({
|
|
|
|
|
+ host: this.ceshi,
|
|
|
|
|
+ url: '/HotWaters/buildgetDayBill.action',
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ header: {
|
|
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
|
+ },
|
|
|
|
|
+ data: {
|
|
|
|
|
+ 'roomSelect': this.roomSelect
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res = await this.$myRequest({
|
|
|
|
|
+ host: this.ceshi,
|
|
|
|
|
+ url: '/HotWaters/buildgetMonthBill.action',
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ header: {
|
|
|
|
|
+ 'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
|
+ },
|
|
|
|
|
+ data: {
|
|
|
|
|
+ 'roomSelect': this.roomSelect
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// console.log(res);
|
|
// console.log(res);
|
|
|
if (res.data.mess == '未查询到数据') {
|
|
if (res.data.mess == '未查询到数据') {
|