修改发票显示问题和暂存工作台修改

This commit is contained in:
qiaomu 2025-02-19 19:54:02 +08:00
parent 103c10347c
commit 616c6a53fb
47 changed files with 1142 additions and 82 deletions

View File

@ -31,7 +31,8 @@
"pages/integral/index", "pages/integral/index",
"pages/discountCoupon/index", "pages/discountCoupon/index",
"pages/integralRecord/index", "pages/integralRecord/index",
"pages/meterList/index" "pages/meterList/index",
"pages/workBench/components/tenement/components/createTenement/index"
], ],
"subPackages": [ "subPackages": [
{ {

View File

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

View File

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

View File

@ -0,0 +1,4 @@
<!--components/Segmented/index.wxml-->
<view>
<view wx:for="{{list}}" wx:key="index"></view>
</view>

View File

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

View File

@ -7,6 +7,7 @@ Component({
properties: { properties: {
title: String, title: String,
canBack: Boolean, canBack: Boolean,
beforeBack: Function,
}, },
/** /**
@ -34,7 +35,11 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
back() { async back() {
const { beforeBack } = this;
if (beforeBack) {
await beforeBack();
}
wx.navigateBack(); wx.navigateBack();
} }
} }

View File

@ -1,8 +1,8 @@
import { getLoginParkList } from "../../service/park" import { getLoginParkList, getParkBuildingList } from "../../service/park"
import { getParkSimpleMeterList } from "../../service/meter" import { getParkSimpleMeterList } from "../../service/meter"
import { alertInfo } from "../../utils/index"; import { alertInfo } from "../../utils/index";
import request from "../../utils/request" import request from "../../utils/request"
import { payWays } from "../../utils/data"; import { payWays, feeType } from "../../utils/data";
import { getTenementList } from "../../service/tenement"; import { getTenementList } from "../../service/tenement";
const { OK } = request; const { OK } = request;
@ -86,9 +86,13 @@ Component({
return; return;
case "meter": case "meter":
this.onSearchMeter(); this.onSearchMeter();
return
case "tenement": case "tenement":
this.onSearchTenement(); this.onSearchTenement();
return; return;
case "building":
this.onSearchBuilding();
return;
} }
}, },
async onSearchPark() { async onSearchPark() {
@ -127,6 +131,18 @@ Component({
list: data, list: data,
}) })
}, },
async onSearchBuilding() {
const { park } = this.data;
const { code, message, data = [] } = await getParkBuildingList(park);
if (code !== OK) {
alertInfo(message)
return
}
this.setData({
columns: data?.length ? data?.map(item => item?.name) : [],
list: data,
})
},
} }
}) })

View File

@ -3,6 +3,7 @@
show="{{ show }}" show="{{ show }}"
bind:click="onClickHide" bind:click="onClickHide"
position="bottom" position="bottom"
z-index="100000"
> >
<view wx:if="{{type !== 'pay'}}"> <view wx:if="{{type !== 'pay'}}">
<van-search <van-search
@ -26,7 +27,7 @@
bind:confirm="onConfirm" bind:confirm="onConfirm"
/> />
</view> </view>
<view wx:else> <view wx:elif="{{type === 'pay'}}">
<van-picker <van-picker
custom-style="width: 100%;" custom-style="width: 100%;"
columns="{{ payWays }}" columns="{{ payWays }}"
@ -36,4 +37,24 @@
bind:confirm="onPayConfirm" bind:confirm="onPayConfirm"
/> />
</view> </view>
<view wx:elif="{{type === 'feeType'}}">
<van-picker
custom-style="width: 100%;"
columns="{{ feeType }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onPayConfirm"
/>
</view>
<view wx:else>
<van-picker
custom-style="width: 100%;"
columns="{{ columns }}"
title="{{title}}"
show-toolbar="{{true}}"
bind:cancel="onCancel"
bind:confirm="onConfirm"
/>
</view>
</van-popup> </van-popup>

View File

@ -1,3 +1 @@
/* components/searchSelect/index.wxss */ /* components/searchSelect/index.wxss */
.van-ellipsis van-picker-column__item {
}

View File

@ -23,7 +23,6 @@ Page({
}, },
onChange(e) { onChange(e) {
console.log('e', e)
this.setData({ this.setData({
active: e.detail.index, active: e.detail.index,
}, () => { }, () => {

View File

@ -56,7 +56,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
}, },
async changeMeter() { async changeMeter() {
const { meterList = [] } = this.data; const { meterList = [] } = this.data;

View File

@ -104,7 +104,7 @@
> >
<view class="modalContentWrapper"> <view class="modalContentWrapper">
<van-field <van-field
value="{{ tenementName }}" value="{{ detail.name }}"
label="发票抬头" label="发票抬头"
readonly readonly
type="textarea" type="textarea"

View File

@ -0,0 +1,50 @@
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
import request from "../../../../../../utils/request"
const { OK } = request
// pages/workBench/components/account/components/editModal/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
type: String,
title: String,
visible: Boolean,
onOk: Function,
onCancel: Function,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
async onSubmit() {
const { phone, name } = this.data;
if (!phone) {
alertInfo("请输入手机号")
return
}
if (!name) {
alertInfo("请输入昵称")
return
}
// const { code, message } = await update()
// if (code !== OK) {
// alertInfo(message)
// return;
// }
// alertSuccess("操作成功")
// if (this.onOk) {
// this.onOk()
// }
}
}
})

View File

@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index"
}
}

View File

@ -0,0 +1,30 @@
<!--pages/workBench/components/account/components/editModal/index.wxml-->
<van-dialog
use-slot
title="{{title}}"
show="{{ visible }}"
show-cancel-button
bind:confirm="onSubmit"
>
<view class="modalContentWrapper">
<van-field
value=""
label="昵称"
readonly
type="textarea"
autosize="{{true}}"
title-width="120rpx"
border="{{false}}"
/>
<van-field
value="{{ meterName }}"
placeholder="请选择电表"
label="手机号"
readonly
border="{{ false }}"
title-width="120rpx"
>
</van-field>
</view>
</van-dialog>

View File

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

View File

@ -0,0 +1,77 @@
// pages/workBench/components/account/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
onTenementFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "商户",
type: 'tenement'
})
},
onConfirm(e) {
const { type, data } = e.detail;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
show: false,
})
break;
case "tenement":
this.setData({
tenement: data.id,
tenementName: data.name,
show: false,
})
break;
}
},
handleDelete(e) {
const {} = e;
wx.showModal({
title: '提示',
content: '确认要移除该用户吗?',
complete: (res) => {
if (res.cancel) {
}
if (res.confirm) {
}
}
})
}
}
})

