Compare commits

...

34 Commits

Author SHA1 Message Date
af749eb638 提交本地接口地址 2025-09-10 14:03:25 +08:00
3340f1f3af 提交用电查询选择电表的问题 2025-09-10 11:26:20 +08:00
3e640c3633 修改部分内容 2025-09-02 17:16:59 +08:00
a8312b89d5 Merge branch 'dev' of https://git.archgrid.xyz/zly/electricity_bill_calc_wx into dev 2025-07-30 11:06:57 +08:00
f0dee5bc77 修改登录提示语 2025-07-30 11:05:45 +08:00
7bc344e90b 修改抄表记录详情中sn取值错误 2025-07-28 10:35:49 +08:00
5f56f9a6a8 b 2025-07-23 17:40:38 +08:00
886a03cf16 工作台 -> 充值审核 -> 已审核列表标签字体缩小 2025-07-22 08:58:30 +08:00
fccaee5f2b C端小程序显示优化 工作台部分 2025-07-21 14:10:05 +08:00
33d7528990 C端小程序显示优化 2025-07-21 09:50:46 +08:00
f9aedf7d79 二、C端小程序电费扣款记录 2025-07-17 15:33:22 +08:00
ac0a4b02c7 提交工作台和首页的更改 2025-07-16 17:33:15 +08:00
7bd4da3c84 修改抄表记录峰谷不显示的问题 2025-06-17 17:30:51 +08:00
a36faa9bcb 支持微信公众号跳转账单 2025-06-11 08:59:40 +08:00
7772b3de1a 开票的时候,点击开票先跳转到开票列表,从接口成功后跳转改成直接跳转,由后端控制状态显示,防止特殊情况下存在接口无返回导致页面卡死的问题后用户重复点击导致多开发票的问题,以及pdf右上角默认展示菜单 2025-06-06 17:08:06 +08:00
10a0fd7c19 修改电量查询的账务余额 2025-05-14 13:11:43 +08:00
d27fa31ac7 处理无响应请求 2025-05-14 09:57:14 +08:00
a3c4e78c22 电量查询支持峰谷 2025-05-13 09:15:51 +08:00
5c202e99a6 抄表记录支持尖峰平谷 2025-05-13 08:39:41 +08:00
e637bbf8a8 用电查询支持尖峰平谷 2025-05-12 17:31:24 +08:00
4d665588ac 修改用电查询 2025-05-12 14:04:17 +08:00
028d695deb 修改描述 2025-04-27 17:39:33 +08:00
3e9857bdcd 账单支持峰谷 2025-04-27 08:59:56 +08:00
34995ef9a3 账单支持峰谷表字 2025-04-23 17:25:17 +08:00
fb9e727efd 修改工作台开户建筑必填和优化报错信息,账单支持峰谷 2025-04-22 18:00:12 +08:00
721937fa5b 修改了开户的时候无法关掉选择的问题,电量图表的错位问题 2025-03-31 16:48:06 +08:00
32b7dbc38c 修改开户缓存问题和修改编辑商户信息后商户信息不变化的问题 2025-03-12 08:47:59 +08:00
1b69035ed2 修改转换管理员接口 2025-03-04 17:32:41 +08:00
fc5ef4b931 修改开户报错 2025-03-04 17:03:39 +08:00
8478e324d8 修改样式 2025-03-03 16:56:50 +08:00
d58436ef5f 修改样式 2025-03-03 16:54:40 +08:00
5fbd34d9f8 完成样式改动和设置为管理员 2025-02-28 10:33:20 +08:00
edcaa7701c 暂存样式修改 2025-02-27 17:37:12 +08:00
902b4726c6 调整样式 2025-02-26 13:41:44 +08:00
88 changed files with 2447 additions and 871 deletions

View File

