修改抄表记录峰谷不显示的问题
This commit is contained in:
parent
a36faa9bcb
commit
7bd4da3c84
@ -2,6 +2,7 @@
|
||||
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../../../service/accounting";
|
||||
import { getTenementMeterList } from "../../../../../service/meter";
|
||||
import dayjs from "../../../../../utils/dayjs";
|
||||
import { getParkInfoByTime } from "../../../../../service/park";
|
||||
import request from '../../../../../utils/request';
|
||||
import { alertInfo, getPixelRatio, loadingFunc } from "../../../../../utils/index";
|
||||
const { OK } = request;
|
||||
@ -19,6 +20,9 @@ Component({
|
||||
loadingFunc(async () => {
|
||||
await this.getReadingList();
|
||||
})
|
||||
},
|
||||
"parkInfo": function(newValue) {
|
||||
this.setData({ park: newValue })
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -27,6 +31,7 @@ Component({
|
||||
data: {
|
||||
readingDetailShow: false,
|
||||
readingDetail: {},
|
||||
park: {},
|
||||
meterReadingHeader: [
|
||||
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||
{ title: '倍率', key: 'ratio' },
|
||||
@ -76,10 +81,32 @@ Component({
|
||||
readingPage: 1,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
console.log("----------")
|
||||
await this.getParkInfo(time)
|
||||
console.log("===========")
|
||||
await this.getReadingList();
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
async getParkInfo(time) {
|
||||
const park = wx.getStorageSync('park');
|
||||
const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${0}`,)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
const that = this;
|
||||
return new Promise((resolve) => {
|
||||
|
||||
that.setData({
|
||||
parkInfo: parkInfo
|
||||
}, () => {
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
showDetail(e) {
|
||||
const { index, data = {} } = e.detail;
|
||||
|
@ -66,7 +66,7 @@
|
||||
border="{{ false }}"
|
||||
label="表字"
|
||||
readonly
|
||||
wx:if="{{parkInfo.category !== 1}}"
|
||||
wx:if="{{park.meter04kvType !== 1}}"
|
||||
/>
|
||||
|
||||
<van-field
|
||||
@ -74,29 +74,30 @@
|
||||
border="{{ false }}"
|
||||
label="表字(尖)"
|
||||
readonly
|
||||
wx:if="{{parkInfo.category === 1}}"
|
||||
wx:if="{{park.meter04kvType === 1}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.peak }}"
|
||||
border="{{ false }}"
|
||||
label="表字(峰)"
|
||||
readonly
|
||||
wx:if="{{parkInfo.category === 1}}"
|
||||
wx:if="{{park.meter04kvType === 1}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.flat }}"
|
||||
border="{{ false }}"
|
||||
label="表字(平)"
|
||||
readonly
|
||||
wx:if="{{parkInfo.category === 1}}"
|
||||
wx:if="{{park.meter04kvType === 1}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.valley }}"
|
||||
border="{{ false }}"
|
||||
label="表字(谷)"
|
||||
readonly
|
||||
wx:if="{{parkInfo.category === 1}}"
|
||||
wx:if="{{park.meter04kvType === 1}}"
|
||||
/>
|
||||
</van-cell-group>
|
||||
|
||||
</view>
|
||||
</van-dialog>
|
@ -356,6 +356,7 @@ Page({
|
||||
case "year":
|
||||
this.setData({ year: time, visible: false, }, () => {
|
||||
loadingFunc(async () => {
|
||||
await this.getParkInfo()
|
||||
await this.init();
|
||||
})
|
||||
});
|
||||
@ -364,6 +365,7 @@ Page({
|
||||
const [year, month] = time.split("-")
|
||||
this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => {
|
||||
loadingFunc(async () => {
|
||||
await this.getParkInfo()
|
||||
await this.init();
|
||||
})
|
||||
});
|
||||
@ -376,13 +378,16 @@ Page({
|
||||
page: 1,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await this.getParkInfo()
|
||||
await this.init();
|
||||
})
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
readingChangeTime(e) {
|
||||
console.log('e', e.detail)
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@ -410,7 +415,7 @@ Page({
|
||||
case 2:
|
||||
time = year;
|
||||
}
|
||||
const { data, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${timeType}`,)
|
||||
const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${timeType}`,)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
@ -419,7 +424,7 @@ Page({
|
||||
return new Promise((resolve) => {
|
||||
|
||||
that.setData({
|
||||
parkInfo: data
|
||||
parkInfo: parkInfo
|
||||
}, () => {
|
||||
resolve()
|
||||
})
|
||||
|
@ -99,7 +99,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{queryType === 1}}">
|
||||
<reading meter="{{meterId}}" parkInfo="{{parkInfo}}" />
|
||||
<reading meter="{{meterId}}" parkInfo="{{parkInfo}}" bind:changeTime="readingChangeTime" />
|
||||
</view>
|
||||
<view wx:if="{{queryType === 2}}">
|
||||
<view style="margin: 30rpx;">
|
||||
|
@ -45,8 +45,8 @@ export function getConfigByEnv() {
|
||||
switch (envVersion) {
|
||||
// 开发版
|
||||
case 'develop':
|
||||
api = "http://localhost:8000"
|
||||
// api = "https://zgd.hbhcbn.com/api3"
|
||||
// api = "http://localhost:8000"
|
||||
api = "https://zgd.hbhcbn.com/api3"
|
||||
// api = "https://zgd.hbhcbn.com/wxApi"
|
||||
// api = "http://127.0.0.1:4523/m1/4143821-0-default"
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user