View File

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

View File

@ -0,0 +1,98 @@
<!--pages/workBench/components/account/index.wxml-->
<view>
<van-field
required
value="{{ parkName }}"
label="园区"
placeholder="请选择园区"
border="{{ true }}"
readonly
use-button-slot
>
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field
required
value="{{ tenementName }}"
label="商户"
placeholder="请选择商户"
border="{{ true }}"
readonly
use-button-slot
>
<van-button slot="button" size="small" type="primary" bind:click="onTenementFocus">
选择
</van-button>
</van-field>
</view>
<van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" />
<view wx:else>
<van-field
value="{{item.tenement.name}}"
label="商户名称"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.meterNo}}"
label="商户简称"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.address}}"
label="收费类型"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.address}}"
label="预留电话"
readonly
title-width="140rpx"
/>
<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: 200rpx"> 昵称 </view>
<view class="th" style="width: 200rpx"> 手机号 </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: 200rpx"> {{ index }} </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="handleDelete" data-id="{{item.id}}">
移除
</view>
</view>
</view>
</block>
</van-radio-group>
</view>
</view>
</view>
<view class="operateBox">
<van-button type="primary" size="small" style="margin-right: 20rpx;"> 添加子账号 </van-button>
<van-button type="primary" size="small" style="margin-right: 20rpx;"> 修改主账号 </van-button>
</view>
</view>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onConcal"
/>
<kaihu park="{{park}}" visible="{{kaihuVisible}}" />

View File

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

View File