@@ -32,7 +32,9 @@
"pages/discountCoupon/index", "pages/discountCoupon/index",
"pages/integralRecord/index", "pages/integralRecord/index",
"pages/meterList/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": [ "subPackages": [
{ {

BIN
assets/images/stop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
assets/images/tihuan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 KiB

View File

@@ -1,9 +1,12 @@
import { getReportDetail } from "../../../service/report"; 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 request from '../../../utils/request'
import * as echarts from '../../components/echarts/echarts'; import * as echarts from '../../components/echarts/echarts';
import { getRoundNumber } from "../../../utils/index"
const { OK } = request const { OK } = request
// pages/billDetail/index.js // pages/billDetail/index.js
Page({ Page({
@@ -15,31 +18,35 @@ Page({
time: "", time: "",
detail: {}, detail: {},
meters: [], meters: [],
header1: [ // header1: [
{ key: 'address', title: '电表地址' }, // { key: 'address', title: '电表地址' },
{ title: '起码',renderBody: (item) => { return item?.startNumber } }, // { title: '起码',renderBody: (item) => { return item?.startNumber } },
{ title: '止码',renderBody: (item) => { return item?.endNumber } }, // { title: '止码',renderBody: (item) => { return item?.endNumber } },
{ title: '倍率',renderBody: (item) => { return item?.displayRatio } }, // { title: '倍率',renderBody: (item) => { return item?.displayRatio } },
], // ],
header2: [ // header2: [
{ title: '用电量', renderBody: (item) => item?.overall?.amount }, // { title: '用电量', renderBody: (item) => item?.overall?.amount },
{ title: '线损电量',renderBody: (item) => item?.loss?.amount }, // { title: '线损电量',renderBody: (item) => item?.loss?.amount },
{ title: '公摊电量',renderBody: (item) => item?.publicAmount }, // { title: '公摊电量',renderBody: (item) => item?.publicAmount },
{ title: '合计电量',renderBody: (item) => { // { title: '合计电量',renderBody: (item) => {
} }, // } },
] // ]
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
const { id, time } = options; const { id, time, tenement } = options;
this.init(id, time); const that = this;
loadingFunc(async () => {
await that.init(id, time, tenement);
})
}, },
async init(id, time) { async init(id, time, tenement) {
const { code, message, detail, amount } = await getReportDetail(id) console.log("time:", tenement)
const { code, message, detail, amount } = await getReportDetail(id, tenement)
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return; return;
@@ -50,45 +57,92 @@ Page({
detail, detail,
amount: amount, amount: amount,
meters: detail?.meters?.map(item => { meters: detail?.meters?.map(item => {
const finalAmount = Number(item?.overall?.amount || 0) + Number(item?.loss?.amount || 0) + Number(item?.publicAmount || 0) if (item?.loss?.amount) {
item.finalAmount = Number(finalAmount).toFixed(2) 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; return item;
}) })
}) })
const option = { if (detail?.park?.meter04kvType === 0) {
tooltip: { const option = {
trigger: 'item' tooltip: {
}, trigger: 'item'
legend: { },
top: 10, legend: {
left: 'center' top: 10,
}, left: 'center'
label: { },
alignTo: 'edge', label: {
formatter: '{name|{b}}\n{value|{c} }', alignTo: 'edge',
minMargin: 5, formatter: '{name|{b}}\n{value|{c} }',
edgeDistance: 10, minMargin: 5,
lineHeight: 15, edgeDistance: 10,
rich: { lineHeight: 15,
time: { rich: {
fontSize: 10, time: {
color: '#999' fontSize: 10,
color: '#999'
}
} }
} },
}, series: [
series: [ {
{ type: 'pie',
type: 'pie', radius: '50%',
radius: '50%', data: [
data: [ { value: detail.comprehensive.lossAmount, name: '线损电量', itemStyle: { color: 'rgb(104,187,196)' } },
{ value: detail.comprehensive.lossAmount, name: '本期线损电量', itemStyle: { color: 'rgb(104,187,196)' } }, { value: detail.comprehensive.consumption, name: '电度电量', itemStyle: { color: 'rgb(80,135,236)' } },
{ value: detail.comprehensive.consumption, name: '本期用电量', itemStyle: { color: 'rgb(80,135,236)' } },
],
], }
} ]
] };
}; this.init_pieCharts(option);
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; const that = this;
wx.getSystemInfo({ wx.getSystemInfo({
success: function (res) { success: function (res) {
@@ -115,6 +169,13 @@ Page({
return pieChart; return pieChart;
}); });
}, },
jumpToDetail(e) {
const { meter } = e.currentTarget.dataset;
console.log("meter", meter)
wx.navigateTo({
url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter),
})
},
download() { download() {
const { id: tenement } = wx.getStorageSync('tenement') const { id: tenement } = wx.getStorageSync('tenement')
const { id } = this.data; const { id } = this.data;

View File

@@ -1,7 +1,7 @@
<!--pages/billDetail/index.wxml--> <!--pages/billDetail/index.wxml-->
<navigator title="{{ time }}电费账单" canBack="{{true}}" /> <navigator title="{{ time }}电费账单" canBack="{{true}}" />
<view class="title" style="top: {{statusBarHeight + 46}}px"> <view class="title" style="top: {{statusBarHeight + 46}}px">
<avatar text="{{detail.tenement.shortName}}" /> <avatar text="{{detail.tenement.shortName}}" />
<view class="titleContent"> <view class="titleContent">
<view class="park"> <view class="park">
<view class="label"> <view class="label">
@@ -11,7 +11,7 @@
</view> </view>
<view class="address"> <view class="address">
<view class="label"> <view class="label">
用电地址: 商户地址:
</view> </view>
<view class="value"> {{ detail.tenement.address }} </view> <view class="value"> {{ detail.tenement.address }} </view>
</view> </view>
@@ -19,20 +19,20 @@
<view class="label"> <view class="label">
账单周期: 账单周期:
</view> </view>
<view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view> <view class="value"> {{ detail.comprehensive.startDate }} 至 {{ detail.comprehensive.endDate }} </view>
</view> </view>
</view> </view>
<van-button type="info" size="small" class="download" bind:click="download">下载</van-button> <van-button type="info" size="small" class="download" bind:click="download">下载</van-button>
</view> </view>
<view class="wrapper"> <view class="wrapper" wx:if="{{detail.park.meter04kvType !== 1}}">
<view class="line"></view> <view class="line"></view>
<view class="contentTitle"> 本期账单 </view> <view class="contentTitle"> 本期账单 </view>
<van-row gutter="10"> <van-row gutter="10">
<van-col span="8"> <van-col span="8">
<view class="colContent"> <view class="colContent">
<view class="colContentTitle">本期用电量</view> <view class="colContentTitle">本期用电量</view>
<view class="colContentValue"> {{ amount }} 千瓦时 </view> <view class="colContentValue" wx:if="{{detail.park.meter04kvType === 0}}"> {{ amount }} 千瓦时 </view>
</view> </view>
</van-col> </van-col>
<van-col span="8"> <van-col span="8">
@@ -50,17 +50,10 @@
</van-row> </van-row>
<view class="line"></view> <view class="line"></view>
<view class="contentTitle"> 电费构成 </view> <view class="contentTitle"> 电费构成 </view>
<echarts <echarts style="width:200rpx;height:180rpx;" id="echarts" class='mychart-bar' canvas-id="mychart-bar" ec="{{ ec }}" forceUseOldCanvas="{{false}}">
style="width:200rpx;height:180rpx;"
id="echarts"
class='mychart-bar'
canvas-id="mychart-bar"
ec="{{ ec }}"
forceUseOldCanvas="{{false}}"
>
</echarts> </echarts>
<view class="tooltip"> <view class="tooltip">
本月电量+本月线损电量)*电单价+摊薄公摊电费+摊薄调整电费 电度电量+线损电量)*电单价+摊薄公摊电费+摊薄调整电费
</view> </view>
<view class="line"></view> <view class="line"></view>
<view class="contentTitle"> 电量明细 </view> <view class="contentTitle"> 电量明细 </view>
@@ -86,7 +79,7 @@
</van-row> </van-row>
<van-row> <van-row>
<van-col span="6"> <van-col span="6">
<view class="tableTitle"> 电量 </view> <view class="tableTitle"> 电度电量 </view>
<view class="tableContent"> {{item.overall.amount}} </view> <view class="tableContent"> {{item.overall.amount}} </view>
</van-col> </van-col>
@@ -106,4 +99,97 @@
</view> </view>
</view> </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> <view style="height: 20rpx;"></view>

View File

@@ -59,12 +59,25 @@ page {
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
} }
.colContentTitle2 {
padding: 30rpx 0;
text-align: center;
font-weight: 500;
}
.colContentValue { .colContentValue {
padding-bottom: 30rpx; padding-bottom: 30rpx;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
} }
.colContentValue2 {
padding-bottom: 20rpx;
padding-left: 40rpx;
overflow: hidden;
}
.tooltip { .tooltip {
font-size: 30rpx; font-size: 30rpx;
color: rgb(136, 132, 132); color: rgb(136, 132, 132);
@@ -87,10 +100,37 @@ page {
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
flex: 1; flex: 1;
word-break: break-all;
} }
.download { .download {
position: absolute; position: absolute;
top: 20rpx; top: 20rpx;
right: 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;
} }

View File

@@ -1,24 +1,23 @@
// pages/electricQuery/components/accountingCard/index.js // pages/electricQuery/components/accountingCard/index.js
Component({ Component({
/**
* 组件的属性列表
*/
properties: {
data: Object
},
/** /**
* 组件的属性列表 * 组件的初始数据
*/ */
properties: { data: {
data: Object
},
/** },
* 组件的初始数据
*/
data: {
}, /**
* 组件的方法列表
*/
methods: {
/** }
* 组件的方法列表
*/
methods: {
}
}) })

View File

@@ -1,33 +1,86 @@
<!--pages/electricQuery/components/accountingCard/index.wxml--> <!--pages/electricQuery/components/accountingCard/index.wxml-->
<view class="wrapper"> <view class="wrapper">
<view class="title"> <view class="title">
{{data.meter.address}} <span>{{data.meter.address}}</span>
</view> <span style="font-size: 30rpx; margin-left: 100rpx;">电表编号:{{data.meter.sn}}</span>
<van-row> </view>
<van-col span="6"> <van-row>
<view class="tableTitle"> 初始余额 </view> <view class="table-header" style="border-bottom: 2rpx solid #000; ">
</van-col> <view class="table-header-row">
<van-col span="7"> <text class="table-header-cell">类目</text>
<view class="tableTitle"> 储值累计金额 </view> <text class="table-header-cell">金额</text>
</van-col> <text class="table-header-cell">更新时间</text>
<van-col span="5"> </view>
<view class="tableTitle"> 电费 </view> </view>
</van-col> </van-row>
<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 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> </view>

View File

@@ -17,8 +17,25 @@
} }
.tableContent { .tableContent {
margin-top: 10rpx; margin-top: 25rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: center; text-align: center;
font-size: 32rpx; 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;
}

View File

@@ -2,6 +2,7 @@
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../../../service/accounting"; import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../../../service/accounting";
import { getTenementMeterList } from "../../../../../service/meter"; import { getTenementMeterList } from "../../../../../service/meter";
import dayjs from "../../../../../utils/dayjs"; import dayjs from "../../../../../utils/dayjs";
import { getParkInfoByTime } from "../../../../../service/park";
import request from '../../../../../utils/request'; import request from '../../../../../utils/request';
import { alertInfo, getPixelRatio, loadingFunc } from "../../../../../utils/index"; import { alertInfo, getPixelRatio, loadingFunc } from "../../../../../utils/index";
const { OK } = request; const { OK } = request;
@@ -12,12 +13,16 @@ Component({
*/ */
properties: { properties: {
meter: String, meter: String,
parkInfo: Object,
}, },
observers: { observers: {
'meter': function() { 'meter': function() {
loadingFunc(async () => { loadingFunc(async () => {
await this.getReadingList(); await this.getReadingList();
}) })
},
"parkInfo": function(newValue) {
this.setData({ park: newValue })
} }
}, },
/** /**
@@ -26,10 +31,11 @@ Component({
data: { data: {
readingDetailShow: false, readingDetailShow: false,
readingDetail: {}, readingDetail: {},
park: {},
meterReadingHeader: [ meterReadingHeader: [
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
{ title: '倍率', key: 'ratio' }, { title: '倍率', key: 'ratio' },
{ key: 'number', title: '抄表记录' }, { key: 'number', title: '当前表字' },
], ],
meterReadingList: [], meterReadingList: [],
yearMonthDayReading: dayjs().format("YYYY-MM-DD"), yearMonthDayReading: dayjs().format("YYYY-MM-DD"),
@@ -75,10 +81,32 @@ Component({
readingPage: 1, readingPage: 1,
}, () => { }, () => {
loadingFunc(async () => { loadingFunc(async () => {
console.log("----------")
await this.getParkInfo(time)
console.log("===========")
await this.getReadingList(); await this.getReadingList();
}) })
}) })
},
async getParkInfo(time) {
const park = wx.getStorageSync('park');
const { park:parkInfo, code, message } = await getParkInfoByTime(park?.id, `${time}`, `${0}`,)
if (code !== OK) {
alertInfo(message)
return;
}
const that = this;
return new Promise((resolve) => {
that.setData({
parkInfo: parkInfo
}, () => {
resolve()
})
})
}, },
showDetail(e) { showDetail(e) {
const { index, data = {} } = e.detail; const { index, data = {} } = e.detail;

View File

@@ -49,24 +49,102 @@
label="地址" label="地址"
readonly readonly
/> />
<van-field
value="{{ readingDetail.meter.sn }}SN"
border="{{ false }}"
label="编号"
readonly
/>
<van-field <van-field
value="{{ readingDetail.readAt }}" value="{{ readingDetail.readAt }}"
border="{{ false }}" border="{{ false }}"
label="时间" label="时间"
readonly readonly
/> />
<van-field <van-field
value="{{ readingDetail.ratio }}" value="{{ readingDetail.ratio }}"
border="{{ false }}" border="{{ false }}"
label="倍率" label="倍率"
readonly readonly
/> />
<van-field <van-field
value="{{ readingDetail.number }}" value="{{ readingDetail.number }}"
border="{{ false }}" border="{{ false }}"
label="表字" label="当前表字(总)"
readonly 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> </van-cell-group>
</view> </view>
</van-dialog> </van-dialog>

View File

@@ -92,4 +92,11 @@ page {
content:""; content:"";
display:block; display:block;
clear:both clear:both
}
.text{
font-size: 28rpx;
color: #999999;
margin: 10rpx 0;
text-align: center;
} }

View File

@@ -1,6 +1,7 @@
// pages/electricQuery/index.js // pages/electricQuery/index.js
import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting"; import { exportElectricityList, getAccountingList, getElectricityList, getMeterReadingList } from "../../../service/accounting";
import { getTenementMeterList } from "../../../service/meter"; import { getTenementMeterList } from "../../../service/meter";
import { getParkInfoByTime } from "../../../service/park";
import dayjs from "../../../utils/dayjs"; import dayjs from "../../../utils/dayjs";
import request from '../../../utils/request'; import request from '../../../utils/request';
import * as echarts from '../../components/echarts/echarts'; import * as echarts from '../../components/echarts/echarts';
@@ -29,14 +30,20 @@ Page({
header: [ header: [
{ key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address }, // { key: 'address', title: '电表地址', renderBody: (item) => item.meter?.address },
{ title: '时间',renderBody: (item) => { return item.time } }, { title: '时间',renderBody: (item) => { return item.time } },
{ key: 'number', title: '耗量' }, { 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: [], list: [],
visible: false, visible: false,
accountingList: [], accountingList: [],
electricNumber: 0, electricNumber: 0,
meterNumber: 0, meterNumber: 0,
@@ -76,7 +83,7 @@ Page({
}, },
changeTimeType(e) { changeTimeType(e) {
const { type } = e.currentTarget.dataset const { type } = e.currentTarget.dataset;
const that = this; const that = this;
this.setData({ timeType: type }, () => { this.setData({ timeType: type }, () => {
loadingFunc(async () => { loadingFunc(async () => {
@@ -90,11 +97,13 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
loadingFunc(async () => { loadingFunc(async () => {
await this.getMeters()
await this.getParkInfo()
await this.init() await this.init()
}) })
}, },
async 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; let time;
switch(timeType) { switch(timeType) {
case 1: case 1:
@@ -129,12 +138,18 @@ Page({
devicePixelRatio: getPixelRatio(), devicePixelRatio: getPixelRatio(),
}); });
const ids = [...new Set(data?.map(item => item?.meter?.id))] const ids = [...new Set(data?.map(item => item?.meter?.id))]
const point = data?.[0]?.time?.slice(-1)
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(3, "0"));
console.log(times)
const options = { const options = {
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
}, },
legend: { legend: {
data: data?.map(item => item?.meter?.address), data: data?.map(item => item?.meter?.address),
}, },
grid: { grid: {
left: '3%', left: '3%',
@@ -145,18 +160,25 @@ Page({
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
data: [...new Set(data?.map(item => item.time))] data: times
}, },
yAxis: { yAxis: {
type: 'value' type: 'value'
}, },
series: ids?.map(item => { series: ids?.map(item => {
const element = data?.find(i => i?.meter?.id === item) const element = data?.find(i => i?.meter?.id === item)
const list = data?.filter(ele => ele?.meter?.id === item)
const newList = [...times].map(item => {
const exist = list.find(ele => ele.time === item)
if (exist) {
return Number(exist.critical)+ Number(exist.peak)+Number(exist.flat)+Number(exist.valley);
}
return null
})
return { return {
name: element?.meter?.address, name: element?.meter?.address,
type: 'line', type: 'line',
stack: 'Total', data: newList
data: data?.filter(ele => ele?.meter?.id === item).map(item => item.number)
}}) }})
}; };
@@ -189,6 +211,7 @@ Page({
wx.openDocument({ wx.openDocument({
filePath: data.tempFilePath, filePath: data.tempFilePath,
fileType: ['xlsx'], fileType: ['xlsx'],
showMenu: true,
success() { success() {
}, },
fail(err) { fail(err) {
@@ -222,15 +245,44 @@ Page({
alertInfo(message) alertInfo(message)
return; return;
} }
const first = data?.[0]
this.setData({ this.setData({
meterList: data || [], 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() { clickMeter() {
this.setData({ this.setData({
type: "meter", 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, show: true,
title: "表计" title: "表计"
}) })
@@ -244,11 +296,14 @@ Page({
}) })
}, },
onOk(e) { onOk(e) {
const { id, code } = e.detail.value; const { id, code, address } = e.detail.value;
console.log('e', e)
console.log("id, code, address", id, code, address)
this.setData({ this.setData({
// year: currentYear, // year: currentYear,
meterId: id, meterId: id,
meterCode: code, meterCode: code,
meterAddress: address,
type: "", type: "",
show: false, show: false,
title: "" title: ""
@@ -287,6 +342,7 @@ Page({
case "year": case "year":
this.setData({ year: time, visible: false, }, () => { this.setData({ year: time, visible: false, }, () => {
loadingFunc(async () => { loadingFunc(async () => {
await this.getParkInfo()
await this.init(); await this.init();
}) })
}); });
@@ -295,6 +351,7 @@ Page({
const [year, month] = time.split("-") const [year, month] = time.split("-")
this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => { this.setData({ yearMonth: time, yearMonthStamp: new Date(Number(year), Number(month) - 1, 1).getTime(), visible: false }, () => {
loadingFunc(async () => { loadingFunc(async () => {
await this.getParkInfo()
await this.init(); await this.init();
}) })
}); });
@@ -307,13 +364,16 @@ Page({
page: 1, page: 1,
}, () => { }, () => {
loadingFunc(async () => { loadingFunc(async () => {
await this.getParkInfo()
await this.init(); await this.init();
}) })
}) })
break; break;
} }
}, },
readingChangeTime(e) {
console.log('e', e.detail)
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@@ -325,9 +385,39 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { 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()
})
})
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

View File

@@ -7,7 +7,7 @@
</view> </view>
<view class="select" bind:tap="clickMeter"> <view class="select" bind:tap="clickMeter">
<view class="selectContent"> <view class="selectContent">
{{ meterCode === "" ? '全部' : meterCode }} {{ meterAddress === "" ? '-' : meterAddress }}
</view> </view>
<van-icon name="arrow-down" /> <van-icon name="arrow-down" />
</view> </view>
@@ -30,23 +30,25 @@
<view class="timeQuery" wx:if="{{queryType === 0}}"> <view class="timeQuery" wx:if="{{queryType === 0}}">
<van-row> <van-row>
<van-col span="8"> <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>
<van-col span="8"> <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>
<van-col span="8"> <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-col>
</van-row> </van-row>
</view> </view>
</view> </view>
<view wx:if="{{queryType === 0}}"> <view wx:if="{{queryType === 0}}">
<view class="tooltip"> <view class="tooltip">
不包括线损电量,显示为电表实际消电量。仅供参考,实际能电量以电费账单为主。如有疑问,请联系客服。 不包括线损电量,显示为电表实际消电量。仅供参考,实际能电量以电费账单为主。如有疑问,请联系客服。
</view> </view>
<view class="timeChooseWrapper"> <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="time" bind:tap="clickTime">
<view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view> <view class="timeText" wx:if="{{timeType === 0}}"> {{yearMonthDay}} </view>
<view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view> <view class="timeText" wx:elif="{{timeType === 1}}"> {{yearMonth}} </view>
@@ -63,7 +65,10 @@
</view> </view>
<view wx:elif="{{queryType === 2}}"> <view wx:elif="{{queryType === 2}}">
<view class="tooltip"> <view class="tooltip">
账务余额更新时间为:每次预存电费后,每次账单发布后,剩余的实际金额。电表余额与账务余额相差较大的用户,每半年统一处理一次。 账务余额更新时间为:每次预存电费后,每次发布账单后剩余的实际金额。
</view>
<view class="tooltip">
计算公式:账务余额 = 初始余额 + 累充充值金额 - 电费
</view> </view>
</view> </view>
@@ -81,14 +86,25 @@
</view> </view>
<empty bind:refresh="init" wx:else /> --> <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>
<view class="sum"> <view class="sum">
合计:表计数量:{{meterNumber}}电量:{{electricNumber}} 合计:表计数量:{{meterNumber}}电量:{{electricNumber}}
</view> </view>
</view> </view>
<view wx:if="{{queryType === 1}}"> <view wx:if="{{queryType === 1}}">
<reading meter="{{meterId}}" /> <reading meter="{{meterId}}" parkInfo="{{parkInfo}}" bind:changeTime="readingChangeTime" />
</view> </view>
<view wx:if="{{queryType === 2}}"> <view wx:if="{{queryType === 2}}">
<view style="margin: 30rpx;"> <view style="margin: 30rpx;">

View 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() {
console.log("attached", this.data.show)
}
},
/**
* 组件的方法列表
*/
methods: {
onCancel() {
this.triggerEvent("cancel")
},
onConfirm(e) {
this.triggerEvent("confirm", { time: dayjs(e.detail).format("YYYY-MM-DD HH:mm:ss") })
}
}
})

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
}

View 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>

View File

@@ -0,0 +1 @@
/* components/datePicker/index.wxss */

View File

@@ -0,0 +1,48 @@
// components/searchSelectWrapper/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
label: String,
placeholder: String,
text: String,
fieldType: {
type: String,
value: "text"
},
type: {
type: String,
value: "select"
}
},
/**
* 组件的初始数据
*/
data: {
keyword: "",
text: "",
},
/**
* 组件的方法列表
*/
methods: {
onSearch() {
this.triggerEvent("search")
},
onChangeKeyword(e) {
this.setData({ keyword: e.detail });
},
onChangeText(e) {
this.setData({ text: e.detail });
this.triggerEvent("changeText", e.detail)
},
onSearchKeyword() {
this.triggerEvent("searchKeyword", this.data.keyword)
this.setData({ keyword: "" })
}
}
})

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"van-button": "@vant/weapp/button/index",
"van-field": "@vant/weapp/field/index"
}
}

View File

@@ -0,0 +1,35 @@
<!--components/searchSelectWrapper/index.wxml-->
<view class="wrapper" wx:if="{{type === 'select'}}">
<view class="label"> {{ label }} </view>
<view class="content" bind:tap="clickTime" bind:tap="onSearch">
<view class="text" wx:if="{{!text}}" style="color: #ccc;"> {{placeholder}} </view>
<view class="text" wx:else> {{text}} </view>
<van-icon name="arrow-down" />
</view>
</view>
<view class="wrapper" wx:if="{{type === 'inputSearch'}}">
<view class="label"> {{ label }} </view>
<view class="inputContent" bind:tap="clickTime">
<van-field
value="{{ value }}"
placeholder="{{placeholder}}"
border="{{ false }}"
bind:change="onChangeKeyword"
custom-style="padding: 0;font-size: 30rpx;line-height: 32rpx;"
/>
</view>
<van-button type="info" size="small" bind:click="onSearchKeyword"> 搜索 </van-button>
</view>
<view class="wrapper" wx:if="{{type === 'input'}}">
<view class="label"> {{ label }} </view>
<view class="inputContent" bind:tap="clickTime">
<van-field
value="{{ value }}"
placeholder="{{placeholder}}"
border="{{ false }}"
type="fieldType"
bind:change="onChangeText"
custom-style="padding: 0;font-size: 30rpx;line-height: 32rpx;"
/>
</view>
</view>

View File

@@ -0,0 +1,37 @@
/* components/searchSelectWrapper/index.wxss */
.wrapper {
display: flex;
align-items: center;
font-size: 30rpx;
padding: 20rpx;
}
.content {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 10rpx 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.inputContent {
flex: 1;
margin-left: 30rpx;
margin-right: 30rpx;
display: flex;
padding: 0 20rpx;
border-radius: 12rpx;
border: 1rpx solid #ccc;
background-color: #fff;
}
.text {
flex: 1;
}
.label {
width: 120rpx;
}

View File

@@ -23,6 +23,7 @@ Component({
year: String, year: String,
month: Number, month: Number,
day: Number, day: Number,
currentDate: Number,
}, },
/** /**
* 组件的初始数据 * 组件的初始数据

View File

@@ -1,5 +1,5 @@
import { getBillList } from "../../service/accounting" import { getBillList } from "../../service/accounting"
import { alertInfo } from "../../utils/index"; import { alertInfo, loadingFunc } from "../../utils/index";
import request from '../../utils/request' import request from '../../utils/request'
const { OK } = request; const { OK } = request;
@@ -17,11 +17,19 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.init(); const that = this;
loadingFunc(async () => {
await that.init();
})
}, },
async init() { async init() {
const { page, list } = this.data; const { page, list } = this.data;
const { code, data, message } = await getBillList(page) const { code, data, message } = await getBillList(page)
if (code !== OK) {
alertInfo(message)
return;
}
if (!data?.length) { if (!data?.length) {
alertInfo("没有更多了") alertInfo("没有更多了")
return; return;
@@ -33,8 +41,9 @@ Page({
}, },
jumpToDetail(e) { jumpToDetail(e) {
const { id: report } = e.currentTarget.dataset const { id: report } = e.currentTarget.dataset
const tenement = wx.getStorageSync('tenement')?.id || ""
wx.navigateTo({ wx.navigateTo({
url: '/childPackage/pages/billDetail/index?id=' + report, url: `/childPackage/pages/billDetail/index?id=${report}&tenement=${tenement}`,
}) })
}, },
}) })

View 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() {
}
})

View 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"
}

View 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>

View 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;
}

View File

@@ -115,6 +115,12 @@ Page({
show: false, show: false,
}) })
}, },
jumpToMeterBalanceRecord(e) {
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/pages/meterBalanceRecord/index?id=${id}`,
})
},
changeMoney(e) { changeMoney(e) {
const { money } = e.currentTarget.dataset; const { money } = e.currentTarget.dataset;
this.setData({ this.setData({

View File

@@ -21,7 +21,7 @@
</view> </view>
<view class="login" wx:if="{{!user || !user.id}}" class="notLoginWrapper"> <view class="login" wx:if="{{!user || !user.id}}" class="notLoginWrapper">
<van-image width="80rpx" height="80rpx" src="/assets/images/defaultAvatar.png" class="defaultAvatar"/> <van-image width="80rpx" height="80rpx" src="/assets/images/defaultAvatar.png" class="defaultAvatar"/>
<van-button type="info" size="small" plain="{{true}}" class="loginBtn" bind:tap="jumpToLogin">请登录</van-button> <van-button type="primary" size="small" plain="{{true}}" class="loginBtn" bind:tap="jumpToLogin">请登录</van-button>
</view> </view>
<view class="logined" wx:else> <view class="logined" wx:else>
<avatar text="{{ user.nickName }}" /> <avatar text="{{ user.nickName }}" />
@@ -60,7 +60,12 @@
<view class="cardItem"> <view class="cardItem">
<view class="cardItemLabel"> 电表余额: </view> <view class="cardItemLabel"> 电表余额: </view>
<view class="cardItemValue" style="position: relative;"> <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> <view class="text" wx:else> --- </view>
<!-- bind:click="refreshMeter" --> <!-- bind:click="refreshMeter" -->
<van-button <van-button

View File

@@ -1,6 +1,10 @@
/* pages/home/index.wxss */ /* pages/home/index.wxss */
@import "/app.wxss"; @import "/app.wxss";
.balanceText {
color: var(--primary-color)
}
.top { .top {
background-color: var(--deep-green); background-color: var(--deep-green);
position: fixed; position: fixed;

View File

@@ -80,13 +80,32 @@ Page({
} }
wx.openDocument({ wx.openDocument({
filePath: res.tempFilePath, filePath: res.tempFilePath,
showMenu: true,
// fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了 // fileType: sheetRes.tapIndex === 0 ? 'xml' : "pdf", // 3. 这个必须写合法类型,不然下载不了
success: function (res) { success: function (res) {
}, },
fail: function (e) { fail: function (e) {
alertError("打开失败") // alertError("打开失败")
console.log('打开失败错误为', e) // console.log('打开失败错误为', e)
wx.showModal({
title: '提示',
content: '打开失败,请复制链接后通过浏览器打开',
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
wx.setClipboardData({
data: data,
success: () => {
alertSuccess("复制成功")
}
})
}
}
})
} }
}) })
} }

View File

@@ -43,6 +43,15 @@ Component({
page: page + 1, page: page + 1,
}) })
}, },
refresh() {
const that = this;
that.setData({
page: 1,
list: []
}, () => {
loadingFunc(() => that.getList())
})
},
onRefresh() { onRefresh() {
loadingFunc(() => this.getList()) loadingFunc(() => this.getList())
}, },

View File

@@ -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"> <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="card" wx:for="{{list}}">
<view class="left"> <view class="left">
<view class="title"> <view class="title">
@@ -28,7 +31,7 @@
</view> </view>
</view> </view>
<view class="{{item.status === 1 ? 'approving' : 'already'}}"> <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 wx:else> 已开票 </view>
</view> </view>
</view> </view>

View File

@@ -14,7 +14,7 @@ Component({
}, },
lifetimes: { lifetimes: {
attached() { 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, }) this.setData({ list: data, selectList: new Array(data?.length).map(() => false), allChecked: false, })
}, },
onRefresh() { onRefresh() {
loadingFunc(() => this.init()) loadingFunc(async () => await this.init())
}, },
onChange(e) { onChange(e) {
const { id, index } = e.currentTarget.dataset; const { id, index } = e.currentTarget.dataset;

View File

@@ -13,7 +13,7 @@
{{ item.tenement.name }} {{ item.tenement.name }}
</view> </view>
<view class="bottom"> <view class="bottom">
{{ item.range[0] }} - {{ item.range[1] }} {{ item.range[0] }} {{ item.range[1] }}
</view> </view>
</view> </view>
<view class="rightMoney"> ¥ {{ item.money }} </view> <view class="rightMoney"> ¥ {{ item.money }} </view>

View File

@@ -82,18 +82,17 @@ Page({
loadingFunc(async() => { loadingFunc(async() => {
const {ids = [], remark } = this.data; const {ids = [], remark } = this.data;
const tenement = wx.getStorageSync('tenement') 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 }) const { code, message, data } = await makeInvoice({ ids, tenement: tenement.id, remark })
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return; return;
} }
alertSuccess("操作成功") alertSuccess("操作成功")
setTimeout(() => {
wx.redirectTo({
url: '/pages/invoiceList/index?tab=1',
})
}, 500)
}) })
}, },
changeShow() { changeShow() {

View File

@@ -54,7 +54,7 @@ Page({
this.noPermission() this.noPermission()
return; return;
} }
alertSuccess("注册成功") alertSuccess("登录成功")
const { token, ...user } = data const { token, ...user } = data
wx.setStorageSync('user', user) wx.setStorageSync('user', user)
wx.setStorageSync('token', data?.token) wx.setStorageSync('token', data?.token)

View 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() {
}
})

