Compare commits

...

6 Commits

Author SHA1 Message Date
493be62f44 暂存工作台抄表 2025-09-10 15:51:13 +08:00
cdbc3fa959 暂存 2025-09-10 11:19:07 +08:00
b1cca8f8a5 导入抄表记录 2025-09-09 17:33:56 +08:00
70737fa2b8 导入抄表记录完成电表列表部分(未调试) 2025-09-08 17:31:03 +08:00
71ad4995c8 开始做工作台的抄表 2025-09-05 17:32:27 +08:00
399ef43d07 暂存获取用户信息错误的问题 2024-12-17 10:23:55 +08:00
48 changed files with 1084 additions and 6 deletions

View File

@@ -27,7 +27,9 @@
"pages/aid/finance/index", "pages/aid/finance/index",
"pages/aid/law/index", "pages/aid/law/index",
"pages/aid/detail/index", "pages/aid/detail/index",
"pages/aid/consult/index" "pages/aid/consult/index",
"pages/writeReading/index",
"pages/readingHistory/index"
], ],
"subPackages": [ "subPackages": [
{ {

24
components/input/index.js Normal file
View File

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

View File

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

View File

@@ -0,0 +1,8 @@
<!--components/input/index.wxml-->
<van-field
value="{{ value }}"
placeholder="请输入本次读数"
bind:change="onChange"
border="{{false}}"
custom-style="border: 1rpx solid #ccc; padding: 2px 14rpx; font-size: 32rpx; border-radius: 10rpx;"
/>

View File

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

View File

@@ -41,7 +41,8 @@ Component({
this.setData({ detail: {...data,name: wx.getStorageSync('tenement')?.name, },editType: 'detail', }) this.setData({ detail: {...data,name: wx.getStorageSync('tenement')?.name, },editType: 'detail', })
}, },
async getUser() { async getUser() {
const { code, message, data } = await getUserInfo() const tenement = wx.getStorageSync('tenement');
const { code, message, data } = await getUserInfo(tenement?.id)
this.setData({ user: data }); this.setData({ user: data });
}, },
changeEditType() { changeEditType() {

View File

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

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-tag": "@vant/weapp/tag/index"
}
}

View File

@@ -0,0 +1,55 @@
<!--pages/readingHistory/components/meterInfo/index.wxml-->
<view class="wrapper">
<view class="title">
<view class="address">
标1东-307
</view>
<view class="status">
正常运行中
</view>
</view>
<view class="detail">
<van-row gutter="20">
<van-col span="12">
<view class="text">
<view>
设备编号
</view>
<view>
1202312423524
</view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view>
电表类型
</view>
<view>
1202312423524
</view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view>
最近读数
</view>
<view>
1202312423524
</view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view>
读数日期
</view>
<view>
1202312423524
</view>
</view>
</van-col>
</van-row>
</view>
</view>

View File

@@ -0,0 +1,22 @@
/* pages/readingHistory/components/meterInfo/index.wxss */
.wrapper {
margin: 20rpx 0;
padding: 20rpx;
box-sizing: border-box;
background-color: white;
border-radius: 16rpx;
}
.title {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 40rpx;
}
.detail .text {
display: flex;
justify-content: space-between;
font-size: 30rpx;
margin-bottom: 20rpx;
}

View File

@@ -0,0 +1,66 @@
// pages/readingHistory/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,8 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"meterInfo": "./components/meterInfo/index",
"van-button": "@vant/weapp/button/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,12 @@
<!--pages/readingHistory/index.wxml-->
<navigator title="历史抄表记录" canBack="{{true}}" />
<view class="wrapper">
<meterInfo />
<view class="historyTitle">
<view class="text">
抄表记录历史
</view>
<van-button type="info" size="small" icon="plus" > 新增记录 </van-button>
</view>
</view>

View File

@@ -0,0 +1,9 @@
/* pages/readingHistory/index.wxss */
page {
background-color: #ebedf0;
}
.historyTitle {
display: flex;
justify-content: space-between;
}

View File

@@ -0,0 +1,73 @@
// pages/workBench/components/reading/index.js
import { getMeterReadingRouteList } from "../../../../service/workBench"
import { alertError, loadingFunc } from "../../../../utils/index"
import request from "../../../../utils/request"
const { OK } = request
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
park: "",
parkName: ""
},
/**
* 组件的方法列表
*/
methods: {
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
async init() {
const { parkName, park } = this.data;
const { code, message, data } = await getMeterReadingRouteList(parkName)
if (code !== OK) {
alertError(message)
return
}
this.setData({
list: data
})
},
onConfirm(e) {
const { data } = e.detail;
const that = this;
this.setData({
parkName: data.name,
park: data.id,
}, () => {
loadingFunc(async () => {
await that.init();
})
})
this.onConcal();
},
onConcal() {
this.setData({
show: false,
title: "",
type: "",
})
},
jumpToReading(e) {
const { id } = e.currentTarget.dataset;
wx.navigateTo({
url: '/pages/writeReading/index',
})
}
}
})

View File

@@ -0,0 +1,16 @@
{
"component": true,
"usingComponents": {
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"search-select": "/components/searchSelect/index",
"van-empty": "@vant/weapp/empty/index",
"table": "/components/table/table",
"pagination": "/components/pagination/index",
"empty": "/components/empty/index",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-cell": "@vant/weapp/cell/index"
}
}

View File

@@ -0,0 +1,38 @@
<!--pages/workBench/components/reading/index.wxml-->
<van-field
value="{{ parkName }}"
placeholder="请选择园区"
label="园区"
readonly
border="{{ false }}"
use-button-slot
title-width="100rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onConcal"
/>
<van-empty description="请先选择园区" wx:if="{{!park}}" />
<view wx:else>
<van-cell
wx:for="{{list}}"
wx:key="id"
title="路线1"
label="包含12个抄表点"
>
<view slot="right-icon">
<van-button type="primary" size="small" type="primary"> 去抄表 </van-button>
</view>
</van-cell>
</view>

View File

@@ -0,0 +1 @@
/* pages/workBench/components/reading/index.wxss */

View File

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

View File

@@ -5,7 +5,8 @@
"navigator": "/components/navigator/index", "navigator": "/components/navigator/index",
"approve": "./components/approve/index", "approve": "./components/approve/index",
"recharge": "./components/recharge/index", "recharge": "./components/recharge/index",
"record": "./components/record/index" "record": "./components/record/index",
"reading": "./components/reading/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@@ -10,4 +10,7 @@
<van-tab title="审核"> <van-tab title="审核">
<approve /> <approve />
</van-tab> </van-tab>
<van-tab title="抄表">
<reading />
</van-tab>
</van-tabs> </van-tabs>

View File

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

View File

@@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-tag": "@vant/weapp/tag/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index"
}
}