@ -33,17 +33,39 @@ Component({
type: 'park' type: 'park'
}) })
}, },
onConfirm(e) { onMeterFocus(e) {
const { data } = e.detail; const { park } = this.data;
const that = this; if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({ this.setData({
parkName: data.name, show: true,
park: data.id, title: "电表",
}, () => { type: 'meter'
loadingFunc(async () => {
await that.init();
})
}) })
},
onConfirm(e) {
console.log('e', e)
const { data, type } = e.detail;
const that = this;
switch(type) {
case "park":
this.setData({
parkName: data.name,
park: data.id,
})
break;
case "meter":
this.setData({
meterName: data.address,
meter: data.id,
}, () => {
that.init();
})
break;
}
this.onConcal(); this.onConcal();
}, },
onChangeKeyword(e) { onChangeKeyword(e) {
@ -60,11 +82,11 @@ Component({
}) })
}, },
async init() { async init() {
const { page, keyword, park } = this.data; const { page, park, meter } = this.data;
if (!park) { if (!park) {
return; return;
} }
const { code, message, data, total } = await getParkMeterList({ park, keyword, page }) const { code, message, data, total } = await getParkMeterList({ park, keyword: meter, page })
if (code !== OK) { if (code !== OK) {
alertInfo(message); alertInfo(message);
return; return;

View File

@ -16,65 +16,113 @@
<van-empty wx:if="{{!park}}" description="选择园区后查看" /> <van-empty wx:if="{{!park}}" description="选择园区后查看" />
<view wx:else> <view wx:else>
<van-field <van-field
value="{{ keyword }}" value="{{ meterName }}"
placeholder="请输入关键字" placeholder="请选择电表"
label="关键字" label="电表"
readonly
border="{{ false }}" border="{{ false }}"
use-button-slot use-button-slot
bind:change="onChangeKeyword"
title-width="100rpx" title-width="100rpx"
> >
<van-button slot="button" size="small" type="primary" bind:click="onSearch"> <van-button slot="button" size="small" type="primary" bind:click="onMeterFocus">
搜索 选择
</van-button> </van-button>
</van-field> </van-field>
<van-empty wx:if="{{!meter}}" description="选择电表后查看" />
<view> <view>
<view wx:if="{{list.length}}"> <view wx:if="{{list.length}}">
<van-radio-group value="{{ radio }}" bind:change="onChangeSelectMeter"> <van-radio-group value="{{ radio }}" bind:change="onChangeSelectMeter">
<view class="classWrapper"> <view class="classWrapper" wx:for="{{list}}" wx:key="id">
<view class="table"> <van-field
<view class="thead"> value="{{item.tenement.name}}"
<view class="th" style="width: 80rpx"> </view> label="商户名称"
<view class="th" style="width: 200rpx"> 商户名称 </view> readonly
<view class="th" style="width: 200rpx"> 电表地址 </view> title-width="140rpx"
<view class="th" style="width: 150rpx"> 电表余额 </view> />
<view class="th" style="width: 130rpx"> 拉合闸 </view> <van-field
<view class="th" style="width: 130rpx"> 是否失联 </view> value="商户电表"
</view> label="电表类型"
<view class="tbody"> readonly
<view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item" class="tr"> wx:if="{{item.type === 0}}"
title-width="140rpx"
<view class="th" style="width: 80rpx"> />
<van-radio name="{{item.id}}"></van-radio> <van-field
</view> value="公摊电表"
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view> label="电表类型"
<view class="th" style="width: 200rpx"> {{ item.address }} </view> readonly
<view class="th" style="width: 150rpx"> {{ item.money }} </view> wx:if="{{item.type === 2}}"
<view class="th" style="width: 130rpx" wx:if="{{item.onPosition}}"> title-width="140rpx"
<van-tag type="warning">拉闸</van-tag> />
</view> <van-field
<view class="th" style="width: 130rpx" wx:else> value="园区电表"
<van-tag type="primary">合闸</van-tag> label="电表类型"
</view> readonly
<view class="th" style="width: 130rpx" wx:if="{{item.canConnect}}"> wx:else
<van-tag type="primary">在线</van-tag> title-width="140rpx"
</view> />
<view class="th" style="width: 130rpx" wx:else> <van-field
<van-tag type="danger">失联</van-tag> value="{{item.meterNo}}"
</view> label="表号"
readonly
</view> title-width="140rpx"
</view> />
</view> <van-field
value="{{item.address}}"
label="表计地址"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.meterSn}}"
label="SN"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.amount}}"
label="表字"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.money}}"
label="电表余额"
readonly
title-width="140rpx"
/>
<van-field
value="合闸"
label="合闸状态"
readonly
wx:if="{{item.onPosition === 0}}"
title-width="140rpx"
/>
<van-field
value="拉闸"
label="合闸状态"
readonly
wx:else
title-width="140rpx"
/>
<van-field
value="在线"
label="在线状态"
readonly
wx:if="{{item.canConnect}}"
title-width="140rpx"
/>
<van-field
value="失联"
label="在线状态"
readonly
wx:else
title-width="140rpx"
/>
</view> </view>
</van-radio-group> </van-radio-group>
<pagination
currentIndex="{{page}}"
totalPage="{{totalPage}}"
bind:pagingChange="onChangePage"
/>
</view> </view>
<empty bind:refresh="init" wx:else /> <empty bind:refresh="init" wx:else />
<view class="operate"> <view class="operate">
@ -88,7 +136,7 @@
> 合闸 </van-button> > 合闸 </van-button>
<van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button> <van-button size="small" bind:click="handleClear" disabled="{{!meter}}" bind:click="handleMeterSwitchOff"> 拉闸 </van-button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -0,0 +1,35 @@
// pages/workBench/components/tenement/components/bindMeter/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onMeterFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "电表",
type: 'meter'
})
},
}
})