View 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"
}

View 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"
/>

View 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);
}

View File

@@ -144,15 +144,27 @@ Page({
}) })
}, },
connect() { connect() {
Dialog.alert({ // Dialog.alert({
title: '提示', // title: '提示',
message: '将进入咨询客服页面', // message: '将进入咨询客服页面',
confirmButtonOpenType: "contact", // "confirm-button-open-type": "contact",
showCancelButton: true, // showCancelButton: true,
}).then(() => { // }).then(() => {
// on close // // on close
}); // });
this.setData({
connectShow: true
})
},
bindConnect() {
this.setData({
connectShow: false
})
},
bindCancelConnect() {
this.setData({
connectShow: false
})
}, },
jumpToFinance() { jumpToFinance() {
wx.navigateTo({ wx.navigateTo({

View File

@@ -69,6 +69,7 @@
/> />
</view> </view>
<view style="border-radius: 16rpx; overflow: hidden;"> <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 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="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"> <van-cell icon="friends-o" wx:if="{{!!user.isAdmin}}" is-link bind:click="jumpToMember">
@@ -88,4 +89,18 @@
</view> </view>
<van-dialog id="van-dialog" /> <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>

View File

@@ -40,3 +40,6 @@
margin-top: 6rpx; margin-top: 6rpx;
} }
.connect {
display: none;
}

View File

@@ -94,6 +94,7 @@ Page({
wx.openDocument({ wx.openDocument({
filePath: res.tempFilePath, filePath: res.tempFilePath,
fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了 fileType: [ "pdf"], // 3. 这个必须写合法类型,不然下载不了
showMenu: true,
success: function (res) { success: function (res) {
resolve() resolve()
}, },

View File

@@ -11,7 +11,7 @@
border="{{ false }}" border="{{ false }}"
/> />
<van-field <van-field
value="{{detail.meter.code}}" value="{{detail.meter.sn}}(SN)"
label="电表编号" label="电表编号"
readonly readonly
autosize="{{true}}" autosize="{{true}}"

View File

@@ -19,7 +19,11 @@ Component({
parentName:String, parentName:String,
parentId:String, parentId:String,
}, },
observers: {
"parentPhone": function (newPhone) {
this.setData({ phone: newPhone })
}
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */

View File

@@ -1,8 +1,8 @@
// pages/workBench/components/account/index.js // pages/workBench/components/account/index.js
import request from "../../../../utils/request" import request from "../../../../utils/request"
import { getTenementBackInfo, } from "../../../../service/tenement" import { getTenementBackInfo, updateUserApp} from "../../../../service/tenement"
import { getBackApproveList, removeUser } from "../../../../service/user" import { getBackApproveList, removeUser } from "../../../../service/user"
import { alertInfo, alertSuccess } from "../../../../utils/index" import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index"
const { OK } = request const { OK } = request
Component({ Component({
@@ -57,7 +57,6 @@ Component({
}) })
break; break;
case "tenement": case "tenement":
console.log('data', data)
this.setData({ this.setData({
tenement: data.id, tenement: data.id,
tenementName: data.name, tenementName: data.name,
@@ -69,6 +68,19 @@ Component({
break; break;
} }
}, },
async setAdmin(e) {
const { id, name } = e.currentTarget.dataset;
const { tenement } = this.data;
await wxModal({ content: `确认要将${name}设置为管理吗?` })
const { code, message } = await updateUserApp({ userId: id, type: 2, tenement: tenement })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("转交成功")
this.initUserList();
this.getTenementInfo();
},
onCancel() { onCancel() {
this.setData({ this.setData({
show: false, show: false,
@@ -103,7 +115,9 @@ Component({
this.handleCancel(); this.handleCancel();
}, },
onUpdatePhoneConfirm() { onUpdatePhoneConfirm() {
this.setData({ parentPhone: "", phone: "", type: "", title: "" })
this.getTenementInfo(); this.getTenementInfo();
this.initUserList()
}, },
async getTenementInfo() { async getTenementInfo() {
const { tenement, park } = this.data; const { tenement, park } = this.data;
@@ -135,18 +149,12 @@ Component({
}) })
}, },
handleChangeMain() { handleChangeMain() {
// const { list = [] } = this.data; const { tenementInfo = {} } = this.data;
// const main = list?.find(item => item.Permissions)
// if (!main) {
// alertInfo("没有主账号")
// return
// }
// console.log("main", main)
this.setData({ this.setData({
updatePhoneVisible: true, updatePhoneVisible: true,
type: "update", type: "update",
title: "编辑管理员", title: "编辑管理员",
// phone: main.WechatPhone, parentPhone: tenementInfo.phone,
// name: main.WechatUserName, // name: main.WechatUserName,
// id: main.WechatUserID, // id: main.WechatUserID,
}) })
@@ -156,6 +164,7 @@ Component({
updatePhoneVisible: false, updatePhoneVisible: false,
type: "", type: "",
phone: "", phone: "",
parentPhone: "",
name: "", name: "",
id: "", id: "",
}) })

View File

@@ -12,6 +12,10 @@
"van-radio-group": "@vant/weapp/radio-group/index", "van-radio-group": "@vant/weapp/radio-group/index",
"van-tag": "@vant/weapp/tag/index", "van-tag": "@vant/weapp/tag/index",
"edit-modal": "./components/editModal/index", "edit-modal": "./components/editModal/index",
"updatePhoneModal": "./components/updatePhoneModal/index" "updatePhoneModal": "./components/updatePhoneModal/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index",
"van-image": "@vant/weapp/image/index"
} }
} }

View File

@@ -1,88 +1,115 @@
<!--pages/workBench/components/account/index.wxml--> <!--pages/workBench/components/account/index.wxml-->
<view> <view>
<van-field <searchSelectWrapper
required
value="{{ parkName }}"
label="园区" label="园区"
placeholder="请选择园区" placeholder="请选择园区"
border="{{ true }}" text="{{ parkName }}"
readonly bind:search="onParkFocus"
use-button-slot />
> <searchSelectWrapper
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field
required
value="{{ tenementName }}"
label="商户" label="商户"
placeholder="请选择商户" placeholder="请选择商户"
border="{{ true }}" text="{{ tenementName }}"
readonly bind:search="onTenementFocus"
use-button-slot />
>
<van-button slot="button" size="small" type="info" bind:click="onTenementFocus">
选择
</van-button>
</van-field>
</view> </view>
<van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" /> <van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" />
<view wx:else> <view wx:else>
<van-field
value="{{tenementInfo.fullName}}"
label="商户名称"
readonly
title-width="140rpx"
/>
<van-field
value="{{tenementInfo.shortName}}"
label="商户简称"
readonly
title-width="140rpx"
/>
<van-field
value="{{tenementInfo.phone}}"
label="预留电话"
readonly
title-width="140rpx"
/>
<view class="operateBox"> <view class="operateBox">
<van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleAddSon"> 添加子账号 </van-button> <van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleAddSon"> 添加子账号 </van-button>
<van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleChangeMain"> 修改主账号 </van-button> <van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleChangeMain"> 修改主账号 </van-button>
</view> </view>
<view wx:if="{{list.length}}"> <view class="customTable">
<view class="tableWrapper"> <view class="customTableTile">
<view class="table"> <van-row>
<view class="thead"> <van-col span="24">
<view class="th" style="width: 70rpx"> 序号 </view> <view class="tableTitleRow">
<view class="th" style="width: 200rpx"> 昵称 </view> <view class="tableTitleRow">
<view class="th" style="width: 300rpx"> 手机号 </view> <view class="tbody">
<view class="th" style="width: 100rpx"> 操作 </view> <view class="tr">
</view> <view class="th" style="width: 200rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
<view class="tbody"> <view> {{tenementInfo.fullName}} </view>
<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"> {{ itemIndex + 1 }} </view>
<view class="th" style="width: 200rpx"> {{ item.WechatUserName }} </view>
<view class="th" style="width: 300rpx"> {{ item.WechatPhone }} </view>
<view class="th" style="width: 100rpx; display: flex;">
<view class="primaryTextBtn" bind:tap="handleDelete" data-id="{{item.WechatUserID}}" data-name="{{item.WechatUserName}}" wx:if="{{!item.Permissions}}">
移除
</view>
<van-tag type="info" wx:else>管理员</van-tag>
</view> </view>
</view> </view>
</block> </view>
</van-radio-group> </view>
</view> </van-col>
</view> <van-col span="24">
<view class="tableTitleRow">
<view class="tbody">
<view class="tr">
<view
class="th"
style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 0}}"
> 华昌宝能收费 </view>
<view
class="th"
style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 1}}"
> 物业代收1 </view>
<view
class="th"
style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 2}}"
> 物业代收2 </view>
<view
class="th"
style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 3}}"
> 物业代收线损 </view>
<view style="margin-left: 26rpx;"> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
</view>
</view>
</view>
</van-col>
</van-row>
</view>
<view class="customTableContent">
<van-row wx:if="{{list.length}}">
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
<view class="tbody">
<view class="tr tableRow">
<view class="th" style="width: 200rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatUserName }} </view>
<view class="th" style="width: 250rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatPhone }} </view>
<view class="th" style="display: flex;">
<view style="margin-left: 16rpx;">
<view wx:if="{{!item.Permissions}}" style="display: inline-block;">
<view
class="primaryTextBtn"
bind:tap="handleDelete"
data-id="{{item.WechatUserID}}"
data-name="{{item.WechatUserName}}"
>
<van-image width="40rpx" height="40rpx" src="/assets/images/stop.png" />
</view>
<view
class="primaryTextBtn"
bind:tap="setAdmin"
data-id="{{item.WechatUserID}}"
data-name="{{item.WechatUserName}}"
style="margin-left: 16rpx;"
>
<van-image width="40rpx" height="40rpx" src="/assets/images/tihuan.png" />
</view>
</view>
<van-tag type="primary" wx:else>管理员</van-tag>
</view>
</view>
</view>
</view>
</block>
</van-radio-group>
</van-row>
<empty wx:else bind:refresh="initUserList" />
</view> </view>
</view> </view>
<empty wx:else bind:refresh="initUserList" />
</view> </view>
<search-select <search-select
show="{{show}}" show="{{show}}"
@@ -109,6 +136,7 @@
visible="{{updatePhoneVisible}}" visible="{{updatePhoneVisible}}"
tenement="{{tenement}}" tenement="{{tenement}}"
park="{{park}}" park="{{park}}"
parentPhone="{{parentPhone}}"
bind:ok="onUpdatePhoneConfirm" bind:ok="onUpdatePhoneConfirm"
bind:cancel="handleUpdatePhoneCancel" bind:cancel="handleUpdatePhoneCancel"
/> />

View File

@@ -28,13 +28,8 @@
} }
.tbody {
width: 890rpx;
}
.tbody .tr { .tr {
padding: 20rpx;
border-bottom: 1rpx solid #EEEEEE;
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
@@ -46,4 +41,31 @@
} }
.primaryTextBtn { .primaryTextBtn {
color: #1989fa; color: #1989fa;
} display: inline-block;
}
.customTable {
margin: 20rpx;
font-size: 32rpx;
}
.customTableTile {
background-color: var(--light-green);
box-sizing: border-box;
}
.tableTitleRow {
padding: 16rpx;
font-weight: 700;
}
.tableRow {
padding: 16rpx;
border: 1rpx solid #ccc;
border-top: 0rpx;
}
page {
background-color: rgb(228,240,236);
font-size: 32rpx;
}

View File

@@ -1,180 +1,279 @@
// pages/workBench/components/recharge/components/waitApprove/index.js // pages/workBench/components/recharge/components/waitApprove/index.js
import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index"; import {
import { getRechargeApproveList, rechargeApprove } from "../../../../../../service/recharge" alertInfo,
alertSuccess,
loadingFunc
} from "../../../../../../utils/index";
import {
getRechargeApproveList,
rechargeApprove
} from "../../../../../../service/recharge"
import request from "../../../../../../utils/request" import request from "../../../../../../utils/request"
const { OK } = request import dayjs from "../../../../../../utils/dayjs"
const {
OK
} = request
// pages/workBench/components/record/index.js // pages/workBench/components/record/index.js
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
status: Number status: Number
},
/**
* 组件的初始数据
*/
data: {
keyword: "",
keywordTemp: "",
page: 1,
},
lifetimes: {
attached() {
loadingFunc(async () => {
await this.init();
})
}
},
/**
* 组件的方法列表
*/
methods: {
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
}, },
onConfirm(e) {
const { data } = e.detail; /**
const that = this; * 组件的初始数据
this.setData({ */
parkName: data.name, data: {
park: data.id, keyword: "",
}, () => { keywordTemp: "",
loadingFunc(async () => { page: 1,
await that.init(); currentActionSheet: null,
}) actionItems: [{
}) name: '查看详细',
this.onCancel(); value: 'detail'
}],
}, },
onChangeKeyword(e) {
this.setData({ keywordTemp: e.detail }) lifetimes: {
}, attached() {
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) {
loadingFunc(async () => { loadingFunc(async () => {
const { code, message } = await rechargeApprove({ id: record, status: 0, }) await this.init();
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("已同意")
that.init();
}) })
}
} }
})
}, },
jumpToDetail(e) { /**
const { id } = e.currentTarget.dataset; * 组件的方法列表
wx.navigateTo({ */
url: '/pages/rechargeDetail/index?id=' + id, methods: {
}) onParkFocus(e) {
}, this.setData({
async onChangePage(e) { show: true,
const page = e.detail.currentIndex; title: "园区",
const that = this; type: 'park'
this.setData({ })
page },
}, () => { onConfirm(e) {
loadingFunc(async () => { const {
await that.init(); data
}) } = e.detail;
}) const that = this;
}, this.setData({
onCancel() { parkName: data.name,
this.setData({ park: data.id,
show: false, }, () => {
title: "", loadingFunc(async () => {
type: "", await that.init();
}) })
}, })
onChangeSelectRecharge(e) { this.onCancel();
this.setData({ },
record: e.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.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
})
}
} }
}
}) })