View File

@@ -0,0 +1,61 @@
<!--pages/writeReading/components/meterInfo/index.wxml-->
<view class="wrapper">
<view class="title">
<text> 电表列表 </text>
</view>
<view class="info">
<view class="title">
<view class="address">
标1东-307
</view>
<view class="meterType">
<van-tag type="primary">华昌宝能收费</van-tag>
</view>
</view>
<view class="detail">
<van-row gutter="20">
<van-col span="12">
<view class="text">
<view>
编号
</view>
<view>
1202312423524
</view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view>
编号
</view>
<view>
1202312423524
</view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view>
编号
</view>
<view>
1202312423524
</view>
</view>
</van-col>
<van-col span="12">
<view class="text">
<view>
编号
</view>
<view>
1202312423524
</view>
</view>
</van-col>
</van-row>
</view>
</view>
</view>

View File

@@ -0,0 +1,33 @@
/* pages/writeReading/components/meterInfo/index.wxss */
.wrapper {
padding: 0 20rpx 20rpx;
}
.info {
margin-top: 20rpx;
padding: 20rpx;
border-radius: 15rpx;
background-color: white;
}
.info .title {
display: flex;
align-items: center;
justify-content: space-between;
}
.info .title .address {
font-size: 36rpx;
font-weight: 800;
}
.info .detail {
margin-top: 20rpx;
}
.info .detail .text {
display: flex;
justify-content: space-between;
font-size: 30rpx;
}

View File

@@ -0,0 +1,32 @@
// pages/writeReading/components/meterList/components/meterItem/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
active: Boolean,
},
observers: {
"active": function (newValue) {
this.setData({
isDeep: newValue
})
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onClick: function() {
this.triggerEvent("click")
}
}
})

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,4 @@
<!--pages/writeReading/components/meterList/components/meterItem/index.wxml-->
<view class="wrapper {{isDeep ? 'deepBg' : ''}}" bind:tap="onClick">
标1东-3071312452636756756857
</view>

View File

@@ -0,0 +1,22 @@
/* pages/writeReading/components/meterList/components/meterItem/index.wxss */
.wrapper {
border-radius: 20rpx;
padding: 20rpx;
margin-bottom: 30rpx;
width: 200rpx;
box-sizing: border-box;
margin-right: 20rpx;
background-color: white;
word-break: break-all;
overflow: hidden;
font-size: 32rpx;
height: 150rpx;
display: flex;
align-items: center;
}
.deepBg {
background-color: var(--deep-green);
color: white;
}

View File

