准备联调抄表记录

This commit is contained in:
2025-09-16 17:35:49 +08:00
194 changed files with 6560 additions and 1095 deletions

View File

@@ -0,0 +1,279 @@
// pages/workBench/components/recharge/components/waitApprove/index.js
import {
alertInfo,
alertSuccess,
loadingFunc
} from "../../../../../../utils/index";
import {
getRechargeApproveList,
rechargeApprove
} from "../../../../../../service/recharge"
import request from "../../../../../../utils/request"
import dayjs from "../../../../../../utils/dayjs"
const {
OK
} = request
// pages/workBench/components/record/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
status: Number
},
/**
* 组件的初始数据
*/
data: {
keyword: "",
keywordTemp: "",
page: 1,
currentActionSheet: null,
actionItems: [{
name: '查看详细',
value: 'detail'
}],
},
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,
park: data.id,
}, () => {
loadingFunc(async () => {
await that.init();
})
})
this.onCancel();
},
onSearchKeyword(e) {
const that = this;
that.setData({
keyword: e.detail
}, () => {
loadingFunc(async () => {
await that.init();
})
})
},
onChangeKeyword(e) {
this.setData({
keywordTemp: e.detail
})
},
onSearch() {
const that = this;
that.setData({
keyword: that.data.keywordTemp
}, () => {
loadingFunc(async () => {
await that.init();
})
})
},
async init() {
const {
page,
keyword,
park,
status
} = this.data;
const {
code,
message,
data,
total
} = await getRechargeApproveList({
park,
page,
keyword,
status
})
if (code !== OK) {
alertInfo(message);
return;
}
this.setData({
list: data.map(item => {
item.topTime = dayjs(item.topTime).format("MM-DD")
return item
}),
total: total,
totalPage: Math.ceil(total / 20)
})
},
onChangeReason(e) {
this.setData({
reason: e.detail,
})
},
onApproveClose() {
this.setData({
reason: "",
approveShow: false,
})
},
onApproveConfirm() {
const {
reason,
record
} = this.data;
const that = this;
if (!reason) {
alertInfo("请输入拒绝理由")
return;
}
loadingFunc(async () => {
const {
code,
message
} = await rechargeApprove({
id: record,
status: 1,
reason
})
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("已拒绝")
that.init();
that.setData({
reason: "",
approveShow: false,
record: "",
})
})
},
handleApprove(e) {
const status = e.currentTarget.dataset.status;
const that = this;
if (status === '1') {
this.setData({
approveShow: true
})
return;
}
const {
record,
list
} = this.data;
const item = list.find(ele => ele.id === record)
wx.showModal({
title: '提示',
content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`,
complete: async (res) => {
if (res.cancel) {
}
if (res.confirm) {
loadingFunc(async () => {
const {
code,
message
} = await rechargeApprove({
id: record,
status: 0,
})
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("已同意")
that.init();
})
}
}
})
},
showActionMenu(e) {
this.setData({
currentActionSheet: e.currentTarget.dataset.id
});
},
hideActionMenu() {
this.setData({
currentActionSheet: null
});
},
onMenuSelect(e) {
const {
value
} = e.detail;
const id = e.currentTarget.dataset.id;
if (value === 'detail') {
this.jumpToDetail({
currentTarget: {
dataset: {
id
}
}
});
}
},
jumpToDetail(e) {
const {
id
} = e.currentTarget.dataset;
wx.navigateTo({
url: '/pages/rechargeDetail/index?id=' + id,
})
},
async onChangePage(e) {
const page = e.detail.currentIndex;
const that = this;
this.setData({
page
}, () => {
loadingFunc(async () => {
await that.init();
})
})
},
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
},
onChangeSelectRecharge(e) {
this.setData({
record: e.detail
})
}
}
})

View File

@@ -0,0 +1,18 @@
{
"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",
"searchSelectWrapper": "/components/searchSelectWrapper/index",
"van-icon": "@vant/weapp/icon/index",
"van-action-sheet": "@vant/weapp/action-sheet/index"
}
}

View File

@@ -0,0 +1,66 @@
<!--pages/workBench/components/recharge/components/waitApprove/index.wxml-->
<searchSelectWrapper label="园区" placeholder="请选择园区" text="{{parkName}}" bind:search="onParkFocus" />
<searchSelectWrapper label="关键字" placeholder="请输入关键字" text="{{meterName}}" bind:searchKeyword="onSearchKeyword" type="inputSearch" />
<view>
<view wx:if="{{list.length}}">
<view class="operate" wx:if="{{status === 2}}">
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleApprove" data-status="0" disabled="{{!record}}"> 同意 </van-button>
<van-button size="small" bind:click="handleClear" disabled="{{!record}}" bind:click="handleApprove" data-status="1"> 拒绝 </van-button>
</view>
</view>
<view class="tableWrapper">
<view class="table">
<view class="thead">
<view class="th" style="flex: 0 0 80rpx; display: {{status === 2 ? 'block' : 'none'}};"> </view>
<!-- <view class="th" style="flex: 0 0 0rpx; display: {{status === 1 ? 'block' : 'none'}};"> </view> -->
<view class="th" style="flex: 0 0 130rpx;"> 商户名字</view>
<view class="th" style="flex: 0 0 150rpx;"> 充值金额 </view>
<view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">状态</view>
<view class="th" style="flex: 0 0 150rpx;">提交时间</view>
<view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view>
</view>
<view class="tbody">
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
<view class="tr" style="display: flex; align-items: center; ">
<view class="th" style="flex: 0 0 80rpx; ; display: {{status === 2 ? 'block' : 'none'}};">
<van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio>
</view>
<view class="th" style="flex: 0 0 130rpx;">
{{ item.tenement.shortName }}
</view>
<view class="th" style="flex: 0 0 150rpx;">
{{ item.money }}
</view>
<view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">
<view class="tag">{{item.orderStatus}}</view>
</view>
<view class="th" style="flex: 0 0 150rpx; font-size: 30rpx;">
{{item.topTime}}
</view>
<view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;">
<van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" class="more-icon" />
<van-action-sheet show="{{ currentActionSheet === item.id }}" actions="{{ actionItems }}" bind:close="hideActionMenu" bind:select="onMenuSelect" data-id="{{item.id}}" close-on-click-action />
</view>
</view>
</block>
</van-radio-group>
</view>
</view>
</view>
<pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
</view>
<empty bind:refresh="init" wx:else />
</view>
<search-select show="{{show}}" title="{{title}}" type="{{type}}" park="{{park}}" bindconfirm="onConfirm" bindcancel="onCancel" />
<van-dialog use-slot title="审核" show="{{ approveShow }}" show-cancel-button bind:close="onApproveClose" bind:confirm="onApproveConfirm">
<van-field label="拒绝理由" value="{{ reason }}" placeholder="请输入拒绝理由" bind:change="onChangeReason" />
</van-dialog>

View File

@@ -0,0 +1,70 @@
/* pages/workBench/components/recharge/components/waitApprove/index.wxss */
.table {
width: 500rpx;
}
.tableWrapper {
width: 100vw;
overflow-x: auto;
}
.thead {
display: flex;
flex-wrap: nowrap;
}
.thead .th {
padding: 10rpx;
white-space: nowrap;
text-align: center;
box-sizing: border-box;
}
.primaryTextBtn {
color: #1989fa;
}
.tbody {
width: 500rpx;
}
.tbody .tr {
padding: 10rpx;
border-bottom: 1rpx solid #EEEEEE;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
.tbody .tr {
word-break: break-all;
text-align: center;
}
.more-icon {
padding: 20rpx;
color: #1989fa;
display: flex;
justify-content: center;
align-items: center;
}
/* 基础标签样式 */
.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

@@ -0,0 +1,152 @@
// pages/workBench/components/recharge/components/reharge/index.js
import { handleRecharge } from "../../../../../../service/recharge";
import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index";
import request from '../../../../../../utils/request'
const { OK } = request;
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onParkFocus() {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
onMeterFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "电表",
type: 'meter'
})
},
onConfirm(e) {
const { data, type, way } = e.detail;
switch(type) {
case "park":
this.setData({
parkName: data.name,
park: data.id,
})
break;
case "meter":
this.setData({
meterName: `${data.meterNo}-${data.address}${data.tenement?.name ? '-' + data.tenement?.name : ''}`,
meter: data.id,
})
break;
case "pay":
this.setData({
payName: data,
way: way,
});
break;
}
this.onCancel();
},
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
},
onPayFocus() {
this.setData({
show: true,
title: "付款方式",
type: 'pay'
})
},
onChangeMoney(e) {
this.setData({ money: e.detail })
},
onChangeVoucherNo(e) {
this.setData({ voucherNo: e.detail })
},
handleClear() {
this.setData({
park: "",
parkName: "",
meter: "",
meterName: "",
way: "",
payName: "",
show: false,
title: "",
type: "",
money: null,
voucherNo: null
})
},
async handleSubmit() {
const that = this;
const { park, meter, money, way, voucherNo } = this.data;
if (!park) {
alertInfo("请选择园区");
return;
}
if (!meter) {
alertInfo("请选择电表")
return;
}
if (!money) {
alertInfo("请输入金额")
return
}
if (!way && way !== 0) {
alertInfo("请选择付款方式")
return
}
if (!voucherNo) {
alertInfo("请输入凭证号")
return
}
loadingFunc(async () => {
const { code, message } = await handleRecharge(park, {
amount: `${money || ''}`,
meter,
paymentType: way,
voucherNo,
type: 0
})
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("充值成功")
setTimeout(() => {
that.handleClear()
that.setData({
})
}, 500)
})
}
}
})

View File

@@ -0,0 +1,10 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index"
}
}

View File

@@ -0,0 +1,50 @@
<!--pages/workBench/components/recharge/components/reharge/index.wxml-->
<van-cell-group>
<searchSelectWrapper
label="园区"
placeholder="请选择园区"
text="{{parkName}}"
bind:search="onParkFocus"
/>
<searchSelectWrapper
label="电表"
placeholder="请选择电表"
text="{{meterName}}"
bind:search="onMeterFocus"
/>
<searchSelectWrapper
label="金额"
placeholder="请输入金额"
text="{{meterName}}"
fieldType="number"
type="input"
bind:changeText="onChangeMoney"
/>
<searchSelectWrapper
label="付款方式"
placeholder="请选择付款方式"
text="{{payName}}"
bind:search="onPayFocus"
/>
<searchSelectWrapper
label="凭证"
placeholder="请输入凭证"
type="input"
bind:changeText="onChangeVoucherNo"
/>
</van-cell-group>
<view style="margin-top: 60rpx;display: flex; justify-content: center; align-items: center;">
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleSubmit"> 确认 </van-button>
<van-button size="small" bind:click="handleClear"> 清空 </van-button>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onCancel"
wx:if="{{show}}"
/>

View File

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

View File

@@ -1,8 +1,4 @@
import { handleRecharge } from "../../../../service/recharge";
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
import request from '../../../../utils/request'
const { OK } = request;
// pages/workBench/components/recharge/index.js
Component({
@@ -18,135 +14,20 @@ Component({
* 组件的初始数据
*/
data: {
show: false,
active: 0,
segmentedList: ['待审核', '已审核', '充值'],
},
/**
* 组件的方法列表
*/
methods: {
onParkFocus(e) {
changeQueryType(e) {
const { type } = e.currentTarget.dataset;
this.setData({
show: true,
title: "园区",
type: 'park'
active: type
})
},
onMeterFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "电表",
type: 'meter'
})
},
onConfirm(e) {
const { data, type, way } = e.detail;
switch(type) {
case "park":
this.setData({
parkName: data.name,
park: data.id,
})
break;
case "meter":
this.setData({
meterName: `${data.meterNo}-${data.address}${data.tenement?.name ? '-' + data.tenement?.name : ''}`,
meter: data.id,
})
break;
case "pay":
this.setData({
payName: data,
way: way,
});
break;
}
this.onConcal();
},
onConcal() {
this.setData({
show: false,
title: "",
type: "",
})
},
onPayFocus() {
this.setData({
show: true,
title: "付款方式",
type: 'pay'
})
},
onChangeMoney(e) {
this.setData({ money: e.detail })
},
onChangeVoucherNo(e) {
this.setData({ voucherNo: e.detail })
},
handleClear() {
this.setData({
park: "",
parkName: "",
meter: "",
meterName: "",
way: "",
payName: "",
show: false,
title: "",
type: "",
money: null,
voucherNo: null
})
},
async handleSubmit() {
const that = this;
const { park, meter, money, way, voucherNo } = this.data;
if (!park) {
alertInfo("请选择园区");
return;
}
if (!meter) {
alertInfo("请选择电表")
return;
}
if (!money) {
alertInfo("请输入金额")
return
}
if (!way && way !== 0) {
alertInfo("请选择付款方式")
return
}
if (!voucherNo) {
alertInfo("请输入凭证号")
return
}
loadingFunc(async () => {
const { code, message } = await handleRecharge(park, {
amount: `${money || ''}`,
meter,
paymentType: way,
voucherNo,
type: 0
})
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("充值成功")
setTimeout(() => {
that.handleClear()
that.setData({
})
}, 500)
})
}
}
})

View File

@@ -1,9 +1,11 @@
{
"component": true,
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index"
"van-button": "@vant/weapp/button/index",
"segmented": "/components/Segmented/index",
"recharge": "./components/reharge/index",
"approve": "./components/approve/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index"
}
}

View File

@@ -1,81 +1,20 @@
<!--pages/workBench/components/recharge/index.wxml-->
<van-cell-group>
<van-field
value="{{ parkName }}"
placeholder="请选择园区"
label="园区"
readonly
border="{{ false }}"
use-button-slot
title-width="70rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ meterName }}"
placeholder="请选择电表"
label="电表"
readonly
border="{{ false }}"
use-button-slot
title-width="70rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onMeterFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ money }}"
placeholder="请输入金额"
label="金额"
type="number"
border="{{ false }}"
use-button-slot
title-width="70rpx"
bind:change="onChangeMoney"
>
</van-field>
<van-field
value="{{ payName }}"
placeholder="请选择付款方式"
label="付款方式"
readonly
border="{{ false }}"
use-button-slot
title-width="140rpx"
>
<van-button
slot="button"
size="small"
type="primary"
bind:click="onPayFocus"
>
选择
</van-button>
</van-field>
<van-field
value="{{ voucherNo }}"
placeholder="请输入凭证"
label="凭证"
border="{{ false }}"
use-button-slot
title-width="70rpx"
bind:change="onChangeVoucherNo"
/>
</van-cell-group>
<view style="margin-top: 60rpx;display: flex; justify-content: center; align-items: center;">
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleSubmit"> 确认 </van-button>
<van-button size="small" bind:click="handleClear"> 清空 </van-button>
<view style="">
<view class="typeQuery">
<van-row>
<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>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onConcal"
wx:if="{{show}}"
/>
<approve status="{{2}}" wx:if="{{active === 0}}" />
<approve status="{{1}}" wx:if="{{active === 1}}" />
<recharge wx:if="{{active === 2}}" />

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