View File

@@ -10,6 +10,9 @@
"empty": "/components/empty/index", "empty": "/components/empty/index",
"van-radio": "@vant/weapp/radio/index", "van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index", "van-radio-group": "@vant/weapp/radio-group/index",
"van-dialog": "@vant/weapp/dialog/index" "van-dialog": "@vant/weapp/dialog/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index",
"van-icon": "@vant/weapp/icon/index",
"van-action-sheet": "@vant/weapp/action-sheet/index"
} }
} }

View File

@@ -1,113 +1,66 @@
<!--pages/workBench/components/recharge/components/waitApprove/index.wxml--> <!--pages/workBench/components/recharge/components/waitApprove/index.wxml-->
<van-field <searchSelectWrapper label="园区" placeholder="请选择园区" text="{{parkName}}" bind:search="onParkFocus" />
value="{{ parkName }}"
placeholder="请选择园区"
label="园区"
readonly
border="{{ false }}"
use-button-slot
title-width="100rpx"
>
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field <searchSelectWrapper label="关键字" placeholder="请输入关键字" text="{{meterName}}" bind:searchKeyword="onSearchKeyword" type="inputSearch" />
value="{{ keyword }}"
placeholder="请输入关键字"
label="关键字"
border="{{ false }}"
use-button-slot
bind:change="onChangeKeyword"
title-width="100rpx"
>
<van-button slot="button" size="small" type="info" bind:click="onSearch">
搜索
</van-button>
</van-field>
<view> <view>
<view wx:if="{{list.length}}"> <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>
</view>
</view>
<view class="tableWrapper"> <view class="tableWrapper">
<view class="table"> <view class="table">
<view class="thead"> <view class="thead">
<view class="th" style="width: 70rpx"> </view> <view class="th" style="flex: 0 0 80rpx; display: {{status === 2 ? 'block' : 'none'}};"> </view>
<view class="th" style="width: 250rpx"> 商户名字 </view> <!-- <view class="th" style="flex: 0 0 0rpx; display: {{status === 1 ? 'block' : 'none'}};"> </view> -->
<view class="th" style="width: 150rpx"> 充值金额 </view> <view class="th" style="flex: 0 0 130rpx;"> 商户名字</view>
<view class="th" style="width: 200rpx"> 操作 </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>
<view class="tbody"> <view class="tbody">
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge"> <van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item"> <block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
<view class="tr"> <view class="tr" style="display: flex; align-items: center; ">
<view class="th" style="width: 70rpx"> <view class="th" style="flex: 0 0 80rpx; ; display: {{status === 2 ? 'block' : 'none'}};">
<van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio> <van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio>
</view> </view>
<view class="th" style="width: 250rpx"> {{ item.tenement.shortName }} </view> <view class="th" style="flex: 0 0 130rpx;">
<view class="th" style="width: 150rpx"> {{ item.money }} </view> {{ item.tenement.shortName }}
<view class="th" style="width: 200rpx"> </view>
<view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}"> <view class="th" style="flex: 0 0 150rpx;">
查看详细 {{ item.money }}
</view> </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>
</view> </view>
</block> </block>
</van-radio-group> </van-radio-group>
</view> </view>
</view> </view>
</view> </view>
<pagination <pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
currentIndex="{{page}}"
totalPage="{{totalPage}}"
bind:pagingChange="onChangePage"
/>
</view> </view>
<empty bind:refresh="init" wx:else /> <empty bind:refresh="init" wx:else />
<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>
</view>
</view>
</view> </view>
<search-select show="{{show}}" title="{{title}}" type="{{type}}" park="{{park}}" bindconfirm="onConfirm" bindcancel="onCancel" />
<search-select <van-dialog use-slot title="审核" show="{{ approveShow }}" show-cancel-button bind:close="onApproveClose" bind:confirm="onApproveConfirm">
show="{{show}}" <van-field label="拒绝理由" value="{{ reason }}" placeholder="请输入拒绝理由" bind:change="onChangeReason" />
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> </van-dialog>