@@ -0,0 +1,90 @@
// pages/writeReading/components/meterList/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
animationData: {}, // 存储动画数据
position: 0,
scrollLeft: 0, // 当前滚动位置
maxScrollLeft: 0 // 最大可滚动距离
},
lifetimes: {
attached() {
const query = this.createSelectorQuery();
// query.select('.scroll-content').boundingClientRect();
console.log("query", query)
query.select('.meterListScrollView').boundingClientRect((rect) => {
console.log("rect", rect)
});
}
},
/**
* 组件的方法列表
*/
methods: {
handleLeft() {
// 将动画数据设置到 data 中,从而触发视图更新
const currentPosition = this.data.position
if (currentPosition === 0) {
this.setData({
position: currentPosition,
});
return;
}
this.setData({
position: this.data.position + 300,
});
},
handleRight() {
// // 将动画数据设置到 data 中,从而触发视图更新
// const currentPosition = this.data.position
// if (currentPosition === 0) {
// this.setData({
// position: currentPosition,
// });
// return;
// }
this.setData({
position: this.data.position - 300,
});
},
onChangeMeter() {
console.log("---------------")
},
onScroll(e) {
// 实时更新当前滚动位置,可用于更复杂的边界判断
this.setData({
scrollLeft: e.detail.scrollLeft
});
},
scrollLeft() {
// 向左滚动:减少 scrollLeft但不能小于0
const newScrollLeft = Math.max(0, this.data.scrollLeft - 200);
this.setData({
scrollLeft: newScrollLeft
});
},
scrollRight() {
// 向右滚动:增加 scrollLeft但不能超过 maxScrollLeft
const newScrollLeft = Math.min(this.data.maxScrollLeft, this.data.scrollLeft + 200);
this.setData({
scrollLeft: newScrollLeft
});
}
}
})

View File

@@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"van-icon": "@vant/weapp/icon/index",
"meter-item": "./components/meterItem/index"
}
}

View File

@@ -0,0 +1,32 @@
<!--pages/writeReading/components/meterList/index.wxml-->
<view class="wrapper">
<view class="title">
<text> 电表列表 </text>
</view>
<view style="display: flex; align-items: center;margin-top: 20rpx;">
<van-icon name="arrow-left" size="50rpx" bind:tap="scrollLeft" />
<scroll-view
scroll-x="{{true}}"
class="meterListScrollView"
scroll-left="{{scrollLeft}}"
bindscroll="onScroll"
scroll-with-animation="true"
>
<view style="display: flex;" class="scroll-content">
<meter-item active="{{true}}" />
<meter-item active="{{false}}" bind:click="onChangeMeter" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
<meter-item active="{{false}}" />
</view>
</scroll-view>
<van-icon name="arrow" size="50rpx" bind:tap="scrollRight" />
</view>
</view>

View File

@@ -0,0 +1,20 @@
/* pages/writeReading/components/meterList/index.wxss */
.wrapper {
padding: 0 20rpx 20rpx;
}
.title {
margin-top: 20rpx;
}
.meterListScrollView {
flex: 1;
margin-left: 20rpx;
margin-right: 20rpx;
overflow-x: hidden;
}
page {
background-color: #ebedf0;
}

View File

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

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1,4 @@
<!--pages/writeReading/components/photo/index.wxml-->
<view class="wrapper">
拍照
</view>

View File

@@ -0,0 +1,4 @@
/* pages/writeReading/components/photo/index.wxss */
.wrapper {
margin-left: 24rpx;
}

View File

@@ -0,0 +1,28 @@
// pages/writeReading/components/readingInfo/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
jumpToHistory() {
wx.navigateTo({
url: '/pages/readingHistory/index',
})
}
}
})

View File

@@ -0,0 +1,10 @@
{
"component": true,
"usingComponents": {
"van-button": "@vant/weapp/button/index",
"van-divider": "@vant/weapp/divider/index",
"custom-input": "/components/input/index",
"van-icon": "@vant/weapp/icon/index",
"photo": "../photo/index"
}
}

View File