View File

@ -0,0 +1,8 @@
{
"component": true,
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index"
}
}

View File

@ -0,0 +1,41 @@
<!--pages/workBench/components/tenement/components/bindMeter/index.wxml-->
<van-dialog
use-slot
title="绑定表计"
show="{{ show }}"
show-cancel-button
bind:confirm="onSubmit"
>
<view class="modalContentWrapper">
<van-field
value=""
label="商户名称"
readonly
type="textarea"
autosize="{{true}}"
title-width="132rpx"
border="{{false}}"
/>
<van-field
value="{{ meterName }}"
placeholder="请选择电表"
label="电表"
readonly
border="{{ false }}"
use-button-slot
title-width="100rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onMeterFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ money }}"
label="表字"
readonly
title-width="132rpx"
border="{{false}}"
/>
</view>
</van-dialog>

View File

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

View File

@ -0,0 +1,103 @@
// pages/workBench/components/tenement/components/createTenement/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData(options)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
onBuildingFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "建筑",
type: 'building'
})
},
onFeeTypeFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "建筑",
type: 'building'
})
},
beforeBack() {
let pages = getCurrentPages(); // 获取当前页面栈
let prevPage = pages[pages.length - 2]; // 获取上一页
const { tenement = '', tenementName = '', park = '', parkName = '' } = this.data;
// 修改上一页的数据
prevPage.setData({
needBackShow: true,
tenement,
tenementName,
park,
parkName
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@ -0,0 +1,8 @@
{
"usingComponents": {
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"navigator": "/components/navigator/index"
}
}

View File

@ -0,0 +1,74 @@
<!--pages/workBench/components/tenement/components/createTenement/index.wxml-->
<navigator title="开户" canBack="{{true}}" beforeBack="beforeBack" />
<view class="modalContentWrapper">
<van-field
value=""
label="商户全称"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value=""
label="商户简称"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
/>
<van-field
value=""
label="联系地址"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value=""
label="联系人"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value=""
label="联系电话"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value="{{ meterName }}"
placeholder="请选择建筑"
label="建筑"
use-button-slot
title-width="120rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onBuildingFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ meterName }}"
placeholder="请选择收费类型"
label="收费类型"
use-button-slot
title-width="120rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onFeeTypeFocus">
选择
</van-button>
</van-field>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onConcal"
/>

View File

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

View File

@ -0,0 +1,57 @@
// pages/workBench/components/tenement/components/kaihu/index.js
import { alertInfo } from "../../../../../../utils/index"
Component({
/**
* 组件的属性列表
*/
properties: {
park: String,
visible: Boolean,
},
// observers: {
// 'visible': function(newVisible) {
// this.setData({
// show: newVisible
// })
// }
// },
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
onBuildingFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "建筑",
type: 'building'
})
},
onFeeTypeFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "建筑",
type: 'building'
})
},
},
})