View File

@@ -1,6 +1,6 @@
/* pages/workBench/components/recharge/components/waitApprove/index.wxss */ /* pages/workBench/components/recharge/components/waitApprove/index.wxss */
.table { .table {
width: 810rpx; width: 500rpx;
} }
@@ -17,7 +17,7 @@
} }
.thead .th { .thead .th {
padding: 20rpx; padding: 10rpx;
white-space: nowrap; white-space: nowrap;
text-align: center; text-align: center;
box-sizing: border-box; box-sizing: border-box;
@@ -28,11 +28,11 @@
} }
.tbody { .tbody {
width: 810rpx; width: 500rpx;
} }
.tbody .tr { .tbody .tr {
padding: 20rpx; padding: 10rpx;
border-bottom: 1rpx solid #EEEEEE; border-bottom: 1rpx solid #EEEEEE;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -43,3 +43,28 @@
word-break: break-all; word-break: break-all;
text-align: center; 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;
}

View File

@@ -32,7 +32,6 @@ Component({
type: 'park' type: 'park'
}) })
}, },
onMeterFocus() { onMeterFocus() {
const { park } = this.data; const { park } = this.data;
if (!park) { if (!park) {

View File

@@ -4,6 +4,7 @@
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"search-select": "/components/searchSelect/index", "search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index", "van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index" "van-button": "@vant/weapp/button/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index"
} }
} }

View File

@@ -1,68 +1,37 @@
<!--pages/workBench/components/recharge/components/reharge/index.wxml--> <!--pages/workBench/components/recharge/components/reharge/index.wxml-->
<van-cell-group> <van-cell-group>
<van-field <searchSelectWrapper
value="{{ parkName }}" label="园区"
placeholder="请选择园区" placeholder="请选择园区"
label="园区" text="{{parkName}}"
readonly bind:search="onParkFocus"
border="{{ false }}" />
use-button-slot
title-width="70rpx" <searchSelectWrapper
> label="电表"
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ meterName }}"
placeholder="请选择电表" placeholder="请选择电表"
label="电表" text="{{meterName}}"
readonly bind:search="onMeterFocus"
border="{{ false }}" />
use-button-slot <searchSelectWrapper
title-width="70rpx" label="金额"
>
<van-button slot="button" size="small" type="info" bind:click="onMeterFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ money }}"
placeholder="请输入金额" placeholder="请输入金额"
label="金额" text="{{meterName}}"
type="number" fieldType="number"
border="{{ false }}" type="input"
use-button-slot bind:changeText="onChangeMoney"
title-width="70rpx" />
bind:change="onChangeMoney" <searchSelectWrapper
> label="付款方式"
</van-field>
<van-field
value="{{ payName }}"
placeholder="请选择付款方式" placeholder="请选择付款方式"
label="付款方式" text="{{payName}}"
readonly bind:search="onPayFocus"
border="{{ false }}" />
use-button-slot <searchSelectWrapper
title-width="140rpx" label="凭证"
>
<van-button
slot="button"
size="small"
type="info"
bind:click="onPayFocus"
>
选择
</van-button>
</van-field>
<van-field
value="{{ voucherNo }}"
placeholder="请输入凭证" placeholder="请输入凭证"
label="凭证" type="input"
border="{{ false }}" bind:changeText="onChangeVoucherNo"
use-button-slot
title-width="70rpx"
bind:change="onChangeVoucherNo"
/> />
</van-cell-group> </van-cell-group>