@@ -0,0 +1,75 @@
<!--pages/writeReading/components/readingInfo/index.wxml-->
<view class="wrapper">
<view class="bodyTitle">
<view class="text">
<!-- 电表数据记录器 -->
</view>
<view class="time" bind:tap="jumpToHistory">
<!-- 2025年9月5日 -->
历史记录
</view>
</view>
<view class="contentWrapper">
<view class="currentMeter">
<view class="text">
当前电表
</view>
<view class="address">
标1东-307
</view>
</view>
<view class="change">
<van-button type="info" size="small"> <van-icon name="arrow-left" /> 上一块</van-button>
<van-button type="info" size="small" >下一块 <van-icon name="arrow" /> </van-button>
</view>
<van-divider />
<view class="readingNumber">
<view class="lastNumber">
<view class="title">
上次表字
</view>
<view class="number">
3318
</view>
</view>
<view class="lastTime">
2025年08月12日
</view>
</view>
<view class="nextReadingNumber">
<view class="currentNumber">
<view class="title">
本次表字
</view>
<view class="number">
<custom-input />
</view>
</view>
<view class="photo">
<photo />
</view>
</view>
<view class="calc">
<view class="title">
表字差
</view>
<view class="rightNumber">
0
</view>
<view class="wrongNumber">
0
</view>
</view>
<view class="operate">
<view style="flex: 1;">
<van-button size="small" type="info" block> 确定录入 </van-button>
</view>
<view style="flex: 1; margin-left: 20rpx;">
<van-button size="small" block> 清除记录 </van-button>
</view>
</view>
</view>
</view>
<view style="height: 10rpx;"></view>

View File

@@ -0,0 +1,112 @@
/* pages/writeReading/components/readingInfo/index.wxss */
.wrapper {
margin-left: 20rpx;
margin-right: 20rpx;
margin-top: 20rpx;
background-color: white;
}
.bodyTitle {
display: flex;
justify-content: space-between;
align-items: center;
background-color: var(--deep-green);
padding: 32rpx 20rpx;
border-radius: 20rpx 20rpx 0 0;
box-sizing: border-box;
color: white;
}
.bodyTitle .text {
font-size: 40rpx;
font-weight: 800;
}
.bodyTitle .time {
font-size: 30rpx;
}
.contentWrapper {
padding: 0 20rpx;
margin-bottom: 30rpx;
}
.currentMeter {
margin-top: 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 32rpx;
}
.currentMeter .address {
color: var(--deep-green);
font-size: 36rpx;
}
.change {
margin-top: 20rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
}
.readingNumber {
display: flex;
justify-content: space-between;
}
.readingNumber .title {
font-size: 32rpx;
}
.readingNumber .number {
font-size: 42rpx;
font-weight: 800;
margin-top: 12rpx;
}
.readingNumber .lastTime {
font-size: 32rpx;
}
.nextReadingNumber {
display: flex;
align-items: bottom;
}
.nextReadingNumber .title {
font-size: 32rpx;
}
.nextReadingNumber .number {
margin-top: 12rpx;
}
.currentNumber {
flex: 1;
}
.calc {
margin-top: 24rpx;
}
.rightNumber {
font-size: 38rpx;
font-weight: 700;
margin-top: 12rpx;
color: #73d13d;
}
.wrongNumber {
font-size: 38rpx;
font-weight: 700;
margin-top: 12rpx;
color: #ff4d4f;
}
.operate {
margin-top: 24rpx;
display: flex;
padding-bottom: 30rpx;
}

View File

@@ -0,0 +1,66 @@
// pages/writeReading/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,9 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"meter-list": "./components/meterList/index",
"meter-info": "./components/meterInfo/index",
"reading-info": "./components/readingInfo/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,5 @@
<!--pages/writeReading/index.wxml-->
<navigator title="录入抄表记录" canBack="{{true}}" />
<meter-list />
<meter-info />
<reading-info />

View File

@@ -0,0 +1 @@
/* pages/writeReading/index.wxss */

View File

@@ -10,6 +10,20 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/readingHistory/index",
"pathName": "pages/readingHistory/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "pages/writeReading/index",
"pathName": "pages/writeReading/index",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "pages/aid/consult/index", "name": "pages/aid/consult/index",
"pathName": "pages/aid/consult/index", "pathName": "pages/aid/consult/index",

7
service/workBench.js Normal file
View File

@@ -0,0 +1,7 @@
import apis from '../utils/request';
const { GET, POST, PUT, DELETE } = apis
// 检索园区路线列表
export const getMeterReadingRouteList = async function(keyword) {
return await GET(`/park/route/list?keyword=${keyword}`);
}

View File

@@ -45,9 +45,9 @@ export function getConfigByEnv() {
switch (envVersion) { switch (envVersion) {
// 开发版 // 开发版
case 'develop': case 'develop':
api = "http://localhost:8000" // api = "http://localhost:8000"
// api = "https://zgd.hbhcbn.com/api3"
// api = "https://zgd.hbhcbn.com/api3" // api = "https://zgd.hbhcbn.com/api3"
api = "https://zgd.hbhcbn.com/api3"
// api = "https://zgd.hbhcbn.com/wxApi" // api = "https://zgd.hbhcbn.com/wxApi"
// api = "http://127.0.0.1:4523/m1/4143821-0-default" // api = "http://127.0.0.1:4523/m1/4143821-0-default"
break; break;