暂存充值审核
This commit is contained in:
parent
616c6a53fb
commit
5d617f2282
|
@ -5,7 +5,8 @@ Component({
|
|||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
list: Array
|
||||
list: Array,
|
||||
active: Number,
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -19,6 +20,13 @@ Component({
|
|||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
handleChange(e) {
|
||||
console.log(e, this.data.active)
|
||||
const { index } = e.currentTarget.dataset;
|
||||
if (index === this.data.active) {
|
||||
return;
|
||||
}
|
||||
this.triggerEvent("change", { index, name: this.data.list[index] })
|
||||
}
|
||||
}
|
||||
})
|
|
@ -1,4 +1,12 @@
|
|||
<!--components/Segmented/index.wxml-->
|
||||
<view>
|
||||
<view wx:for="{{list}}" wx:key="index"></view>
|
||||
<view style="margin: 10rpx 20rpx">
|
||||
<view
|
||||
wx:for="{{list}}"
|
||||
wx:key="index"
|
||||
class="item {{index === active ? 'active' : ''}}"
|
||||
bind:tap="handleChange"
|
||||
data-index="{{index}}"
|
||||
>
|
||||
{{ item }}
|
||||
</view>
|
||||
</view>
|
|
@ -1 +1,19 @@
|
|||
/* components/Segmented/index.wxss */
|
||||
/* components/Segmented/index.wxss */
|
||||
.item {
|
||||
display: inline-block;
|
||||
padding: 20rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
border-right: 0rpx;
|
||||
font-size: 32rpx;
|
||||
min-width: 140rpx;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.item:nth-last-child(1) {
|
||||
border-right: 1rpx solid #ccc;
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: var(--middle-green);
|
||||
}
|
||||
|
|
|
@ -72,6 +72,10 @@ Component({
|
|||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const { tenementName } = this.data;
|
||||
const { code, message, data } = await
|
||||
}
|
||||
}
|
||||
})
|
|
@ -1,179 +1 @@
|
|||
// pages/workBench/components/approve/index.js
|
||||
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
|
||||
import { getParkMeterList, handleOperateMeterSwitch } from "../../../../service/meter"
|
||||
import { getRechargeApproveList, rechargeApprove } from "../../../../service/recharge"
|
||||
import request from "../../../../utils/request"
|
||||
const { OK } = request
|
||||
|
||||
// pages/workBench/components/record/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
keyword: "",
|
||||
keywordTemp: "",
|
||||
page: 1,
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
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.onConcal();
|
||||
},
|
||||
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 } = this.data;
|
||||
const { code, message, data, total } = await getRechargeApproveList({ park, page, keyword })
|
||||
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 () => {
|
||||
const { code, message } = await rechargeApprove({ id: record, status: 0, })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已同意")
|
||||
that.init();
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
jumpToDetail(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: '/pages/rechargeDetail/index?id=' + id,
|
||||
})
|
||||
},
|
||||
async onChangePage(e) {
|
||||
const page = e.detail.currentIndex;
|
||||
const that = this;
|
||||
this.setData({
|
||||
page
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
onConcal() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
onChangeSelectRecharge(e) {
|
||||
this.setData({
|
||||
record: e.detail
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
|
@ -1,15 +1,6 @@
|
|||
{
|
||||
"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"
|
||||
|
||||
}
|
||||
}
|
|
@ -1,114 +1,3 @@
|
|||
<!--pages/workBench/components/approve/index.wxml-->
|
||||
<!--pages/workBench/components/record/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>
|
||||
|
||||
<van-field
|
||||
value="{{ keyword }}"
|
||||
placeholder="请输入关键字"
|
||||
label="关键字"
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
bind:change="onChangeKeyword"
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="primary" bind:click="onSearch">
|
||||
搜索
|
||||
</van-button>
|
||||
</van-field>
|
||||
<view>
|
||||
<view wx:if="{{list.length}}">
|
||||
<view class="tableWrapper">
|
||||
<view class="table">
|
||||
<view class="thead">
|
||||
<view class="th" style="width: 70rpx"> </view>
|
||||
<view class="th" style="width: 250rpx"> 商户名字 </view>
|
||||
<view class="th" style="width: 150rpx"> 充值金额 </view>
|
||||
<view class="th" style="width: 200rpx"> 操作 </view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||
<view class="tr">
|
||||
<view class="th" style="width: 60rpx">
|
||||
<van-radio wx:if="{{item.orderStatus !== '已退回'}}" name="{{item.id}}"></van-radio>
|
||||
</view>
|
||||
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view>
|
||||
<view class="th" style="width: 200rpx"> {{ item.money }} </view>
|
||||
<view class="th" style="width: 200rpx">
|
||||
<view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}">
|
||||
查看详细
|
||||
</view>
|
||||
</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 class="operate">
|
||||
<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>
|
||||
|
||||
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
/>
|
||||
|
||||
<van-dialog
|
||||
use-slot
|
||||
title="审核"
|
||||
show="{{ approveShow }}"
|
||||
show-cancel-button
|
||||
bind:close="onApproveClose"
|
||||
bind:confirm="onApproveConfirm"
|
||||
>
|
||||
<van-field
|
||||
label="拒绝理由"
|
||||
value="{{ reason }}"
|
||||
placeholder="请输入拒绝理由"
|
||||
bind:change="onChangeReason"
|
||||
/>
|
||||
</van-dialog>
|
||||
|
|
|
@ -1,45 +1 @@
|
|||
/* pages/workBench/components/approve/index.wxss */
|
||||
.table {
|
||||
width: 810rpx;
|
||||
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
width: 100vw;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.thead {
|
||||
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
}
|
||||
|
||||
.thead .th {
|
||||
padding: 20rpx;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.primaryTextBtn {
|
||||
color: #1989fa;
|
||||
}
|
||||
|
||||
.tbody {
|
||||
width: 810rpx;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
178
pages/workBench/components/recharge/components/approve/index.js
Normal file
178
pages/workBench/components/recharge/components/approve/index.js
Normal file
|
@ -0,0 +1,178 @@
|
|||
// 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"
|
||||
const { OK } = request
|
||||
|
||||
// pages/workBench/components/record/index.js
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
status: Number
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
keyword: "",
|
||||
keywordTemp: "",
|
||||
page: 1,
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
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.onConcal();
|
||||
},
|
||||
onChangeKeyword(e) {
|
||||
this.setData({ keywordTemp: e.detail })
|
||||
},
|
||||
onSearch() {
|
||||
const that = this;
|
||||
that.setData({
|
||||
keyword: that.data.keywordTemp
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
async init() {
|
||||
const { page, keyword, park, status } = this.data;
|
||||
const { code, message, data, total } = await getRechargeApproveList({ park, page, keyword, status })
|
||||
if (code !== OK) {
|
||||
alertInfo(message);
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
list: data,
|
||||
total: total,
|
||||
totalPage: Math.ceil(total / 20)
|
||||
})
|
||||
},
|
||||
onChangeReason(e) {
|
||||
this.setData({
|
||||
reason: e.detail,
|
||||
})
|
||||
},
|
||||
onApproveClose() {
|
||||
this.setData({
|
||||
reason: "",
|
||||
approveShow: false,
|
||||
})
|
||||
},
|
||||
onApproveConfirm() {
|
||||
const { reason, record } = this.data;
|
||||
const that = this;
|
||||
if (!reason) {
|
||||
alertInfo("请输入拒绝理由")
|
||||
return;
|
||||
}
|
||||
loadingFunc(async () => {
|
||||
const { code, message } = await rechargeApprove({ id: record, status: 1, reason })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已拒绝")
|
||||
that.init();
|
||||
that.setData({
|
||||
reason: "",
|
||||
approveShow: false,
|
||||
record: "",
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
handleApprove(e) {
|
||||
const status = e.currentTarget.dataset.status;
|
||||
const that = this;
|
||||
if (status === '1') {
|
||||
this.setData({
|
||||
approveShow: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
const { record, list } = this.data;
|
||||
const item = list.find(ele => ele.id === record)
|
||||
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`,
|
||||
complete: async (res) => {
|
||||
if (res.cancel) {
|
||||
|
||||
}
|
||||
if (res.confirm) {
|
||||
loadingFunc(async () => {
|
||||
const { code, message } = await rechargeApprove({ id: record, status: 0, })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return;
|
||||
}
|
||||
alertSuccess("已同意")
|
||||
that.init();
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
jumpToDetail(e) {
|
||||
const { id } = e.currentTarget.dataset;
|
||||
wx.navigateTo({
|
||||
url: '/pages/rechargeDetail/index?id=' + id,
|
||||
})
|
||||
},
|
||||
async onChangePage(e) {
|
||||
const page = e.detail.currentIndex;
|
||||
const that = this;
|
||||
this.setData({
|
||||
page
|
||||
}, () => {
|
||||
loadingFunc(async () => {
|
||||
await that.init();
|
||||
})
|
||||
})
|
||||
},
|
||||
onConcal() {
|
||||
this.setData({
|
||||
show: false,
|
||||
title: "",
|
||||
type: "",
|
||||
})
|
||||
},
|
||||
onChangeSelectRecharge(e) {
|
||||
this.setData({
|
||||
record: e.detail
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
<!--pages/workBench/components/recharge/components/waitApprove/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>
|
||||
|
||||
<van-field
|
||||
value="{{ keyword }}"
|
||||
placeholder="请输入关键字"
|
||||
label="关键字"
|
||||
border="{{ false }}"
|
||||
use-button-slot
|
||||
bind:change="onChangeKeyword"
|
||||
title-width="100rpx"
|
||||
>
|
||||
<van-button slot="button" size="small" type="primary" bind:click="onSearch">
|
||||
搜索
|
||||
</van-button>
|
||||
</van-field>
|
||||
<view>
|
||||
<view wx:if="{{list.length}}">
|
||||
<view class="tableWrapper">
|
||||
<view class="table">
|
||||
<view class="thead">
|
||||
<view class="th" style="width: 70rpx"> </view>
|
||||
<view class="th" style="width: 250rpx"> 商户名字 </view>
|
||||
<view class="th" style="width: 150rpx"> 充值金额 </view>
|
||||
<view class="th" style="width: 200rpx"> 操作 </view>
|
||||
</view>
|
||||
<view class="tbody">
|
||||
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||
<view class="tr">
|
||||
<view class="th" style="width: 60rpx">
|
||||
<van-radio wx:if="{{item.orderStatus !== '已退回'}}" name="{{item.id}}"></van-radio>
|
||||
</view>
|
||||
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view>
|
||||
<view class="th" style="width: 200rpx"> {{ item.money }} </view>
|
||||
<view class="th" style="width: 200rpx">
|
||||
<view class="primaryTextBtn" bind:tap="jumpToDetail" data-id="{{item.id}}">
|
||||
查看详细
|
||||
</view>
|
||||
</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 class="operate">
|
||||
<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>
|
||||
|
||||
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
/>
|
||||
|
||||
<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>
|
|
@ -0,0 +1,45 @@
|
|||
/* pages/workBench/components/recharge/components/waitApprove/index.wxss */
|
||||
.table {
|
||||
width: 810rpx;
|
||||
|
||||
}
|
||||
|
||||
.tableWrapper {
|
||||
width: 100vw;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.thead {
|
||||
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
}
|
||||
|
||||
.thead .th {
|
||||
padding: 20rpx;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.primaryTextBtn {
|
||||
color: #1989fa;
|
||||
}
|
||||
|
||||
.tbody {
|
||||
width: 810rpx;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.tbody .tr {
|
||||
word-break: break-all;
|
||||
text-align: center;
|
||||
}
|
153
pages/workBench/components/recharge/components/reharge/index.js
Normal file
153
pages/workBench/components/recharge/components/reharge/index.js
Normal file
|
@ -0,0 +1,153 @@
|
|||
// 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.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)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
})
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
<!--pages/workBench/components/recharge/components/reharge/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>
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
wx:if="{{show}}"
|
||||
/>
|
|
@ -0,0 +1 @@
|
|||
/* pages/workBench/components/recharge/components/reharge/index.wxss */
|
|
@ -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,21 @@ Component({
|
|||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
show: false,
|
||||
active: 0,
|
||||
segmentedList: ['待审核', '已审核', '充值'],
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onParkFocus(e) {
|
||||
handleChange(e) {
|
||||
console.log("change", e)
|
||||
const { index } = e.detail;
|
||||
this.setData({
|
||||
show: true,
|
||||
title: "园区",
|
||||
type: 'park'
|
||||
active: index
|
||||
})
|
||||
},
|
||||
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)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
})
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
|
@ -1,81 +1,10 @@
|
|||
<!--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>
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
title="{{title}}"
|
||||
type="{{type}}"
|
||||
park="{{park}}"
|
||||
bindconfirm="onConfirm"
|
||||
bindcancel="onConcal"
|
||||
wx:if="{{show}}"
|
||||
<segmented
|
||||
list="{{segmentedList}}"
|
||||
active="{{active}}"
|
||||
bind:change="handleChange"
|
||||
/>
|
||||
|
||||
<approve status="{{1}}" wx:if="{{active === 0}}" />
|
||||
<approve status="{{2}}" wx:if="{{active === 1}}" />
|
||||
<recharge wx:if="{{active === 2}}" />
|
|
@ -5,7 +5,7 @@ Page({
|
|||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
active: 3
|
||||
active: 2
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,8 +34,8 @@ export const handleRecharge = async function(park, data) {
|
|||
}
|
||||
|
||||
// 获取后台审核列表
|
||||
export const getRechargeApproveList = async function({park = "", page, keyword}) {
|
||||
return await GET(`/wx/getTopExamineList?park=${park}&page=${page}&keyword=${replaceSpecialIcon(keyword)}`)
|
||||
export const getRechargeApproveList = async function({park = "", page, keyword, status}) {
|
||||
return await GET(`/wx/getTopExamineList?park=${park}&page=${page}&keyword=${replaceSpecialIcon(keyword)}&status=${status}`)
|
||||
}
|
||||
|
||||
// 对公审核
|
||||
|
|
|
@ -38,3 +38,8 @@ export const updateTenement = async function(pid, data) {
|
|||
export const unbindMeter = async function(pid, tid, code) {
|
||||
return await POST(`/tenement/${pid}/${tid}/binding/${code}/unbind`)
|
||||
}
|
||||
|
||||
// 获取b端用户
|
||||
export const getTenementUsers = async function(id) {
|
||||
return await GET(`/records/getWxUserList`);
|
||||
}
|
Loading…
Reference in New Issue
Block a user