View File

@@ -22,11 +22,11 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
handleChange(e) { changeQueryType(e) {
console.log("change", e) console.log("change", e)
const { index } = e.detail; const { type } = e.currentTarget.dataset;
this.setData({ this.setData({
active: index active: type
}) })
}, },

View File

@@ -4,6 +4,8 @@
"van-button": "@vant/weapp/button/index", "van-button": "@vant/weapp/button/index",
"segmented": "/components/Segmented/index", "segmented": "/components/Segmented/index",
"recharge": "./components/reharge/index", "recharge": "./components/reharge/index",
"approve": "./components/approve/index" "approve": "./components/approve/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index"
} }
} }

View File

@@ -1,9 +1,19 @@
<!--pages/workBench/components/recharge/index.wxml--> <!--pages/workBench/components/recharge/index.wxml-->
<segmented <view style="">
list="{{segmentedList}}" <view class="typeQuery">
active="{{active}}" <van-row>
bind:change="handleChange" <van-col span="8">
/> <view class="typeQueryText" style="color: {{active === 0 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{0}}"> 待审核 </view>
</van-col>
<van-col span="8">
<view class="typeQueryText" style="color: {{active === 1 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{1}}"> 已审核 </view>
</van-col>
<van-col span="8">
<view class="typeQueryText" style="color: {{active === 2 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{2}}"> 充值 </view>
</van-col>
</van-row>
</view>
</view>
<approve status="{{2}}" wx:if="{{active === 0}}" /> <approve status="{{2}}" wx:if="{{active === 0}}" />
<approve status="{{1}}" wx:if="{{active === 1}}" /> <approve status="{{1}}" wx:if="{{active === 1}}" />

View File

@@ -1 +1,27 @@
/* pages/workBench/components/recharge/index.wxss */ /* pages/workBench/components/recharge/index.wxss */
page {
background-color: rgb(228,240,236);
font-size: 32rpx;
}
.query {
margin: 20rpx 0rpx;
}
.typeQueryText {
text-align: center;
padding: 20rpx;
background-color: var(--light-green);
font-size: 32rpx;
}
.select {
border: 1rpx solid #ccc;
padding: 12rpx;
border-radius: 12rpx;
flex: 1;
display: flex;
justify-content: space-between;
font-size: 30rpx;
}

View File

@@ -46,7 +46,6 @@ Component({
}) })
}, },
onConfirm(e) { onConfirm(e) {
console.log('e', e)
const { data, type } = e.detail; const { data, type } = e.detail;
const that = this; const that = this;
switch(type) { switch(type) {
@@ -61,7 +60,9 @@ Component({
meterName: data.address, meterName: data.address,
meter: data.id, meter: data.id,
}, () => { }, () => {
that.init(); loadingFunc(async () => {
await that.init();
})
}) })
break; break;
} }
@@ -122,11 +123,10 @@ Component({
}, },
async handleMeterSwitchOn() { async handleMeterSwitchOn() {
const that = this; const that = this;
const { meter, list } = this.data; const { meter, meterName } = this.data;
const item = list.find(ele => ele.id === meter)
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: `您确认要对${item?.address || 当前电表}进行合闸吗?`, content: `您确认要对${meterName || 当前电表}进行合闸吗?`,
complete: async (res) => { complete: async (res) => {
if (res.cancel) { if (res.cancel) {
@@ -149,11 +149,10 @@ Component({
}, },
async handleMeterSwitchOff() { async handleMeterSwitchOff() {
const that = this; const that = this;
const { meter, list } = this.data; const { meter, meterName } = this.data;
const item = list.find(ele => ele.id === meter)
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: `您确认要对${item?.address || 当前电表}进行拉闸吗?`, content: `您确认要对${meterName || 当前电表}进行拉闸吗?`,
complete: async (res) => { complete: async (res) => {
if (res.cancel) { if (res.cancel) {
return; return;

View File

@@ -10,6 +10,9 @@
"empty": "/components/empty/index", "empty": "/components/empty/index",
"van-radio": "@vant/weapp/radio/index", "van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index", "van-radio-group": "@vant/weapp/radio-group/index",
"van-tag": "@vant/weapp/tag/index" "van-tag": "@vant/weapp/tag/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index"
} }
} }

View File

@@ -1,132 +1,22 @@
<!--pages/workBench/components/record/index.wxml--> <!--pages/workBench/components/record/index.wxml-->
<van-field <searchSelectWrapper
value="{{ parkName }}" label="园区"
placeholder="请选择园区" placeholder="请选择园区"
label="园区" text="{{parkName}}"
readonly bind:search="onParkFocus"
border="{{ false }}" />
use-button-slot
title-width="100rpx"
>
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-empty wx:if="{{!park}}" description="选择园区后查看" /> <searchSelectWrapper
label="电表"
placeholder="请选择电表"
text="{{meterName}}"
bind:search="onMeterFocus"
/>
<van-empty wx:if="{{!meter}}" description="选择电表后查看" />
<view wx:else> <view wx:else>
<van-field <view wx:if="{{list.length}}">
value="{{ meterName }}"
placeholder="请选择电表"
label="电表"
readonly
border="{{ false }}"
use-button-slot
title-width="100rpx"
>
<van-button slot="button" size="small" type="info" bind:click="onMeterFocus">
选择
</van-button>
</van-field>
<van-empty wx:if="{{!meter}}" description="选择电表后查看" />
<view>
<view wx:if="{{list.length}}">
<van-radio-group value="{{ radio }}" bind:change="onChangeSelectMeter">
<view class="classWrapper" wx:for="{{list}}" wx:key="id">
<van-field
value="{{item.tenement.name}}"
label="商户名称"
readonly
title-width="140rpx"
/>
<van-field
value="商户电表"
label="电表类型"
readonly
wx:if="{{item.type === 0}}"
title-width="140rpx"
/>
<van-field
value="公摊电表"
label="电表类型"
readonly
wx:if="{{item.type === 2}}"
title-width="140rpx"
/>
<van-field
value="园区电表"
label="电表类型"
readonly
wx:else
title-width="140rpx"
/>
<van-field
value="{{item.meterNo}}"
label="表号"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.address}}"
label="表计地址"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.meterSn}}"
label="SN"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.amount}}"
label="表字"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.money}}"
label="电表余额"
readonly
title-width="140rpx"
/>
<van-field
value="合闸"
label="合闸状态"
readonly
wx:if="{{item.onPosition === 0}}"
title-width="140rpx"
/>
<van-field
value="拉闸"
label="合闸状态"
readonly
wx:else
title-width="140rpx"
/>
<van-field
value="在线"
label="在线状态"
readonly
wx:if="{{item.canConnect}}"
title-width="140rpx"
/>
<van-field
value="失联"
label="在线状态"
readonly
wx:else
title-width="140rpx"
/>
</view>
</van-radio-group>
</view>
<empty bind:refresh="init" wx:else />
<view class="operate"> <view class="operate">
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;"> <view style="margin-top: 24rpx; margin-bottom: 24rpx;display: flex; justify-content: center; align-items: center;">
<van-button <van-button
type="info" type="info"
size="small" size="small"
@@ -137,7 +27,67 @@
<van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button> <van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button>
</view> </view>
</view> </view>
<view class="customTable" wx:for="{{list}}" wx:key="id">
<view class="customTableTile">
<van-row>
<van-col span="8">
<view style="text-align: center;"> {{item.tenement.shortName}} </view>
</van-col>
<van-col span="16"><view style="margin-left: 16rpx;">{{item.tenement.name}}</view> </van-col>
</van-row>
</view>
<view class="customTableContent">
<van-row >
<van-col span="24">
<view class="tableRow">
<van-row gutter="5">
<van-col span="8" wx:if="{{item.type === 0}}">
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 商户电表 </view></van-col>
<van-col span="8" wx:elif="{{item.type === 2}}">
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 公摊电表 </view></van-col>
<van-col span="8" wx:else>
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 园区电表 </view></van-col>
<van-col span="16">表号:{{item.meterNo}}</van-col>
</van-row>
</view>
</van-col>
<van-col span="24">
<view class="tableRow">
<van-row gutter="5">
<van-col span="8">
<view style="text-align: center;border-right: 1rpx solid #ccc;"> {{item.address}} </view>
</van-col>
<van-col span="16">SN{{item.meterSn}}</van-col>
</van-row>
</view>
</van-col>
<van-col span="24">
<view class="tableRow">
<van-row gutter="5">
<van-col span="8">
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 表字:{{item.amount}} </view>
</van-col>
<van-col span="16">余额:{{item.money}}</van-col>
</van-row>
</view>
</van-col>
<van-col span="24">
<view class="tableRow">
<van-row gutter="5">
<van-col span="8" wx:if="{{item.onPosition === 0}}">
<view style="text-align: center;border-right: 1rpx solid #ccc;">合闸</view> </van-col>
<van-col span="8" wx:else><view style="text-align: center;border-right: 1rpx solid #ccc;">拉闸</view> </van-col>
<van-col span="8" wx:if="{{item.canConnect}}"><view style="text-align: center;">在线</view> </van-col>
<van-col span="8" wx:else><view style="text-align: center;">失联</view> </van-col>
</van-row>
</view>
</van-col>
</van-row>
</view>
</view>
</view> </view>
<empty bind:refresh="init" wx:else />
</view> </view>
<search-select <search-select

View File

@@ -39,3 +39,25 @@
word-break: break-all; word-break: break-all;
text-align: center; text-align: center;
} }
.customTable {
margin: 20rpx;
}
.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;
}
page {
background-color: rgb(228,240,236);
font-size: 32rpx;
}

View File

