Compare commits
7 Commits
1bb3d6dddb
...
883461c852
Author | SHA1 | Date | |
---|---|---|---|
883461c852 | |||
84c6c54e58 | |||
efe3d3241d | |||
c8649288ff | |||
b9d1ee34a7 | |||
08ef87ce33 | |||
58b945eb72 |
3
app.json
3
app.json
@ -21,7 +21,8 @@
|
|||||||
"pages/publicTransfer/index",
|
"pages/publicTransfer/index",
|
||||||
"pages/special/index",
|
"pages/special/index",
|
||||||
"pages/encyclopedia/index",
|
"pages/encyclopedia/index",
|
||||||
"pages/encyclopediaDetail/index"
|
"pages/encyclopediaDetail/index",
|
||||||
|
"pages/workBench/index"
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
// childPackage/pages/electricQuery/components/listTable/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
},
|
||||||
|
header: Array,
|
||||||
|
totalPage: Number,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
'list': function(val) {
|
||||||
|
this.setData({
|
||||||
|
tempList: (this.data.list || [])?.slice(0, 20),
|
||||||
|
page: 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
page: 1,
|
||||||
|
tempList: [],
|
||||||
|
},
|
||||||
|
lifetimes: {
|
||||||
|
attached() {
|
||||||
|
this.setData({
|
||||||
|
tempList: (this.data.list || [])?.slice(0, 20),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
async onChangePage(e) {
|
||||||
|
const page = e.detail.currentIndex;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
page,
|
||||||
|
tempList: (this.data.list || [])?.slice((page - 1) * 20, page * 20)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"table": "/components/table/table",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"pagination": "/components/pagination/index"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
<!--childPackage/pages/electricQuery/components/listTable/index.wxml-->
|
||||||
|
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<table header="{{header}}" list="{{tempList}}" />
|
||||||
|
<pagination
|
||||||
|
currentIndex="{{page}}"
|
||||||
|
totalPage="{{totalPage}}"
|
||||||
|
bind:pagingChange="onChangePage"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<empty bind:refresh="init" wx:else />
|
@ -0,0 +1 @@
|
|||||||
|
/* childPackage/pages/electricQuery/components/listTable/index.wxss */
|
@ -48,13 +48,20 @@ Page({
|
|||||||
this.setData({ queryType: type },() => {
|
this.setData({ queryType: type },() => {
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 0:
|
case 0:
|
||||||
this.init()
|
loadingFunc(async () => {
|
||||||
|
await this.init()
|
||||||
|
})
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
this.getReadingList();
|
loadingFunc(async () => {
|
||||||
|
await this.getReadingList();
|
||||||
|
})
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.getAccountingBalanceList();
|
loadingFunc(async () => {
|
||||||
|
await this.getAccountingBalanceList();
|
||||||
|
})
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,8 +76,11 @@ Page({
|
|||||||
},
|
},
|
||||||
changeTimeType(e) {
|
changeTimeType(e) {
|
||||||
const { type } = e.currentTarget.dataset
|
const { type } = e.currentTarget.dataset
|
||||||
|
const that = this;
|
||||||
this.setData({ timeType: type }, () => {
|
this.setData({ timeType: type }, () => {
|
||||||
this.init()
|
loadingFunc(async () => {
|
||||||
|
await that.init()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -78,7 +88,9 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init()
|
loadingFunc(async () => {
|
||||||
|
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 } = this.data;
|
||||||
@ -251,13 +263,20 @@ Page({
|
|||||||
const { queryType, } = this.data;
|
const { queryType, } = this.data;
|
||||||
switch(queryType) {
|
switch(queryType) {
|
||||||
case 1:
|
case 1:
|
||||||
this.getReadingList();
|
loadingFunc(async () => {
|
||||||
|
await this.getReadingList();
|
||||||
|
})
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.getAccountingBalanceList();
|
loadingFunc(async () => {
|
||||||
|
await this.getAccountingBalanceList();
|
||||||
|
})
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.init();
|
loadingFunc(async () => {
|
||||||
|
await this.init();
|
||||||
|
})
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -273,13 +292,17 @@ Page({
|
|||||||
switch(type) {
|
switch(type) {
|
||||||
case "year":
|
case "year":
|
||||||
this.setData({ year: time, visible: false, }, () => {
|
this.setData({ year: time, visible: false, }, () => {
|
||||||
this.init();
|
loadingFunc(async () => {
|
||||||
|
await this.init();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "month":
|
case "month":
|
||||||
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 }, () => {
|
||||||
this.init();
|
loadingFunc(async () => {
|
||||||
|
await this.init();
|
||||||
|
})
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "day":
|
case "day":
|
||||||
@ -289,7 +312,9 @@ Page({
|
|||||||
visible: false,
|
visible: false,
|
||||||
page: 1,
|
page: 1,
|
||||||
}, () => {
|
}, () => {
|
||||||
this.init();
|
loadingFunc(async () => {
|
||||||
|
await this.init();
|
||||||
|
})
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
"timePicker": "/components/timePicker/index",
|
"timePicker": "/components/timePicker/index",
|
||||||
"accountingCard": "./components/accountingCard/index",
|
"accountingCard": "./components/accountingCard/index",
|
||||||
"pagination": "/components/pagination/index",
|
"pagination": "/components/pagination/index",
|
||||||
"echarts": "/childPackage/components/echarts/ec-canvas"
|
"echarts": "/childPackage/components/echarts/ec-canvas",
|
||||||
|
"listTable": "./components/listTable/index"
|
||||||
},
|
},
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
@ -70,7 +70,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view wx:if="{{queryType === 0}}">
|
<view wx:if="{{queryType === 0}}">
|
||||||
<view style="margin: 30rpx;">
|
<view style="margin: 30rpx;">
|
||||||
<view wx:if="{{list.length}}">
|
<!-- <view wx:if="{{list.length}}">
|
||||||
<table header="{{header}}" list="{{list}}" />
|
<table header="{{header}}" list="{{list}}" />
|
||||||
<pagination
|
<pagination
|
||||||
currentIndex="{{page}}"
|
currentIndex="{{page}}"
|
||||||
@ -79,7 +79,9 @@
|
|||||||
wx:if="{{timeType === 0}}"
|
wx:if="{{timeType === 0}}"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<empty bind:refresh="init" wx:else />
|
<empty bind:refresh="init" wx:else /> -->
|
||||||
|
|
||||||
|
<listTable list="{{list}}" header="{{header}}" totalPage="{{totalPage}}" />
|
||||||
</view>
|
</view>
|
||||||
<view class="sum">
|
<view class="sum">
|
||||||
合计:表计数量:{{meterNumber}},耗电量:{{electricNumber}}
|
合计:表计数量:{{meterNumber}},耗电量:{{electricNumber}}
|
||||||
@ -87,7 +89,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view wx:if="{{queryType === 1}}">
|
<view wx:if="{{queryType === 1}}">
|
||||||
<view style="margin: 30rpx;">
|
<view style="margin: 30rpx;">
|
||||||
<view wx:if="{{meterReadingList.length}}" >
|
<view wx:if="{{meterReadingList.length}}">
|
||||||
<table
|
<table
|
||||||
header="{{meterReadingHeader}}"
|
header="{{meterReadingHeader}}"
|
||||||
list="{{meterReadingList}}"
|
list="{{meterReadingList}}"
|
||||||
|
117
components/searchSelect/index.js
Normal file
117
components/searchSelect/index.js
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
import { getParkList } from "../../service/park"
|
||||||
|
import { getParkSimpleMeterList } from "../../service/meter"
|
||||||
|
import { alertInfo } from "../../utils/index";
|
||||||
|
import request from "../../utils/request"
|
||||||
|
import { payWays } from "../../utils/data";
|
||||||
|
|
||||||
|
const { OK } = request;
|
||||||
|
|
||||||
|
// components/searchSelect/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
title: String,
|
||||||
|
type: String,
|
||||||
|
show: Boolean,
|
||||||
|
park: String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"show,type": function(newShow, newType) {
|
||||||
|
if (newShow && newType) {
|
||||||
|
this.onSearch()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
columns: [],
|
||||||
|
searchText: "",
|
||||||
|
payWays,
|
||||||
|
},
|
||||||
|
lifetimes: {
|
||||||
|
attached() {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onChangeSearch(e) {
|
||||||
|
this.setData({
|
||||||
|
searchText: e.detail,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
columns: [],
|
||||||
|
list: [],
|
||||||
|
searchText: ""
|
||||||
|
})
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
},
|
||||||
|
onConfirm(event) {
|
||||||
|
const { index } = event.detail;
|
||||||
|
const { list = [], type } = this.data;
|
||||||
|
const item = list[index];
|
||||||
|
this.setData({
|
||||||
|
columns: [],
|
||||||
|
list: [],
|
||||||
|
searchText: ""
|
||||||
|
})
|
||||||
|
this.triggerEvent("confirm", { data: item, type } );
|
||||||
|
},
|
||||||
|
onPayConfirm(event) {
|
||||||
|
const { index } = event.detail;
|
||||||
|
const { payWays = [], type } = this.data;
|
||||||
|
const item = payWays[index];
|
||||||
|
this.setData({
|
||||||
|
columns: [],
|
||||||
|
list: [],
|
||||||
|
searchText: ""
|
||||||
|
})
|
||||||
|
this.triggerEvent("confirm", { data: item, way: index, type } );
|
||||||
|
},
|
||||||
|
onSearch() {
|
||||||
|
const { type } = this.data;
|
||||||
|
switch(type) {
|
||||||
|
case "park":
|
||||||
|
this.onSearchPark();
|
||||||
|
return;
|
||||||
|
case "meter":
|
||||||
|
this.onSearchMeter();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async onSearchPark() {
|
||||||
|
const { searchText = "" } = this.data;
|
||||||
|
const { code, message, data: parks = [] } = await getParkList({keyword: searchText});
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
columns: parks?.map(item => item?.name),
|
||||||
|
list: parks,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onSearchMeter() {
|
||||||
|
const { searchText = "", park } = this.data;
|
||||||
|
const { code, message, data: parks = [] } = await getParkSimpleMeterList({keyword: searchText, park});
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`),
|
||||||
|
list: parks,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
8
components/searchSelect/index.json
Normal file
8
components/searchSelect/index.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
|
"van-picker": "@vant/weapp/picker/index",
|
||||||
|
"van-search": "@vant/weapp/search/index"
|
||||||
|
}
|
||||||
|
}
|
39
components/searchSelect/index.wxml
Normal file
39
components/searchSelect/index.wxml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<!--components/searchSelect/index.wxml-->
|
||||||
|
<van-popup
|
||||||
|
show="{{ show }}"
|
||||||
|
bind:click="onClickHide"
|
||||||
|
position="bottom"
|
||||||
|
>
|
||||||
|
<view wx:if="{{type !== 'pay'}}">
|
||||||
|
<van-search
|
||||||
|
value="{{ value }}"
|
||||||
|
placeholder="请输入搜索关键词"
|
||||||
|
use-action-slot
|
||||||
|
bind:change="onChangeSearch"
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
style="margin-left: 20rpx; margin-right: 20rpx"
|
||||||
|
slot="action"
|
||||||
|
bind:tap="onSearch"
|
||||||
|
>搜索</view>
|
||||||
|
</van-search>
|
||||||
|
<van-picker
|
||||||
|
custom-style="width: 100%;"
|
||||||
|
columns="{{ columns }}"
|
||||||
|
title="{{title}}"
|
||||||
|
show-toolbar="{{true}}"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
bind:confirm="onConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view wx:else>
|
||||||
|
<van-picker
|
||||||
|
custom-style="width: 100%;"
|
||||||
|
columns="{{ payWays }}"
|
||||||
|
title="{{title}}"
|
||||||
|
show-toolbar="{{true}}"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
bind:confirm="onPayConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</van-popup>
|
3
components/searchSelect/index.wxss
Normal file
3
components/searchSelect/index.wxss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/* components/searchSelect/index.wxss */
|
||||||
|
.van-ellipsis van-picker-column__item {
|
||||||
|
}
|
@ -43,8 +43,8 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
chooseTenement() {
|
chooseTenement() {
|
||||||
const { park = {}} = this.data;
|
const { all = [], park = {} } = this.data;
|
||||||
const { tenements } = park;
|
const tenements = all.find(item => item.id === park?.id)?.tenements
|
||||||
this.setData({
|
this.setData({
|
||||||
columns: tenements,
|
columns: tenements,
|
||||||
show: true,
|
show: true,
|
||||||
@ -292,27 +292,24 @@ Page({
|
|||||||
const updateDatas = {}
|
const updateDatas = {}
|
||||||
if (!park || !park.id) {
|
if (!park || !park.id) {
|
||||||
const storagePark = wx.getStorageSync('park')
|
const storagePark = wx.getStorageSync('park')
|
||||||
if (data.find(item => item.id !== storagePark.id)) {
|
if (!data.find(item => item.id === storagePark?.id)) {
|
||||||
updateDatas.park = firstPark
|
updateDatas.park = firstPark
|
||||||
} else {
|
} else {
|
||||||
updateDatas.park = storagePark
|
updateDatas.park = storagePark || firstPark
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
updateDatas.park = park;
|
||||||
}
|
}
|
||||||
if (!tenement || !tenement.id) {
|
if (!tenement || !tenement.id) {
|
||||||
const storageTenement = wx.getStorageSync('tenement')
|
const storageTenement = wx.getStorageSync('tenement')
|
||||||
if (!park || !park.id) {
|
if (!updateDatas.park.tenements?.find(item => item.id === storageTenement?.id)) {
|
||||||
if (firstPark.tenements?.find(item => item.id !== storageTenement.id)) {
|
updateDatas.tenement = updateDatas.park.tenements?.[0]
|
||||||
updateDatas.tenement = firstPark.tenements?.[0]
|
|
||||||
} else {
|
|
||||||
updateDatas.tenement = storageTenement
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (park.tenements?.find(item => item.id !== storageTenement.id)) {
|
updateDatas.tenement = storageTenement || park.tenements?.[0]
|
||||||
updateDatas.tenement = park.tenements?.[0]
|
|
||||||
} else {
|
|
||||||
updateDatas.tenement = storageTenement
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
updateDatas.tenement = tenement
|
||||||
}
|
}
|
||||||
updateDatas.all = data;
|
updateDatas.all = data;
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -389,4 +386,5 @@ Page({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
})
|
})
|
@ -39,6 +39,11 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
jumpToQrCode() {
|
jumpToQrCode() {
|
||||||
|
const { user = {} } = this.data;
|
||||||
|
if (!user?.id) {
|
||||||
|
alertInfo("请先登录")
|
||||||
|
return;
|
||||||
|
}
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/qrCode/index',
|
url: '/pages/qrCode/index',
|
||||||
})
|
})
|
||||||
@ -59,7 +64,8 @@ Page({
|
|||||||
this.getUnReadNumber()
|
this.getUnReadNumber()
|
||||||
},
|
},
|
||||||
async init() {
|
async init() {
|
||||||
const result = await getUserInfo();
|
const tenement = wx.getStorageSync('tenement')
|
||||||
|
const result = await getUserInfo(tenement?.id);
|
||||||
if (result.code !== OK) {
|
if (result.code !== OK) {
|
||||||
alertInfo(result.message)
|
alertInfo(result.message)
|
||||||
return;
|
return;
|
||||||
@ -72,6 +78,11 @@ Page({
|
|||||||
url: '/pages/invoiceList/index?tab=2',
|
url: '/pages/invoiceList/index?tab=2',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
jumpToWorkBench() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/workBench/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
async getUnReadNumber() {
|
async getUnReadNumber() {
|
||||||
const dot = await getDot();
|
const dot = await getDot();
|
||||||
this.setData({
|
this.setData({
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" />
|
<van-cell title="发票抬头" value="" is-link bind:tap="jumpToUpdateInvoice" />
|
||||||
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
|
<van-cell title="绑定企业" value="" is-link bind:tap="bindTenement" />
|
||||||
<van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" />
|
<van-cell title="常见问题" value="" is-link bind:tap="jumpToQuestions" />
|
||||||
|
<van-cell title="工作台" wx:if="{{user.workStatus}}" value="" is-link bind:tap="jumpToWorkBench" />
|
||||||
<van-cell title="退出登录" value="" is-link bind:tap="logout" />
|
<van-cell title="退出登录" value="" is-link bind:tap="logout" />
|
||||||
|
|
||||||
<van-dialog id="van-dialog" />
|
<van-dialog id="van-dialog" />
|
@ -41,7 +41,6 @@ Page({
|
|||||||
async upload(res) {
|
async upload(res) {
|
||||||
|
|
||||||
const result = await uploadPublicFile(res.tempFiles[0]?.tempFilePath)
|
const result = await uploadPublicFile(res.tempFiles[0]?.tempFilePath)
|
||||||
console.log('upload result', result)
|
|
||||||
if (result.statusCode !== 200) {
|
if (result.statusCode !== 200) {
|
||||||
alertInfo("上传失败")
|
alertInfo("上传失败")
|
||||||
return;
|
return;
|
||||||
|
@ -40,7 +40,6 @@ Page({
|
|||||||
},
|
},
|
||||||
async getCode() {
|
async getCode() {
|
||||||
const tenement = wx.getStorageSync('tenement');
|
const tenement = wx.getStorageSync('tenement');
|
||||||
console.log("tenement", tenement)
|
|
||||||
const { code, message, data } = await getWxCode(tenement.id)
|
const { code, message, data } = await getWxCode(tenement.id)
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
|
@ -28,7 +28,6 @@ Page({
|
|||||||
this.setData({ servicesList: data })
|
this.setData({ servicesList: data })
|
||||||
},
|
},
|
||||||
clickService(e) {
|
clickService(e) {
|
||||||
console.log('e', e)
|
|
||||||
const { type, value } = e.currentTarget.dataset.data;
|
const { type, value } = e.currentTarget.dataset.data;
|
||||||
if (!value) {
|
if (!value) {
|
||||||
alertInfo("暂未开通")
|
alertInfo("暂未开通")
|
||||||
|
179
pages/workBench/components/approve/index.js
Normal file
179
pages/workBench/components/approve/index.js
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
// 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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
15
pages/workBench/components/approve/index.json
Normal file
15
pages/workBench/components/approve/index.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
114
pages/workBench/components/approve/index.wxml
Normal file
114
pages/workBench/components/approve/index.wxml
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<!--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>
|
45
pages/workBench/components/approve/index.wxss
Normal file
45
pages/workBench/components/approve/index.wxss
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/* 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;
|
||||||
|
}
|
152
pages/workBench/components/recharge/index.js
Normal file
152
pages/workBench/components/recharge/index.js
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
|
||||||
|
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({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onParkFocus(e) {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
9
pages/workBench/components/recharge/index.json
Normal file
9
pages/workBench/components/recharge/index.json
Normal file
@ -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"
|
||||||
|
}
|
||||||
|
}
|
81
pages/workBench/components/recharge/index.wxml
Normal file
81
pages/workBench/components/recharge/index.wxml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<!--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}}"
|
||||||
|
/>
|
1
pages/workBench/components/recharge/index.wxss
Normal file
1
pages/workBench/components/recharge/index.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/recharge/index.wxss */
|
154
pages/workBench/components/record/index.js
Normal file
154
pages/workBench/components/record/index.js
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
|
||||||
|
import { getParkMeterList, handleOperateMeterSwitch } from "../../../../service/meter"
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
// pages/workBench/components/record/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
keyword: "",
|
||||||
|
keywordTemp: "",
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
if (!park) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { code, message, data, total } = await getParkMeterList({ park, keyword, page })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data,
|
||||||
|
total: total,
|
||||||
|
totalPage: Math.ceil(total / 20)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeSelectMeter(e) {
|
||||||
|
this.setData({
|
||||||
|
meter: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async handleMeterSwitchOn() {
|
||||||
|
const that = this;
|
||||||
|
const { meter, list } = this.data;
|
||||||
|
const item = list.find(ele => ele.id === meter)
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确认要对${item?.address || 当前电表}进行合闸吗?`,
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
const { code, message } = await handleOperateMeterSwitch({ ids: [meter], status: 0 })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("合闸成功")
|
||||||
|
that.init();
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async handleMeterSwitchOff() {
|
||||||
|
const that = this;
|
||||||
|
const { meter, list } = this.data;
|
||||||
|
const item = list.find(ele => ele.id === meter)
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确认要对${item?.address || 当前电表}进行拉闸吗?`,
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (res.confirm) {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
const { code, message } = await handleOperateMeterSwitch({ ids: [meter], status: 1 })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("拉闸成功")
|
||||||
|
that.init();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
15
pages/workBench/components/record/index.json
Normal file
15
pages/workBench/components/record/index.json
Normal file
@ -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-tag": "@vant/weapp/tag/index"
|
||||||
|
}
|
||||||
|
}
|
103
pages/workBench/components/record/index.wxml
Normal file
103
pages/workBench/components/record/index.wxml
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<!--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-empty wx:if="{{!park}}" description="选择园区后查看" />
|
||||||
|
<view wx:else>
|
||||||
|
<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}}">
|
||||||
|
<van-radio-group value="{{ radio }}" bind:change="onChangeSelectMeter">
|
||||||
|
<view class="classWrapper">
|
||||||
|
<view class="table">
|
||||||
|
<view class="thead">
|
||||||
|
<view class="th" style="width: 80rpx"> </view>
|
||||||
|
<view class="th" style="width: 200rpx"> 商户名称 </view>
|
||||||
|
<view class="th" style="width: 200rpx"> 电表地址 </view>
|
||||||
|
<view class="th" style="width: 150rpx"> 电表余额 </view>
|
||||||
|
<view class="th" style="width: 130rpx"> 拉合闸 </view>
|
||||||
|
<view class="th" style="width: 130rpx"> 是否失联 </view>
|
||||||
|
</view>
|
||||||
|
<view class="tbody">
|
||||||
|
<view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item" class="tr">
|
||||||
|
|
||||||
|
<view class="th" style="width: 80rpx">
|
||||||
|
<van-radio name="{{item.id}}"></van-radio>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view>
|
||||||
|
<view class="th" style="width: 200rpx"> {{ item.address }} </view>
|
||||||
|
<view class="th" style="width: 150rpx"> {{ item.amount }} </view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:if="{{item.onPosition}}">
|
||||||
|
<van-tag type="warning">拉闸</van-tag>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:else>
|
||||||
|
<van-tag type="primary">合闸</van-tag>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:if="{{canConnect}}">
|
||||||
|
<van-tag type="primary">在线</van-tag>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 130rpx" wx:else>
|
||||||
|
<van-tag type="danger">失联</van-tag>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-radio-group>
|
||||||
|
<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="handleMeterSwitchOn"
|
||||||
|
disabled="{{!meter}}"
|
||||||
|
> 合闸 </van-button>
|
||||||
|
<van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onConcal"
|
||||||
|
wx:if="{{show}}"
|
||||||
|
/>
|
41
pages/workBench/components/record/index.wxss
Normal file
41
pages/workBench/components/record/index.wxss
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/* pages/workBench/components/record/index.wxss */
|
||||||
|
.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;
|
||||||
|
}
|
68
pages/workBench/index.js
Normal file
68
pages/workBench/index.js
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// pages/workBench/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
active: 0
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
onTabChange(e) {
|
||||||
|
this.setData({ active: e.detail.index })
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
11
pages/workBench/index.json
Normal file
11
pages/workBench/index.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-tab": "@vant/weapp/tab/index",
|
||||||
|
"van-tabs": "@vant/weapp/tabs/index",
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"approve": "./components/approve/index",
|
||||||
|
"recharge": "./components/recharge/index",
|
||||||
|
"record": "./components/record/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
13
pages/workBench/index.wxml
Normal file
13
pages/workBench/index.wxml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!--pages/workBench/index.wxml-->
|
||||||
|
<navigator title="工作台" canBack="true" />
|
||||||
|
<van-tabs active="{{ active }}" bind:change="onTabChange">
|
||||||
|
<van-tab title="充值">
|
||||||
|
<recharge />
|
||||||
|
</van-tab>
|
||||||
|
<van-tab title="查询">
|
||||||
|
<record />
|
||||||
|
</van-tab>
|
||||||
|
<van-tab title="审核">
|
||||||
|
<approve />
|
||||||
|
</van-tab>
|
||||||
|
</van-tabs>
|
1
pages/workBench/index.wxss
Normal file
1
pages/workBench/index.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/index.wxss */
|
@ -10,6 +10,20 @@
|
|||||||
"condition": {
|
"condition": {
|
||||||
"miniprogram": {
|
"miniprogram": {
|
||||||
"list": [
|
"list": [
|
||||||
|
{
|
||||||
|
"name": "childPackage/pages/electricQuery/index",
|
||||||
|
"pathName": "childPackage/pages/electricQuery/index",
|
||||||
|
"query": "",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "pages/workBench/index",
|
||||||
|
"pathName": "pages/workBench/index",
|
||||||
|
"query": "",
|
||||||
|
"launchMode": "default",
|
||||||
|
"scene": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "pages/publicTransfer/index",
|
"name": "pages/publicTransfer/index",
|
||||||
"pathName": "pages/publicTransfer/index",
|
"pathName": "pages/publicTransfer/index",
|
||||||
|
@ -14,4 +14,22 @@ export const getMeterDetail = async function({ tenement, id }) {
|
|||||||
// 获取某一商户的电表列表
|
// 获取某一商户的电表列表
|
||||||
export const getTenementMeterList = async function(tid) {
|
export const getTenementMeterList = async function(tid) {
|
||||||
return await GET(`/wx/getMeterList/${tid}`);
|
return await GET(`/wx/getMeterList/${tid}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取某一园区下的电表列表
|
||||||
|
export const getParkMeterList = async function({park = "", keyword = "", page = 1}) {
|
||||||
|
return await GET(`/equipment/getOperateMeterList?page=${page}&park=${park}&keyword=${escape(keyword)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取某一园区下的简洁电表列表
|
||||||
|
export const getParkSimpleMeterList = async function({park = "", keyword = "", page = 1}) {
|
||||||
|
return await GET(`/work/getWorkMeter?page=${page}&park=${park}&keyword=${escape(keyword)}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 拉合闸
|
||||||
|
export const handleOperateMeterSwitch = async function({ ids = [], status }) {
|
||||||
|
return await PUT(`/equipment/batchSwtich`, { ids, status });
|
||||||
}
|
}
|
@ -2,8 +2,8 @@ import apis from '../utils/request';
|
|||||||
const { GET, POST, PUT, DELETE } = apis
|
const { GET, POST, PUT, DELETE } = apis
|
||||||
|
|
||||||
// 获取园区列表
|
// 获取园区列表
|
||||||
export const getParkList = async function({ keyword }) {
|
export const getParkList = async function({ keyword = "" }) {
|
||||||
return await GET(`/wx/getParkList?keyword=${keyword}`);
|
return await GET(`/wx/getParkList?keyword=${keyword || ""}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取未登录的园区列表
|
// 获取未登录的园区列表
|
||||||
|
@ -25,4 +25,19 @@ export const returnFee = async function(data) {
|
|||||||
// 创建对公
|
// 创建对公
|
||||||
export const createPublicTopUp = async function(data) {
|
export const createPublicTopUp = async function(data) {
|
||||||
return await POST(`/wx/createPublicTopUp`, data);
|
return await POST(`/wx/createPublicTopUp`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 后台充值
|
||||||
|
export const handleRecharge = async function(park, data) {
|
||||||
|
return await POST(`/wechatTopup/${park}`, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取后台审核列表
|
||||||
|
export const getRechargeApproveList = async function({park = "", page, keyword}) {
|
||||||
|
return await GET(`/wx/getTopExamineList?park=${park}&page=${page}&keyword=${escape(keyword)}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 对公审核
|
||||||
|
export const rechargeApprove = async function({ id, status, reason }) {
|
||||||
|
return await PUT(`/wx/updateTopExamineList/`, { id, status, reason })
|
||||||
}
|
}
|
@ -3,7 +3,8 @@ export const getRechargeOperateType = (num) => {
|
|||||||
return types[num];
|
return types[num];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const payWays = ["现金", "银行卡", "支付宝", "微信", "云闪付","对公转账", "小程序-微信支付"]
|
||||||
|
|
||||||
export const getRechargeOperateWay = (num) => {
|
export const getRechargeOperateWay = (num) => {
|
||||||
const types = ["现金", "银行卡", "支付宝", "微信", "云闪付","对公转账", "小程序-微信支付"]
|
return payWays[num];
|
||||||
return types[num];
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user