Compare commits
32 Commits
721937fa5b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 17c992fb0b | |||
| 493be62f44 | |||
| af749eb638 | |||
| 3340f1f3af | |||
| cdbc3fa959 | |||
| b1cca8f8a5 | |||
| 70737fa2b8 | |||
| 71ad4995c8 | |||
| 3e640c3633 | |||
| a8312b89d5 | |||
| f0dee5bc77 | |||
| 7bc344e90b | |||
| 5f56f9a6a8 | |||
| 886a03cf16 | |||
| fccaee5f2b | |||
| 33d7528990 | |||
| f9aedf7d79 | |||
| ac0a4b02c7 | |||
| 7bd4da3c84 | |||
| a36faa9bcb | |||
| 7772b3de1a | |||
| 10a0fd7c19 | |||
| d27fa31ac7 | |||
| a3c4e78c22 | |||
| 5c202e99a6 | |||
| e637bbf8a8 | |||
| 4d665588ac | |||
| 028d695deb | |||
| 3e9857bdcd | |||
| 34995ef9a3 | |||
| fb9e727efd | |||
| 399ef43d07 |
6
app.json
6
app.json
@@ -28,11 +28,15 @@
|
||||
"pages/aid/law/index",
|
||||
"pages/aid/detail/index",
|
||||
"pages/aid/consult/index",
|
||||
"pages/writeReading/index",
|
||||
"pages/readingHistory/index",
|
||||
"pages/integral/index",
|
||||
"pages/discountCoupon/index",
|
||||
"pages/integralRecord/index",
|
||||
"pages/meterList/index",
|
||||
"pages/workBench/components/tenement/components/createTenement/index"
|
||||
"pages/workBench/components/tenement/components/createTenement/index",
|
||||
"pages/billMeterDetail/index",
|
||||
"pages/meterBalanceRecord/index"
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import { getReportDetail } from "../../../service/report";
|
||||
import { alertInfo, alertSuccess, getPixelRatio } from "../../../utils/index";
|
||||
import { alertInfo, alertSuccess, getPixelRatio, loadingFunc } from "../../../utils/index";
|
||||
import request from '../../../utils/request'
|
||||
import * as echarts from '../../components/echarts/echarts';
|
||||
import { getRoundNumber } from "../../../utils/index"
|
||||
const { OK } = request
|
||||
|
||||
|
||||
|
||||
// pages/billDetail/index.js
|
||||
Page({
|
||||
|
||||
@@ -15,31 +18,34 @@ Page({
|
||||
time: "",
|
||||
detail: {},
|
||||
meters: [],
|
||||
header1: [
|
||||
{ key: 'address', title: '电表地址' },
|
||||
{ title: '起码',renderBody: (item) => { return item?.startNumber } },
|
||||
{ title: '止码',renderBody: (item) => { return item?.endNumber } },
|
||||
{ title: '倍率',renderBody: (item) => { return item?.displayRatio } },
|
||||
],
|
||||
header2: [
|
||||
{ title: '用电量', renderBody: (item) => item?.overall?.amount },
|
||||
{ title: '线损电量',renderBody: (item) => item?.loss?.amount },
|
||||
{ title: '公摊电量',renderBody: (item) => item?.publicAmount },
|
||||
{ title: '合计电量',renderBody: (item) => {
|
||||
// header1: [
|
||||
// { key: 'address', title: '电表地址' },
|
||||
// { title: '起码',renderBody: (item) => { return item?.startNumber } },
|
||||
// { title: '止码',renderBody: (item) => { return item?.endNumber } },
|
||||
// { title: '倍率',renderBody: (item) => { return item?.displayRatio } },
|
||||
// ],
|
||||
// header2: [
|
||||
// { title: '用电量', renderBody: (item) => item?.overall?.amount },
|
||||
// { title: '线损电量',renderBody: (item) => item?.loss?.amount },
|
||||
// { title: '公摊电量',renderBody: (item) => item?.publicAmount },
|
||||
// { title: '合计电量',renderBody: (item) => {
|
||||
|
||||
} },
|
||||
]
|
||||
// } },
|
||||
// ]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { id, time } = options;
|
||||
this.init(id, time);
|
||||
const { id, time, tenement } = options;
|
||||
const that = this;
|
||||
loadingFunc(async () => {
|
||||
await that.init(id, time, tenement);
|
||||
})
|
||||
},
|
||||
async init(id, time) {
|
||||
const { code, message, detail, amount } = await getReportDetail(id)
|
||||
async init(id, time, tenement) {
|
||||
const { code, message, detail, amount } = await getReportDetail(id, tenement)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
@@ -50,45 +56,92 @@ Page({
|
||||
detail,
|
||||
amount: amount,
|
||||
meters: detail?.meters?.map(item => {
|
||||
const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0)
|
||||
item.finalAmount = Number(finalAmount).toFixed(2)
|
||||
if (item?.loss?.amount) {
|
||||
item.loss.amount = getRoundNumber(Number(item.loss.amount))
|
||||
}
|
||||
// const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0)
|
||||
item.finalAmount = getRoundNumber(Number(item.finalAmount))
|
||||
return item;
|
||||
})
|
||||
})
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
top: 10,
|
||||
left: 'center'
|
||||
},
|
||||
label: {
|
||||
alignTo: 'edge',
|
||||
formatter: '{name|{b}}\n{value|{c} }',
|
||||
minMargin: 5,
|
||||
edgeDistance: 10,
|
||||
lineHeight: 15,
|
||||
rich: {
|
||||
time: {
|
||||
fontSize: 10,
|
||||
color: '#999'
|
||||
if (detail?.park?.meter04kvType === 0) {
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
top: 10,
|
||||
left: 'center'
|
||||
},
|
||||
label: {
|
||||
alignTo: 'edge',
|
||||
formatter: '{name|{b}}\n{value|{c} }',
|
||||
minMargin: 5,
|
||||
edgeDistance: 10,
|
||||
lineHeight: 15,
|
||||
rich: {
|
||||
time: {
|
||||
fontSize: 10,
|
||||
color: '#999'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [
|
||||
{ value: detail.comprehensive.lossAmount, name: '本期线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
|
||||
{ value: detail.comprehensive.consumption, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } },
|
||||
|
||||
],
|
||||
}
|
||||
]
|
||||
};
|
||||
this.init_pieCharts(option);
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: [
|
||||
{ value: detail.comprehensive.lossAmount, name: '线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
|
||||
{ value: detail.comprehensive.consumption, name: '电度电量', itemStyle: { color: 'rgb(80,135,236)' } },
|
||||
|
||||
],
|
||||
}
|
||||
]
|
||||
};
|
||||
this.init_pieCharts(option);
|
||||
} else {
|
||||
// const option = {
|
||||
// tooltip: {
|
||||
// trigger: 'item'
|
||||
// },
|
||||
// legend: {
|
||||
// top: 10,
|
||||
// left: 'center'
|
||||
// },
|
||||
// label: {
|
||||
// alignTo: 'edge',
|
||||
// formatter: '{name|{b}}\n{value|{c} }',
|
||||
// minMargin: 5,
|
||||
// edgeDistance: 10,
|
||||
// lineHeight: 15,
|
||||
// rich: {
|
||||
// time: {
|
||||
// fontSize: 10,
|
||||
// color: '#999'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// series: [
|
||||
// {
|
||||
// type: 'pie',
|
||||
// radius: '50%',
|
||||
// data: [
|
||||
// {
|
||||
// value: detail.comprehensive.lossAmount,
|
||||
// name: '线损电量',
|
||||
// },
|
||||
// {
|
||||
// value: detail.comprehensive.consumption,
|
||||
// name: '电度电量',
|
||||
// },
|
||||
|
||||
// ],
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
// this.init_pieCharts(option);
|
||||
}
|
||||
|
||||
const that = this;
|
||||
wx.getSystemInfo({
|
||||
success: function (res) {
|
||||
@@ -115,6 +168,12 @@ Page({
|
||||
return pieChart;
|
||||
});
|
||||
},
|
||||
jumpToDetail(e) {
|
||||
const { meter } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter),
|
||||
})
|
||||
},
|
||||
download() {
|
||||
const { id: tenement } = wx.getStorageSync('tenement')
|
||||
const { id } = this.data;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--pages/billDetail/index.wxml-->
|
||||
<navigator title="{{ time }}电费账单" canBack="{{true}}" />
|
||||
<view class="title" style="top: {{statusBarHeight + 46}}px">
|
||||
<avatar text="{{detail.tenement.shortName}}" />
|
||||
<avatar text="{{detail.tenement.shortName}}" />
|
||||
<view class="titleContent">
|
||||
<view class="park">
|
||||
<view class="label">
|
||||
@@ -11,7 +11,7 @@
|
||||
</view>
|
||||
<view class="address">
|
||||
<view class="label">
|
||||
用电地址:
|
||||
商户地址:
|
||||
</view>
|
||||
<view class="value"> {{ detail.tenement.address }} </view>
|
||||
</view>
|
||||
@@ -19,20 +19,20 @@
|
||||
<view class="label">
|
||||
账单周期:
|
||||
</view>
|
||||
<view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view>
|
||||
<view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view>
|
||||
</view>
|
||||
</view>
|
||||
<van-button type="info" size="small" class="download" bind:click="download">下载</van-button>
|
||||
</view>
|
||||
|
||||
<view class="wrapper">
|
||||
<view class="wrapper" wx:if="{{detail.park.meter04kvType !== 1}}">
|
||||
<view class="line"></view>
|
||||
<view class="contentTitle"> 本期账单 </view>
|
||||
<van-row gutter="10">
|
||||
<van-col span="8">
|
||||
<view class="colContent">
|
||||
<view class="colContentTitle">本期用电量</view>
|
||||
<view class="colContentValue"> {{ amount }} 千瓦时 </view>
|
||||
<view class="colContentValue" wx:if="{{detail.park.meter04kvType === 0}}"> {{ amount }} 千瓦时 </view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
@@ -50,17 +50,10 @@
|
||||
</van-row>
|
||||
<view class="line"></view>
|
||||
<view class="contentTitle"> 电费构成 </view>
|
||||
<echarts
|
||||
style="width:200rpx;height:180rpx;"
|
||||
id="echarts"
|
||||
class='mychart-bar'
|
||||
canvas-id="mychart-bar"
|
||||
ec="{{ ec }}"
|
||||
forceUseOldCanvas="{{false}}"
|
||||
>
|
||||
<echarts style="width:200rpx;height:180rpx;" id="echarts" class='mychart-bar' canvas-id="mychart-bar" ec="{{ ec }}" forceUseOldCanvas="{{false}}">
|
||||
</echarts>
|
||||
<view class="tooltip">
|
||||
(本月电量+本月线损电量)*电单价+摊薄公摊电费+摊薄调整电费
|
||||
(电度电量+线损电量)*电单价+摊薄公摊电费+摊薄调整电费
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="contentTitle"> 电量明细 </view>
|
||||
@@ -86,7 +79,7 @@
|
||||
</van-row>
|
||||
<van-row>
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 用电量 </view>
|
||||
<view class="tableTitle"> 电度电量 </view>
|
||||
<view class="tableContent"> {{item.overall.amount}} </view>
|
||||
|
||||
</van-col>
|
||||
@@ -106,4 +99,97 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper" wx:if="{{detail.park.meter04kvType === 1}}">
|
||||
<view class="line"></view>
|
||||
<view class="contentTitle"> 本期账单 </view>
|
||||
<van-row gutter="10">
|
||||
<van-col span="12">
|
||||
<view class="colContent">
|
||||
<view class="colContentTitle">本期用电量</view>
|
||||
<view class="colContentValue"> {{ detail.comprehensive.finalAmount }} 千瓦时 </view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="colContent">
|
||||
<view class="colContentTitle">本期电费</view>
|
||||
<view class="colContentValue"> {{ detail.comprehensive.total }} 元 </view>
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<view class="line"></view>
|
||||
<view class="contentTitle"> 分时明细 </view>
|
||||
<van-row gutter="10">
|
||||
<van-col span="12">
|
||||
<view class="colContent">
|
||||
<view class="colContentTitle">
|
||||
分时电量
|
||||
<view> (千瓦时) </view>
|
||||
</view>
|
||||
<view class="colContentValue2">尖: {{ detail.comprehensive.sharpAmount }} </view>
|
||||
<view class="colContentValue2">峰: {{ detail.comprehensive.peakAmount }} </view>
|
||||
<view class="colContentValue2">平: {{ detail.comprehensive.flatAmount }} </view>
|
||||
<view class="colContentValue2">谷: {{ detail.comprehensive.valleyAmount }} </view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="colContent">
|
||||
<view class="colContentTitle">
|
||||
分时单价
|
||||
<view> (元/千瓦时) </view>
|
||||
</view>
|
||||
<view class="colContentValue2">尖: {{ detail.comprehensive.priceSharp }} </view>
|
||||
<view class="colContentValue2">峰: {{ detail.comprehensive.pricePeak }} </view>
|
||||
<view class="colContentValue2">平: {{ detail.comprehensive.priceFlat }} </view>
|
||||
<view class="colContentValue2">谷: {{ detail.comprehensive.priceValley }} </view>
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<view class="line"></view>
|
||||
<view class="tooltip">
|
||||
(电度电量+线损电量)*单价+摊薄公摊电费+摊薄调整电费
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="contentTitle"> 分时电量明细 </view>
|
||||
<view class="tableWrapper">
|
||||
<view class="meterListItem" wx:for="{{meters}}" wx:key="id">
|
||||
<div class="top">
|
||||
<view class="address">{{item.address}}</view>
|
||||
<view class="detail primaryTextBtn" bind:tap="jumpToDetail" data-meter="{{item}}"> 详情 </view>
|
||||
</div>
|
||||
<view style="margin: 20rpx 0; background-color: #fff;">
|
||||
<van-row custom-style="height: 100%;display: flex;flex-direction: column;overflow: hidden;">
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 电度电量 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 线损电量 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 合计电量 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 合计电费 </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<van-row class="meterListItemContent">
|
||||
<van-col span="6">
|
||||
<view class="tableContent"> {{item.overall.amount}} </view>
|
||||
</van-col>
|
||||
|
||||
<van-col span="6">
|
||||
<view class="tableContent"> {{item.loss.amount}} </view>
|
||||
</van-col>
|
||||
|
||||
<van-col span="6">
|
||||
<view class="tableContent"> {{item.finalAmount}} </view>
|
||||
</van-col>
|
||||
|
||||
<van-col span="6">
|
||||
<view class="tableContent"> {{item.finalTotal}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 20rpx;"></view>
|
||||
@@ -59,12 +59,25 @@ page {
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.colContentTitle2 {
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.colContentValue {
|
||||
padding-bottom: 30rpx;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.colContentValue2 {
|
||||
padding-bottom: 20rpx;
|
||||
padding-left: 40rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
font-size: 30rpx;
|
||||
color: rgb(136, 132, 132);
|
||||
@@ -87,10 +100,37 @@ page {
|
||||
background-color: #fff;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.download {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.meterListItem {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.meterListItem .top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.meterListItem .address {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
|
||||
/* .top .meterListItem:nth-child(even) .tableContent,
|
||||
.bottom .meterListItem:nth-child(even) .tableContent,
|
||||
.top .meterListItem:nth-child(even),
|
||||
.bottom .meterListItem:nth-child(even)
|
||||
{
|
||||
|
||||
} */
|
||||
|
||||
.meterListItemContent, .meterListItemContent .tableContent {
|
||||
background-color: #fff;
|
||||
}
|
||||
@@ -1,24 +1,23 @@
|
||||
// pages/electricQuery/components/accountingCard/index.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
data: Object
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
data: Object
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
},
|
||||
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,33 +1,86 @@
|
||||
<!--pages/electricQuery/components/accountingCard/index.wxml-->
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
{{data.meter.address}}
|
||||
</view>
|
||||
<van-row>
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 初始余额 </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view class="tableTitle"> 储值累计金额 </view>
|
||||
</van-col>
|
||||
<van-col span="5">
|
||||
<view class="tableTitle"> 电费 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view class="tableTitle"> 账务余额 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view class="tableContent"> {{data.startMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view class="tableContent"> {{data.rechargeMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="5">
|
||||
<view class="tableContent"> {{data.electricMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view class="tableContent"> {{data.currentMoney}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
<view class="title">
|
||||
<span>{{data.meter.address}}</span>
|
||||
<span style="font-size: 30rpx; margin-left: 100rpx;">电表编号:{{data.meter.sn}}</span>
|
||||
</view>
|
||||
<van-row>
|
||||
<view class="table-header" style="border-bottom: 2rpx solid #000; ">
|
||||
<view class="table-header-row">
|
||||
<text class="table-header-cell">类目</text>
|
||||
<text class="table-header-cell">金额</text>
|
||||
<text class="table-header-cell">更新时间</text>
|
||||
</view>
|
||||
</view>
|
||||
</van-row>
|
||||
|
||||
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
|
||||
<van-row>
|
||||
<van-col span="7">
|
||||
<view class="tableTitle"> 初始余额 </view>
|
||||
</van-col>
|
||||
<van-col span="10">
|
||||
<view class="tableContent"> {{data.startMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view calss="tableContent"> {{data.updateStartMoneyAt || '--'}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
|
||||
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
|
||||
<van-row>
|
||||
<van-col span="7">
|
||||
<view class="tableTitle"> 累计充值金额 </view>
|
||||
</van-col>
|
||||
<van-col span="10">
|
||||
<view class="tableContent"> {{data.rechargeMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view calss="tableContent"> {{data.updateRechargeMoneyAt || '--'}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
|
||||
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
|
||||
<van-row>
|
||||
<van-col span="7">
|
||||
<view class="tableTitle"> 电费 </view>
|
||||
</van-col>
|
||||
<van-col span="10">
|
||||
<view class="tableContent"> {{data.electricMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view calss="tableContent"> {{data.updateElectricMoneyAt || '--'}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
|
||||
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
|
||||
<van-row>
|
||||
<van-col span="7">
|
||||
<view class="tableTitle"> 账务余额 </view>
|
||||
</van-col>
|
||||
<van-col span="10">
|
||||
<view class="tableContent"> {{data.accountMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view calss="tableContent"> {{data.updateAccountMoneyAt || '--'}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
|
||||
<view style="border-bottom: 2rpx solid rgba(12, 236, 188, 0.26); ">
|
||||
<van-row>
|
||||
<van-col span="7">
|
||||
<view class="tableTitle"> 电表余额 </view>
|
||||
</van-col>
|
||||
<van-col span="10">
|
||||
<view class="tableContent"> {{data.meterMoney}} </view>
|
||||
</van-col>
|
||||
<van-col span="7">
|
||||
<view calss="tableContent"> {{data.updateMeterMoneyAt || '--'}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
@@ -17,8 +17,25 @@
|
||||
}
|
||||
|
||||
.tableContent {
|
||||
margin-top: 10rpx;
|
||||
margin-top: 25rpx;
|
||||
margin-bottom: 20rpx;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
.table-header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
background-color: #f5f5f5;
|
||||
border-bottom: 1rpx solid #eaeaea;
|
||||
}
|
||||
.table-header-row {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
.table-header-cell {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 20rpx 0;
|
||||
font-size: 25rpx;
|
||||
color: #333;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -12,12 +13,16 @@ Component({
|
||||
*/
|
||||
properties: {
|
||||
meter: String,
|
||||
parkInfo: Object,
|
||||
},
|
||||
observers: {
|
||||
'meter': function() {
|
||||
loadingFunc(async () => {
|
||||
await this.getReadingList();
|
||||
})
|
||||
},
|
||||
"parkInfo": function(newValue) {
|
||||
this.setData({ park: newValue })
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -26,10 +31,11 @@ Component({
|
||||
data: {
|
||||
readingDetailShow: false,
|
||||
readingDetail: {},
|
||||
park: {},
|
||||
meterReadingHeader: [
|
||||
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||
{ title: '倍率', key: 'ratio' },
|
||||
{ key: 'number', title: '抄表记录' },
|
||||
{ key: 'number', title: '当前表字' },
|
||||
],
|
||||
meterReadingList: [],
|
||||
yearMonthDayReading: dayjs().format("YYYY-MM-DD"),
|
||||
@@ -75,10 +81,30 @@ Component({
|
||||
readingPage: 1,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await this.getParkInfo(time)
|
||||
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;
|
||||
|
||||
@@ -49,24 +49,102 @@
|
||||
label="地址"
|
||||
readonly
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.meter.sn }}(SN)"
|
||||
border="{{ false }}"
|
||||
label="编号"
|
||||
readonly
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.readAt }}"
|
||||
border="{{ false }}"
|
||||
label="时间"
|
||||
readonly
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.ratio }}"
|
||||
border="{{ false }}"
|
||||
label="倍率"
|
||||
readonly
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.number }}"
|
||||
border="{{ false }}"
|
||||
label="表字"
|
||||
label="当前表字(总)"
|
||||
readonly
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.overall }}"
|
||||
border="{{ false }}"
|
||||
label="总用电量"
|
||||
readonly
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.sharp }}"
|
||||
border="{{ false }}"
|
||||
label="当前表字(尖)"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.sharpAmount }}"
|
||||
border="{{ false }}"
|
||||
label="尖用电量"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.peak }}"
|
||||
border="{{ false }}"
|
||||
label="当前表字(峰)"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1 || park.meter04kvType === 2}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.peakAmount }}"
|
||||
border="{{ false }}"
|
||||
label="峰用电量"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.flat }}"
|
||||
border="{{ false }}"
|
||||
label="当前表字(平)"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.flatAmount }}"
|
||||
border="{{ false }}"
|
||||
label="平用电量"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
|
||||
<van-field
|
||||
value="{{ readingDetail.valley }}"
|
||||
border="{{ false }}"
|
||||
label="当前表字(谷)"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readingDetail.valleyAmount }}"
|
||||
border="{{ false }}"
|
||||
label="谷用电量"
|
||||
readonly
|
||||
wx:if="{{park.meter04kvType === 1|| park.meter04kvType === 2}}"
|
||||
/>
|
||||
<view class="text">上次抄表记录起,至现在时间内的用电量</view>
|
||||
</van-cell-group>
|
||||
|
||||
</view>
|
||||
</van-dialog>
|
||||
@@ -92,4 +92,11 @@ page {
|
||||
content:"";
|
||||
display:block;
|
||||
clear:both
|
||||
}
|
||||
|
||||
.text{
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
margin: 10rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// pages/electricQuery/index.js
|
||||
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting";
|
||||
import { getTenementMeterList } from "../../../service/meter";
|
||||
import { getParkInfoByTime } from "../../../service/park";
|
||||
import dayjs from "../../../utils/dayjs";
|
||||
import request from '../../../utils/request';
|
||||
import * as echarts from '../../components/echarts/echarts';
|
||||
@@ -29,14 +30,20 @@ Page({
|
||||
|
||||
|
||||
header: [
|
||||
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||
// { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||
{ title: '时间',renderBody: (item) => { return item.time } },
|
||||
{ key: 'number', title: '耗量' },
|
||||
],
|
||||
|
||||
valleyHeader: [
|
||||
// { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
|
||||
{ title: '时间',renderBody: (item) => { return item.time } },
|
||||
{ key: 'critical', title: '尖' },
|
||||
{ key: 'peak', title: '峰' },
|
||||
{ key: 'flat', title: '平' },
|
||||
{ key: 'valley', title: '谷' },
|
||||
],
|
||||
list: [],
|
||||
visible: false,
|
||||
|
||||
accountingList: [],
|
||||
electricNumber: 0,
|
||||
meterNumber: 0,
|
||||
@@ -76,7 +83,7 @@ Page({
|
||||
},
|
||||
|
||||
changeTimeType(e) {
|
||||
const { type } = e.currentTarget.dataset
|
||||
const { type } = e.currentTarget.dataset;
|
||||
const that = this;
|
||||
this.setData({ timeType: type }, () => {
|
||||
loadingFunc(async () => {
|
||||
@@ -90,11 +97,13 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
loadingFunc(async () => {
|
||||
await this.getMeters()
|
||||
await this.getParkInfo()
|
||||
await this.init()
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page } = this.data;
|
||||
const { queryType, timeType, meterId, year, yearMonth, yearMonthDay, page, parkInfo } = this.data;
|
||||
let time;
|
||||
switch(timeType) {
|
||||
case 1:
|
||||
@@ -133,14 +142,14 @@ Page({
|
||||
const times = [...new Set(data?.map(item => item.time))].
|
||||
map(item => Number(item.replace(point, ""))).
|
||||
sort((a, b) => a - b).
|
||||
map(ele => `${ele}${point}`.padStart(2, "0"));
|
||||
|
||||
map(ele => `${ele}${point}`.padStart(3, "0"));
|
||||
|
||||
const options = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
data: data?.map(item => item?.meter?.address),
|
||||
data: data?.map(item => item?.meter?.address),
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
@@ -162,7 +171,7 @@ Page({
|
||||
const newList = [...times].map(item => {
|
||||
const exist = list.find(ele => ele.time === item)
|
||||
if (exist) {
|
||||
return exist.number;
|
||||
return Number(exist.critical)+ Number(exist.peak)+Number(exist.flat)+Number(exist.valley);
|
||||
}
|
||||
return null
|
||||
})
|
||||
@@ -202,6 +211,7 @@ Page({
|
||||
wx.openDocument({
|
||||
filePath: data.tempFilePath,
|
||||
fileType: ['xlsx'],
|
||||
showMenu: true,
|
||||
success() {
|
||||
},
|
||||
fail(err) {
|
||||
@@ -235,15 +245,44 @@ Page({
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
|
||||
const first = data?.[0]
|
||||
this.setData({
|
||||
meterList: data || [],
|
||||
meterId: first?.id,
|
||||
meterAddress: first?.address,
|
||||
meterCode: first?.code,
|
||||
}, () => {
|
||||
const { queryType, } = this.data;
|
||||
switch(queryType) {
|
||||
case 1:
|
||||
loadingFunc(async () => {
|
||||
await this.getReadingList();
|
||||
})
|
||||
break;
|
||||
case 2:
|
||||
loadingFunc(async () => {
|
||||
await this.getAccountingBalanceList();
|
||||
})
|
||||
break;
|
||||
default:
|
||||
loadingFunc(async () => {
|
||||
await this.init();
|
||||
})
|
||||
break;
|
||||
}
|
||||
})
|
||||
},
|
||||
clickMeter() {
|
||||
this.setData({
|
||||
type: "meter",
|
||||
columns: [{ id: "", name: "全部", code: "" }, ...this.data.meterList.map(item => ({ id: item.id, name: `${item.code}-${item.address}`, code: item.code }))],
|
||||
columns: [
|
||||
// { id: "", name: "全部", code: "" },
|
||||
...this.data.meterList.map(item => ({
|
||||
id: item.id,
|
||||
name: `${item.code}-${item.address}`,
|
||||
code: item.code,
|
||||
address: item.address
|
||||
}))],
|
||||
show: true,
|
||||
title: "表计"
|
||||
})
|
||||
@@ -257,11 +296,12 @@ Page({
|
||||
})
|
||||
},
|
||||
onOk(e) {
|
||||
const { id, code } = e.detail.value;
|
||||
const { id, code, address } = e.detail.value;
|
||||
this.setData({
|
||||
// year: currentYear,
|
||||
meterId: id,
|
||||
meterCode: code,
|
||||
meterAddress: address,
|
||||
type: "",
|
||||
show: false,
|
||||
title: ""
|
||||
@@ -300,6 +340,7 @@ Page({
|
||||
case "year":
|
||||
this.setData({ year: time, visible: false, }, () => {
|
||||
loadingFunc(async () => {
|
||||
await this.getParkInfo()
|
||||
await this.init();
|
||||
})
|
||||
});
|
||||
@@ -308,6 +349,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();
|
||||
})
|
||||
});
|
||||
@@ -320,13 +362,16 @@ Page({
|
||||
page: 1,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await this.getParkInfo()
|
||||
await this.init();
|
||||
})
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
readingChangeTime(e) {
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@@ -338,9 +383,39 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
this.getMeters()
|
||||
},
|
||||
|
||||
},
|
||||
async getParkInfo() {
|
||||
const park = wx.getStorageSync('park');
|
||||
const { timeType, yearMonthDay, yearMonth, year } = this.data;
|
||||
let time = ''
|
||||
switch(timeType) {
|
||||
case 0:
|
||||
time = yearMonthDay;
|
||||
break;
|
||||
case 1:
|
||||
time = yearMonth;
|
||||
break;
|
||||
case 2:
|
||||
time = year;
|
||||
}
|
||||
const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${timeType}`,)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
const that = this;
|
||||
return new Promise((resolve) => {
|
||||
|
||||
that.setData({
|
||||
parkInfo: parkInfo
|
||||
}, () => {
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</view>
|
||||
<view class="select" bind:tap="clickMeter">
|
||||
<view class="selectContent">
|
||||
{{ meterCode === "" ? '全部' : meterCode }}
|
||||
{{ meterAddress === "" ? '-' : meterAddress }}
|
||||
</view>
|
||||
<van-icon name="arrow-down" />
|
||||
</view>
|
||||
@@ -30,23 +30,25 @@
|
||||
<view class="timeQuery" wx:if="{{queryType === 0}}">
|
||||
<van-row>
|
||||
<van-col span="8">
|
||||
<view class="timeQueryText" style="color: {{timeType === 0 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{0}}"> 日耗量 </view>
|
||||
<view class="timeQueryText" style="color: {{timeType === 0 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{0}}"> 日用电量 </view>
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
<view class="timeQueryText" style="color: {{timeType === 1 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{1}}"> 月耗量 </view>
|
||||
<view class="timeQueryText" style="color: {{timeType === 1 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{1}}"> 月电用量 </view>
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
<view class="timeQueryText" style="color: {{timeType === 2 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{2}}"> 年耗量 </view>
|
||||
<view class="timeQueryText" style="color: {{timeType === 2 ? '#0958d9' : '#000'}}" bind:tap="changeTimeType" data-type="{{2}}"> 年用电量 </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{queryType === 0}}">
|
||||
<view class="tooltip">
|
||||
不包括线损电量,显示为电表实际消耗电量。仅供参考,实际能耗电量以电费账单为主。如有疑问,请联系客服。
|
||||
不包括线损电量,显示为电表实际消用电量。仅供参考,实际能用电量以电费账单为主。如有疑问,请联系客服。
|
||||
</view>
|
||||
<view class="timeChooseWrapper">
|
||||
<view> 选择时间 </view>
|
||||
<view wx:if="{{timeType === 0}}"> 选择时间 </view>
|
||||
<view wx:elif="{{timeType === 1}}"> 选择日期 </view>
|
||||
<view wx:else="{{timeType === 2}}"> 选择月份 </view>
|
||||
<view class="time" bind:tap="clickTime">
|
||||
<view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view>
|
||||
<view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view>
|
||||
@@ -63,7 +65,10 @@
|
||||
</view>
|
||||
<view wx:elif="{{queryType === 2}}">
|
||||
<view class="tooltip">
|
||||
账务余额更新时间为:每次预存电费后,每次账单发布后,剩余的实际金额。电表余额与账务余额相差较大的用户,每半年统一处理一次。
|
||||
账务余额更新时间为:每次预存电费后,每次发布账单后剩余的实际金额。
|
||||
</view>
|
||||
<view class="tooltip">
|
||||
计算公式:账务余额 = 初始余额 + 累充充值金额 - 电费
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -81,14 +86,25 @@
|
||||
</view>
|
||||
<empty bind:refresh="init" wx:else /> -->
|
||||
|
||||
<listTable list="{{list}}" header="{{header}}" totalPage="{{totalPage}}" />
|
||||
<listTable
|
||||
list="{{list}}"
|
||||
header="{{header}}"
|
||||
totalPage="{{totalPage}}"
|
||||
wx:if="{{parkInfo.category !== 1}}"
|
||||
/>
|
||||
<listTable
|
||||
list="{{list}}"
|
||||
header="{{valleyHeader}}"
|
||||
totalPage="{{totalPage}}"
|
||||
wx:if="{{parkInfo.category === 1}}"
|
||||
/>
|
||||
</view>
|
||||
<view class="sum">
|
||||
合计:表计数量:{{meterNumber}},耗电量:{{electricNumber}}
|
||||
合计:表计数量:{{meterNumber}},用电量:{{electricNumber}}
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{queryType === 1}}">
|
||||
<reading meter="{{meterId}}" />
|
||||
<reading meter="{{meterId}}" parkInfo="{{parkInfo}}" bind:changeTime="readingChangeTime" />
|
||||
</view>
|
||||
<view wx:if="{{queryType === 2}}">
|
||||
<view style="margin: 30rpx;">
|
||||
|
||||
37
components/DateTimePicker/index.js
Normal file
37
components/DateTimePicker/index.js
Normal file
@@ -0,0 +1,37 @@
|
||||
// components/datePicker/index.js
|
||||
import dayjs from "../../utils/dayjs"
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
show: Boolean,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
currentDate: new Date().getTime(),
|
||||
maxDate: new Date().getTime(),
|
||||
minDate: new Date(2024, 1, 1).getTime(),
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onCancel() {
|
||||
this.triggerEvent("cancel")
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") })
|
||||
}
|
||||
}
|
||||
})
|
||||
7
components/DateTimePicker/index.json
Normal file
7
components/DateTimePicker/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-popup": "@vant/weapp/popup/index",
|
||||
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
|
||||
}
|
||||
}
|
||||
18
components/DateTimePicker/index.wxml
Normal file
18
components/DateTimePicker/index.wxml
Normal file
@@ -0,0 +1,18 @@
|
||||
<!--components/datePicker/index.wxml-->
|
||||
|
||||
<van-popup
|
||||
show="{{ show }}"
|
||||
position="bottom"
|
||||
bind:close="onClose"
|
||||
z-index="10000"
|
||||
>
|
||||
|
||||
<van-datetime-picker
|
||||
type="datetime"
|
||||
value="{{ currentDate }}"
|
||||
min-date="{{ minDate }}"
|
||||
max-date="{{ maxDate }}"
|
||||
bind:confirm="onConfirm"
|
||||
bind:cancel="onCancel"
|
||||
/>
|
||||
</van-popup>
|
||||
1
components/DateTimePicker/index.wxss
Normal file
1
components/DateTimePicker/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* components/datePicker/index.wxss */
|
||||
@@ -21,7 +21,6 @@ Component({
|
||||
*/
|
||||
methods: {
|
||||
handleChange(e) {
|
||||
console.log(e, this.data.active)
|
||||
const { index } = e.currentTarget.dataset;
|
||||
if (index === this.data.active) {
|
||||
return;
|
||||
|
||||
@@ -61,7 +61,6 @@ Component({
|
||||
onConfirm(event) {
|
||||
const { index } = event.detail;
|
||||
const { list = [], type } = this.data;
|
||||
console.log("index", index)
|
||||
const item = list[index];
|
||||
if (!item) {
|
||||
alertInfo("请选择一项")
|
||||
|
||||
@@ -23,6 +23,7 @@ Component({
|
||||
year: String,
|
||||
month: Number,
|
||||
day: Number,
|
||||
currentDate: Number,
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
|
||||
@@ -20,9 +20,7 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
const querys = decodeURIComponent(options.scene)
|
||||
console.log('querys', querys)
|
||||
const id = querys.slice(querys.indexOf("=") + 1)
|
||||
console.log("id", id)
|
||||
this.getInfo(id);
|
||||
},
|
||||
async getInfo(id) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getBillList } from "../../service/accounting"
|
||||
import { alertInfo } from "../../utils/index";
|
||||
import { alertInfo, loadingFunc } from "../../utils/index";
|
||||
import request from '../../utils/request'
|
||||
const { OK } = request;
|
||||
|
||||
@@ -17,11 +17,19 @@ Page({
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.init();
|
||||
const that = this;
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
|
||||
},
|
||||
async init() {
|
||||
const { page, list } = this.data;
|
||||
const { code, data, message } = await getBillList(page)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
if (!data?.length) {
|
||||
alertInfo("没有更多了")
|
||||
return;
|
||||
@@ -33,8 +41,9 @@ Page({
|
||||
},
|
||||
jumpToDetail(e) {
|
||||
const { id: report } = e.currentTarget.dataset
|
||||
const tenement = wx.getStorageSync('tenement')?.id || ""
|
||||
wx.navigateTo({
|
||||
url: '/childPackage/pages/billDetail/index?id=' + report,
|
||||
url: `/childPackage/pages/billDetail/index?id=${report}&tenement=${tenement}`,
|
||||
})
|
||||
},
|
||||
})
|
||||
87
pages/billMeterDetail/index.js
Normal file
87
pages/billMeterDetail/index.js
Normal file
@@ -0,0 +1,87 @@
|
||||
// pages/billMeterDetail/index.js
|
||||
import { getRoundNumber } from "../../utils/index"
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
data: {},
|
||||
headers: [
|
||||
{ key: 'type', title: '' },
|
||||
{ title: '尖',renderBody: (item) => { return item?.sharp } },
|
||||
{ title: '峰',renderBody: (item) => { return item?.peak } },
|
||||
{ title: '平',renderBody: (item) => { return item?.flat } },
|
||||
{ title: '谷',renderBody: (item) => { return item?.valley } },
|
||||
],
|
||||
list: []
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const data = JSON.parse(options.data) || {}
|
||||
this.setData({
|
||||
data: data,
|
||||
list: [
|
||||
{ type: "起码", sharp: data.startSharp, peak: data.startPeak, flat: data.startFlat, valley: data.startValley },
|
||||
{ type: "止码", sharp: data.endSharp, peak: data.endPeak, flat: data.endFlat, valley: data.endValley },
|
||||
{ type: "退补电量", sharp: data.refundSharp, peak: data.refundPeak, flat: data.refundFlat, valley: data.refundValley },
|
||||
{ type: "从表电量", sharp: getRoundNumber(data.nestSharp), peak: getRoundNumber(data.nestPeak), flat: getRoundNumber(data.nestFlat), valley: getRoundNumber(data.nestValley) },
|
||||
{ type: "电度电量", sharp: getRoundNumber(data?.critical?.amount), peak: getRoundNumber(data.peak?.amount), flat: getRoundNumber(data.flat?.amount), valley: getRoundNumber(data.valley?.amount) },
|
||||
{ type: "分时单价", sharp: data.critical?.price, peak: data.peak?.price, flat: data.flat?.price, valley: data.valley?.price },
|
||||
{ type: "电费", sharp: getRoundNumber(data.chargeSharp), peak: getRoundNumber(data.chargePeak), flat: getRoundNumber(data.chargeFlat), valley: getRoundNumber(data.chargeValley) },
|
||||
]
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
10
pages/billMeterDetail/index.json
Normal file
10
pages/billMeterDetail/index.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"van-row": "@vant/weapp/row/index",
|
||||
"van-col": "@vant/weapp/col/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"table": "/components/table/table"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
45
pages/billMeterDetail/index.wxml
Normal file
45
pages/billMeterDetail/index.wxml
Normal file
@@ -0,0 +1,45 @@
|
||||
<!--pages/billMeterDetail/index.wxml-->
|
||||
<navigator title="详情" canBack="{{true}}" />
|
||||
<view class="contentWrapper">
|
||||
<van-field
|
||||
label="电表编号"
|
||||
readonly="{{true}}"
|
||||
border="{{false}}"
|
||||
custom-style="padding-left: 0; padding-right: 0;"
|
||||
title-width="132rpx"
|
||||
value="{{data.meterNo}}"
|
||||
/>
|
||||
<van-field
|
||||
label="电表地址"
|
||||
readonly="{{true}}"
|
||||
custom-style="padding-left: 0; padding-right: 0;"
|
||||
title-width="132rpx"
|
||||
border="{{false}}"
|
||||
value="{{data.address}}"
|
||||
/>
|
||||
<van-field
|
||||
label="倍率"
|
||||
readonly="{{true}}"
|
||||
border="{{false}}"
|
||||
custom-style="padding-left: 0; padding-right: 0;"
|
||||
title-width="132rpx"
|
||||
value="{{data.ratio}}"
|
||||
/>
|
||||
<view class="table">
|
||||
<table header="{{headers}}" list="{{list}}" />
|
||||
</view>
|
||||
<view class="total">
|
||||
<van-row>
|
||||
<van-col span="12">
|
||||
<view class="totalNumber">
|
||||
电度电量:{{data.overall.amount}}
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="totalNumber">
|
||||
电度电费:{{data.overall.fee}}
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
22
pages/billMeterDetail/index.wxss
Normal file
22
pages/billMeterDetail/index.wxss
Normal file
@@ -0,0 +1,22 @@
|
||||
/* pages/billMeterDetail/index.wxss */
|
||||
.infoItem {
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.contentWrapper {
|
||||
margin: 20rpx;
|
||||
}
|
||||
|
||||
.table {
|
||||
border: 1rpx solid rgba(204,204,204,.5);
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.total {
|
||||
padding-top: 30rpx;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.totalNumber {
|
||||
word-break: break-all;
|
||||
}
|
||||
@@ -125,7 +125,6 @@ Page({
|
||||
wx.scanCode({
|
||||
scanType: "qrCode",
|
||||
success: ({ path }) => {
|
||||
console.log('path', path)
|
||||
wx.navigateTo({
|
||||
url: '/' + path,
|
||||
})
|
||||
@@ -137,7 +136,6 @@ Page({
|
||||
})
|
||||
},
|
||||
onConfirm(e) {
|
||||
console.log('e', e.detail)
|
||||
const { type, data = {} } = e.detail;
|
||||
switch(type) {
|
||||
case "park":
|
||||
|
||||
@@ -115,6 +115,12 @@ Page({
|
||||
show: false,
|
||||
})
|
||||
},
|
||||
jumpToMeterBalanceRecord(e) {
|
||||
const id = e.currentTarget.dataset.id
|
||||
wx.navigateTo({
|
||||
url: `/pages/meterBalanceRecord/index?id=${id}`,
|
||||
})
|
||||
},
|
||||
changeMoney(e) {
|
||||
const { money } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
|
||||
@@ -60,7 +60,12 @@
|
||||
<view class="cardItem">
|
||||
<view class="cardItemLabel"> 电表余额: </view>
|
||||
<view class="cardItemValue" style="position: relative;">
|
||||
<view class="text" wx:if="{{user.id}}"> {{meter.money}} </view>
|
||||
<view
|
||||
class="text primaryTextBtn"
|
||||
wx:if="{{user.id}}"
|
||||
bind:tap="jumpToMeterBalanceRecord"
|
||||
data-id="{{meter.id}}"
|
||||
> {{meter.money}} </view>
|
||||
<view class="text" wx:else> --- </view>
|
||||
<!-- bind:click="refreshMeter" -->
|
||||
<van-button
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* pages/home/index.wxss */
|
||||
@import "/app.wxss";
|
||||
|
||||
.balanceText {
|
||||
color: var(--primary-color)
|
||||
}
|
||||
|
||||
.top {
|
||||
background-color: var(--deep-green);
|
||||
position: fixed;
|
||||
|
||||
@@ -80,13 +80,32 @@ Page({
|
||||
}
|
||||
wx.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
showMenu: true,
|
||||
// fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||
success: function (res) {
|
||||
|
||||
},
|
||||
fail: function (e) {
|
||||
alertError("打开失败")
|
||||
console.log('打开失败错误为', e)
|
||||
// alertError("打开失败")
|
||||
// console.log('打开失败错误为', e)
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '打开失败,请复制链接后通过浏览器打开',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
wx.setClipboardData({
|
||||
data: data,
|
||||
success: () => {
|
||||
alertSuccess("复制成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -43,6 +43,15 @@ Component({
|
||||
page: page + 1,
|
||||
})
|
||||
},
|
||||
refresh() {
|
||||
const that = this;
|
||||
that.setData({
|
||||
page: 1,
|
||||
list: []
|
||||
}, () => {
|
||||
loadingFunc(() => that.getList())
|
||||
})
|
||||
},
|
||||
onRefresh() {
|
||||
loadingFunc(() => this.getList())
|
||||
},
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
|
||||
<scroll-view wx:if="{{list.length}}" scroll-y lower-threshold="100px" bindscrolltolower="scrollToLower" style="height: 80vh;" scroll-top="{{topHeight}}px" class="scrView">
|
||||
<view style="margin: 18rpx 30rpx;">
|
||||
<van-button type="info" size="small" icon="replay" bind:click="refresh"> 刷新 </van-button>
|
||||
</view>
|
||||
<view class="card" wx:for="{{list}}">
|
||||
<view class="left">
|
||||
<view class="title">
|
||||
@@ -28,7 +31,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="{{item.status === 1 ? 'approving' : 'already'}}">
|
||||
<view wx:if="{{item.status === 1}}"> 审核中 </view>
|
||||
<view wx:if="{{item.status === 1}}"> 开票中 </view>
|
||||
<view wx:else> 已开票 </view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -14,7 +14,7 @@ Component({
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
loadingFunc(() => this.init())
|
||||
loadingFunc(async () => await this.init())
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ Component({
|
||||
this.setData({ list: data, selectList: new Array(data?.length).map(() => false), allChecked: false, })
|
||||
},
|
||||
onRefresh() {
|
||||
loadingFunc(() => this.init())
|
||||
loadingFunc(async () => await this.init())
|
||||
},
|
||||
onChange(e) {
|
||||
const { id, index } = e.currentTarget.dataset;
|
||||
|
||||
@@ -82,18 +82,17 @@ Page({
|
||||
loadingFunc(async() => {
|
||||
const {ids = [], remark } = this.data;
|
||||
const tenement = wx.getStorageSync('tenement')
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: '/pages/invoiceList/index?tab=1',
|
||||
})
|
||||
}, 500)
|
||||
const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("操作成功")
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: '/pages/invoiceList/index?tab=1',
|
||||
})
|
||||
}, 500)
|
||||
|
||||
})
|
||||
},
|
||||
changeShow() {
|
||||
|
||||
@@ -54,7 +54,7 @@ Page({
|
||||
this.noPermission()
|
||||
return;
|
||||
}
|
||||
alertSuccess("注册成功")
|
||||
alertSuccess("登录成功")
|
||||
const { token, ...user } = data
|
||||
wx.setStorageSync('user', user)
|
||||
wx.setStorageSync('token', data?.token)
|
||||
|
||||
149
pages/meterBalanceRecord/index.js
Normal file
149
pages/meterBalanceRecord/index.js
Normal file
@@ -0,0 +1,149 @@
|
||||
import dayjs from "../../utils/dayjs"
|
||||
import { getDayCalcList } from "../../service/calc"
|
||||
import { alertError } from "../../utils/index";
|
||||
import request from "../../utils/request"
|
||||
const { OK } = request
|
||||
|
||||
// pages/meterBalanceRecord/index.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
time: "",
|
||||
timeStamp: undefined,
|
||||
list: [],
|
||||
page: 1,
|
||||
size: 999,
|
||||
header: [
|
||||
{ key: 'day', title: '日期', },
|
||||
{ key: "money", title: '充值金额', renderBody: (item) => {
|
||||
if (item.type === 1 || item.type === 7) {
|
||||
return item.topFee
|
||||
} else if (item.type === 5 || item.type === 6 || item.type === 8) {
|
||||
return `-${item.topFee}`
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
} },
|
||||
{ key: 'overall', title: '电费', renderBody: (item) => {
|
||||
if (item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8) {
|
||||
return 0;
|
||||
} else {
|
||||
return item.money
|
||||
}
|
||||
} },
|
||||
{ key: 'balance', title: '电表余额' },
|
||||
],
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { id } = options
|
||||
const that = this;
|
||||
this.setData({
|
||||
id,
|
||||
time: dayjs().format("YYYY-MM"),
|
||||
timeStamp: Date.now()
|
||||
}, () => {
|
||||
that.getList()
|
||||
})
|
||||
},
|
||||
clickTime() {
|
||||
this.setData({
|
||||
timeVisible: true
|
||||
})
|
||||
},
|
||||
async getList() {
|
||||
const { id, time, page, size } = this.data;
|
||||
const { code, message, data } = await getDayCalcList({
|
||||
page,
|
||||
size,
|
||||
startTime: dayjs(time).subtract(1, 'month').endOf('month').format("YYYY-MM-DD"),
|
||||
endTime: dayjs(time).endOf('month').format("YYYY-MM-DD"),
|
||||
codeId: id,
|
||||
})
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
list: data?.map(item => {
|
||||
item.day = dayjs(item.endTime).format("DD日")
|
||||
return item;
|
||||
})
|
||||
})
|
||||
},
|
||||
onTimeConfirm(e) {
|
||||
const { time } = e.detail;
|
||||
const that = this;
|
||||
this.setData({
|
||||
time,
|
||||
timeStamp: new Date(time).getTime(),
|
||||
timeVisible: false,
|
||||
}, () => {
|
||||
that.getList()
|
||||
})
|
||||
},
|
||||
onTimeCancel() {
|
||||
this.setData({
|
||||
timeVisible: false,
|
||||
})
|
||||
},
|
||||
onTimeClose() {
|
||||
this.setData({
|
||||
timeVisible: false,
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
13
pages/meterBalanceRecord/index.json
Normal file
13
pages/meterBalanceRecord/index.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"timePicker": "/components/timePicker/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-tag": "@vant/weapp/tag/index",
|
||||
"van-row": "@vant/weapp/row/index",
|
||||
"empty": "/components/empty/index",
|
||||
"table": "/components/table/table",
|
||||
"van-col": "@vant/weapp/col/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
74
pages/meterBalanceRecord/index.wxml
Normal file
74
pages/meterBalanceRecord/index.wxml
Normal file
@@ -0,0 +1,74 @@
|
||||
<!--pages/meterBalanceRecord/index.wxml-->
|
||||
<navigator title="电费扣款记录" canBack="{{true}}" />
|
||||
<view class="pageWrapper">
|
||||
<view class="timeChooseWrapper">
|
||||
<view> 选择时间 </view>
|
||||
<view class="time" bind:tap="clickTime">
|
||||
|
||||
<view class="timeText"> {{time}} </view>
|
||||
<van-icon name="arrow-down" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="customTable" wx:if="{{list.length}}">
|
||||
<!-- <view class="customTableTile">
|
||||
<van-row>
|
||||
<van-col span="4">
|
||||
<view style="text-align: center;"> 日期 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view style="text-align: center;"> 充值金额 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view style="text-align: center;"> 电费 </view>
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
<view style="text-align: center;"> 电表余额 </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
<view class="customTableContent" wx:for="{{list}}" wx:key="id">
|
||||
<view class="tableRow">
|
||||
<van-row>
|
||||
<van-col span="4">
|
||||
<view style="text-align: center;"> {{ item.day }} </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view style="text-align: center;" wx:if="{{item.type === 1 || item.type === 7}}"> {{ item.topFee }} </view>
|
||||
<view style="text-align: center;" wx:elif="{{item.type === 5 || item.type === 6 || item.type === 8}}"> -{{ item.topFee }} </view>
|
||||
<view style="text-align: center;" wx:else> 0 </view>
|
||||
</van-col>
|
||||
<van-col span="6">
|
||||
<view style="text-align: center;" wx:if="{{item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8}}">
|
||||
0
|
||||
</view>
|
||||
<view style="text-align: center;" wx:else> {{item.money}} </view>
|
||||
</van-col>
|
||||
<van-col span="8">
|
||||
<view style="text-align: center;"> {{item.balance}} </view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
<table
|
||||
header="{{header}}"
|
||||
list="{{list}}"
|
||||
border="{{true}}"
|
||||
topStyle="text-align: center"
|
||||
bodyStyle="text-align: center"
|
||||
topColor="rgb(242,248,246)"
|
||||
/>
|
||||
</view>
|
||||
<empty bind:refresh="getList" wx:else />
|
||||
</view>
|
||||
|
||||
|
||||
<timePicker
|
||||
type="month"
|
||||
currentDate="{{timeStamp}}"
|
||||
show="{{timeVisible}}"
|
||||
bind:cancel="onTimeCancel"
|
||||
bind:close="onTimeClose"
|
||||
bind:confirm="onTimeConfirm"
|
||||
/>
|
||||
91
pages/meterBalanceRecord/index.wxss
Normal file
91
pages/meterBalanceRecord/index.wxss
Normal file
@@ -0,0 +1,91 @@
|
||||
/* pages/meterBalanceRecord/index.wxss */
|
||||
.pageWrapper {
|
||||
margin: 30rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
margin-right: 30rpx;
|
||||
display: flex;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 12rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.timeChooseWrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
|
||||
.timeText {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 890rpx;
|
||||
|
||||
}
|
||||
|
||||
.classWrapper {
|
||||
width: 100vw;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.thead {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
}
|
||||
|
||||
.thead .th {
|
||||
padding: 20rpx;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
|
||||
}
|
||||
|
||||
.tbody {
|
||||
width: 890rpx;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.tbody .th {
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.customTable {
|
||||
margin: 20rpx 0;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.customTableTile {
|
||||
background-color: var(--light-green);
|
||||
padding: 16rpx;
|
||||
box-sizing: border-box;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tableRow {
|
||||
padding: 16rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
border-top: 0rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
|
||||
page {
|
||||
background-color: var(--transparent-green);
|
||||
}
|
||||
@@ -144,15 +144,27 @@ Page({
|
||||
})
|
||||
},
|
||||
connect() {
|
||||
Dialog.alert({
|
||||
title: '提示',
|
||||
message: '将进入咨询客服页面',
|
||||
confirmButtonOpenType: "contact",
|
||||
showCancelButton: true,
|
||||
}).then(() => {
|
||||
// on close
|
||||
});
|
||||
|
||||
// Dialog.alert({
|
||||
// title: '提示',
|
||||
// message: '将进入咨询客服页面',
|
||||
// "confirm-button-open-type": "contact",
|
||||
// showCancelButton: true,
|
||||
// }).then(() => {
|
||||
// // on close
|
||||
// });
|
||||
this.setData({
|
||||
connectShow: true
|
||||
})
|
||||
},
|
||||
bindConnect() {
|
||||
this.setData({
|
||||
connectShow: false
|
||||
})
|
||||
},
|
||||
bindCancelConnect() {
|
||||
this.setData({
|
||||
connectShow: false
|
||||
})
|
||||
},
|
||||
jumpToFinance() {
|
||||
wx.navigateTo({
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
/>
|
||||
</view>
|
||||
<view style="border-radius: 16rpx; overflow: hidden;">
|
||||
<!-- <button open-type="contact" class="connect"> 联系客服 </button> -->
|
||||
<van-cell title="联系客服" value="" is-link bind:tap="connect" icon="service-o" />
|
||||
<van-cell icon="qr" wx:if="{{!!user.isAdmin}}" title="二维码" value="" is-link bind:click="jumpToQrCode" />
|
||||
<van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
|
||||
@@ -88,4 +89,18 @@
|
||||
</view>
|
||||
|
||||
<van-dialog id="van-dialog" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<van-dialog
|
||||
title="提示"
|
||||
message="将进入咨询客服页面"
|
||||
show="{{ connectShow }}"
|
||||
custom-class="my-custom-class"
|
||||
show-cancel-button
|
||||
use-confirm-button-slot="{{true}}"
|
||||
use-cancel-button-slot="{{true}}"
|
||||
>
|
||||
<button slot="cancel-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindCancelConnect"> 取消 </button>
|
||||
<button open-type="contact" slot="confirm-button" style="width: 50%;background-color: transparent;border: 0px;border-radius: 0;" bind:tap="bindConnect"> 确认 </button>
|
||||
</van-dialog>
|
||||
|
||||
|
||||
@@ -40,3 +40,6 @@
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
|
||||
.connect {
|
||||
display: none;
|
||||
}
|
||||
|
||||
84
pages/readingHistory/components/editModal/index.js
Normal file
84
pages/readingHistory/components/editModal/index.js
Normal file
@@ -0,0 +1,84 @@
|
||||
// pages/workBench/components/tenement/components/bindMeter/index.js
|
||||
// 0015980101
|
||||
import { bindMeter, } from "../../../../service/tenement"
|
||||
import { getWorkMeterDetail } from "../../../../service/meter"
|
||||
import { alertInfo, alertSuccess } from "../../../../utils/index";
|
||||
import request from "../../../../utils/request"
|
||||
import dayjs from "../../../../utils/dayjs"
|
||||
const { OK } = request
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
visible: Boolean,
|
||||
title: String,
|
||||
timeProps: String,
|
||||
numberProps: String,
|
||||
id: String
|
||||
},
|
||||
observers: {
|
||||
"timeProps": function(newValue) {
|
||||
this.setData({
|
||||
time: newValue
|
||||
})
|
||||
},
|
||||
"numberProps": function(newValue) {
|
||||
this.setData({
|
||||
number: newValue
|
||||
})
|
||||
},
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
dateTimeShow: false,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onCancel() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
// this.triggerEvent("close")
|
||||
},
|
||||
onClose() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
onChange(e) {
|
||||
const { name } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
[name]: e.detail
|
||||
})
|
||||
},
|
||||
async onSubmit() {
|
||||
const { time, number } = this.data;
|
||||
if (time == null || number == null) {
|
||||
alertInfo("请正确填写后保存")
|
||||
return;
|
||||
}
|
||||
this.triggerEvent("ok")
|
||||
},
|
||||
|
||||
dateTimeConfirm(e) {
|
||||
this.setData({ time: e.detail.time, dateTimeShow: false })
|
||||
},
|
||||
dateTimeCancal(e) {
|
||||
this.setData({ dateTimeShow: false })
|
||||
},
|
||||
onTimeFocus() {
|
||||
this.setData({ dateTimeShow: true })
|
||||
}
|
||||
}
|
||||
})
|
||||
10
pages/readingHistory/components/editModal/index.json
Normal file
10
pages/readingHistory/components/editModal/index.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"search-select": "/components/searchSelect/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"date-time-picker": "/components/DateTimePicker/index"
|
||||
}
|
||||
}
|
||||
50
pages/readingHistory/components/editModal/index.wxml
Normal file
50
pages/readingHistory/components/editModal/index.wxml
Normal file
@@ -0,0 +1,50 @@
|
||||
<!--pages/workBench/components/tenement/components/bindMeter/index.wxml-->
|
||||
<van-dialog
|
||||
use-slot
|
||||
title="{{title}}"
|
||||
show="{{ visible }}"
|
||||
show-cancel-button
|
||||
bind:confirm="onSubmit"
|
||||
bind:close="onClose"
|
||||
>
|
||||
<view class="modalContentWrapper">
|
||||
<van-field
|
||||
value="{{ time }}"
|
||||
placeholder="请选择绑定时间"
|
||||
label="时间"
|
||||
readonly
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="info" bind:click="onTimeFocus">
|
||||
选择
|
||||
</van-button>
|
||||
</van-field>
|
||||
<van-field
|
||||
value="{{ number }}"
|
||||
placeholder="请输入读数"
|
||||
label="读数"
|
||||
type="digit"
|
||||
border="{{ false }}"
|
||||
title-width="100rpx"
|
||||
>
|
||||
</van-field>
|
||||
</view>
|
||||
|
||||
</van-dialog>
|
||||
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onCancel"
|
||||
/>
|
||||
|
||||
<date-time-picker
|
||||
show="{{dateTimeShow}}"
|
||||
bind:confirm="dateTimeConfirm"
|
||||
bind:cancel="dateTimeCancal"
|
||||
/>
|
||||
1
pages/readingHistory/components/editModal/index.wxss
Normal file
1
pages/readingHistory/components/editModal/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/workBench/components/tenement/components/bindMeter/index.wxss */
|
||||
24
pages/readingHistory/components/meterInfo/index.js
Normal file
24
pages/readingHistory/components/meterInfo/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// pages/readingHistory/components/meterInfo/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
meterInfo: Object,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
8
pages/readingHistory/components/meterInfo/index.json
Normal file
8
pages/readingHistory/components/meterInfo/index.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-row": "@vant/weapp/row/index",
|
||||
"van-col": "@vant/weapp/col/index",
|
||||
"van-tag": "@vant/weapp/tag/index"
|
||||
}
|
||||
}
|
||||
68
pages/readingHistory/components/meterInfo/index.wxml
Normal file
68
pages/readingHistory/components/meterInfo/index.wxml
Normal file
@@ -0,0 +1,68 @@
|
||||
<!--pages/readingHistory/components/meterInfo/index.wxml-->
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
<view class="address">
|
||||
{{meterInfo.address}}
|
||||
</view>
|
||||
<view class="status">
|
||||
<view wx:if="{{meterInfo.enabled}}">
|
||||
正常
|
||||
</view>
|
||||
<view wx:else>
|
||||
停用
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="detail">
|
||||
<van-row gutter="20">
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
设备编号
|
||||
</view>
|
||||
<view>
|
||||
{{meterInfo.meterSn}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
电表类型
|
||||
</view>
|
||||
<view>
|
||||
<view wx:if="{{meterInfo.meterBelongType === 0}}">
|
||||
商户电表
|
||||
</view>
|
||||
<view wx:elif="{{meterInfo.meterBelongType === 1}}">
|
||||
公区电表
|
||||
</view>
|
||||
<view wx:elif="{{meterInfo.meterBelongType === 2}}">
|
||||
公摊电表
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
最近读数
|
||||
</view>
|
||||
<view>
|
||||
{{meterInfo.overall}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
读数日期
|
||||
</view>
|
||||
<view>
|
||||
{{meterInfo.readAt}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
22
pages/readingHistory/components/meterInfo/index.wxss
Normal file
22
pages/readingHistory/components/meterInfo/index.wxss
Normal file
@@ -0,0 +1,22 @@
|
||||
/* pages/readingHistory/components/meterInfo/index.wxss */
|
||||
.wrapper {
|
||||
margin: 20rpx 0;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: white;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.detail .text {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
112
pages/readingHistory/index.js
Normal file
112
pages/readingHistory/index.js
Normal file
@@ -0,0 +1,112 @@
|
||||
// pages/readingHistory/index.js
|
||||
import { getMeterReadingRouteMeterDetail } from "../../service/workBench"
|
||||
import request from "../../utils/request"
|
||||
import { alertInfo, alertSuccess, alertError } from "../../utils/index"
|
||||
const { OK } = request;
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
list: [{time: "2025-05-05 14:10:09", number: 90803.87}]
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { meter, park } = options;
|
||||
this.setData({
|
||||
meter,
|
||||
park
|
||||
})
|
||||
this.getMeterInfo(meter);
|
||||
},
|
||||
async getMeterInfo(id) {
|
||||
const { code, message, data } = await getMeterReadingRouteMeterDetail(id)
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return;
|
||||
}
|
||||
this.setData({ meterInfo: data })
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
handleCreate() {
|
||||
this.setData({
|
||||
title: "新增记录",
|
||||
visible: true
|
||||
})
|
||||
},
|
||||
handleUpdate() {
|
||||
this.setData({
|
||||
title: "编辑记录",
|
||||
visible: true,
|
||||
time: "2025-09-11",
|
||||
number: 100,
|
||||
id: ""
|
||||
})
|
||||
},
|
||||
handleDelete(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.showModal({
|
||||
title: '删除确认',
|
||||
content: '确认要删除这一项记录吗?',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
10
pages/readingHistory/index.json
Normal file
10
pages/readingHistory/index.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"navigator": "/components/navigator/index",
|
||||
"meterInfo": "./components/meterInfo/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"editModal": "./components/editModal/index"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
49
pages/readingHistory/index.wxml
Normal file
49
pages/readingHistory/index.wxml
Normal file
@@ -0,0 +1,49 @@
|
||||
<!--pages/readingHistory/index.wxml-->
|
||||
<navigator title="历史抄表记录" canBack="{{true}}" />
|
||||
|
||||
<view class="wrapper">
|
||||
<meterInfo meterInfo="{{meterInfo}}" />
|
||||
<view class="historyTitle">
|
||||
<view class="text">
|
||||
抄表记录历史
|
||||
</view>
|
||||
<van-button type="info" size="small" icon="plus" bind:tap="handleCreate"> 新增记录 </van-button>
|
||||
</view>
|
||||
<view>
|
||||
<view wx:if="{{list.length}}">
|
||||
<view class="tableWrapper">
|
||||
<view class="table">
|
||||
<view class="thead">
|
||||
<view class="th" style="width: 40%; text-align: center;"> 抄表时间 </view>
|
||||
<view class="th" style="width: 35%; text-align: center;"> 抄表读数 </view>
|
||||
<view class="th" style="width: 25%; text-align: center;"> 操作 </view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||
<view class="tr" style="display: flex; align-items: center; ">
|
||||
<view class="th" style="width: 40%; text-align: center; font-size: 30rpx;">
|
||||
{{ item.time }}
|
||||
</view>
|
||||
<view class="th" style="width: 35%; text-align: center; font-size: 30rpx;">
|
||||
{{ item.number }}
|
||||
</view>
|
||||
|
||||
<view class="th" style="width: 25%; text-align: center; justify-content: center; display: flex; align-items: center;">
|
||||
<van-icon name="edit" size="40rpx" bind:tap="handleUpdate" data-data="{{item}}" color="#15755e" />
|
||||
<van-icon name="delete" size="40rpx" bind:tap="handleDelete" data-id="{{item.id}}" color="#15755e" custom-style="margin-left: 20rpx" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
|
||||
|
||||
</view>
|
||||
<empty bind:refresh="init" wx:else />
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<editModal title="{{title}}" visible="{{visible}}" timeProps="{{time}}" numberProps="{{number}}" id="{{id}}" />
|
||||
72
pages/readingHistory/index.wxss
Normal file
72
pages/readingHistory/index.wxss
Normal file
@@ -0,0 +1,72 @@
|
||||
/* pages/readingHistory/index.wxss */
|
||||
page {
|
||||
background-color: #ebedf0;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
padding: 0 20rpx 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.historyTitle {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
width: 100%;
|
||||
margin-top: 30rpx;
|
||||
background-color: #fff;
|
||||
overflow-x: auto;
|
||||
padding: 20rpx 12rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.thead {
|
||||
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
}
|
||||
|
||||
.thead .th {
|
||||
padding: 10rpx;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.primaryTextBtn {
|
||||
color: #1989fa;
|
||||
}
|
||||
|
||||
.tbody {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
padding: 10rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.more-icon {
|
||||
padding: 20rpx;
|
||||
color: #1989fa;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ Page({
|
||||
wx.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 !!!
|
||||
showMenu: true,
|
||||
success: function (res) {
|
||||
resolve()
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
border="{{ false }}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{detail.meter.code}}"
|
||||
value="{{detail.meter.sn}}(SN)"
|
||||
label="电表编号"
|
||||
readonly
|
||||
autosize="{{true}}"
|
||||
|
||||
@@ -102,7 +102,6 @@ Page({
|
||||
},
|
||||
onChangePay(e) {
|
||||
const { id, name } = e;
|
||||
console.log('e', e)
|
||||
const { year, codeId } = this.data;
|
||||
this.setData({
|
||||
payType: name,
|
||||
|
||||
@@ -71,11 +71,9 @@ Page({
|
||||
})
|
||||
},
|
||||
fail: (res) => {
|
||||
console.log('fail', res)
|
||||
alertInfo("请稍后重试")
|
||||
},
|
||||
complete: (res) => {
|
||||
console.log('complete')
|
||||
that.handleGetMeterDetail(meter.id)
|
||||
}
|
||||
})
|
||||
|
||||
97
pages/workBench/components/reading/index.js
Normal file
97
pages/workBench/components/reading/index.js
Normal file
@@ -0,0 +1,97 @@
|
||||
// pages/workBench/components/reading/index.js
|
||||
import { getMeterReadingRouteList, changeMeterRouteStatus } from "../../../../service/workBench"
|
||||
import { alertError, alertSuccess, loadingFunc } from "../../../../utils/index"
|
||||
import request from "../../../../utils/request"
|
||||
const { OK } = request
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
park: "",
|
||||
parkName: ""
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onParkFocus(e) {
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "园区",
|
||||
type: 'park'
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const { parkName, park } = this.data;
|
||||
const { code, message, data } = await getMeterReadingRouteList(parkName)
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
list: data
|
||||
})
|
||||
},
|
||||
onConfirm(e) {
|
||||
const { data } = e.detail;
|
||||
const that = this;
|
||||
this.setData({
|
||||
parkName: data.name,
|
||||
park: data.id,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
this.onConcal();
|
||||
},
|
||||
onConcal() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
jumpToReading(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: `/pages/writeReading/index?id=${id}`,
|
||||
})
|
||||
},
|
||||
async changeStartStatus(e) {
|
||||
const that = this;
|
||||
const { id } = e.currentTarget.dataset;
|
||||
const { code, message } = await changeMeterRouteStatus({ id, status: 1 })
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
alertSuccess("操作成功")
|
||||
this.init()
|
||||
setTimeout(() => {
|
||||
that.jumpToReading()
|
||||
}, 500)
|
||||
},
|
||||
async changeEndStatus(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
const { code, message } = await changeMeterRouteStatus({ id, status: 0 })
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
alertSuccess("操作成功")
|
||||
this.init()
|
||||
}
|
||||
}
|
||||
})
|
||||
16
pages/workBench/components/reading/index.json
Normal file
16
pages/workBench/components/reading/index.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"search-select": "/components/searchSelect/index",
|
||||
"van-empty": "@vant/weapp/empty/index",
|
||||
"table": "/components/table/table",
|
||||
"pagination": "/components/pagination/index",
|
||||
"empty": "/components/empty/index",
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"van-cell": "@vant/weapp/cell/index"
|
||||
}
|
||||
}
|
||||
61
pages/workBench/components/reading/index.wxml
Normal file
61
pages/workBench/components/reading/index.wxml
Normal file
@@ -0,0 +1,61 @@
|
||||
<!--pages/workBench/components/reading/index.wxml-->
|
||||
<van-field
|
||||
value="{{ parkName }}"
|
||||
placeholder="请选择园区"
|
||||
label="园区"
|
||||
readonly
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||
选择
|
||||
</van-button>
|
||||
</van-field>
|
||||
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
/>
|
||||
|
||||
<van-empty description="请先选择园区" wx:if="{{!park}}" />
|
||||
|
||||
<view wx:else>
|
||||
<van-cell
|
||||
wx:for="{{list}}"
|
||||
wx:key="id"
|
||||
title="{{item.readingRouteName}}"
|
||||
label="包含{{item.meterRoute}}个抄表点"
|
||||
>
|
||||
<view slot="right-icon">
|
||||
<van-button
|
||||
type="primary"
|
||||
size="small"
|
||||
type="primary"
|
||||
bind:tap="changeStartStatus"
|
||||
custom-style="margin-right: 20rpx;"
|
||||
data-id="{{item.id}}"
|
||||
wx:if="{{item.status === 0}}"
|
||||
> 开始抄表 </van-button>
|
||||
<van-button
|
||||
type="primary"
|
||||
size="small"
|
||||
bind:tap="jumpToReading"
|
||||
data-id="{{item.id}}"
|
||||
custom-style="margin-right: 20rpx;"
|
||||
wx:if="{{item.status === 1}}"
|
||||
> 去抄表 </van-button>
|
||||
<van-button
|
||||
size="small"
|
||||
type="danger"
|
||||
bind:tap="changeEndStatus"
|
||||
data-id="{{item.id}}"
|
||||
wx:if="{{item.status === 1}}"
|
||||
> 结束抄表 </van-button>
|
||||
</view>
|
||||
</van-cell>
|
||||
</view>
|
||||
1
pages/workBench/components/reading/index.wxss
Normal file
1
pages/workBench/components/reading/index.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/workBench/components/reading/index.wxss */
|
||||
@@ -1,190 +1,279 @@
|
||||
// pages/workBench/components/recharge/components/waitApprove/index.js
|
||||
import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index";
|
||||
import { getRechargeApproveList, rechargeApprove } from "../../../../../../service/recharge"
|
||||
import {
|
||||
alertInfo,
|
||||
alertSuccess,
|
||||
loadingFunc
|
||||
} from "../../../../../../utils/index";
|
||||
import {
|
||||
getRechargeApproveList,
|
||||
rechargeApprove
|
||||
} from "../../../../../../service/recharge"
|
||||
import request from "../../../../../../utils/request"
|
||||
const { OK } = request
|
||||
import dayjs from "../../../../../../utils/dayjs"
|
||||
const {
|
||||
OK
|
||||
} = request
|
||||
|
||||
// pages/workBench/components/record/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
status: Number
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
keyword: "",
|
||||
keywordTemp: "",
|
||||
page: 1,
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
loadingFunc(async () => {
|
||||
await this.init();
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onParkFocus(e) {
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "园区",
|
||||
type: 'park'
|
||||
})
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
status: Number
|
||||
},
|
||||
onConfirm(e) {
|
||||
const { data } = e.detail;
|
||||
const that = this;
|
||||
this.setData({
|
||||
parkName: data.name,
|
||||
park: data.id,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
this.onCancel();
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
keyword: "",
|
||||
keywordTemp: "",
|
||||
page: 1,
|
||||
currentActionSheet: null,
|
||||
actionItems: [{
|
||||
name: '查看详细',
|
||||
value: 'detail'
|
||||
}],
|
||||
},
|
||||
onSearchKeyword(e) {
|
||||
const that = this;
|
||||
that.setData({
|
||||
keyword: e.detail
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
onChangeKeyword(e) {
|
||||
this.setData({ keywordTemp: e.detail })
|
||||
},
|
||||
onSearch() {
|
||||
const that = this;
|
||||
that.setData({
|
||||
keyword: that.data.keywordTemp
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const { page, keyword, park, status } = this.data;
|
||||
const { code, message, data, total } = await getRechargeApproveList({ park, page, keyword, status })
|
||||
if (code !== OK) {
|
||||
alertInfo(message);
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
list: data,
|
||||
total: total,
|
||||
totalPage: Math.ceil(total / 20)
|
||||
})
|
||||
},
|
||||
onChangeReason(e) {
|
||||
this.setData({
|
||||
reason: e.detail,
|
||||
})
|
||||
},
|
||||
onApproveClose() {
|
||||
this.setData({
|
||||
reason: "",
|
||||
approveShow: false,
|
||||
})
|
||||
},
|
||||
onApproveConfirm() {
|
||||
const { reason, record } = this.data;
|
||||
const that = this;
|
||||
if (!reason) {
|
||||
alertInfo("请输入拒绝理由")
|
||||
return;
|
||||
}
|
||||
loadingFunc(async () => {
|
||||
const { code, message } = await rechargeApprove({ id: record, status: 1, reason })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已拒绝")
|
||||
that.init();
|
||||
that.setData({
|
||||
reason: "",
|
||||
approveShow: false,
|
||||
record: "",
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
handleApprove(e) {
|
||||
const status = e.currentTarget.dataset.status;
|
||||
const that = this;
|
||||
if (status === '1') {
|
||||
this.setData({
|
||||
approveShow: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
const { record, list } = this.data;
|
||||
const item = list.find(ele => ele.id === record)
|
||||
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`,
|
||||
complete: async (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
if (res.confirm) {
|
||||
|
||||
lifetimes: {
|
||||
attached() {
|
||||
loadingFunc(async () => {
|
||||
const { code, message } = await rechargeApprove({ id: record, status: 0, })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已同意")
|
||||
that.init();
|
||||
await this.init();
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
jumpToDetail(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: '/pages/rechargeDetail/index?id=' + id,
|
||||
})
|
||||
},
|
||||
async onChangePage(e) {
|
||||
const page = e.detail.currentIndex;
|
||||
const that = this;
|
||||
this.setData({
|
||||
page
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
onChangeSelectRecharge(e) {
|
||||
this.setData({
|
||||
record: e.detail
|
||||
})
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onParkFocus(e) {
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "园区",
|
||||
type: 'park'
|
||||
})
|
||||
},
|
||||
onConfirm(e) {
|
||||
const {
|
||||
data
|
||||
} = e.detail;
|
||||
const that = this;
|
||||
this.setData({
|
||||
parkName: data.name,
|
||||
park: data.id,
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
this.onCancel();
|
||||
},
|
||||
onSearchKeyword(e) {
|
||||
const that = this;
|
||||
that.setData({
|
||||
keyword: e.detail
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
onChangeKeyword(e) {
|
||||
this.setData({
|
||||
keywordTemp: e.detail
|
||||
})
|
||||
},
|
||||
onSearch() {
|
||||
const that = this;
|
||||
that.setData({
|
||||
keyword: that.data.keywordTemp
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const {
|
||||
page,
|
||||
keyword,
|
||||
park,
|
||||
status
|
||||
} = this.data;
|
||||
const {
|
||||
code,
|
||||
message,
|
||||
data,
|
||||
total
|
||||
} = await getRechargeApproveList({
|
||||
park,
|
||||
page,
|
||||
keyword,
|
||||
status
|
||||
})
|
||||
if (code !== OK) {
|
||||
alertInfo(message);
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
list: data.map(item => {
|
||||
item.topTime = dayjs(item.topTime).format("MM-DD")
|
||||
return item
|
||||
}),
|
||||
total: total,
|
||||
totalPage: Math.ceil(total / 20)
|
||||
})
|
||||
},
|
||||
onChangeReason(e) {
|
||||
this.setData({
|
||||
reason: e.detail,
|
||||
})
|
||||
},
|
||||
onApproveClose() {
|
||||
this.setData({
|
||||
reason: "",
|
||||
approveShow: false,
|
||||
})
|
||||
},
|
||||
onApproveConfirm() {
|
||||
const {
|
||||
reason,
|
||||
record
|
||||
} = this.data;
|
||||
const that = this;
|
||||
if (!reason) {
|
||||
alertInfo("请输入拒绝理由")
|
||||
return;
|
||||
}
|
||||
loadingFunc(async () => {
|
||||
const {
|
||||
code,
|
||||
message
|
||||
} = await rechargeApprove({
|
||||
id: record,
|
||||
status: 1,
|
||||
reason
|
||||
})
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已拒绝")
|
||||
that.init();
|
||||
that.setData({
|
||||
reason: "",
|
||||
approveShow: false,
|
||||
record: "",
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
handleApprove(e) {
|
||||
const status = e.currentTarget.dataset.status;
|
||||
const that = this;
|
||||
if (status === '1') {
|
||||
this.setData({
|
||||
approveShow: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
const {
|
||||
record,
|
||||
list
|
||||
} = this.data;
|
||||
const item = list.find(ele => ele.id === record)
|
||||
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`,
|
||||
complete: async (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
if (res.confirm) {
|
||||
loadingFunc(async () => {
|
||||
const {
|
||||
code,
|
||||
message
|
||||
} = await rechargeApprove({
|
||||
id: record,
|
||||
status: 0,
|
||||
})
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已同意")
|
||||
that.init();
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
showActionMenu(e) {
|
||||
this.setData({
|
||||
currentActionSheet: e.currentTarget.dataset.id
|
||||
});
|
||||
},
|
||||
|
||||
hideActionMenu() {
|
||||
this.setData({
|
||||
currentActionSheet: null
|
||||
});
|
||||
},
|
||||
|
||||
onMenuSelect(e) {
|
||||
const {
|
||||
value
|
||||
} = e.detail;
|
||||
const id = e.currentTarget.dataset.id;
|
||||
|
||||
if (value === 'detail') {
|
||||
this.jumpToDetail({
|
||||
currentTarget: {
|
||||
dataset: {
|
||||
id
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
jumpToDetail(e) {
|
||||
const {
|
||||
id
|
||||
} = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: '/pages/rechargeDetail/index?id=' + id,
|
||||
})
|
||||
},
|
||||
async onChangePage(e) {
|
||||
const page = e.detail.currentIndex;
|
||||
const that = this;
|
||||
this.setData({
|
||||
page
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
onChangeSelectRecharge(e) {
|
||||
this.setData({
|
||||
record: e.detail
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -11,6 +11,8 @@
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
||||
"searchSelectWrapper": "/components/searchSelectWrapper/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-action-sheet": "@vant/weapp/action-sheet/index"
|
||||
}
|
||||
}
|
||||
@@ -1,100 +1,66 @@
|
||||
<!--pages/workBench/components/recharge/components/waitApprove/index.wxml-->
|
||||
<searchSelectWrapper
|
||||
label="园区"
|
||||
placeholder="请选择园区"
|
||||
text="{{parkName}}"
|
||||
bind:search="onParkFocus"
|
||||
/>
|
||||
<searchSelectWrapper label="园区" placeholder="请选择园区" text="{{parkName}}" bind:search="onParkFocus" />
|
||||
|
||||
<searchSelectWrapper
|
||||
label="关键字"
|
||||
placeholder="请输入关键字"
|
||||
text="{{meterName}}"
|
||||
bind:searchKeyword="onSearchKeyword"
|
||||
type="inputSearch"
|
||||
/>
|
||||
<searchSelectWrapper label="关键字" placeholder="请输入关键字" text="{{meterName}}" bind:searchKeyword="onSearchKeyword" type="inputSearch" />
|
||||
<view>
|
||||
<view wx:if="{{list.length}}">
|
||||
<view class="operate" wx:if="{{status === 2}}">
|
||||
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
|
||||
<van-button
|
||||
type="info"
|
||||
size="small"
|
||||
style="margin-right: 30rpx;"
|
||||
bind:click="handleApprove"
|
||||
data-status="0"
|
||||
disabled="{{!record}}"
|
||||
> 同意 </van-button>
|
||||
<van-button
|
||||
size="small"
|
||||
bind:click="handleClear"
|
||||
disabled="{{!record}}"
|
||||
bind:click="handleApprove"
|
||||
data-status="1"
|
||||
> 拒绝 </van-button>
|
||||
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleApprove" data-status="0" disabled="{{!record}}"> 同意 </van-button>
|
||||
<van-button size="small" bind:click="handleClear" disabled="{{!record}}" bind:click="handleApprove" data-status="1"> 拒绝 </van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tableWrapper">
|
||||
<view class="table">
|
||||
<view class="thead">
|
||||
<view class="th" style="width: 70rpx"> </view>
|
||||
<view class="th" style="width: 250rpx"> 商户名字 </view>
|
||||
<view class="th" style="width: 150rpx"> 充值金额 </view>
|
||||
<view class="th" style="width: 200rpx"> 操作 </view>
|
||||
<view class="th" style="flex: 0 0 80rpx; display: {{status === 2 ? 'block' : 'none'}};"> </view>
|
||||
<!-- <view class="th" style="flex: 0 0 0rpx; display: {{status === 1 ? 'block' : 'none'}};"> </view> -->
|
||||
<view class="th" style="flex: 0 0 130rpx;"> 商户名字</view>
|
||||
<view class="th" style="flex: 0 0 150rpx;"> 充值金额 </view>
|
||||
<view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">状态</view>
|
||||
<view class="th" style="flex: 0 0 150rpx;">提交时间</view>
|
||||
<view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||
<view class="tr">
|
||||
<view class="th" style="width: 70rpx">
|
||||
<view class="tr" style="display: flex; align-items: center; ">
|
||||
<view class="th" style="flex: 0 0 80rpx; ; display: {{status === 2 ? 'block' : 'none'}};">
|
||||
<van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio>
|
||||
</view>
|
||||
<view class="th" style="width: 250rpx"> {{ item.tenement.shortName }} </view>
|
||||
<view class="th" style="width: 150rpx"> {{ item.money }} </view>
|
||||
<view class="th" style="width: 200rpx">
|
||||
<view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}">
|
||||
查看详细
|
||||
</view>
|
||||
<view class="th" style="flex: 0 0 130rpx;">
|
||||
{{ item.tenement.shortName }}
|
||||
</view>
|
||||
<view class="th" style="flex: 0 0 150rpx;">
|
||||
{{ item.money }}
|
||||
</view>
|
||||
<view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">
|
||||
<view class="tag">{{item.orderStatus}}</view>
|
||||
</view>
|
||||
<view class="th" style="flex: 0 0 150rpx; font-size: 30rpx;">
|
||||
{{item.topTime}}
|
||||
</view>
|
||||
<view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;">
|
||||
<van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" class="more-icon" />
|
||||
<van-action-sheet show="{{ currentActionSheet === item.id }}" actions="{{ actionItems }}" bind:close="hideActionMenu" bind:select="onMenuSelect" data-id="{{item.id}}" close-on-click-action />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
</van-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<pagination
|
||||
currentIndex="{{page}}"
|
||||
totalPage="{{totalPage}}"
|
||||
bind:pagingChange="onChangePage"
|
||||
/>
|
||||
|
||||
|
||||
<pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
|
||||
|
||||
</view>
|
||||
<empty bind:refresh="init" wx:else />
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onCancel"
|
||||
/>
|
||||
<search-select show="{{show}}" title="{{title}}" type="{{type}}" park="{{park}}" bindconfirm="onConfirm" bindcancel="onCancel" />
|
||||
|
||||
<van-dialog
|
||||
use-slot
|
||||
title="审核"
|
||||
show="{{ approveShow }}"
|
||||
show-cancel-button
|
||||
bind:close="onApproveClose"
|
||||
bind:confirm="onApproveConfirm"
|
||||
>
|
||||
<van-field
|
||||
label="拒绝理由"
|
||||
value="{{ reason }}"
|
||||
placeholder="请输入拒绝理由"
|
||||
bind:change="onChangeReason"
|
||||
/>
|
||||
<van-dialog use-slot title="审核" show="{{ approveShow }}" show-cancel-button bind:close="onApproveClose" bind:confirm="onApproveConfirm">
|
||||
<van-field label="拒绝理由" value="{{ reason }}" placeholder="请输入拒绝理由" bind:change="onChangeReason" />
|
||||
</van-dialog>
|
||||
@@ -1,6 +1,6 @@
|
||||
/* pages/workBench/components/recharge/components/waitApprove/index.wxss */
|
||||
.table {
|
||||
width: 810rpx;
|
||||
width: 500rpx;
|
||||
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
.thead .th {
|
||||
padding: 20rpx;
|
||||
padding: 10rpx;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
@@ -28,11 +28,11 @@
|
||||
}
|
||||
|
||||
.tbody {
|
||||
width: 810rpx;
|
||||
width: 500rpx;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
padding: 20rpx;
|
||||
padding: 10rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -43,3 +43,28 @@
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.more-icon {
|
||||
padding: 20rpx;
|
||||
color: #1989fa;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 基础标签样式 */
|
||||
.tag {
|
||||
display: inline-block;
|
||||
padding: 4px 5px;
|
||||
margin-right: 0px;
|
||||
border-radius: 16px;
|
||||
background: #07c160;
|
||||
color: white;
|
||||
font-size: 25rpx;
|
||||
}
|
||||
|
||||
/* 激活状态样式 */
|
||||
.tag.active {
|
||||
background: #07c160;
|
||||
color: white;
|
||||
}
|
||||
@@ -23,7 +23,6 @@ Component({
|
||||
*/
|
||||
methods: {
|
||||
changeQueryType(e) {
|
||||
console.log("change", e)
|
||||
const { type } = e.currentTarget.dataset;
|
||||
this.setData({
|
||||
active: type
|
||||
|
||||
@@ -23,7 +23,7 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
dateTimeShow: false,
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -64,11 +64,19 @@ Component({
|
||||
})
|
||||
},
|
||||
async onSubmit() {
|
||||
const { overall, critical, peak, valley, park, tenement, meter } = this.data;
|
||||
const { code, message } = await bindMeter(park, tenement, { code: meter, overall:overall? Number(overall) : overall,
|
||||
critical : critical ? Number(critical) : critical,
|
||||
peak: peak ? Number(peak) : peak,
|
||||
valley : valley ? Number(valley) : valley, readAt: dayjs().format('YYYY-MM-DD HH:mm:ss') })
|
||||
const { overall, critical, peak, valley, park, tenement, meter, readAt } = this.data;
|
||||
const { code, message } = await bindMeter(
|
||||
park,
|
||||
tenement,
|
||||
{
|
||||
code: meter,
|
||||
overall:overall? Number(overall) : overall,
|
||||
critical : critical ? Number(critical) : critical,
|
||||
peak: peak ? Number(peak) : peak,
|
||||
valley : valley ? Number(valley) : valley,
|
||||
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
@@ -79,7 +87,6 @@ Component({
|
||||
onConfirm(e) {
|
||||
const { type, data } = e.detail;
|
||||
const that = this;
|
||||
console.log("e.deail", e.detail)
|
||||
switch(type) {
|
||||
case "meter":
|
||||
this.setData({
|
||||
@@ -101,6 +108,15 @@ Component({
|
||||
overall: Number(data?.overall || 0),
|
||||
status: data?.breakType ? '合闸' : "分闸"
|
||||
})
|
||||
},
|
||||
dateTimeConfirm(e) {
|
||||
this.setData({ readAt: e.detail.time, dateTimeShow: false })
|
||||
},
|
||||
dateTimeCancal(e) {
|
||||
this.setData({ dateTimeShow: false })
|
||||
},
|
||||
onTimeFocus() {
|
||||
this.setData({ dateTimeShow: true })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -4,6 +4,7 @@
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"search-select": "/components/searchSelect/index",
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index"
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"date-time-picker": "/components/DateTimePicker/index"
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,19 @@
|
||||
readonly
|
||||
type="digit"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readAt }}"
|
||||
placeholder="请选择绑定时间"
|
||||
label="时间"
|
||||
readonly
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="info" bind:click="onTimeFocus">
|
||||
选择
|
||||
</van-button>
|
||||
</van-field>
|
||||
<van-field
|
||||
value="{{ overall }}"
|
||||
label="表字"
|
||||
@@ -99,4 +112,10 @@
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onCancel"
|
||||
/>
|
||||
/>
|
||||
|
||||
<date-time-picker
|
||||
show="{{dateTimeShow}}"
|
||||
bind:confirm="dateTimeConfirm"
|
||||
bind:cancel="dateTimeCancal"
|
||||
/>
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
use-button-slot
|
||||
readonly
|
||||
title-width="120rpx"
|
||||
required
|
||||
>
|
||||
<van-button slot="button" size="small" type="info" bind:click="onBuildingFocus">
|
||||
选择
|
||||
|
||||
@@ -5,6 +5,7 @@ import request from "../../../../../../utils/request"
|
||||
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||
const { OK } = request
|
||||
import { getWorkMeterDetail } from "../../../../../../service/meter"
|
||||
import dayjs from "../../../../../../utils/dayjs"
|
||||
|
||||
Component({
|
||||
|
||||
@@ -28,7 +29,7 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
dateTimeShow: false
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -68,13 +69,17 @@ Component({
|
||||
})
|
||||
},
|
||||
async onSubmit() {
|
||||
const { overall, critical, peak, valley, park, tenement, meterId } = this.data;
|
||||
const { code, message, } = await unbindMeter(park, tenement, meterId,
|
||||
const { overall, critical, peak, valley, park, tenement, meterId,readAt } = this.data;
|
||||
const { code, message, } = await unbindMeter(
|
||||
park,
|
||||
tenement,
|
||||
meterId,
|
||||
{
|
||||
overall:overall? Number(overall) : overall,
|
||||
critical : critical ? Number(critical) : critical,
|
||||
peak: peak ? Number(peak) : peak,
|
||||
valley : valley ? Number(valley) : valley,
|
||||
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||
});
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
@@ -82,6 +87,15 @@ Component({
|
||||
}
|
||||
alertSuccess("解绑成功")
|
||||
this.triggerEvent("ok")
|
||||
},
|
||||
dateTimeConfirm(e) {
|
||||
this.setData({ readAt: e.detail.time, dateTimeShow: false })
|
||||
},
|
||||
dateTimeCancal(e) {
|
||||
this.setData({ dateTimeShow: false })
|
||||
},
|
||||
onTimeFocus() {
|
||||
this.setData({ dateTimeShow: true })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -3,6 +3,8 @@
|
||||
"usingComponents": {
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"search-select": "/components/searchSelect/index",
|
||||
"van-field": "@vant/weapp/field/index"
|
||||
"van-field": "@vant/weapp/field/index",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"date-time-picker": "/components/DateTimePicker/index"
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,19 @@
|
||||
title-width="132rpx"
|
||||
border="{{false}}"
|
||||
/>
|
||||
<van-field
|
||||
value="{{ readAt }}"
|
||||
placeholder="请选择解绑时间"
|
||||
label="时间"
|
||||
readonly
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="info" bind:click="onTimeFocus">
|
||||
选择
|
||||
</van-button>
|
||||
</van-field>
|
||||
<van-field
|
||||
value="{{ overall }}"
|
||||
label="表字"
|
||||
@@ -78,4 +91,10 @@
|
||||
/>
|
||||
</view>
|
||||
|
||||
</van-dialog>
|
||||
</van-dialog>
|
||||
|
||||
<date-time-picker
|
||||
show="{{dateTimeShow}}"
|
||||
bind:confirm="dateTimeConfirm"
|
||||
bind:cancel="dateTimeCancal"
|
||||
/>
|
||||
|
||||
@@ -126,7 +126,6 @@ Component({
|
||||
})
|
||||
},
|
||||
onBindClose() {
|
||||
console.log("-----------")
|
||||
this.setData({
|
||||
bindVisible: false,
|
||||
})
|
||||
@@ -183,6 +182,9 @@ Component({
|
||||
bindVisible: false,
|
||||
})
|
||||
this.getTenementMeters();
|
||||
},
|
||||
onTimeConfirm(e) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -132,4 +132,4 @@
|
||||
meterId="{{meterId}}"
|
||||
meterAddress="{{meterAddress}}"
|
||||
bind:ok="onUnbindOk"
|
||||
/>
|
||||
/>
|
||||
|
||||
@@ -5,7 +5,7 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
active: 0,
|
||||
active: 4
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,7 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
console.log("this,data", this.data)
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"navigator": "/components/navigator/index",
|
||||
"recharge": "./components/recharge/index",
|
||||
"record": "./components/record/index",
|
||||
"reading": "./components/reading/index",
|
||||
"tenement": "./components/tenement/index",
|
||||
"account": "./components/account/index"
|
||||
},
|
||||
|
||||
@@ -13,4 +13,7 @@
|
||||
<van-tab title="C端账号" >
|
||||
<account />
|
||||
</van-tab>
|
||||
<van-tab title="抄表">
|
||||
<reading />
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
24
pages/writeReading/components/meterInfo/index.js
Normal file
24
pages/writeReading/components/meterInfo/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// pages/writeReading/components/meterInfo/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
meterInfo: Object,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
8
pages/writeReading/components/meterInfo/index.json
Normal file
8
pages/writeReading/components/meterInfo/index.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-tag": "@vant/weapp/tag/index",
|
||||
"van-row": "@vant/weapp/row/index",
|
||||
"van-col": "@vant/weapp/col/index"
|
||||
}
|
||||
}
|
||||
70
pages/writeReading/components/meterInfo/index.wxml
Normal file
70
pages/writeReading/components/meterInfo/index.wxml
Normal file
@@ -0,0 +1,70 @@
|
||||
<!--pages/writeReading/components/meterInfo/index.wxml-->
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
<text> 电表列表 </text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="title">
|
||||
<view class="address">
|
||||
标1东-307
|
||||
</view>
|
||||
<view class="meterType">
|
||||
<van-tag type="primary">华昌宝能收费</van-tag>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="detail">
|
||||
<van-row gutter="20">
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
编号
|
||||
</view>
|
||||
<view>
|
||||
{{meterInfo.meterSn}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
类型
|
||||
</view>
|
||||
<view wx:if="{{meterInfo.meterBelongType === 0}}">
|
||||
商户电表
|
||||
</view>
|
||||
<view wx:elif="{{meterInfo.meterBelongType === 1}}">
|
||||
公区电表
|
||||
</view>
|
||||
<view wx:elif="{{meterInfo.meterBelongType === 2}}">
|
||||
公摊电表
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
状态
|
||||
</view>
|
||||
<view wx:if="{{meterInfo.enabled}}">
|
||||
正常
|
||||
</view>
|
||||
<view wx:else>
|
||||
停用
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="12">
|
||||
<view class="text">
|
||||
<view>
|
||||
读数
|
||||
</view>
|
||||
<view>
|
||||
{{meterInfo.overall}}
|
||||
</view>
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
33
pages/writeReading/components/meterInfo/index.wxss
Normal file
33
pages/writeReading/components/meterInfo/index.wxss
Normal file
@@ -0,0 +1,33 @@
|
||||
/* pages/writeReading/components/meterInfo/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
padding: 0 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.info {
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 15rpx;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.info .title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.info .title .address {
|
||||
font-size: 36rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.info .detail {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.info .detail .text {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// pages/writeReading/components/meterList/components/meterItem/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
active: Boolean,
|
||||
meter: Object
|
||||
},
|
||||
observers: {
|
||||
"active": function (newValue) {
|
||||
this.setData({
|
||||
isDeep: newValue
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onClick: function() {
|
||||
this.triggerEvent("click")
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<!--pages/writeReading/components/meterList/components/meterItem/index.wxml-->
|
||||
<view class="wrapper {{isDeep ? 'deepBg' : ''}}" bind:tap="onClick">
|
||||
{{meter.meterAddress}}
|
||||
</view>
|
||||
@@ -0,0 +1,24 @@
|
||||
/* pages/writeReading/components/meterList/components/meterItem/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
width: 200rpx;
|
||||
box-sizing: border-box;
|
||||
margin-right: 20rpx;
|
||||
background-color: white;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
font-size: 32rpx;
|
||||
height: 150rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.deepBg {
|
||||
background-color: var(--deep-green);
|
||||
color: white;
|
||||
}
|
||||
134
pages/writeReading/components/meterList/index.js
Normal file
134
pages/writeReading/components/meterList/index.js
Normal file
@@ -0,0 +1,134 @@
|
||||
// pages/writeReading/components/meterList/index.js
|
||||
import { getMeterReadingRouteMeterDetail } from "../../../../service/workBench"
|
||||
import request from "../../../../utils/request"
|
||||
import { alertInfo, alertSuccess, alertError } from "../../../../utils/index"
|
||||
const { OK } = request;
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
list: Array,
|
||||
active: Number,
|
||||
meterInfo: Object
|
||||
},
|
||||
observers: {
|
||||
"active,list": function(newActive, newList) {
|
||||
if (newActive >= 0 && newList.length) {
|
||||
this.getMeterInfo(newList?.[newActive]?.meterId, newActive, true)
|
||||
}
|
||||
if (newActive === 0) {
|
||||
this.setData({ scrollLeft: 0 })
|
||||
} else if (newActive > 0) {
|
||||
this.setData({ scrollLeft: 220 * newList.length - 20 })
|
||||
}
|
||||
const { scrollWidth } = this.data;
|
||||
if (scrollWidth) {
|
||||
this.setData({
|
||||
maxScrollLeft: newList?.length ? 220 * newList.length - (scrollWidth || 0) - 20 : 0,
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
animationData: {}, // 存储动画数据
|
||||
position: 0,
|
||||
scrollLeft: 0, // 当前滚动位置
|
||||
maxScrollLeft: 0, // 最大可滚动距离
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
const that = this;
|
||||
const query = this.createSelectorQuery();
|
||||
query.select('.meterListScrollView').boundingClientRect()
|
||||
query.exec(function(res){
|
||||
const { list } = that.data;
|
||||
const length = that.data.list?.length || 0;
|
||||
that.setData({
|
||||
maxScrollLeft:length ? 220 * list.length - (res?.[0]?.width || 0) - 20 : 0,
|
||||
scrollWidth: res?.[0]?.width || 0
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
handleLeft() {
|
||||
// 将动画数据设置到 data 中,从而触发视图更新
|
||||
const currentPosition = this.data.position
|
||||
if (currentPosition === 0) {
|
||||
this.setData({
|
||||
position: currentPosition,
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
position: this.data.position + 300,
|
||||
});
|
||||
|
||||
},
|
||||
handleRight() {
|
||||
// // 将动画数据设置到 data 中,从而触发视图更新
|
||||
// const currentPosition = this.data.position
|
||||
// if (currentPosition === 0) {
|
||||
// this.setData({
|
||||
// position: currentPosition,
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
|
||||
this.setData({
|
||||
position: this.data.position - 300,
|
||||
});
|
||||
|
||||
},
|
||||
handleSelect(e) {
|
||||
const { id, index } = e.currentTarget.dataset;
|
||||
this.getMeterInfo(id, index)
|
||||
},
|
||||
async getMeterInfo(id, index, noChange) {
|
||||
const { code, message, data } = await getMeterReadingRouteMeterDetail(id)
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return;
|
||||
}
|
||||
if (noChange) {
|
||||
this.triggerEvent("changeMeter", { meter: data })
|
||||
return;
|
||||
}
|
||||
this.triggerEvent("changeMeterAndIndex", { index: index, meter: data })
|
||||
},
|
||||
// onScroll(e) {
|
||||
// // 实时更新当前滚动位置,可用于更复杂的边界判断
|
||||
// console.log("e", e)
|
||||
// this.setData({
|
||||
// scrollLeft: e.detail.scrollLeft
|
||||
// });
|
||||
// },
|
||||
|
||||
scrollLeft() {
|
||||
// 向左滚动:减少 scrollLeft,但不能小于0
|
||||
const newScrollLeft = Math.max(0, this.data.scrollLeft - 200);
|
||||
this.setData({
|
||||
scrollLeft: newScrollLeft
|
||||
});
|
||||
},
|
||||
|
||||
scrollRight() {
|
||||
// 向右滚动:增加 scrollLeft,但不能超过 maxScrollLeft
|
||||
const newScrollLeft = Math.min(this.data.maxScrollLeft, this.data.scrollLeft + 200);
|
||||
this.setData({
|
||||
scrollLeft: newScrollLeft
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
7
pages/writeReading/components/meterList/index.json
Normal file
7
pages/writeReading/components/meterList/index.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"meter-item": "./components/meterItem/index"
|
||||
}
|
||||
}
|
||||
31
pages/writeReading/components/meterList/index.wxml
Normal file
31
pages/writeReading/components/meterList/index.wxml
Normal file
@@ -0,0 +1,31 @@
|
||||
<!--pages/writeReading/components/meterList/index.wxml-->
|
||||
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
<text> 电表列表 </text>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;margin-top: 20rpx;">
|
||||
<van-icon name="arrow-left" size="50rpx" bind:tap="scrollLeft" />
|
||||
<scroll-view
|
||||
scroll-x="{{true}}"
|
||||
class="meterListScrollView"
|
||||
scroll-left="{{scrollLeft}}"
|
||||
bindscroll="onScroll"
|
||||
scroll-with-animation="true"
|
||||
>
|
||||
<view style="display: flex;" class="scroll-content">
|
||||
<meter-item
|
||||
active="{{active === index}}"
|
||||
wx:for="{{list}}"
|
||||
wx:key="id"
|
||||
meter="{{item}}"
|
||||
bind:click="handleSelect"
|
||||
data-index="{{index}}"
|
||||
data-id="{{item.meterId}}"
|
||||
/>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<van-icon name="arrow" size="50rpx" bind:tap="scrollRight" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
20
pages/writeReading/components/meterList/index.wxss
Normal file
20
pages/writeReading/components/meterList/index.wxss
Normal file
@@ -0,0 +1,20 @@
|
||||
/* pages/writeReading/components/meterList/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
padding: 0 20rpx 20rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.meterListScrollView {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: #ebedf0;
|
||||
}
|
||||
24
pages/writeReading/components/photo/index.js
Normal file
24
pages/writeReading/components/photo/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
// pages/writeReading/components/photo/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
4
pages/writeReading/components/photo/index.json
Normal file
4
pages/writeReading/components/photo/index.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
4
pages/writeReading/components/photo/index.wxml
Normal file
4
pages/writeReading/components/photo/index.wxml
Normal file
@@ -0,0 +1,4 @@
|
||||
<!--pages/writeReading/components/photo/index.wxml-->
|
||||
<view class="wrapper">
|
||||
拍照
|
||||
</view>
|
||||
4
pages/writeReading/components/photo/index.wxss
Normal file
4
pages/writeReading/components/photo/index.wxss
Normal file
@@ -0,0 +1,4 @@
|
||||
/* pages/writeReading/components/photo/index.wxss */
|
||||
.wrapper {
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
106
pages/writeReading/components/readingInfo/index.js
Normal file
106
pages/writeReading/components/readingInfo/index.js
Normal file
@@ -0,0 +1,106 @@
|
||||
// pages/writeReading/components/readingInfo/index.js
|
||||
|
||||
import { createReading } from "../../../../service/workBench"
|
||||
import { alertError, alertInfo, alertSuccess } from "../../../../utils/index"
|
||||
import request from "../../../../utils/request"
|
||||
const { OK } = request
|
||||
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
meterInfo: Object,
|
||||
showLeft: Boolean,
|
||||
showRight: Boolean,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
currentNumber: null
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
jumpToHistory() {
|
||||
const { meterInfo } = this.data;
|
||||
wx.navigateTo({
|
||||
url: `/pages/readingHistory/index?meter=${meterInfo?.id}&park=${meterInfo?.park}`,
|
||||
})
|
||||
},
|
||||
handlePrev() {
|
||||
this.triggerEvent("prev")
|
||||
},
|
||||
handleNext() {
|
||||
this.triggerEvent("next")
|
||||
},
|
||||
onChange(e) {
|
||||
this.setData({
|
||||
currentNumber: e.detail ? Number(e.detail) : 0
|
||||
})
|
||||
},
|
||||
handleClear() {
|
||||
this.setData({
|
||||
currentNumber: null,
|
||||
})
|
||||
},
|
||||
async onSubmit() {
|
||||
const { meterInfo, currentNumber } = this.data;
|
||||
const { parkId, id } = meterInfo;
|
||||
const { code, message } = await createReading(parkId, id, {
|
||||
overall: `${currentNumber}`,
|
||||
flat: `${currentNumber}`
|
||||
})
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return
|
||||
}
|
||||
alertSuccess("录入成功")
|
||||
this.handleNext()
|
||||
this.handleClear()
|
||||
},
|
||||
handleCreateReading() {
|
||||
const { meterInfo, currentNumber } = this.data;
|
||||
if (currentNumber == null || currentNumber == undefined) {
|
||||
alertInfo("请填写本次表字后保存")
|
||||
return;
|
||||
}
|
||||
const that = this;
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '确定要录入吗?',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
if (meterInfo.consumption < currentNumber) {
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '本次用电量已抄过历史平均水平的100%,是否确认录入?',
|
||||
complete: (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
|
||||
if (res.confirm) {
|
||||
that.onSubmit()
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.onSubmit()
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
10
pages/writeReading/components/readingInfo/index.json
Normal file
10
pages/writeReading/components/readingInfo/index.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-divider": "@vant/weapp/divider/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"photo": "../photo/index",
|
||||
"van-field": "@vant/weapp/field/index"
|
||||
}
|
||||
}
|
||||
90
pages/writeReading/components/readingInfo/index.wxml
Normal file
90
pages/writeReading/components/readingInfo/index.wxml
Normal file
@@ -0,0 +1,90 @@
|
||||
<!--pages/writeReading/components/readingInfo/index.wxml-->
|
||||
|
||||
<view class="wrapper">
|
||||
<view class="bodyTitle">
|
||||
<view class="text">
|
||||
<!-- 电表数据记录器 -->
|
||||
</view>
|
||||
<view class="time" bind:tap="jumpToHistory">
|
||||
<!-- 2025年9月5日 -->
|
||||
历史记录
|
||||
</view>
|
||||
</view>
|
||||
<view class="contentWrapper">
|
||||
<view class="currentMeter">
|
||||
<view class="text">
|
||||
当前电表
|
||||
</view>
|
||||
<view class="address">
|
||||
{{meterInfo.address}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="change">
|
||||
<van-button wx:if="{{showLeft}}" type="info" size="small" bind:click="handlePrev">
|
||||
<van-icon name="arrow-left" />
|
||||
上一块
|
||||
</van-button>
|
||||
<view wx:else></view>
|
||||
<van-button wx:if="{{showRight}}" type="info" size="small" bind:click="handleNext">
|
||||
下一块
|
||||
<van-icon name="arrow" />
|
||||
</van-button>
|
||||
<view wx:else></view>
|
||||
</view>
|
||||
<van-divider />
|
||||
<view class="readingNumber">
|
||||
<view class="lastNumber">
|
||||
<view class="title">
|
||||
上次表字
|
||||
</view>
|
||||
<view class="number">
|
||||
{{meterInfo.overall}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="lastTime">
|
||||
{{meterInfo.readAt}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="nextReadingNumber">
|
||||
<view class="currentNumber">
|
||||
<view class="title">
|
||||
本次表字
|
||||
</view>
|
||||
|
||||
<view class="number">
|
||||
<van-field
|
||||
value="{{currentNumber}}"
|
||||
placeholder="请输入本次读数"
|
||||
bind:change="onChange"
|
||||
border="{{false}}"
|
||||
custom-style="border: 1rpx solid #ccc; padding: 2px 14rpx; font-size: 32rpx; border-radius: 10rpx;"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="photo">
|
||||
<photo />
|
||||
</view>
|
||||
</view>
|
||||
<view class="calc">
|
||||
<view class="title">
|
||||
表字差
|
||||
</view>
|
||||
<view class="rightNumber" wx:if="{{currentNumber - meterInfo.overall >= 0}}">
|
||||
{{(currentNumber || 0) - meterInfo.overall}}
|
||||
</view>
|
||||
<view class="wrongNumber" wx:else>
|
||||
{{(currentNumber || 0) - meterInfo.overall}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="operate">
|
||||
<view style="flex: 1;">
|
||||
<van-button size="small" type="info" block bind:click="handleCreateReading"> 确定录入 </van-button>
|
||||
</view>
|
||||
<view style="flex: 1; margin-left: 20rpx;">
|
||||
<van-button size="small" block bind:click="handleClear"> 清除记录 </van-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view style="height: 10rpx;"></view>
|
||||
112
pages/writeReading/components/readingInfo/index.wxss
Normal file
112
pages/writeReading/components/readingInfo/index.wxss
Normal file
@@ -0,0 +1,112 @@
|
||||
/* pages/writeReading/components/readingInfo/index.wxss */
|
||||
|
||||
.wrapper {
|
||||
margin-left: 20rpx;
|
||||
margin-right: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.bodyTitle {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: var(--deep-green);
|
||||
padding: 32rpx 20rpx;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
box-sizing: border-box;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bodyTitle .text {
|
||||
font-size: 40rpx;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.bodyTitle .time {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.contentWrapper {
|
||||
padding: 0 20rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.currentMeter {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.currentMeter .address {
|
||||
color: var(--deep-green);
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.change {
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.readingNumber {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.readingNumber .title {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.readingNumber .number {
|
||||
font-size: 42rpx;
|
||||
font-weight: 800;
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
.readingNumber .lastTime {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.nextReadingNumber {
|
||||
display: flex;
|
||||
align-items: bottom;
|
||||
}
|
||||
|
||||
.nextReadingNumber .title {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.nextReadingNumber .number {
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.currentNumber {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.calc {
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.rightNumber {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
margin-top: 12rpx;
|
||||
color: #73d13d;
|
||||
}
|
||||
|
||||
.wrongNumber {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
margin-top: 12rpx;
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
.operate {
|
||||
margin-top: 24rpx;
|
||||
display: flex;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
109
pages/writeReading/index.js
Normal file
109
pages/writeReading/index.js
Normal file
@@ -0,0 +1,109 @@
|
||||
// pages/writeReading/index.js
|
||||
import { getMeterReadingRouteDetail } from "../../service/workBench"
|
||||
import request from "../../utils/request"
|
||||
import { alertSuccess, alertInfo, alertError } from "../../utils/index"
|
||||
const { OK } = request
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
meterList: [],
|
||||
meterInfo: {},
|
||||
active: 0,
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
const { id } = options;
|
||||
this.getMeterList(id)
|
||||
},
|
||||
async getMeterList(id) {
|
||||
const { code, message, data } = await getMeterReadingRouteDetail(id);
|
||||
if (code !== OK) {
|
||||
alertError(message)
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
meterList: data?.meterRouteDetail || [],
|
||||
meterInfo: data?.meterRouteDetail?.[0] || {}
|
||||
})
|
||||
},
|
||||
changeMeter(e) {
|
||||
this.setData({
|
||||
meterInfo: e.detail.meter,
|
||||
})
|
||||
},
|
||||
changeMeterAndIndex(e) {
|
||||
this.setData({
|
||||
meterInfo: e.detail.meter,
|
||||
active: e.detail.index,
|
||||
})
|
||||
},
|
||||
handleNext() {
|
||||
const { active = 0, meterList } = this.data;
|
||||
let newIndex = active + 1
|
||||
if (active > meterList?.length - 1) {
|
||||
newIndex = meterList?.length - 1
|
||||
}
|
||||
this.setData({
|
||||
active: newIndex
|
||||
})
|
||||
},
|
||||
handlePrev() {
|
||||
this.setData({
|
||||
active: this.data.active === 0 ? 0 : this.data.active - 1
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
},
|
||||
})
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user