@@ -1,6 +1,7 @@
// pages/workBench/components/tenement/components/bindMeter/index.js // pages/workBench/components/tenement/components/bindMeter/index.js
// 0015980101 // 0015980101
import { bindMeter, } from "../../../../../../service/tenement" import { bindMeter, } from "../../../../../../service/tenement"
import { getWorkMeterDetail } from "../../../../../../service/meter"
import { alertInfo, alertSuccess } from "../../../../../../utils/index"; import { alertInfo, alertSuccess } from "../../../../../../utils/index";
import request from "../../../../../../utils/request" import request from "../../../../../../utils/request"
import dayjs from "../../../../../../utils/dayjs" import dayjs from "../../../../../../utils/dayjs"
@@ -22,7 +23,7 @@ Component({
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
dateTimeShow: false,
}, },
/** /**
@@ -41,8 +42,20 @@ Component({
type: 'meter' type: 'meter'
}) })
}, },
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
// this.triggerEvent("close")
},
onClose() { onClose() {
this.triggerEvent("close") this.setData({
show: false,
title: "",
type: "",
})
}, },
onChange(e) { onChange(e) {
const { name } = e.currentTarget.dataset; const { name } = e.currentTarget.dataset;
@@ -51,11 +64,19 @@ Component({
}) })
}, },
async onSubmit() { async onSubmit() {
const { overall, critical, peak, valley, park, tenement, meter } = this.data; 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, const { code, message } = await bindMeter(
critical : critical ? Number(critical) : critical, park,
peak: peak ? Number(peak) : peak, tenement,
valley : valley ? Number(valley) : valley, readAt: dayjs().format('YYYY-MM-DD HH:mm:ss') }) {
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) { if (code !== OK) {
alertInfo(message) alertInfo(message)
return; return;
@@ -66,15 +87,37 @@ Component({
onConfirm(e) { onConfirm(e) {
const { type, data } = e.detail; const { type, data } = e.detail;
const that = this; const that = this;
console.log("e.deail", e.detail)
switch(type) { switch(type) {
case "meter": case "meter":
this.setData({ this.setData({
meter: data.id, meter: data.id,
meterName: data.name, meterName: data.address,
show: false, show: false,
}) })
this.getMeterDetail(data.id);
break; break;
} }
}, },
async getMeterDetail(id) {
const { code, message, data } = await getWorkMeterDetail(id)
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
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 })
}
} }
}) })

View File

@@ -4,6 +4,7 @@
"van-dialog": "@vant/weapp/dialog/index", "van-dialog": "@vant/weapp/dialog/index",
"search-select": "/components/searchSelect/index", "search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/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"
} }
} }

View File

@@ -30,6 +30,27 @@
选择 选择
</van-button> </van-button>
</van-field> </van-field>
<van-field
value="{{ status }}"
label="状态"
title-width="132rpx"
border="{{false}}"
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 <van-field
value="{{ overall }}" value="{{ overall }}"
label="表字" label="表字"
@@ -38,7 +59,7 @@
bind:change="onChange" bind:change="onChange"
data-name="overall" data-name="overall"
placeholder="请输入表字" placeholder="请输入表字"
type="number" type="digit"
/> />
<van-field <van-field
value="{{ critical }}" value="{{ critical }}"
@@ -48,7 +69,7 @@
bind:change="onChange" bind:change="onChange"
data-name="critical" data-name="critical"
placeholder="请输入有功(尖)" placeholder="请输入有功(尖)"
type="number" type="digit"
/> />
<van-field <van-field
value="{{ peak }}" value="{{ peak }}"
@@ -58,7 +79,7 @@
bind:change="onChange" bind:change="onChange"
data-name="peak" data-name="peak"
placeholder="请输入有功(峰)" placeholder="请输入有功(峰)"
type="number" type="digit"
/> />
<van-field <van-field
value="{{ overall }}" value="{{ overall }}"
@@ -68,7 +89,7 @@
bind:change="onChange" bind:change="onChange"
data-name="overall" data-name="overall"
placeholder="请输入有功(平)" placeholder="请输入有功(平)"
type="number" type="digit"
/> />
<van-field <van-field
value="{{ valley }}" value="{{ valley }}"
@@ -77,7 +98,7 @@
border="{{false}}" border="{{false}}"
bind:change="onChange" bind:change="onChange"
data-name="valley" data-name="valley"
type="number" type="digit"
placeholder="请输入有功(谷)" placeholder="请输入有功(谷)"
/> />
</view> </view>
@@ -91,4 +112,10 @@
park="{{park}}" park="{{park}}"
bindconfirm="onConfirm" bindconfirm="onConfirm"
bindcancel="onCancel" bindcancel="onCancel"
/> />
<date-time-picker
show="{{dateTimeShow}}"
bind:confirm="dateTimeConfirm"
bind:cancel="dateTimeCancal"
/>

View File

@@ -69,6 +69,7 @@
use-button-slot use-button-slot
readonly readonly
title-width="120rpx" title-width="120rpx"
required
> >
<van-button slot="button" size="small" type="info" bind:click="onBuildingFocus"> <van-button slot="button" size="small" type="info" bind:click="onBuildingFocus">
选择 选择

View File

@@ -4,6 +4,8 @@ import { unbindMeter, } from "../../../../../../service/tenement"
import request from "../../../../../../utils/request" import request from "../../../../../../utils/request"
import { alertInfo, alertSuccess } from "../../../../../../utils/index"; import { alertInfo, alertSuccess } from "../../../../../../utils/index";
const { OK } = request const { OK } = request
import { getWorkMeterDetail } from "../../../../../../service/meter"
import dayjs from "../../../../../../utils/dayjs"
Component({ Component({
@@ -18,12 +20,16 @@ Component({
meterAddress: String, meterAddress: String,
visible:Boolean, visible:Boolean,
}, },
observers: {
"meterId": function(newValue) {
this.getMeterDetail(newValue)
}
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: { data: {
dateTimeShow: false
}, },
/** /**
@@ -42,6 +48,17 @@ Component({
type: 'meter' type: 'meter'
}) })
}, },
async getMeterDetail(id) {
const { code, message, data } = await getWorkMeterDetail(id)
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
overall: Number(data?.overall || 0),
status: data?.breakType ? '合闸' : "分闸"
})
},
onClose() { onClose() {
this.triggerEvent("close") this.triggerEvent("close")
}, },
@@ -52,13 +69,17 @@ Component({
}) })
}, },
async onSubmit() { async onSubmit() {
const { overall, critical, peak, valley, park, tenement, meterId } = this.data; const { overall, critical, peak, valley, park, tenement, meterId,readAt } = this.data;
const { code, message, } = await unbindMeter(park, tenement, meterId, const { code, message, } = await unbindMeter(
park,
tenement,
meterId,
{ {
overall:overall? Number(overall) : overall, overall:overall? Number(overall) : overall,
critical : critical ? Number(critical) : critical, critical : critical ? Number(critical) : critical,
peak: peak ? Number(peak) : peak, peak: peak ? Number(peak) : peak,
valley : valley ? Number(valley) : valley, valley : valley ? Number(valley) : valley,
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
}); });
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
@@ -66,6 +87,15 @@ Component({
} }
alertSuccess("解绑成功") alertSuccess("解绑成功")
this.triggerEvent("ok") this.triggerEvent("ok")
},
dateTimeConfirm(e) {
this.setData({ readAt: e.detail.time, dateTimeShow: false })
},
dateTimeCancal(e) {
this.setData({ dateTimeShow: false })
},
onTimeFocus() {
this.setData({ dateTimeShow: true })
} }
} }
}) })

View File

@@ -3,6 +3,8 @@
"usingComponents": { "usingComponents": {
"van-dialog": "@vant/weapp/dialog/index", "van-dialog": "@vant/weapp/dialog/index",
"search-select": "/components/searchSelect/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"
} }
} }

View File

@@ -26,6 +26,19 @@
title-width="132rpx" title-width="132rpx"
border="{{false}}" 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 <van-field
value="{{ overall }}" value="{{ overall }}"
label="表字" label="表字"
@@ -78,4 +91,10 @@
/> />
</view> </view>
</van-dialog> </van-dialog>
<date-time-picker
show="{{dateTimeShow}}"
bind:confirm="dateTimeConfirm"
bind:cancel="dateTimeCancal"
/>

View File

@@ -51,6 +51,9 @@ Component({
}, },
async getTenementInfo() { async getTenementInfo() {
const { tenement, park } = this.data; const { tenement, park } = this.data;
if (!tenement || !park) {
return;
}
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement) const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
if (code !== OK) { if (code !== OK) {
alertInfo(message) alertInfo(message)
@@ -92,7 +95,8 @@ Component({
this.setData({ this.setData({
kaihuVisible: true, kaihuVisible: true,
editType: "add", editType: "add",
title: "开户" title: "开户",
defaultValue: { feeType: 0, feeTypeName: "华昌宝能收费" }
}) })
}, },
startUpdateInfo() { startUpdateInfo() {
@@ -117,10 +121,17 @@ Component({
this.setData({ this.setData({
kaihuVisible: false, kaihuVisible: false,
defaultValue: {}, defaultValue: {},
title: "编辑" title: "编辑",
editType: "",
}) })
}, },
onKaihuConfirm() { onBindClose() {
console.log("-----------")
this.setData({
bindVisible: false,
})
},
async onKaihuConfirm() {
this.getTenementInfo(); this.getTenementInfo();
this.onKaihuClose(); this.onKaihuClose();
}, },
@@ -172,6 +183,9 @@ Component({
bindVisible: false, bindVisible: false,
}) })
this.getTenementMeters(); this.getTenementMeters();
},
onTimeConfirm(e) {
console.log('e', e)
} }
} }
}) })

View File

@@ -7,6 +7,9 @@
"van-empty": "@vant/weapp/empty/index", "van-empty": "@vant/weapp/empty/index",
"kaihu": "./components/kaihu/index", "kaihu": "./components/kaihu/index",
"bindMeter": "./components/bindMeter/index", "bindMeter": "./components/bindMeter/index",
"unBindMeter": "./components/unBindMeter/index" "unBindMeter": "./components/unBindMeter/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index"
} }
} }

View File

@@ -1,31 +1,17 @@
<!--pages/workBench/components/tenement/index.wxml--> <!--pages/workBench/components/tenement/index.wxml-->
<view> <view>
<van-field <searchSelectWrapper
required
value="{{ parkName }}"
label="园区" label="园区"
placeholder="请选择园区" placeholder="请选择园区"
border="{{ true }}" text="{{ parkName }}"
readonly bind:search="onParkFocus"
use-button-slot />
> <searchSelectWrapper
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field
required
value="{{ tenementName }}"
label="商户" label="商户"
placeholder="请选择商户" placeholder="请选择商户"
border="{{ true }}" text="{{ tenementName }}"
readonly bind:search="onTenementFocus"
use-button-slot />
>
<van-button slot="button" size="small" type="info" bind:click="onTenementFocus">
选择
</van-button>
</van-field>
</view> </view>
<view style="display: flex; align-items: center;margin: 20rpx"> <view style="display: flex; align-items: center;margin: 20rpx">
<view wx:if="{{tenement}}"> <view wx:if="{{tenement}}">
@@ -46,39 +32,51 @@
</view> </view>
<van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" /> <van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" />
<view wx:else> <view wx:else>
<van-field <view class="customTable">
value="{{tenementInfo.fullName}}" <view class="customTableTile">
label="商户名称" <van-row>
readonly <van-col span="24">
title-width="140rpx" <view class="tableTitleRow">
/> <view class="tbody">
<van-field
value="{{tenementInfo.shortName}}"
label="商户简称"
readonly
title-width="140rpx"
/>
<van-field
value="{{tenementInfo.phone}}"
label="预留电话"
readonly
title-width="140rpx"
/>
<view wx:if="{{meterList.length}}">
<view class="tableWrapper">
<view class="table">
<view class="thead">
<view class="th" style="width: 250rpx"> 电表地址 </view>
<view class="th" style="width: 250rpx"> SN </view>
<view class="th" style="width: 200rpx"> 操作 </view>
</view>
<view class="tbody">
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
<block wx:for="{{meterList}}" wx:for-index="itemIndex" wx:key="item">
<view class="tr"> <view class="tr">
<view class="th" style="width: 250rpx"> {{ item.address }} </view> <view style="width: 250rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
<view class="th" style="width: 250rpx"> {{ item.meterSn }} </view> <view> {{tenementInfo.fullName}} </view>
</view>
<view class="tr">
<view wx:if="{{tenementInfo.feeType === 0}}" class="th" style="width: 250rpx;text-align: center;"> 华昌宝能收费 </view>
<view wx:if="{{tenementInfo.feeType === 1}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收1 </view>
<view wx:if="{{tenementInfo.feeType === 2}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收2 </view>
<view wx:if="{{tenementInfo.feeType === 3}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收线损 </view>
<view> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
</view>
</view>
</view>
</van-col>
<!-- <van-row gutter="5">
<van-col span="8">
<view style="text-align: center;"> 华昌宝能收费 </view> </van-col>
<van-col span="8" wx:elif="{{tenementInfo.feeType === 1}}">
<view style="text-align: center;"> 物业代收1 </view> </van-col>
<van-col span="8" wx:elif="{{tenementInfo.feeType === 2}}">
<view style="text-align: center;"> 物业代收2 </view> </van-col>
<van-col span="8" wx:else> <view style="text-align: center;"> 物业代收线损 </view> </van-col>
<van-col span="16">{{tenementInfo.contact}} {{tenementInfo.phone}} </van-col>
</van-row> -->
</van-row>
</view>
<view class="customTableContent">
<van-row>
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
<block wx:for="{{meterList}}" wx:for-index="itemIndex" wx:key="item">
<view class="tbody">
<view class="tr tableRow">
<view class="th" style="width: 250rpx;padding-right: 16rpx;box-sizing: border-box;border-right: 1rpx solid #ccc;"> {{ item.address }} </view>
<view class="th" style="width: 250rpx;padding-right: 16rpx;box-sizing: border-box;border-right: 1rpx solid #ccc;"> {{ item.meterSn }} </view>
<view class="th" style="width: 200rpx"> <view class="th" style="width: 200rpx">
<view <view
class="primaryTextBtn" class="primaryTextBtn"
@@ -90,12 +88,11 @@
</view> </view>
</view> </view>
</view> </view>
</block> </view>
</van-radio-group> </block>
</view> </van-radio-group>
</view> </van-row>
</view> </view>
</view> </view>
</view> </view>
<search-select <search-select
@@ -103,10 +100,12 @@
title="{{title}}" title="{{title}}"
type="{{type}}" type="{{type}}"
park="{{park}}" park="{{park}}"
isBack="{{true}}"
bindconfirm="onConfirm" bindconfirm="onConfirm"
bindcancel="onCancel" bindcancel="onCancel"
/> />
<kaihu <kaihu
wx:if="{{kaihuVisible}}"
park="{{park}}" park="{{park}}"
visible="{{kaihuVisible}}" visible="{{kaihuVisible}}"
defaultValue="{{defaultValue}}" defaultValue="{{defaultValue}}"
@@ -122,6 +121,7 @@
tenement="{{tenement}}" tenement="{{tenement}}"
tenementName="{{tenementName}}" tenementName="{{tenementName}}"
bind:ok="onBindOk" bind:ok="onBindOk"
bind:close="onBindClose"
/> />
<unBindMeter <unBindMeter
@@ -132,4 +132,4 @@
meterId="{{meterId}}" meterId="{{meterId}}"
meterAddress="{{meterAddress}}" meterAddress="{{meterAddress}}"
bind:ok="onUnbindOk" bind:ok="onUnbindOk"
/> />

View File

@@ -23,13 +23,9 @@
} }
.tbody {
width: 890rpx;
}
.tbody .tr { .tbody .tr {
padding: 20rpx; padding: 20rpx;
border-bottom: 1rpx solid #EEEEEE; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
@@ -42,4 +38,33 @@
.primaryTextBtn { .primaryTextBtn {
color: #1989fa; color: #1989fa;
} }
.customTable {
margin: 20rpx;
font-size: 32rpx;
}
.customTableTile {
background-color: var(--light-green);
box-sizing: border-box;
font-weight: 700;
}
.tableTitleRow {
padding: 16rpx;
}
.tableRow {
padding: 16rpx;
border: 1rpx solid #ccc;
border-top: 0rpx;
font-size: 32rpx;
}
page {
background-color: rgb(228,240,236);
font-size: 32rpx;
}

View File

@@ -5,7 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active: 0 active: 0,
}, },
/** /**

View File

@@ -37,7 +37,15 @@
} }
], ],
"minifyWXSS": true, "minifyWXSS": true,
"ignoreUploadUnusedFiles": false "ignoreUploadUnusedFiles": false,
"compileWorklet": false,
"minifyWXML": true,
"localPlugins": false,
"disableUseStrict": false,
"useCompilerPlugins": false,
"condition": false,
"swc": false,
"disableSWC": true
}, },
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
@@ -48,5 +56,7 @@
"ignore": [], "ignore": [],
"include": [] "include": []
}, },
"appid": "wxb34b4e70f8a5c6f1" "appid": "wxb34b4e70f8a5c6f1",
"libVersion": "development",
"simulatorPluginLibVersion": {}
} }

View File

@@ -4,57 +4,35 @@
"setting": { "setting": {
"compileHotReLoad": true, "compileHotReLoad": true,
"urlCheck": false, "urlCheck": false,
"skylineRenderEnable": true "skylineRenderEnable": true,
"coverView": true,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"autoAudits": false,
"useApiHook": true,
"useApiHostProcess": true,
"showShadowRootInWxmlPanel": true,
"useStaticServer": false,
"useLanDebug": false,
"showES6CompileOption": false,
"checkInvalidKey": true,
"ignoreDevUnusedFiles": true,
"bigPackageSizeSupport": false
}, },
"libVersion": "development", "libVersion": "development",
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "pages/discountCoupon/index", "name": "pages/workBench/index",
"pathName": "pages/discountCoupon/index", "pathName": "pages/workBench/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "childPackage/pages/electricQuery/index", "name": "pages/workBench/index",
"pathName": "childPackage/pages/electricQuery/index", "pathName": "pages/workBench/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/handleLogin/index",
"pathName": "pages/handleLogin/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/ticket/index",
"pathName": "pages/ticket/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/aid/consult/index",
"pathName": "pages/aid/consult/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/aid/law/index",
"pathName": "pages/aid/law/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/my/index",
"pathName": "pages/my/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
@@ -74,15 +52,29 @@
"scene": null "scene": null
}, },
{ {
"name": "pages/publicTransfer/index", "name": "childPackage/pages/electricQuery/index",
"pathName": "pages/publicTransfer/index", "pathName": "childPackage/pages/electricQuery/index",
"query": "money=50&meterId=METER00071009940341737&tenementId=T00069259189616641&tenementName=%E5%8D%8E%E6%98%8C%E5%AE%9D%E8%83%BD&park=P00070370277523457", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{ {
"name": "pages/special/index", "name": "pages/workBench/index",
"pathName": "pages/special/index", "pathName": "pages/workBench/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "childPackage/pages/electricQuery/index",
"pathName": "childPackage/pages/electricQuery/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "childPackage/pages/electricQuery/index",
"pathName": "childPackage/pages/electricQuery/index",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null

9
service/calc.js Normal file
View File

@@ -0,0 +1,9 @@
import apis from '../utils/request';
import { replaceSpecialIcon } from '../utils/index'
const { GET, POST, PUT, DELETE } = apis
// 获取电表列表
export const getDayCalcList = async function({ page, size, startTime, endTime, codeId }) {
const park = wx.getStorageSync('park')
return await GET(`/accounting/getEveryDayAccountingList?park=${park?.id}&page=${page}&size=${size}&startTime=${startTime}&endTime=${endTime}&codeId=${codeId}`);
}

View File

@@ -27,6 +27,7 @@ export const getParkSimpleMeterList = async function({park = "", keyword = "", p
return await GET(`/work/getWorkMeter?page=${page}&park=${park}&keyword=${replaceSpecialIcon(keyword)}`); return await GET(`/work/getWorkMeter?page=${page}&park=${park}&keyword=${replaceSpecialIcon(keyword)}`);
} }
// 获取商户下的电表,后台 // 获取商户下的电表,后台
export const getBackTenementMeters = async function(park, tenement) { export const getBackTenementMeters = async function(park, tenement) {
return await GET(`/vx/getWorkMeterDetails?park=${park}&tenement=${tenement}`); return await GET(`/vx/getWorkMeterDetails?park=${park}&tenement=${tenement}`);
@@ -35,4 +36,8 @@ export const getBackTenementMeters = async function(park, tenement) {
// 拉合闸 // 拉合闸
export const handleOperateMeterSwitch = async function({ ids = [], status }) { export const handleOperateMeterSwitch = async function({ ids = [], status }) {
return await PUT(`/equipment/batchSwtich`, { ids, status }); return await PUT(`/equipment/batchSwtich`, { ids, status });
}
// 绑定时获取电表的最新信息
export const getWorkMeterDetail = async function(code = '') {
return await GET(`/vx/getWorkMeterDetail?code=${code}`);
} }

View File

@@ -15,4 +15,9 @@ export const getLoginParkList = async function({ keyword }) {
// 获取建筑列表 // 获取建筑列表
export const getParkBuildingList = async function(pid) { export const getParkBuildingList = async function(pid) {
return await GET(`/vx/park/${pid}/building`); return await GET(`/vx/park/${pid}/building`);
}
// 获取指定园区指定月份核算的详细信息
export const getParkInfoByTime = async function(pid, period, method) {
return await GET(`/park/getReportParkIndex/${pid}?period=${period}&method=${method}`);
} }

View File

@@ -2,7 +2,7 @@ import apis from '../utils/request';
const { GET, POST, PUT, DELETE } = apis const { GET, POST, PUT, DELETE } = apis
// 获取电费账单 // 获取电费账单
export const getReportDetail = async function(id) { export const getReportDetail = async function(id, tid) {
const tenement = wx.getStorageSync('tenement') const tenement = wx.getStorageSync('tenement')
return await GET(`/report/${id}/tenement/${tenement?.id}`); return await GET(`/report/${id}/tenement/${tid || tenement?.id}`);
} }

View File

@@ -76,4 +76,9 @@ export const bindMeter = async function(pid, tid, data) {
// 修改管理员手机号 // 修改管理员手机号
export const updateAdminPhone = async function(data) { export const updateAdminPhone = async function(data) {
return await PUT(`/wx/updatePhone`, data) return await PUT(`/wx/updatePhone`, data)
}
// 工作台移交管理权限
export const updateUserApp = async function(data) {
return await PUT(`/wx/updateUserApp`, data)
} }

View File

@@ -47,8 +47,8 @@ export function getConfigByEnv() {
case 'develop': case 'develop':
api = "http://localhost:8000" api = "http://localhost:8000"
// api = "https://zgd.hbhcbn.com/api3" // api = "https://zgd.hbhcbn.com/api3"
// api = "https://zgd.hbhcbn.com/api3" // TODO: 发布正式时使用此路径
// api = "https://zgd.hbhcbn.com/wxApi" // api = "https://zgd.hbhcbn.com/wxApi"
// api = "http://127.0.0.1:4523/m1/4143821-0-default" // api = "http://127.0.0.1:4523/m1/4143821-0-default"
break; break;
// 体验版 // 体验版
@@ -198,9 +198,11 @@ export const wxLogin = () => {
resolve(res.code) resolve(res.code)
return return
} }
alertInfo("未进行微信登录")
reject() reject()
}, },
fail: err => { fail: err => {
alertError(err)
reject(err) reject(err)
} }
}) })
@@ -249,4 +251,8 @@ export function getFileName(path) {
export function replaceSpecialIcon(str) { export function replaceSpecialIcon(str) {
return str.replace(/#/g, escape("#")) return str.replace(/#/g, escape("#"))
} }
export function getRoundNumber(number) {
return (Math.round(number * 100) / 100).toFixed(2)
}

View File

@@ -35,10 +35,10 @@ const request = async function (options, config = {}) {
try { try {
response = await requestWithoutCookie(options); response = await requestWithoutCookie(options);
// 服务器没有返回200直接报错 // 服务器没有返回200直接报错
// if (!response || response.statusCode !== 200) { if (!response || response.statusCode !== 200) {
// alertError(response?.data?.message || "发生错误,请稍后重试") alertError(response?.data?.message || "发生错误,请稍后重试")
// return; return;
// } }
// 处理cookie // 处理cookie
const setCookie = response.header['set-cookie'] || response.header['Set-Cookie']; const setCookie = response.header['set-cookie'] || response.header['Set-Cookie'];
@@ -78,9 +78,15 @@ const request = async function (options, config = {}) {
// 处理返回结果,默认直接返回数据 // 处理返回结果,默认直接返回数据
const parseResponse = function (response, url) { const parseResponse = function (response, url) {
console.log('response', response)
if (!response) { if (!response) {
alertError("服务异常") wx.redirectTo({
url: '/pages/login/index',
})
wx.clearStorageSync()
alertError("无响应,请重试")
return return
} }
const { statusCode } = response; const { statusCode } = response;
if (!statusCode) { if (!statusCode) {