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