View File

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

View File

@ -0,0 +1,81 @@
<!--pages/workBench/components/tenement/components/kaihu/index.wxml-->
<van-dialog
use-slot
title="开户"
show="{{ visible }}"
show-cancel-button
bind:confirm="onSubmit"
>
<view class="modalContentWrapper">
<van-field
value=""
label="商户全称"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value=""
label="商户简称"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
/>
<van-field
value=""
label="联系地址"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value=""
label="联系人"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value=""
label="联系电话"
type="textarea"
autosize="{{true}}"
title-width="132rpx"
required
/>
<van-field
value="{{ meterName }}"
placeholder="请选择建筑"
label="建筑"
use-button-slot
title-width="120rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onBuildingFocus">
选择
</van-button>
</van-field>
<van-field
value="{{ meterName }}"
placeholder="请选择收费类型"
label="收费类型"
use-button-slot
title-width="120rpx"
>
<van-button slot="button" size="small" type="primary" bind:click="onFeeTypeFocus">
选择
</van-button>
</van-field>
</view>
</van-dialog>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onConcal"
/>

View File

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

View File

@ -0,0 +1,72 @@
import { alertInfo } from "../../../../utils/index";
// pages/workBench/components/tenement/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
lifetimes: {
ready() {
console.log("this.data", this.data)
}
},
/**
* 组件的方法列表
*/
methods: {
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
onTenementFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "商户",
type: 'tenement'
})
},
async init() {
},
onConfirm(e) {
const { type, data } = e.detail;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
show: false,
})
break;
}
},
startKh() {
this.setData({
kaihuVisible: true
})
// const { park = '', parkName = '', tenement = '', tenementName = '' } = this.data;
// wx.navigateTo({
// url: `/pages/workBench/components/tenement/components/createTenement/index?park=${park}&tenement=${tenement}&parkName=${parkName}&${tenementName}=${tenementName}`,
// })
}
}
})

View File

@ -0,0 +1,10 @@
{
"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",
"kaihu": "./components/kaihu/index"
}
}

View File

@ -0,0 +1,100 @@
<!--pages/workBench/components/tenement/index.wxml-->
<view>
<van-field
required
value="{{ parkName }}"
label="园区"
placeholder="请选择园区"
border="{{ true }}"
readonly
use-button-slot
>
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<van-field
required
value="{{ tenementName }}"
label="商户"
placeholder="请选择商户"
border="{{ true }}"
readonly
use-button-slot
>
<van-button slot="button" size="small" type="primary" bind:click="onTenementFocus">
选择
</van-button>
</van-field>
</view>
<view style="display: flex; align-items: center;margin: 20rpx">
<view wx:if="{{tenement}}">
<van-button style="margin-right: 20rpx;" type="info" size="small" bind:click="startBind"> 绑定电表 </van-button>
<van-button style="margin-right: 20rpx;" type="info" size="small" bind:tap="startUpdateInfo"> 修改信息 </van-button>
</view>
<van-button type="info" size="small" bind:click="startKh" wx:if="{{!!park}}"> 开户 </van-button>
</view>
<van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" />
<view wx:else>
<van-field
value="{{item.tenement.name}}"
label="商户名称"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.meterNo}}"
label="商户简称"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.address}}"
label="收费类型"
readonly
title-width="140rpx"
/>
<van-field
value="{{item.address}}"
label="预留电话"
readonly
title-width="140rpx"
/>
<view wx:if="{{list.length}}">
<view class="tableWrapper">
<view class="table">
<view class="thead">
<view class="th" style="width: 250rpx"> 电表地址 </view>
<view class="th" style="width: 150rpx"> SN </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: 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>
</view>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onConcal"
/>
<kaihu park="{{park}}" visible="{{kaihuVisible}}" />

View File

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

View File

@ -5,7 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active: 0 active: 3
}, },
/** /**
@ -28,7 +28,7 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
console.log("this,data", this.data)
}, },
/** /**

View File

@ -5,7 +5,9 @@
"navigator": "/components/navigator/index", "navigator": "/components/navigator/index",
"approve": "./components/approve/index", "approve": "./components/approve/index",
"recharge": "./components/recharge/index", "recharge": "./components/recharge/index",
"record": "./components/record/index" "record": "./components/record/index",
"tenement": "./components/tenement/index",
"account": "./components/account/index"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
} }

View File

@ -1,13 +1,16 @@
<!--pages/workBench/index.wxml--> <!--pages/workBench/index.wxml-->
<navigator title="工作台" canBack="true" /> <navigator title="工作台" canBack="true" />
<van-tabs active="{{ active }}" bind:change="onTabChange"> <van-tabs active="{{ active }}" bind:change="onTabChange">
<van-tab title="充值"> <van-tab title="电表信息" >
<recharge />
</van-tab>
<van-tab title="查询">
<record /> <record />
</van-tab> </van-tab>
<van-tab title="审核"> <van-tab title="商户信息" >
<approve /> <tenement />
</van-tab>
<van-tab title="充值审核">
<recharge />
</van-tab>
<van-tab title="C端账号" >
<account />
</van-tab> </van-tab>
</van-tabs> </van-tabs>

View File

@ -10,4 +10,9 @@ export const getParkList = async function({ keyword = "" }) {
// 获取未登录的园区列表 // 获取未登录的园区列表
export const getLoginParkList = async function({ keyword }) { export const getLoginParkList = async function({ keyword }) {
return await GET(`/wx/getLoginParkList?keyword=${replaceSpecialIcon(keyword)}`); return await GET(`/wx/getLoginParkList?keyword=${replaceSpecialIcon(keyword)}`);
}
// 获取建筑列表
export const getParkBuildingList = async function(pid) {
return await GET(`/vx/park/${pid}/building`);
} }

View File

@ -95,3 +95,4 @@ export const redeemCoupons = async function({ id, type }) {
export const getCurrentCoupons = async function() { export const getCurrentCoupons = async function() {
return await GET(`/wx/getCurrentCoupons`); return await GET(`/wx/getCurrentCoupons`);
} }

View File

@ -12,7 +12,7 @@ export const getOwnTenementList = async function() {
return await GET(`/wx/getOwnTenements`); return await GET(`/wx/getOwnTenements`);
} }
// 获取商户详情 // 获取商户详情(简易)
export const getTenementDetail = async function(id) { export const getTenementDetail = async function(id) {
return await GET(`/wx/getTenementDetail/${id}`); return await GET(`/wx/getTenementDetail/${id}`);
} }
@ -20,4 +20,21 @@ export const getTenementDetail = async function(id) {
// 获取商户是否限电 // 获取商户是否限电
export const getTenementExceptionalCase = async function(pid, tid) { export const getTenementExceptionalCase = async function(pid, tid) {
return await GET(`/wx/exceptionalCase/${pid}/${tid}`); return await GET(`/wx/exceptionalCase/${pid}/${tid}`);
} }
// 获取商户详情b端
export const getTenementInfoDetail = async function(id) {
return await GET(`/wx/getTenementDetail/${id}`);
}
// 创建商户
export const createTenement = async function(pid, data) {
return await POST(`/vx/tenement/${pid}`, data)
}
// 修改商户
export const updateTenement = async function(pid, data) {
return await POST(`/vx/tenement/${pid}`, data)
}
// 解绑电表
export const unbindMeter = async function(pid, tid, code) {
return await POST(`/tenement/${pid}/${tid}/binding/${code}/unbind`)
}

View File

@ -8,3 +8,5 @@ export const payWays = ["现金", "银行卡", "支付宝", "微信", "云闪
export const getRechargeOperateWay = (num) => { export const getRechargeOperateWay = (num) => {
return payWays[num]; return payWays[num];
} }
export const feeType = ['华昌宝能收费', "物业代收1", "物业代收2", "物业代收线损"]

View File

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

View File

@ -9,6 +9,9 @@ export const getDot = async () => {
return; return;
} }
const { code, message, data } = await getUnReadApproveNumber(); const { code, message, data } = await getUnReadApproveNumber();
if (code !== OK) {
return;
}
if (data > 0) { if (data > 0) {
wx.showTabBarRedDot({ wx.showTabBarRedDot({
index: 2, index: 2,