Compare commits
26 Commits
af749eb638
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| fe590353df | |||
| 2535720023 | |||
| 5e2b2dcfda | |||
| 612dd4eac1 | |||
| 87bb23a9a4 | |||
| a2f92a0959 | |||
| e64318f174 | |||
| 195a6d7c48 | |||
| 76746682fa | |||
| ad4d9323ad | |||
| d4f357d624 | |||
| 9b00bb3561 | |||
| d77af4b78f | |||
| 345a362c74 | |||
| aea85af0f9 | |||
| b61f3287fb | |||
| 49aeeb05a7 | |||
| 95e6937d06 | |||
| 4308096394 | |||
| 17c992fb0b | |||
| 493be62f44 | |||
| cdbc3fa959 | |||
| b1cca8f8a5 | |||
| 70737fa2b8 | |||
| 71ad4995c8 | |||
| 399ef43d07 |
10
app.json
10
app.json
@@ -23,18 +23,26 @@
|
|||||||
"pages/encyclopedia/index",
|
"pages/encyclopedia/index",
|
||||||
"pages/encyclopediaDetail/index",
|
"pages/encyclopediaDetail/index",
|
||||||
"pages/workBench/index",
|
"pages/workBench/index",
|
||||||
|
"pages/workBenchNew/index",
|
||||||
"pages/webPage/index",
|
"pages/webPage/index",
|
||||||
"pages/aid/finance/index",
|
"pages/aid/finance/index",
|
||||||
"pages/aid/law/index",
|
"pages/aid/law/index",
|
||||||
"pages/aid/detail/index",
|
"pages/aid/detail/index",
|
||||||
"pages/aid/consult/index",
|
"pages/aid/consult/index",
|
||||||
|
"pages/writeReading/index",
|
||||||
|
"pages/readingHistory/index",
|
||||||
"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",
|
"pages/workBench/components/tenement/components/createTenement/index",
|
||||||
"pages/billMeterDetail/index",
|
"pages/billMeterDetail/index",
|
||||||
"pages/meterBalanceRecord/index"
|
"pages/meterBalanceRecord/index",
|
||||||
|
"pages/workBenchNew/components/workBenchMeter/index",
|
||||||
|
"pages/workBenchNew/components/workBenchTenement/index",
|
||||||
|
"pages/workBenchNew/components/workBenchApprove/index",
|
||||||
|
"pages/workBenchNew/components/workBenchWxUser/index",
|
||||||
|
"pages/workBenchNew/components/workBenchReading/index"
|
||||||
],
|
],
|
||||||
"subPackages": [
|
"subPackages": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async init(id, time, tenement) {
|
async init(id, time, tenement) {
|
||||||
console.log("time:", tenement)
|
|
||||||
const { code, message, detail, amount } = await getReportDetail(id, tenement)
|
const { code, message, detail, amount } = await getReportDetail(id, tenement)
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
@@ -171,7 +170,6 @@ Page({
|
|||||||
},
|
},
|
||||||
jumpToDetail(e) {
|
jumpToDetail(e) {
|
||||||
const { meter } = e.currentTarget.dataset;
|
const { meter } = e.currentTarget.dataset;
|
||||||
console.log("meter", meter)
|
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter),
|
url: '/pages/billMeterDetail/index?data=' + JSON.stringify(meter),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -81,9 +81,7 @@ Component({
|
|||||||
readingPage: 1,
|
readingPage: 1,
|
||||||
}, () => {
|
}, () => {
|
||||||
loadingFunc(async () => {
|
loadingFunc(async () => {
|
||||||
console.log("----------")
|
|
||||||
await this.getParkInfo(time)
|
await this.getParkInfo(time)
|
||||||
console.log("===========")
|
|
||||||
await this.getReadingList();
|
await this.getReadingList();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ Page({
|
|||||||
map(item => Number(item.replace(point, ""))).
|
map(item => Number(item.replace(point, ""))).
|
||||||
sort((a, b) => a - b).
|
sort((a, b) => a - b).
|
||||||
map(ele => `${ele}${point}`.padStart(3, "0"));
|
map(ele => `${ele}${point}`.padStart(3, "0"));
|
||||||
console.log(times)
|
|
||||||
const options = {
|
const options = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis'
|
trigger: 'axis'
|
||||||
@@ -297,8 +297,6 @@ Page({
|
|||||||
},
|
},
|
||||||
onOk(e) {
|
onOk(e) {
|
||||||
const { id, code, address } = e.detail.value;
|
const { id, code, address } = e.detail.value;
|
||||||
console.log('e', e)
|
|
||||||
console.log("id, code, address", id, code, address)
|
|
||||||
this.setData({
|
this.setData({
|
||||||
// year: currentYear,
|
// year: currentYear,
|
||||||
meterId: id,
|
meterId: id,
|
||||||
@@ -372,7 +370,7 @@ Page({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
readingChangeTime(e) {
|
readingChangeTime(e) {
|
||||||
console.log('e', e.detail)
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面初次渲染完成
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
|||||||
@@ -8,8 +8,18 @@ Component({
|
|||||||
*/
|
*/
|
||||||
properties: {
|
properties: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
|
// time: String,
|
||||||
},
|
},
|
||||||
|
// observers: {
|
||||||
|
// time: function(newValue) {
|
||||||
|
// if (!newValue) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// this.setData({
|
||||||
|
// currentDate: new Date(newValue).getTime(),
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
/**
|
/**
|
||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
*/
|
*/
|
||||||
@@ -20,7 +30,10 @@ Component({
|
|||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
attached() {
|
attached() {
|
||||||
console.log("attached", this.data.show)
|
this.setData({
|
||||||
|
maxDate: new Date().getTime(),
|
||||||
|
currentDate: new Date().getTime(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ Component({
|
|||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
handleChange(e) {
|
handleChange(e) {
|
||||||
console.log(e, this.data.active)
|
|
||||||
const { index } = e.currentTarget.dataset;
|
const { index } = e.currentTarget.dataset;
|
||||||
if (index === this.data.active) {
|
if (index === this.data.active) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -18,9 +18,10 @@ Component({
|
|||||||
show: Boolean,
|
show: Boolean,
|
||||||
park: String,
|
park: String,
|
||||||
isBack: Boolean,
|
isBack: Boolean,
|
||||||
|
filterBind: Boolean,
|
||||||
},
|
},
|
||||||
observers: {
|
observers: {
|
||||||
"show,type": function(newShow, newType) {
|
"show,type,filterBind": function(newShow, newType) {
|
||||||
if (newShow && newType) {
|
if (newShow && newType) {
|
||||||
this.onSearch()
|
this.onSearch()
|
||||||
}
|
}
|
||||||
@@ -61,7 +62,6 @@ Component({
|
|||||||
onConfirm(event) {
|
onConfirm(event) {
|
||||||
const { index } = event.detail;
|
const { index } = event.detail;
|
||||||
const { list = [], type } = this.data;
|
const { list = [], type } = this.data;
|
||||||
console.log("index", index)
|
|
||||||
const item = list[index];
|
const item = list[index];
|
||||||
if (!item) {
|
if (!item) {
|
||||||
alertInfo("请选择一项")
|
alertInfo("请选择一项")
|
||||||
@@ -97,7 +97,7 @@ Component({
|
|||||||
this.triggerEvent("confirm", { data: item, way: index, type } );
|
this.triggerEvent("confirm", { data: item, way: index, type } );
|
||||||
},
|
},
|
||||||
onSearch() {
|
onSearch() {
|
||||||
const { type } = this.data;
|
const { type, bind, filterBind } = this.data;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "park":
|
case "park":
|
||||||
this.onSearchPark();
|
this.onSearchPark();
|
||||||
@@ -126,8 +126,8 @@ Component({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async onSearchMeter() {
|
async onSearchMeter() {
|
||||||
const { searchText = "", park } = this.data;
|
const { searchText = "", park, filterBind } = this.data;
|
||||||
const { code, message, data: parks = [] } = await getParkSimpleMeterList({keyword: searchText, park});
|
const { code, message, data: parks = [] } = await getParkSimpleMeterList({keyword: searchText, park, isNeedBind: !filterBind});
|
||||||
if (code !== OK) {
|
if (code !== OK) {
|
||||||
alertInfo(message)
|
alertInfo(message)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ Page({
|
|||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const querys = decodeURIComponent(options.scene)
|
const querys = decodeURIComponent(options.scene)
|
||||||
console.log('querys', querys)
|
|
||||||
const id = querys.slice(querys.indexOf("=") + 1)
|
const id = querys.slice(querys.indexOf("=") + 1)
|
||||||
console.log("id", id)
|
|
||||||
this.getInfo(id);
|
this.getInfo(id);
|
||||||
},
|
},
|
||||||
async getInfo(id) {
|
async getInfo(id) {
|
||||||
|
|||||||
@@ -125,7 +125,6 @@ Page({
|
|||||||
wx.scanCode({
|
wx.scanCode({
|
||||||
scanType: "qrCode",
|
scanType: "qrCode",
|
||||||
success: ({ path }) => {
|
success: ({ path }) => {
|
||||||
console.log('path', path)
|
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/' + path,
|
url: '/' + path,
|
||||||
})
|
})
|
||||||
@@ -137,7 +136,6 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onConfirm(e) {
|
onConfirm(e) {
|
||||||
console.log('e', e.detail)
|
|
||||||
const { type, data = {} } = e.detail;
|
const { type, data = {} } = e.detail;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "park":
|
case "park":
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ Page({
|
|||||||
},
|
},
|
||||||
fail: function (e) {
|
fail: function (e) {
|
||||||
// alertError("打开失败")
|
// alertError("打开失败")
|
||||||
// console.log('打开失败错误为', e)
|
|
||||||
wx.showModal({
|
wx.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '打开失败,请复制链接后通过浏览器打开',
|
content: '打开失败,请复制链接后通过浏览器打开',
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ Page({
|
|||||||
const { token, ...user } = data
|
const { token, ...user } = data
|
||||||
wx.setStorageSync('user', user)
|
wx.setStorageSync('user', user)
|
||||||
wx.setStorageSync('token', data?.token)
|
wx.setStorageSync('token', data?.token)
|
||||||
|
console.log("user.workStatus", user.workStatus)
|
||||||
|
if (user.workStatus) {
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/workBenchNew/index',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
wx.switchTab({
|
wx.switchTab({
|
||||||
url: '/pages/home/index',
|
url: '/pages/home/index',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ Page({
|
|||||||
},
|
},
|
||||||
jumpToWorkBench() {
|
jumpToWorkBench() {
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: '/pages/workBench/index',
|
url: '/pages/workBenchNew/index',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
jumpToIntegral() {
|
jumpToIntegral() {
|
||||||
|
|||||||
30
pages/readingHistory/components/detailModal/index.js
Normal file
30
pages/readingHistory/components/detailModal/index.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// pages/readingHistory/components/detailModal/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
visible: Boolean,
|
||||||
|
detail: Object,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
showImage() {
|
||||||
|
this.setData({ show: true })
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.setData({ show: false })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
9
pages/readingHistory/components/detailModal/index.json
Normal file
9
pages/readingHistory/components/detailModal/index.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-image": "@vant/weapp/image/index",
|
||||||
|
"van-popup": "@vant/weapp/popup/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
64
pages/readingHistory/components/detailModal/index.wxml
Normal file
64
pages/readingHistory/components/detailModal/index.wxml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<!--pages/readingHistory/components/detailModal/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="详情"
|
||||||
|
show="{{ visible }}"
|
||||||
|
confirmButtonText="关闭"
|
||||||
|
bind:close="onClose"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.readAt }}"
|
||||||
|
label="时间"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ detail.overall }}"
|
||||||
|
placeholder="请输入读数"
|
||||||
|
label="读数"
|
||||||
|
readonly
|
||||||
|
type="digit"
|
||||||
|
border="{{ false }}"
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
wx:if="{{!!detail.url}}"
|
||||||
|
value="{{ detail.overall }}"
|
||||||
|
label="图片"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
title-width="100rpx"
|
||||||
|
use-button-slot
|
||||||
|
>
|
||||||
|
<view slot="input">
|
||||||
|
<van-image
|
||||||
|
width="100"
|
||||||
|
height="100"
|
||||||
|
fit="contain"
|
||||||
|
src="{{detail.url}}"
|
||||||
|
bind:click="showImage"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
||||||
|
|
||||||
|
<van-popup
|
||||||
|
show="{{ show }}"
|
||||||
|
bind:close="onClose"
|
||||||
|
z-index="99999"
|
||||||
|
>
|
||||||
|
<van-image
|
||||||
|
width="100vw"
|
||||||
|
height="99.1vh"
|
||||||
|
fit="contain"
|
||||||
|
src="{{detail.url}}"
|
||||||
|
bind:click="onClose"
|
||||||
|
/>
|
||||||
|
</van-popup>
|
||||||
1
pages/readingHistory/components/detailModal/index.wxss
Normal file
1
pages/readingHistory/components/detailModal/index.wxss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* pages/readingHistory/components/detailModal/index.wxss */
|
||||||
116
pages/readingHistory/components/editModal/index.js
Normal file
116
pages/readingHistory/components/editModal/index.js
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
// pages/workBench/components/tenement/components/bindMeter/index.js
|
||||||
|
// 0015980101
|
||||||
|
import { createReading, updateReading } from "../../../../service/workBench"
|
||||||
|
import { getWorkMeterDetail } from "../../../../service/meter"
|
||||||
|
import { alertInfo, alertSuccess, alertError } from "../../../../utils/index";
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
import dayjs from "../../../../utils/dayjs"
|
||||||
|
const { OK } = request
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
visible: Boolean,
|
||||||
|
title: String,
|
||||||
|
timeProps: String,
|
||||||
|
numberProps: String,
|
||||||
|
idProps: String,
|
||||||
|
meter: String,
|
||||||
|
park: String,
|
||||||
|
routeId: String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"timeProps": function(newValue) {
|
||||||
|
this.setData({
|
||||||
|
time: newValue,
|
||||||
|
// startTime: newValue
|
||||||
|
})
|
||||||
|
},
|
||||||
|
"numberProps": function(newValue) {
|
||||||
|
this.setData({
|
||||||
|
number: newValue
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
dateTimeShow: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
// this.triggerEvent("close")
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
[name]: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
const { time, number, idProps, park, meter, timeProps, routeId } = this.data;
|
||||||
|
if (time == null || number == null) {
|
||||||
|
alertInfo("请正确填写后保存")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!idProps) {
|
||||||
|
const { code, message } = await createReading(park, meter, routeId, {
|
||||||
|
overall: `${number}`,
|
||||||
|
flat: `${number}`,
|
||||||
|
readAt: time,
|
||||||
|
source: 1,
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("录入成功")
|
||||||
|
this.setData({ number: null, time: null, startTime: null })
|
||||||
|
} else {
|
||||||
|
const { code, message } = await updateReading(park, meter, new Date(timeProps).getTime() * 1000, {
|
||||||
|
overall: `${number}`,
|
||||||
|
flat: `${number}`,
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("录入成功")
|
||||||
|
this.setData({ number: null, time: null, startTime: null })
|
||||||
|
}
|
||||||
|
const that = this;
|
||||||
|
setTimeout(() => {
|
||||||
|
that.triggerEvent("ok")
|
||||||
|
}, 300)
|
||||||
|
},
|
||||||
|
|
||||||
|
dateTimeConfirm(e) {
|
||||||
|
this.setData({ time: e.detail.time, dateTimeShow: false })
|
||||||
|
},
|
||||||
|
dateTimeCancal(e) {
|
||||||
|
this.setData({ dateTimeShow: false })
|
||||||
|
},
|
||||||
|
onTimeFocus() {
|
||||||
|
this.setData({ dateTimeShow: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
10
pages/readingHistory/components/editModal/index.json
Normal file
10
pages/readingHistory/components/editModal/index.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"date-time-picker": "/components/DateTimePicker/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
54
pages/readingHistory/components/editModal/index.wxml
Normal file
54
pages/readingHistory/components/editModal/index.wxml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<!--pages/workBench/components/tenement/components/bindMeter/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="{{title}}"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
bind:close="onClose"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{ time }}"
|
||||||
|
placeholder="请选择绑定时间"
|
||||||
|
label="时间"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<!-- <van-button slot="button" size="small" type="info" bind:click="onTimeFocus" wx:if="{{!idProps}}">
|
||||||
|
选择
|
||||||
|
</van-button> -->
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ number }}"
|
||||||
|
placeholder="请输入读数"
|
||||||
|
label="读数"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="number"
|
||||||
|
type="digit"
|
||||||
|
border="{{ false }}"
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<date-time-picker
|
||||||
|
wx:if="{{dateTimeShow}}"
|
||||||
|
show="{{dateTimeShow}}"
|
||||||
|
time="{{startTime}}"
|
||||||
|
bind:confirm="dateTimeConfirm"
|
||||||
|
bind:cancel="dateTimeCancal"
|
||||||
|
/>
|
||||||
1
pages/readingHistory/components/editModal/index.wxss
Normal file
1
pages/readingHistory/components/editModal/index.wxss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/tenement/components/bindMeter/index.wxss */
|
||||||
24
pages/readingHistory/components/meterInfo/index.js
Normal file
24
pages/readingHistory/components/meterInfo/index.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
// pages/readingHistory/components/meterInfo/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
meterInfo: Object,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
8
pages/readingHistory/components/meterInfo/index.json
Normal file
8
pages/readingHistory/components/meterInfo/index.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"van-tag": "@vant/weapp/tag/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
68
pages/readingHistory/components/meterInfo/index.wxml
Normal file
68
pages/readingHistory/components/meterInfo/index.wxml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<!--pages/readingHistory/components/meterInfo/index.wxml-->
|
||||||
|
<view class="wrapper">
|
||||||
|
<view class="title">
|
||||||
|
<view class="address">
|
||||||
|
{{meterInfo.address}}
|
||||||
|
</view>
|
||||||
|
<view class="status">
|
||||||
|
<view wx:if="{{meterInfo.enabled}}">
|
||||||
|
正常
|
||||||
|
</view>
|
||||||
|
<view wx:else>
|
||||||
|
停用
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="detail">
|
||||||
|
<van-row gutter="20">
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view>
|
||||||
|
设备编号
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
{{meterInfo.meterSn}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view>
|
||||||
|
电表类型
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view wx:if="{{meterInfo.meterBelongType === 0}}">
|
||||||
|
商户电表
|
||||||
|
</view>
|
||||||
|
<view wx:elif="{{meterInfo.meterBelongType === 1}}">
|
||||||
|
公区电表
|
||||||
|
</view>
|
||||||
|
<view wx:elif="{{meterInfo.meterBelongType === 2}}">
|
||||||
|
公摊电表
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view>
|
||||||
|
最近读数
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
{{meterInfo.overall}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view>
|
||||||
|
读数日期
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
{{meterInfo.readAt}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
26
pages/readingHistory/components/meterInfo/index.wxss
Normal file
26
pages/readingHistory/components/meterInfo/index.wxss
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/* pages/readingHistory/components/meterInfo/index.wxss */
|
||||||
|
.wrapper {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
padding: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail .text {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
180
pages/readingHistory/index.js
Normal file
180
pages/readingHistory/index.js
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
// pages/readingHistory/index.js
|
||||||
|
import { getMeterReadingRouteMeterDetail, getReadingList, deleteReading } from "../../service/workBench"
|
||||||
|
import request from "../../utils/request"
|
||||||
|
import { alertInfo, alertSuccess, alertError, loadingFunc } from "../../utils/index"
|
||||||
|
const { OK } = request;
|
||||||
|
import dayjs from "../../utils/dayjs"
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
list: [],
|
||||||
|
page: 1,
|
||||||
|
size: 20,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
const { meter, park, routeId, disabled } = options;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
meter,
|
||||||
|
park,
|
||||||
|
routeId,
|
||||||
|
disabled
|
||||||
|
}, () => {
|
||||||
|
that.refresh();
|
||||||
|
})
|
||||||
|
this.getMeterInfo(meter);
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
const that = this;
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.getList();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onEditFinish() {
|
||||||
|
this.setData({
|
||||||
|
title: null,
|
||||||
|
visible: null,
|
||||||
|
time: null,
|
||||||
|
number: null,
|
||||||
|
id: null,
|
||||||
|
readAtTimestamp: null,
|
||||||
|
type: null,
|
||||||
|
})
|
||||||
|
this.refresh()
|
||||||
|
},
|
||||||
|
async getMeterInfo(id) {
|
||||||
|
const { code, message, data } = await getMeterReadingRouteMeterDetail(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({ meterInfo: data })
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
const { meter, park, page, size } = this.data;
|
||||||
|
const { code, message, records: data } = await getReadingList(park, meter, page)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data,
|
||||||
|
totalPage: Math.ceil(data?.length / size)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onChangePage(e) {
|
||||||
|
const newPage = e.detail.currentIndex;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
page: newPage
|
||||||
|
}, () => {
|
||||||
|
that.getList();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
handleCreate() {
|
||||||
|
this.setData({
|
||||||
|
title: "新增记录",
|
||||||
|
visible: true,
|
||||||
|
type: "create",
|
||||||
|
time: dayjs().format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdate(e) {
|
||||||
|
const { data } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
title: "编辑记录",
|
||||||
|
visible: true,
|
||||||
|
time: data.readAt,
|
||||||
|
number: data.overall,
|
||||||
|
id: data.id,
|
||||||
|
readAtTimestamp: data.readAtTimestamp,
|
||||||
|
type: "edit",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDetail(e) {
|
||||||
|
const { data } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
detail: data,
|
||||||
|
detailVisible: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(e) {
|
||||||
|
const { data } = e.currentTarget.dataset;
|
||||||
|
const that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '删除确认',
|
||||||
|
content: '确认要删除这一项记录吗?',
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
const { code, message } = await deleteReading(data?.id, data?.overall)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("删除成功")
|
||||||
|
setTimeout(() => {
|
||||||
|
that.refresh()
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
13
pages/readingHistory/index.json
Normal file
13
pages/readingHistory/index.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"meterInfo": "./components/meterInfo/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"van-icon": "@vant/weapp/icon/index",
|
||||||
|
"editModal": "./components/editModal/index",
|
||||||
|
"pagination": "/components/pagination/index",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"detailModal": "./components/detailModal/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
67
pages/readingHistory/index.wxml
Normal file
67
pages/readingHistory/index.wxml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<!--pages/readingHistory/index.wxml-->
|
||||||
|
<navigator title="历史抄表记录" canBack="{{true}}" />
|
||||||
|
<view class="wrapper">
|
||||||
|
<meterInfo meterInfo="{{meterInfo}}" />
|
||||||
|
<view class="historyTitle">
|
||||||
|
<view class="text">
|
||||||
|
抄表记录历史
|
||||||
|
</view>
|
||||||
|
<van-button disabled="{{disabled === 'true'}}" type="info" size="small" icon="plus" bind:tap="handleCreate"> 新增记录 </van-button>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<view class="tableWrapper">
|
||||||
|
<view class="table">
|
||||||
|
<view class="thead">
|
||||||
|
<view class="th" style="width: 40%; text-align: center;"> 抄表时间 </view>
|
||||||
|
<view class="th" style="width: 30%; text-align: center;"> 抄表读数 </view>
|
||||||
|
<view class="th" style="width: 30%; text-align: center;"> 操作 </view>
|
||||||
|
</view>
|
||||||
|
<view class="tbody">
|
||||||
|
<view wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
|
<view class="tr" style="display: flex; align-items: center; ">
|
||||||
|
<view class="th" style="width: 40%; text-align: center; font-size: 30rpx;">
|
||||||
|
{{ item.readAt }}
|
||||||
|
</view>
|
||||||
|
<view class="th" style="width: 30%; text-align: center; font-size: 30rpx;">
|
||||||
|
{{ item.overall }}
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="th" style="width: 30%; text-align: center; justify-content: center; display: flex; align-items: center;">
|
||||||
|
<van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="edit" size="40rpx" bind:tap="handleUpdate" data-data="{{item}}" color="#15755e" />
|
||||||
|
<van-icon wx:if="{{item.isDelete && disabled !== 'true'}}" name="delete" size="40rpx" bind:tap="handleDelete" data-data="{{item}}" color="#15755e" custom-style="margin-left: 20rpx" />
|
||||||
|
<van-icon name="ellipsis" size="40rpx" data-data="{{item}}" color="#15755e" bind:tap="handleDetail" custom-style="margin-left: 20rpx" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<empty bind:refresh="refresh" wx:else />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<editModal
|
||||||
|
wx:if="{{visible}}"
|
||||||
|
title="{{title}}"
|
||||||
|
visible="{{visible}}"
|
||||||
|
timeProps="{{time}}"
|
||||||
|
timeStamp="{{readAtTimestamp}}"
|
||||||
|
numberProps="{{number}}"
|
||||||
|
idProps="{{id}}"
|
||||||
|
park="{{park}}"
|
||||||
|
meter="{{meter}}"
|
||||||
|
bind:ok="onEditFinish"
|
||||||
|
startTime="{{startTime}}"
|
||||||
|
routeId="{{routeId}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<detailModal
|
||||||
|
visible="{{detailVisible}}"
|
||||||
|
detail="{{detail}}"
|
||||||
|
/>
|
||||||
77
pages/readingHistory/index.wxss
Normal file
77
pages/readingHistory/index.wxss
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/* pages/readingHistory/index.wxss */
|
||||||
|
page {
|
||||||
|
background-color: #ebedf0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
padding: 0 20rpx 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.historyTitle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.historyTitle .text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableWrapper {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding: 20rpx 12rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead {
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead .th {
|
||||||
|
padding: 10rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryTextBtn {
|
||||||
|
color: #1989fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .tr {
|
||||||
|
padding: 10rpx;
|
||||||
|
border-bottom: 1rpx solid #EEEEEE;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .tr {
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more-icon {
|
||||||
|
padding: 20rpx;
|
||||||
|
color: #1989fa;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -102,7 +102,6 @@ Page({
|
|||||||
},
|
},
|
||||||
onChangePay(e) {
|
onChangePay(e) {
|
||||||
const { id, name } = e;
|
const { id, name } = e;
|
||||||
console.log('e', e)
|
|
||||||
const { year, codeId } = this.data;
|
const { year, codeId } = this.data;
|
||||||
this.setData({
|
this.setData({
|
||||||
payType: name,
|
payType: name,
|
||||||
|
|||||||
@@ -71,11 +71,9 @@ Page({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: (res) => {
|
fail: (res) => {
|
||||||
console.log('fail', res)
|
|
||||||
alertInfo("请稍后重试")
|
alertInfo("请稍后重试")
|
||||||
},
|
},
|
||||||
complete: (res) => {
|
complete: (res) => {
|
||||||
console.log('complete')
|
|
||||||
that.handleGetMeterDetail(meter.id)
|
that.handleGetMeterDetail(meter.id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
103
pages/workBench/components/reading/index.js
Normal file
103
pages/workBench/components/reading/index.js
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
// pages/workBench/components/reading/index.js
|
||||||
|
import { getMeterReadingRouteList, changeMeterRouteStatus } from "../../../../service/workBench"
|
||||||
|
import { alertError, alertSuccess, loadingFunc } from "../../../../utils/index"
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
park: "",
|
||||||
|
parkName: ""
|
||||||
|
},
|
||||||
|
lifetimes: {
|
||||||
|
attached() {
|
||||||
|
if (this.data.parkName) {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onParkFocus(e) {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
const { parkName, park } = this.data;
|
||||||
|
const { code, message, data } = await getMeterReadingRouteList(parkName)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { data } = e.detail;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
parkName: data.name,
|
||||||
|
park: data.id,
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.onConcal();
|
||||||
|
},
|
||||||
|
onConcal() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToReading(e) {
|
||||||
|
const { id } = e.currentTarget.dataset;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/writeReading/index?id=${id}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async changeStartStatus(e) {
|
||||||
|
const that = this;
|
||||||
|
const { id } = e.currentTarget.dataset;
|
||||||
|
const { code, message } = await changeMeterRouteStatus({ id, status: 1 })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.init()
|
||||||
|
setTimeout(() => {
|
||||||
|
that.jumpToReading({ currentTarget: { dataset: { id } } })
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
|
async changeEndStatus(e) {
|
||||||
|
const { id } = e.currentTarget.dataset;
|
||||||
|
const { code, message } = await changeMeterRouteStatus({ id, status: 0 })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
16
pages/workBench/components/reading/index.json
Normal file
16
pages/workBench/components/reading/index.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-empty": "@vant/weapp/empty/index",
|
||||||
|
"table": "/components/table/table",
|
||||||
|
"pagination": "/components/pagination/index",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"van-radio": "@vant/weapp/radio/index",
|
||||||
|
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"van-cell": "@vant/weapp/cell/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
64
pages/workBench/components/reading/index.wxml
Normal file
64
pages/workBench/components/reading/index.wxml
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<!--pages/workBench/components/reading/index.wxml-->
|
||||||
|
<van-field
|
||||||
|
value="{{ parkName }}"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
label="园区"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onConcal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<van-empty description="请先选择园区" wx:if="{{!park}}" />
|
||||||
|
|
||||||
|
<view wx:else>
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<van-cell
|
||||||
|
wx:for="{{list}}"
|
||||||
|
wx:key="id"
|
||||||
|
title="{{item.readingRouteName}}"
|
||||||
|
label="包含{{item.meterRoute}}个抄表点"
|
||||||
|
>
|
||||||
|
<view slot="right-icon">
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
bind:tap="changeStartStatus"
|
||||||
|
custom-style="margin-right: 20rpx;"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
wx:if="{{item.status === 0}}"
|
||||||
|
> 开始抄表 </van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
bind:tap="jumpToReading"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
custom-style="margin-right: 20rpx;"
|
||||||
|
wx:if="{{item.status === 1}}"
|
||||||
|
> 去抄表 </van-button>
|
||||||
|
<van-button
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
bind:tap="changeEndStatus"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
wx:if="{{item.status === 1}}"
|
||||||
|
> 结束抄表 </van-button>
|
||||||
|
</view>
|
||||||
|
</van-cell>
|
||||||
|
</view>
|
||||||
|
<empty wx:else bind:refresh="init" />
|
||||||
|
</view>
|
||||||
1
pages/workBench/components/reading/index.wxss
Normal file
1
pages/workBench/components/reading/index.wxss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/reading/index.wxss */
|
||||||
@@ -23,7 +23,6 @@ Component({
|
|||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
changeQueryType(e) {
|
changeQueryType(e) {
|
||||||
console.log("change", e)
|
|
||||||
const { type } = e.currentTarget.dataset;
|
const { type } = e.currentTarget.dataset;
|
||||||
this.setData({
|
this.setData({
|
||||||
active: type
|
active: type
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ Component({
|
|||||||
onConfirm(e) {
|
onConfirm(e) {
|
||||||
const { type, data } = e.detail;
|
const { type, data } = e.detail;
|
||||||
const that = this;
|
const that = this;
|
||||||
console.log("e.deail", e.detail)
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "meter":
|
case "meter":
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ Component({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
onBindClose() {
|
onBindClose() {
|
||||||
console.log("-----------")
|
|
||||||
this.setData({
|
this.setData({
|
||||||
bindVisible: false,
|
bindVisible: false,
|
||||||
})
|
})
|
||||||
@@ -185,7 +184,7 @@ Component({
|
|||||||
this.getTenementMeters();
|
this.getTenementMeters();
|
||||||
},
|
},
|
||||||
onTimeConfirm(e) {
|
onTimeConfirm(e) {
|
||||||
console.log('e', e)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -5,14 +5,14 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
active: 0,
|
active: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
|
||||||
},
|
},
|
||||||
onTabChange(e) {
|
onTabChange(e) {
|
||||||
this.setData({ active: e.detail.index })
|
this.setData({ active: e.detail.index })
|
||||||
@@ -28,7 +28,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
console.log("this,data", this.data)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"navigator": "/components/navigator/index",
|
"navigator": "/components/navigator/index",
|
||||||
"recharge": "./components/recharge/index",
|
"recharge": "./components/recharge/index",
|
||||||
"record": "./components/record/index",
|
"record": "./components/record/index",
|
||||||
|
"reading": "./components/reading/index",
|
||||||
"tenement": "./components/tenement/index",
|
"tenement": "./components/tenement/index",
|
||||||
"account": "./components/account/index"
|
"account": "./components/account/index"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,4 +13,7 @@
|
|||||||
<van-tab title="C端账号" >
|
<van-tab title="C端账号" >
|
||||||
<account />
|
<account />
|
||||||
</van-tab>
|
</van-tab>
|
||||||
|
<van-tab title="抄表">
|
||||||
|
<reading />
|
||||||
|
</van-tab>
|
||||||
</van-tabs>
|
</van-tabs>
|
||||||
@@ -0,0 +1,279 @@
|
|||||||
|
// pages/workBench/components/recharge/components/waitApprove/index.js
|
||||||
|
import {
|
||||||
|
alertInfo,
|
||||||
|
alertSuccess,
|
||||||
|
loadingFunc
|
||||||
|
} from "../../../../../../utils/index";
|
||||||
|
import {
|
||||||
|
getRechargeApproveList,
|
||||||
|
rechargeApprove
|
||||||
|
} from "../../../../../../service/recharge"
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
import dayjs from "../../../../../../utils/dayjs"
|
||||||
|
const {
|
||||||
|
OK
|
||||||
|
} = request
|
||||||
|
|
||||||
|
// pages/workBench/components/record/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
status: Number
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
keyword: "",
|
||||||
|
keywordTemp: "",
|
||||||
|
page: 1,
|
||||||
|
currentActionSheet: null,
|
||||||
|
actionItems: [{
|
||||||
|
name: '查看详细',
|
||||||
|
value: 'detail'
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
|
||||||
|
lifetimes: {
|
||||||
|
attached() {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await this.init();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onParkFocus(e) {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const {
|
||||||
|
data
|
||||||
|
} = e.detail;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
parkName: data.name,
|
||||||
|
park: data.id,
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.onCancel();
|
||||||
|
},
|
||||||
|
onSearchKeyword(e) {
|
||||||
|
const that = this;
|
||||||
|
that.setData({
|
||||||
|
keyword: e.detail
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeKeyword(e) {
|
||||||
|
this.setData({
|
||||||
|
keywordTemp: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSearch() {
|
||||||
|
const that = this;
|
||||||
|
that.setData({
|
||||||
|
keyword: that.data.keywordTemp
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
const {
|
||||||
|
page,
|
||||||
|
keyword,
|
||||||
|
park,
|
||||||
|
status
|
||||||
|
} = this.data;
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
message,
|
||||||
|
data,
|
||||||
|
total
|
||||||
|
} = await getRechargeApproveList({
|
||||||
|
park,
|
||||||
|
page,
|
||||||
|
keyword,
|
||||||
|
status
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data.map(item => {
|
||||||
|
item.topTime = dayjs(item.topTime).format("MM-DD")
|
||||||
|
return item
|
||||||
|
}),
|
||||||
|
total: total,
|
||||||
|
totalPage: Math.ceil(total / 20)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeReason(e) {
|
||||||
|
this.setData({
|
||||||
|
reason: e.detail,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onApproveClose() {
|
||||||
|
this.setData({
|
||||||
|
reason: "",
|
||||||
|
approveShow: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onApproveConfirm() {
|
||||||
|
const {
|
||||||
|
reason,
|
||||||
|
record
|
||||||
|
} = this.data;
|
||||||
|
const that = this;
|
||||||
|
if (!reason) {
|
||||||
|
alertInfo("请输入拒绝理由")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loadingFunc(async () => {
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
message
|
||||||
|
} = await rechargeApprove({
|
||||||
|
id: record,
|
||||||
|
status: 1,
|
||||||
|
reason
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("已拒绝")
|
||||||
|
that.init();
|
||||||
|
that.setData({
|
||||||
|
reason: "",
|
||||||
|
approveShow: false,
|
||||||
|
record: "",
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
handleApprove(e) {
|
||||||
|
const status = e.currentTarget.dataset.status;
|
||||||
|
const that = this;
|
||||||
|
if (status === '1') {
|
||||||
|
this.setData({
|
||||||
|
approveShow: true
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
record,
|
||||||
|
list
|
||||||
|
} = this.data;
|
||||||
|
const item = list.find(ele => ele.id === record)
|
||||||
|
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确认要同意${item?.tenement?.shortName || 当前记录}吗?`,
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (res.confirm) {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
const {
|
||||||
|
code,
|
||||||
|
message
|
||||||
|
} = await rechargeApprove({
|
||||||
|
id: record,
|
||||||
|
status: 0,
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("已同意")
|
||||||
|
that.init();
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
showActionMenu(e) {
|
||||||
|
this.setData({
|
||||||
|
currentActionSheet: e.currentTarget.dataset.id
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
hideActionMenu() {
|
||||||
|
this.setData({
|
||||||
|
currentActionSheet: null
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
onMenuSelect(e) {
|
||||||
|
const {
|
||||||
|
value
|
||||||
|
} = e.detail;
|
||||||
|
const id = e.currentTarget.dataset.id;
|
||||||
|
|
||||||
|
if (value === 'detail') {
|
||||||
|
this.jumpToDetail({
|
||||||
|
currentTarget: {
|
||||||
|
dataset: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
jumpToDetail(e) {
|
||||||
|
const {
|
||||||
|
id
|
||||||
|
} = e.currentTarget.dataset;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/rechargeDetail/index?id=' + id,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onChangePage(e) {
|
||||||
|
const page = e.detail.currentIndex;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
page
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeSelectRecharge(e) {
|
||||||
|
this.setData({
|
||||||
|
record: e.detail
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-empty": "@vant/weapp/empty/index",
|
||||||
|
"table": "/components/table/table",
|
||||||
|
"pagination": "/components/pagination/index",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"van-radio": "@vant/weapp/radio/index",
|
||||||
|
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"searchSelectWrapper": "/components/searchSelectWrapper/index",
|
||||||
|
"van-icon": "@vant/weapp/icon/index",
|
||||||
|
"van-action-sheet": "@vant/weapp/action-sheet/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<!--pages/workBench/components/recharge/components/waitApprove/index.wxml-->
|
||||||
|
<searchSelectWrapper label="园区" placeholder="请选择园区" text="{{parkName}}" bind:search="onParkFocus" />
|
||||||
|
|
||||||
|
<searchSelectWrapper label="关键字" placeholder="请输入关键字" text="{{meterName}}" bind:searchKeyword="onSearchKeyword" type="inputSearch" />
|
||||||
|
<view>
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<view class="operate" wx:if="{{status === 2}}">
|
||||||
|
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
|
||||||
|
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleApprove" data-status="0" disabled="{{!record}}"> 同意 </van-button>
|
||||||
|
<van-button size="small" bind:click="handleClear" disabled="{{!record}}" bind:click="handleApprove" data-status="1"> 拒绝 </van-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tableWrapper">
|
||||||
|
<view class="table">
|
||||||
|
<view class="thead">
|
||||||
|
<view class="th" style="flex: 0 0 80rpx; display: {{status === 2 ? 'block' : 'none'}};"> </view>
|
||||||
|
<!-- <view class="th" style="flex: 0 0 0rpx; display: {{status === 1 ? 'block' : 'none'}};"> </view> -->
|
||||||
|
<view class="th" style="flex: 0 0 130rpx;"> 商户名字</view>
|
||||||
|
<view class="th" style="flex: 0 0 150rpx;"> 充值金额 </view>
|
||||||
|
<view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">状态</view>
|
||||||
|
<view class="th" style="flex: 0 0 150rpx;">提交时间</view>
|
||||||
|
<view class="th"style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;"> 操作 </view>
|
||||||
|
</view>
|
||||||
|
<view class="tbody">
|
||||||
|
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||||
|
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
|
<view class="tr" style="display: flex; align-items: center; ">
|
||||||
|
<view class="th" style="flex: 0 0 80rpx; ; display: {{status === 2 ? 'block' : 'none'}};">
|
||||||
|
<van-radio wx:if="{{status === 2}}" name="{{item.id}}"></van-radio>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="flex: 0 0 130rpx;">
|
||||||
|
{{ item.tenement.shortName }}
|
||||||
|
</view>
|
||||||
|
<view class="th" style="flex: 0 0 150rpx;">
|
||||||
|
{{ item.money }}
|
||||||
|
</view>
|
||||||
|
<view class="th" style="flex: 0 0 150rpx; display: {{status === 1 ? 'block' : 'none'}};">
|
||||||
|
<view class="tag">{{item.orderStatus}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="th" style="flex: 0 0 150rpx; font-size: 30rpx;">
|
||||||
|
{{item.topTime}}
|
||||||
|
</view>
|
||||||
|
<view class="th" style="flex: 0 0 120rpx; justify-content: flex-end; display: flex; align-items: center;">
|
||||||
|
<van-icon name="ellipsis" size="24px" bind:tap="showActionMenu" data-id="{{item.id}}" class="more-icon" />
|
||||||
|
<van-action-sheet show="{{ currentActionSheet === item.id }}" actions="{{ actionItems }}" bind:close="hideActionMenu" bind:select="onMenuSelect" data-id="{{item.id}}" close-on-click-action />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</block>
|
||||||
|
</van-radio-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<empty bind:refresh="init" wx:else />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<search-select show="{{show}}" title="{{title}}" type="{{type}}" park="{{park}}" bindconfirm="onConfirm" bindcancel="onCancel" />
|
||||||
|
|
||||||
|
<van-dialog use-slot title="审核" show="{{ approveShow }}" show-cancel-button bind:close="onApproveClose" bind:confirm="onApproveConfirm">
|
||||||
|
<van-field label="拒绝理由" value="{{ reason }}" placeholder="请输入拒绝理由" bind:change="onChangeReason" />
|
||||||
|
</van-dialog>
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/* pages/workBench/components/recharge/components/waitApprove/index.wxss */
|
||||||
|
.table {
|
||||||
|
width: 500rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableWrapper {
|
||||||
|
width: 100vw;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead {
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.thead .th {
|
||||||
|
padding: 10rpx;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryTextBtn {
|
||||||
|
color: #1989fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody {
|
||||||
|
width: 500rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .tr {
|
||||||
|
padding: 10rpx;
|
||||||
|
border-bottom: 1rpx solid #EEEEEE;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .tr {
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more-icon {
|
||||||
|
padding: 20rpx;
|
||||||
|
color: #1989fa;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 基础标签样式 */
|
||||||
|
.tag {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 4px 5px;
|
||||||
|
margin-right: 0px;
|
||||||
|
border-radius: 16px;
|
||||||
|
background: #07c160;
|
||||||
|
color: white;
|
||||||
|
font-size: 25rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 激活状态样式 */
|
||||||
|
.tag.active {
|
||||||
|
background: #07c160;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
// pages/workBench/components/recharge/components/reharge/index.js
|
||||||
|
|
||||||
|
import { handleRecharge } from "../../../../../../service/recharge";
|
||||||
|
import { alertInfo, alertSuccess, loadingFunc } from "../../../../../../utils/index";
|
||||||
|
import request from '../../../../../../utils/request'
|
||||||
|
const { OK } = request;
|
||||||
|
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onParkFocus() {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onMeterFocus() {
|
||||||
|
const { park } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请先选择园区")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "电表",
|
||||||
|
type: 'meter'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { data, type, way } = e.detail;
|
||||||
|
switch(type) {
|
||||||
|
case "park":
|
||||||
|
this.setData({
|
||||||
|
parkName: data.name,
|
||||||
|
park: data.id,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case "meter":
|
||||||
|
this.setData({
|
||||||
|
meterName: `${data.meterNo}-${data.address}${data.tenement?.name ? '-' + data.tenement?.name : ''}`,
|
||||||
|
meter: data.id,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case "pay":
|
||||||
|
this.setData({
|
||||||
|
payName: data,
|
||||||
|
way: way,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.onCancel();
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onPayFocus() {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "付款方式",
|
||||||
|
type: 'pay'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeMoney(e) {
|
||||||
|
this.setData({ money: e.detail })
|
||||||
|
},
|
||||||
|
onChangeVoucherNo(e) {
|
||||||
|
this.setData({ voucherNo: e.detail })
|
||||||
|
},
|
||||||
|
handleClear() {
|
||||||
|
this.setData({
|
||||||
|
park: "",
|
||||||
|
parkName: "",
|
||||||
|
meter: "",
|
||||||
|
meterName: "",
|
||||||
|
way: "",
|
||||||
|
payName: "",
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
money: null,
|
||||||
|
voucherNo: null
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async handleSubmit() {
|
||||||
|
const that = this;
|
||||||
|
const { park, meter, money, way, voucherNo } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请选择园区");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!meter) {
|
||||||
|
alertInfo("请选择电表")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!money) {
|
||||||
|
alertInfo("请输入金额")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!way && way !== 0) {
|
||||||
|
alertInfo("请选择付款方式")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!voucherNo) {
|
||||||
|
alertInfo("请输入凭证号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loadingFunc(async () => {
|
||||||
|
const { code, message } = await handleRecharge(park, {
|
||||||
|
amount: `${money || ''}`,
|
||||||
|
meter,
|
||||||
|
paymentType: way,
|
||||||
|
voucherNo,
|
||||||
|
type: 0
|
||||||
|
})
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("充值成功")
|
||||||
|
setTimeout(() => {
|
||||||
|
that.handleClear()
|
||||||
|
that.setData({
|
||||||
|
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-popup": "@vant/weapp/popup/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<!--pages/workBench/components/recharge/components/reharge/index.wxml-->
|
||||||
|
<van-cell-group>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="园区"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
text="{{parkName}}"
|
||||||
|
bind:search="onParkFocus"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="电表"
|
||||||
|
placeholder="请选择电表"
|
||||||
|
text="{{meterName}}"
|
||||||
|
bind:search="onMeterFocus"
|
||||||
|
/>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="金额"
|
||||||
|
placeholder="请输入金额"
|
||||||
|
text="{{meterName}}"
|
||||||
|
fieldType="number"
|
||||||
|
type="input"
|
||||||
|
bind:changeText="onChangeMoney"
|
||||||
|
/>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="付款方式"
|
||||||
|
placeholder="请选择付款方式"
|
||||||
|
text="{{payName}}"
|
||||||
|
bind:search="onPayFocus"
|
||||||
|
/>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="凭证"
|
||||||
|
placeholder="请输入凭证"
|
||||||
|
type="input"
|
||||||
|
bind:changeText="onChangeVoucherNo"
|
||||||
|
/>
|
||||||
|
</van-cell-group>
|
||||||
|
|
||||||
|
<view style="margin-top: 60rpx;display: flex; justify-content: center; align-items: center;">
|
||||||
|
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="handleSubmit"> 确认 </van-button>
|
||||||
|
<van-button size="small" bind:click="handleClear"> 清空 </van-button>
|
||||||
|
</view>
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
wx:if="{{show}}"
|
||||||
|
/>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/recharge/components/reharge/index.wxss */
|
||||||
72
pages/workBenchNew/components/workBenchApprove/index.js
Normal file
72
pages/workBenchNew/components/workBenchApprove/index.js
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
// pages/workBenchNew/components/workBenchApprove/index.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
active: 0,
|
||||||
|
segmentedList: ['待审核', '已审核', '充值'],
|
||||||
|
},
|
||||||
|
changeQueryType(e) {
|
||||||
|
const { type } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
active: type
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
12
pages/workBenchNew/components/workBenchApprove/index.json
Normal file
12
pages/workBenchNew/components/workBenchApprove/index.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"segmented": "/components/Segmented/index",
|
||||||
|
"recharge": "./components/reharge/index",
|
||||||
|
"approve": "./components/approve/index",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"navigator": "/components/navigator/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
21
pages/workBenchNew/components/workBenchApprove/index.wxml
Normal file
21
pages/workBenchNew/components/workBenchApprove/index.wxml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<!--pages/workBench/components/recharge/index.wxml-->
|
||||||
|
<navigator title="充值审核" canBack="{{true}}" />
|
||||||
|
<view style="">
|
||||||
|
<view class="typeQuery">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="8">
|
||||||
|
<view class="typeQueryText" style="color: {{active === 0 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{0}}"> 待审核 </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="8">
|
||||||
|
<view class="typeQueryText" style="color: {{active === 1 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{1}}"> 已审核 </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="8">
|
||||||
|
<view class="typeQueryText" style="color: {{active === 2 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{2}}"> 充值 </view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<approve status="{{2}}" wx:if="{{active === 0}}" />
|
||||||
|
<approve status="{{1}}" wx:if="{{active === 1}}" />
|
||||||
|
<recharge wx:if="{{active === 2}}" />
|
||||||
27
pages/workBenchNew/components/workBenchApprove/index.wxss
Normal file
27
pages/workBenchNew/components/workBenchApprove/index.wxss
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/* pages/workBench/components/recharge/index.wxss */
|
||||||
|
page {
|
||||||
|
background-color: rgb(228,240,236);
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.query {
|
||||||
|
margin: 20rpx 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.typeQueryText {
|
||||||
|
text-align: center;
|
||||||
|
padding: 20rpx;
|
||||||
|
background-color: var(--light-green);
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select {
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
padding: 12rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
218
pages/workBenchNew/components/workBenchMeter/index.js
Normal file
218
pages/workBenchNew/components/workBenchMeter/index.js
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
// pages/workBenchNew/components/workBenchMeter/index.js
|
||||||
|
|
||||||
|
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
|
||||||
|
import { getParkMeterList, handleOperateMeterSwitch } from "../../../../service/meter"
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
keyword: "",
|
||||||
|
keywordTemp: "",
|
||||||
|
page: 1,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
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 } = 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,
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.onCancel();
|
||||||
|
},
|
||||||
|
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, park, meter } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { code, message, data, total } = await getParkMeterList({ park, keyword: meter, 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();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeSelectMeter(e) {
|
||||||
|
this.setData({
|
||||||
|
meter: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async handleMeterSwitchOn() {
|
||||||
|
const that = this;
|
||||||
|
const { meter, meterName } = this.data;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确认要对${meterName || 当前电表}进行合闸吗?`,
|
||||||
|
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, meterName } = this.data;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `您确认要对${meterName || 当前电表}进行拉闸吗?`,
|
||||||
|
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();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
19
pages/workBenchNew/components/workBenchMeter/index.json
Normal file
19
pages/workBenchNew/components/workBenchMeter/index.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
102
pages/workBenchNew/components/workBenchMeter/index.wxml
Normal file
102
pages/workBenchNew/components/workBenchMeter/index.wxml
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<!--pages/workBench/components/record/index.wxml-->
|
||||||
|
<navigator title="电表信息" canBack="{{true}}" />
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="园区"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
text="{{parkName}}"
|
||||||
|
bind:search="onParkFocus"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="电表"
|
||||||
|
placeholder="请选择电表"
|
||||||
|
text="{{meterName}}"
|
||||||
|
bind:search="onMeterFocus"
|
||||||
|
/>
|
||||||
|
<van-empty wx:if="{{!meter}}" description="选择电表后查看" />
|
||||||
|
<view wx:else>
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<view class="operate">
|
||||||
|
<view style="margin-top: 24rpx; margin-bottom: 24rpx;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 class="customTable" wx:for="{{list}}" wx:key="id">
|
||||||
|
<view class="customTableTile">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="8">
|
||||||
|
<view style="text-align: center;"> {{item.tenement.shortName}} </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="16"><view style="margin-left: 16rpx;">{{item.tenement.name}}</view> </van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
<view class="customTableContent">
|
||||||
|
<van-row >
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableRow">
|
||||||
|
<van-row gutter="5">
|
||||||
|
<van-col span="8" wx:if="{{item.type === 0}}">
|
||||||
|
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 商户电表 </view></van-col>
|
||||||
|
<van-col span="8" wx:elif="{{item.type === 2}}">
|
||||||
|
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 公摊电表 </view></van-col>
|
||||||
|
<van-col span="8" wx:else>
|
||||||
|
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 园区电表 </view></van-col>
|
||||||
|
<van-col span="16">表号:{{item.meterNo}}</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableRow">
|
||||||
|
<van-row gutter="5">
|
||||||
|
<van-col span="8">
|
||||||
|
<view style="text-align: center;border-right: 1rpx solid #ccc;"> {{item.address}} </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="16">SN:{{item.meterSn}}</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableRow">
|
||||||
|
<van-row gutter="5">
|
||||||
|
<van-col span="8">
|
||||||
|
<view style="text-align: center;border-right: 1rpx solid #ccc;"> 表字:{{item.amount}} </view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="16">余额:{{item.money}}</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableRow">
|
||||||
|
<van-row gutter="5">
|
||||||
|
<van-col span="8" wx:if="{{item.onPosition === 0}}">
|
||||||
|
<view style="text-align: center;border-right: 1rpx solid #ccc;">合闸</view> </van-col>
|
||||||
|
<van-col span="8" wx:else><view style="text-align: center;border-right: 1rpx solid #ccc;">拉闸</view> </van-col>
|
||||||
|
<van-col span="8" wx:if="{{item.canConnect}}"><view style="text-align: center;">在线</view> </van-col>
|
||||||
|
<van-col span="8" wx:else><view style="text-align: center;">失联</view> </van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<empty bind:refresh="init" wx:else />
|
||||||
|
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
wx:if="{{show}}"
|
||||||
|
/>
|
||||||
63
pages/workBenchNew/components/workBenchMeter/index.wxss
Normal file
63
pages/workBenchNew/components/workBenchMeter/index.wxss
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTable {
|
||||||
|
margin: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTableTile {
|
||||||
|
background-color: var(--light-green);
|
||||||
|
padding: 16rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableRow {
|
||||||
|
padding: 16rpx;
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
border-top: 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: rgb(228,240,236);
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
190
pages/workBenchNew/components/workBenchReading/index.js
Normal file
190
pages/workBenchNew/components/workBenchReading/index.js
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
// pages/workBenchNew/components/workBenchReading/index.js
|
||||||
|
import { getMeterReadingRouteList, changeMeterRouteStatus, checkReadingFinish } from "../../../../service/workBench"
|
||||||
|
import { alertError, alertSuccess, loadingFunc } from "../../../../utils/index"
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
park: "",
|
||||||
|
parkName: "",
|
||||||
|
},
|
||||||
|
onParkFocus(e) {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
const { parkName, park } = this.data;
|
||||||
|
const { code, message, data } = await getMeterReadingRouteList(parkName)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { data } = e.detail;
|
||||||
|
const that = this;
|
||||||
|
this.setData({
|
||||||
|
parkName: data.name,
|
||||||
|
park: data.id,
|
||||||
|
}, () => {
|
||||||
|
loadingFunc(async () => {
|
||||||
|
await that.init();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.onConcal();
|
||||||
|
},
|
||||||
|
onConcal() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToReading(e) {
|
||||||
|
const { id, type } = e.currentTarget.dataset;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/writeReading/index?id=${id}&type=${type}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async changeStartStatus(e) {
|
||||||
|
const that = this;
|
||||||
|
const { id, routeid: routeId } = e.currentTarget.dataset;
|
||||||
|
const { code, message } = await changeMeterRouteStatus({ id, status: 1, routeId })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.init()
|
||||||
|
setTimeout(() => {
|
||||||
|
that.jumpToReading({ currentTarget: { dataset: { id } } })
|
||||||
|
}, 500)
|
||||||
|
},
|
||||||
|
// async checkFinish(id) {
|
||||||
|
|
||||||
|
// return {data, num};
|
||||||
|
// },
|
||||||
|
async changeEndStatus(e) {
|
||||||
|
const that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '确认要结束吗?',
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
const { id, routeid: routeId } = e.currentTarget.dataset;
|
||||||
|
const { code, message, data, num } = await checkReadingFinish(id || this.data.routeId);
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("data", data, "num", num)
|
||||||
|
if (!data) {
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `该路线还有${num}块电表还没有抄完,是否确认结束结束抄表?`,
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
const { code: cd, message } = await changeMeterRouteStatus({ id, status: 0, routeId })
|
||||||
|
if (cd !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
that.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { code: c, message: m } = await changeMeterRouteStatus({ id, status: 0, routeId })
|
||||||
|
if (c !== OK) {
|
||||||
|
alertError(m)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
that.init()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
const { parkName } = this.data;
|
||||||
|
if (!parkName) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
17
pages/workBenchNew/components/workBenchReading/index.json
Normal file
17
pages/workBenchNew/components/workBenchReading/index.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-empty": "@vant/weapp/empty/index",
|
||||||
|
"table": "/components/table/table",
|
||||||
|
"pagination": "/components/pagination/index",
|
||||||
|
"empty": "/components/empty/index",
|
||||||
|
"van-radio": "@vant/weapp/radio/index",
|
||||||
|
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"van-cell": "@vant/weapp/cell/index",
|
||||||
|
"navigator": "/components/navigator/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
72
pages/workBenchNew/components/workBenchReading/index.wxml
Normal file
72
pages/workBenchNew/components/workBenchReading/index.wxml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<!--pages/workBench/components/reading/index.wxml-->
|
||||||
|
<navigator title="抄表记录录入" canBack="{{true}}" />
|
||||||
|
<van-field
|
||||||
|
value="{{ parkName }}"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
label="园区"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="primary" bind:click="onParkFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onConcal"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<van-empty description="请先选择园区" wx:if="{{!park}}" />
|
||||||
|
|
||||||
|
<view wx:else>
|
||||||
|
<view wx:if="{{list.length}}">
|
||||||
|
<van-cell
|
||||||
|
wx:for="{{list}}"
|
||||||
|
wx:key="id"
|
||||||
|
title="{{item.readingRouteName}}"
|
||||||
|
label="包含{{item.meterRoute}}个抄表点"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
data-type="look"
|
||||||
|
catch:click="jumpToReading"
|
||||||
|
>
|
||||||
|
<view slot="right-icon">
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
catch:tap="changeStartStatus"
|
||||||
|
data-routeId="{{item.readingRouteId}}"
|
||||||
|
custom-style="margin-right: 20rpx;"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
|
||||||
|
wx:if="{{item.status === 0}}"
|
||||||
|
> 开始抄表 </van-button>
|
||||||
|
<van-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
catch:tap="jumpToReading"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
data-type="edit"
|
||||||
|
custom-style="margin-right: 20rpx;"
|
||||||
|
wx:if="{{item.status === 1}}"
|
||||||
|
> 去抄表 </van-button>
|
||||||
|
<van-button
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
catch:tap="changeEndStatus"
|
||||||
|
data-id="{{item.id}}"
|
||||||
|
wx:if="{{item.status === 1}}"
|
||||||
|
data-routeId="{{item.readingRouteId}}"
|
||||||
|
> 结束抄表 </van-button>
|
||||||
|
</view>
|
||||||
|
</van-cell>
|
||||||
|
</view>
|
||||||
|
<empty wx:else bind:refresh="init" />
|
||||||
|
</view>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBenchNew/components/workBenchReading/index.wxss */
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
// pages/workBench/components/tenement/components/bindMeter/index.js
|
||||||
|
// 0015980101
|
||||||
|
import { bindMeter, } from "../../../../../../service/tenement"
|
||||||
|
import { getWorkMeterDetail } from "../../../../../../service/meter"
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
import dayjs from "../../../../../../utils/dayjs"
|
||||||
|
const { OK } = request
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
tenement: String,
|
||||||
|
tenementName: String,
|
||||||
|
park: String,
|
||||||
|
visible: Boolean,
|
||||||
|
meterId: String,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
dateTimeShow: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onMeterFocus(e) {
|
||||||
|
const { park } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请先选择园区")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "电表",
|
||||||
|
type: 'meter'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
// this.triggerEvent("close")
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
title: "",
|
||||||
|
type: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
[name]: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
const { overall, critical, peak, valley, park, tenement, meter, readAt, flat } = this.data;
|
||||||
|
const { code, message } = await bindMeter(
|
||||||
|
park,
|
||||||
|
tenement,
|
||||||
|
{
|
||||||
|
code: meter,
|
||||||
|
overall:overall? Number(overall) : overall,
|
||||||
|
critical : critical ? Number(critical) : critical,
|
||||||
|
peak: peak ? Number(peak) : peak,
|
||||||
|
flat: flat ? Number(flat) : flat,
|
||||||
|
valley : valley ? Number(valley) : valley,
|
||||||
|
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("绑定成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { type, data } = e.detail;
|
||||||
|
const that = this;
|
||||||
|
switch(type) {
|
||||||
|
case "meter":
|
||||||
|
this.setData({
|
||||||
|
meter: data.id,
|
||||||
|
meterName: data.address,
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
this.getMeterDetail(data.id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getMeterDetail(id) {
|
||||||
|
const { code, message, data } = await getWorkMeterDetail(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
overall: data?.overall ? Number(data?.overall || 0) : null,
|
||||||
|
critical: data?.overall ? Number(data?.sharp || 0) : null,
|
||||||
|
peak: data?.overall ? Number(data?.peak || 0) : null,
|
||||||
|
flat: data?.overall ? Number(data?.flat || 0) : null,
|
||||||
|
valley: data?.overall ? Number(data?.valley || 0) : null,
|
||||||
|
meter04kvType: data?.meter04kvType,
|
||||||
|
status: data?.breakType ? '合闸' : "分闸",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
dateTimeConfirm(e) {
|
||||||
|
this.setData({ readAt: e.detail.time, dateTimeShow: false })
|
||||||
|
},
|
||||||
|
dateTimeCancal(e) {
|
||||||
|
this.setData({ dateTimeShow: false })
|
||||||
|
},
|
||||||
|
onTimeFocus() {
|
||||||
|
this.setData({ dateTimeShow: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"date-time-picker": "/components/DateTimePicker/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
<!--pages/workBench/components/tenement/components/bindMeter/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="绑定表计"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
bind:close="onClose"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{tenementName}}"
|
||||||
|
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="info" bind:click="onMeterFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ status }}"
|
||||||
|
label="状态"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
readonly
|
||||||
|
type="digit"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ readAt }}"
|
||||||
|
placeholder="请选择绑定时间"
|
||||||
|
label="时间"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="info" bind:click="onTimeFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ overall }}"
|
||||||
|
label="表字"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="overall"
|
||||||
|
placeholder="请输入表字"
|
||||||
|
type="digit"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ critical }}"
|
||||||
|
label="尖"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="critical"
|
||||||
|
placeholder="请输入有功(尖)"
|
||||||
|
type="digit"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ peak }}"
|
||||||
|
label="峰"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="peak"
|
||||||
|
placeholder="请输入有功(峰)"
|
||||||
|
type="digit"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ flat }}"
|
||||||
|
label="平"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="flat"
|
||||||
|
placeholder="请输入有功(平)"
|
||||||
|
type="digit"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ valley }}"
|
||||||
|
label="谷"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="valley"
|
||||||
|
type="digit"
|
||||||
|
placeholder="请输入有功(谷)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
filterBind="{{true}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<date-time-picker
|
||||||
|
show="{{dateTimeShow}}"
|
||||||
|
bind:confirm="dateTimeConfirm"
|
||||||
|
bind:cancel="dateTimeCancal"
|
||||||
|
/>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/tenement/components/bindMeter/index.wxss */
|
||||||
@@ -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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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="info" 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="info" bind:click="onFeeTypeFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/tenement/components/createTenement/index.wxss */
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
// pages/workBench/components/tenement/components/kaihu/index.js
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index"
|
||||||
|
import { createBackTenement, updateTenementBackInfo } from "../../../../../../service/tenement"
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
import { payWays, feeType as feeTypeList } from "../../../../../../utils/data";
|
||||||
|
const { OK } = request;
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
park: String,
|
||||||
|
visible: Boolean,
|
||||||
|
defaultValue: Object,
|
||||||
|
editType: String,
|
||||||
|
title: String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
'defaultValue': function(defaultValue) {
|
||||||
|
const { fullName, shortName, phone, id, feeType, address, building, buildingName, contact,} = defaultValue;
|
||||||
|
this.setData({
|
||||||
|
name: fullName,
|
||||||
|
shortName,
|
||||||
|
phone, id, feeType, address, building, buildingName, contact,
|
||||||
|
feeTypeName: feeTypeList[feeType]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
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: 'feeType'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { type, data, way } = e.detail;
|
||||||
|
switch(type) {
|
||||||
|
case "building":
|
||||||
|
this.setData({
|
||||||
|
building: data.id,
|
||||||
|
buildingName: data.name,
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
case "feeType":
|
||||||
|
this.setData({
|
||||||
|
feeTypeName: data,
|
||||||
|
feeType: way,
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onCancel() {
|
||||||
|
this.setData({ show: false })
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.triggerEvent("close")
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
[name]: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
clear() {
|
||||||
|
this.setData({
|
||||||
|
name: "", shortName: "", address: "", contact: "", phone: "",
|
||||||
|
building: "", feeType: "", buildingName: "", feeTypeName: "", id,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
const { name, shortName, address, contact, phone, building, feeType, park, editType, id } = this.data;
|
||||||
|
if (editType === "add") {
|
||||||
|
const { code, message } = await createBackTenement(park, { name, shortName, address, contact, phone, building, feeType })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("开户成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { code, message } = await updateTenementBackInfo(park, id, { name, shortName, address, contact, phone, building, feeType })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("编辑成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<!--pages/workBench/components/tenement/components/kaihu/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="{{title}}"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:close="onClose"
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{name}}"
|
||||||
|
data-name="name"
|
||||||
|
bind:change="onChange"
|
||||||
|
label="商户全称"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入商户全称"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{shortName}}"
|
||||||
|
data-name="shortName"
|
||||||
|
bind:change="onChange"
|
||||||
|
label="商户简称"
|
||||||
|
placeholder="请输入商户简称"
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{address}}"
|
||||||
|
data-name="address"
|
||||||
|
bind:change="onChange"
|
||||||
|
label="联系地址"
|
||||||
|
placeholder="请输入联系地址"
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{contact}}"
|
||||||
|
data-name="contact"
|
||||||
|
bind:change="onChange"
|
||||||
|
label="联系人"
|
||||||
|
placeholder="请输入联系人"
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{phone}}"
|
||||||
|
data-name="phone"
|
||||||
|
bind:change="onChange"
|
||||||
|
label="联系电话"
|
||||||
|
placeholder="请输入联系电话"
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ buildingName }}"
|
||||||
|
placeholder="请选择建筑"
|
||||||
|
label="建筑"
|
||||||
|
use-button-slot
|
||||||
|
readonly
|
||||||
|
title-width="120rpx"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="info" bind:click="onBuildingFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ feeTypeName }}"
|
||||||
|
placeholder="请选择收费类型"
|
||||||
|
label="收费类型"
|
||||||
|
readonly
|
||||||
|
use-button-slot
|
||||||
|
title-width="120rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="info" bind:click="onFeeTypeFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
</van-dialog>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/tenement/components/kaihu/index.wxss */
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
// pages/workBench/components/tenement/components/bindMeter/index.js
|
||||||
|
|
||||||
|
import { unbindMeter, } from "../../../../../../service/tenement"
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
const { OK } = request
|
||||||
|
import { getWorkMeterDetail } from "../../../../../../service/meter"
|
||||||
|
import dayjs from "../../../../../../utils/dayjs"
|
||||||
|
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
tenement: String,
|
||||||
|
park: String,
|
||||||
|
tenementName: String,
|
||||||
|
meterId: String,
|
||||||
|
meterAddress: String,
|
||||||
|
visible:Boolean,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"meterId": function(newValue) {
|
||||||
|
this.getMeterDetail(newValue)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
dateTimeShow: false
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onMeterFocus(e) {
|
||||||
|
const { park } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请先选择园区")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "电表",
|
||||||
|
type: 'meter'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getMeterDetail(id) {
|
||||||
|
const { code, message, data } = await getWorkMeterDetail(id)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
overall: data?.overall ? Number(data?.overall || 0) : null,
|
||||||
|
critical: data?.overall ? Number(data?.sharp || 0) : null,
|
||||||
|
peak: data?.overall ? Number(data?.peak || 0) : null,
|
||||||
|
flat: data?.overall ? Number(data?.flat || 0) : null,
|
||||||
|
valley: data?.overall ? Number(data?.valley || 0) : null,
|
||||||
|
meter04kvType: data?.meter04kvType,
|
||||||
|
status: data?.breakType ? '合闸' : "分闸"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.triggerEvent("close")
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
[name]: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
const { overall, critical, peak, valley, park, tenement, meterId,readAt, flat } = this.data;
|
||||||
|
const { code, message, } = await unbindMeter(
|
||||||
|
park,
|
||||||
|
tenement,
|
||||||
|
meterId,
|
||||||
|
{
|
||||||
|
overall:overall? Number(overall) : overall,
|
||||||
|
critical : critical ? Number(critical) : critical,
|
||||||
|
peak: peak ? Number(peak) : peak,
|
||||||
|
flat: flat ? Number(flat) : flat,
|
||||||
|
valley : valley ? Number(valley) : valley,
|
||||||
|
readAt: readAt || dayjs().format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
});
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("解绑成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
},
|
||||||
|
dateTimeConfirm(e) {
|
||||||
|
this.setData({ readAt: e.detail.time, dateTimeShow: false })
|
||||||
|
},
|
||||||
|
dateTimeCancal(e) {
|
||||||
|
this.setData({ dateTimeShow: false })
|
||||||
|
},
|
||||||
|
onTimeFocus() {
|
||||||
|
this.setData({ dateTimeShow: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index",
|
||||||
|
"date-time-picker": "/components/DateTimePicker/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<!--pages/workBench/components/tenement/components/bindMeter/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="解绑电表"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
bind:close="onClose"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{tenementName}}"
|
||||||
|
label="商户名称"
|
||||||
|
readonly
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{meterAddress}}"
|
||||||
|
label="电表地址"
|
||||||
|
readonly
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ readAt }}"
|
||||||
|
placeholder="请选择解绑时间"
|
||||||
|
label="时间"
|
||||||
|
readonly
|
||||||
|
border="{{ false }}"
|
||||||
|
use-button-slot
|
||||||
|
title-width="100rpx"
|
||||||
|
>
|
||||||
|
<van-button slot="button" size="small" type="info" bind:click="onTimeFocus">
|
||||||
|
选择
|
||||||
|
</van-button>
|
||||||
|
</van-field>
|
||||||
|
<van-field
|
||||||
|
value="{{ overall }}"
|
||||||
|
label="表字"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="overall"
|
||||||
|
placeholder="请输入表字"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ critical }}"
|
||||||
|
label="尖"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="critical"
|
||||||
|
placeholder="请输入有功(尖)"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ peak }}"
|
||||||
|
label="峰"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="peak"
|
||||||
|
placeholder="请输入有功(峰)"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ flat }}"
|
||||||
|
label="平"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="flat"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入有功(平)"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ valley }}"
|
||||||
|
label="谷"
|
||||||
|
type="number"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="valley"
|
||||||
|
placeholder="请输入有功(谷)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
||||||
|
|
||||||
|
<date-time-picker
|
||||||
|
show="{{dateTimeShow}}"
|
||||||
|
bind:confirm="dateTimeConfirm"
|
||||||
|
bind:cancel="dateTimeCancal"
|
||||||
|
/>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/tenement/components/bindMeter/index.wxss */
|
||||||
233
pages/workBenchNew/components/workBenchTenement/index.js
Normal file
233
pages/workBenchNew/components/workBenchTenement/index.js
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
// pages/workBenchNew/components/workBenchTenement/index.js
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../utils/index";
|
||||||
|
import { getTenementBackInfo, unbindMeter, } from "../../../../service/tenement"
|
||||||
|
import { getBackTenementMeters, } from "../../../../service/meter"
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
defaultValue: {},
|
||||||
|
editType: "",
|
||||||
|
meterList: [],
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
onParkFocus(e) {
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "园区",
|
||||||
|
type: 'park'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onTenementFocus(e) {
|
||||||
|
const { park } = this.data;
|
||||||
|
const that = this;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请先选择园区")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "商户",
|
||||||
|
type: 'tenement'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
|
||||||
|
},
|
||||||
|
async getTenementInfo() {
|
||||||
|
const { tenement, park } = this.data;
|
||||||
|
if (!tenement || !park) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
tenementInfo: data,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm(e) {
|
||||||
|
const { type, data } = e.detail;
|
||||||
|
const that = this;
|
||||||
|
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,
|
||||||
|
} , () => {
|
||||||
|
that.getTenementInfo();
|
||||||
|
that.getTenementMeters();
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
startKh() {
|
||||||
|
this.setData({
|
||||||
|
kaihuVisible: true,
|
||||||
|
editType: "add",
|
||||||
|
title: "开户",
|
||||||
|
defaultValue: { feeType: 0, feeTypeName: "华昌宝能收费" }
|
||||||
|
})
|
||||||
|
},
|
||||||
|
startUpdateInfo() {
|
||||||
|
const { tenementInfo } = this.data;
|
||||||
|
this.setData({
|
||||||
|
kaihuVisible: true,
|
||||||
|
defaultValue: tenementInfo,
|
||||||
|
editType: "update",
|
||||||
|
title: "开户"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getTenementMeters() {
|
||||||
|
const { park, tenement } = this.data;
|
||||||
|
const { code, message, data } = await getBackTenementMeters(park, tenement)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({ meterList: data });
|
||||||
|
},
|
||||||
|
onKaihuClose() {
|
||||||
|
this.setData({
|
||||||
|
kaihuVisible: false,
|
||||||
|
defaultValue: {},
|
||||||
|
title: "编辑",
|
||||||
|
editType: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onBindClose() {
|
||||||
|
this.setData({
|
||||||
|
bindVisible: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onKaihuConfirm() {
|
||||||
|
this.getTenementInfo();
|
||||||
|
this.onKaihuClose();
|
||||||
|
},
|
||||||
|
unbind(e) {
|
||||||
|
const that = this;
|
||||||
|
const { park, tenement } = this.data;
|
||||||
|
const { address, id } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
unbindVisible: true,
|
||||||
|
meterId: id,
|
||||||
|
meterAddress: address
|
||||||
|
})
|
||||||
|
// wx.showModal({
|
||||||
|
// title: '提示',
|
||||||
|
// content: `确认要解绑${address}吗?`,
|
||||||
|
// complete: async (res) => {
|
||||||
|
// if (res.cancel) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (res.confirm) {
|
||||||
|
// const { code, message, } = await unbindMeter(park, tenement, id);
|
||||||
|
// if (code !== OK) {
|
||||||
|
// alertInfo(message)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// alertSuccess("解绑成功")
|
||||||
|
// that.getTenementMeters();
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
onUnbindOk() {
|
||||||
|
this.setData({
|
||||||
|
unbindVisible: false,
|
||||||
|
meterId: "",
|
||||||
|
meterAddress: "",
|
||||||
|
})
|
||||||
|
this.getTenementMeters();
|
||||||
|
},
|
||||||
|
startBind() {
|
||||||
|
this.setData({
|
||||||
|
bindVisible: true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onBindOk() {
|
||||||
|
this.setData({
|
||||||
|
bindVisible: false,
|
||||||
|
})
|
||||||
|
this.getTenementMeters();
|
||||||
|
},
|
||||||
|
onTimeConfirm(e) {
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
16
pages/workBenchNew/components/workBenchTenement/index.json
Normal file
16
pages/workBenchNew/components/workBenchTenement/index.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"bindMeter": "./components/bindMeter/index",
|
||||||
|
"unBindMeter": "./components/unBindMeter/index",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"searchSelectWrapper": "/components/searchSelectWrapper/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
138
pages/workBenchNew/components/workBenchTenement/index.wxml
Normal file
138
pages/workBenchNew/components/workBenchTenement/index.wxml
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<!--pages/workBench/components/tenement/index.wxml-->
|
||||||
|
<navigator title="商户信息" canBack="{{true}}" />
|
||||||
|
<view>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="园区"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
text="{{ parkName }}"
|
||||||
|
bind:search="onParkFocus"
|
||||||
|
/>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="商户"
|
||||||
|
placeholder="请选择商户"
|
||||||
|
text="{{ tenementName }}"
|
||||||
|
bind:search="onTenementFocus"
|
||||||
|
/>
|
||||||
|
</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>
|
||||||
|
<view class="customTable">
|
||||||
|
<view class="customTableTile">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableTitleRow">
|
||||||
|
<view class="tbody">
|
||||||
|
<view class="tr">
|
||||||
|
<view style="width: 250rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
|
||||||
|
<view> {{tenementInfo.fullName}} </view>
|
||||||
|
</view>
|
||||||
|
<view class="tr">
|
||||||
|
<view wx:if="{{tenementInfo.feeType === 0}}" class="th" style="width: 250rpx;text-align: center;"> 华昌宝能收费 </view>
|
||||||
|
<view wx:if="{{tenementInfo.feeType === 1}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收1 </view>
|
||||||
|
<view wx:if="{{tenementInfo.feeType === 2}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收2 </view>
|
||||||
|
<view wx:if="{{tenementInfo.feeType === 3}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收线损 </view>
|
||||||
|
<view> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <van-row gutter="5">
|
||||||
|
<van-col span="8">
|
||||||
|
<view style="text-align: center;"> 华昌宝能收费 </view> </van-col>
|
||||||
|
<van-col span="8" wx:elif="{{tenementInfo.feeType === 1}}">
|
||||||
|
<view style="text-align: center;"> 物业代收1 </view> </van-col>
|
||||||
|
<van-col span="8" wx:elif="{{tenementInfo.feeType === 2}}">
|
||||||
|
<view style="text-align: center;"> 物业代收2 </view> </van-col>
|
||||||
|
<van-col span="8" wx:else> <view style="text-align: center;"> 物业代收线损 </view> </van-col>
|
||||||
|
<van-col span="16">{{tenementInfo.contact}} {{tenementInfo.phone}} </van-col>
|
||||||
|
</van-row> -->
|
||||||
|
|
||||||
|
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
<view class="customTableContent">
|
||||||
|
|
||||||
|
<van-row>
|
||||||
|
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||||
|
<block wx:for="{{meterList}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
|
<view class="tbody">
|
||||||
|
<view class="tr tableRow">
|
||||||
|
<view class="th" style="width: 250rpx;padding-right: 16rpx;box-sizing: border-box;border-right: 1rpx solid #ccc;"> {{ item.address }} </view>
|
||||||
|
<view class="th" style="width: 250rpx;padding-right: 16rpx;box-sizing: border-box;border-right: 1rpx solid #ccc;"> {{ item.meterSn }} </view>
|
||||||
|
<view class="th" style="width: 200rpx">
|
||||||
|
<view
|
||||||
|
class="primaryTextBtn"
|
||||||
|
bind:tap="unbind"
|
||||||
|
data-id="{{item.meterId}}"
|
||||||
|
data-address="{{item.address}}"
|
||||||
|
>
|
||||||
|
解绑
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</van-radio-group>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
isBack="{{true}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
||||||
|
<kaihu
|
||||||
|
wx:if="{{kaihuVisible}}"
|
||||||
|
park="{{park}}"
|
||||||
|
visible="{{kaihuVisible}}"
|
||||||
|
defaultValue="{{defaultValue}}"
|
||||||
|
bind:close="onKaihuClose"
|
||||||
|
bind:ok="onKaihuConfirm"
|
||||||
|
editType="{{editType}}"
|
||||||
|
title="{{title}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<bindMeter
|
||||||
|
visible="{{bindVisible}}"
|
||||||
|
wx:if="{{bindVisible}}"
|
||||||
|
park="{{park}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
tenementName="{{tenementName}}"
|
||||||
|
bind:ok="onBindOk"
|
||||||
|
bind:close="onBindClose"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<unBindMeter
|
||||||
|
wx:if="{{unbindVisible}}"
|
||||||
|
visible="{{unbindVisible}}"
|
||||||
|
park="{{park}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
tenementName="{{tenementName}}"
|
||||||
|
meterId="{{meterId}}"
|
||||||
|
meterAddress="{{meterAddress}}"
|
||||||
|
bind:ok="onUnbindOk"
|
||||||
|
/>
|
||||||
70
pages/workBenchNew/components/workBenchTenement/index.wxss
Normal file
70
pages/workBenchNew/components/workBenchTenement/index.wxss
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
/* pages/workBench/components/tenement/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 .tr {
|
||||||
|
padding: 20rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .th {
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryTextBtn {
|
||||||
|
color: #1989fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.customTable {
|
||||||
|
margin: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTableTile {
|
||||||
|
background-color: var(--light-green);
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableTitleRow {
|
||||||
|
padding: 16rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableRow {
|
||||||
|
|
||||||
|
padding: 16rpx;
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
border-top: 0rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: rgb(228,240,236);
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
import { createTenementWxUser } from "../../../../../../service/tenement";
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
// pages/workBench/components/account/components/editModal/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
type: String,
|
||||||
|
title: String,
|
||||||
|
visible: Boolean,
|
||||||
|
onCancel: Function,
|
||||||
|
park: String,
|
||||||
|
tenement: String,
|
||||||
|
parentPhone:String,
|
||||||
|
parentName:String,
|
||||||
|
parentId:String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"parentName,parentId,parentPhone": function(newName, newId, newPhone) {
|
||||||
|
this.setData({ data: { name: newName, id: newId, phone: newPhone } })
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
data: { name: "", phone: "", id: "" }
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
async onSubmit() {
|
||||||
|
const { data = {}, tenement, park, type } = this.data;
|
||||||
|
if (!data.phone) {
|
||||||
|
alertInfo("请输入手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!data.name) {
|
||||||
|
alertInfo("请输入昵称")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
this.setData({ data: {} })
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
const newData = this.data.data;
|
||||||
|
newData[name] = e.detail;
|
||||||
|
this.setData({
|
||||||
|
data: newData,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({ data: {} })
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<!--pages/workBench/components/account/components/editModal/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="{{title}}"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{data.name}}"
|
||||||
|
label="昵称"
|
||||||
|
placeholder="请输入昵称"
|
||||||
|
type="textarea"
|
||||||
|
autosize="{{true}}"
|
||||||
|
title-width="120rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
data-name="name"
|
||||||
|
bind:change="onChange"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ data.phone }}"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
label="手机号"
|
||||||
|
border="{{ false }}"
|
||||||
|
title-width="120rpx"
|
||||||
|
data-name="phone"
|
||||||
|
bind:change="onChange"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/account/components/editModal/index.wxss */
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
// pages/workBench/components/account/components/updatePhoneModa/index.js
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
import { updateAdminPhone } from "../../../../../../service/tenement";
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
type: String,
|
||||||
|
title: String,
|
||||||
|
visible: Boolean,
|
||||||
|
onCancel: Function,
|
||||||
|
park: String,
|
||||||
|
tenement: String,
|
||||||
|
parentPhone:String,
|
||||||
|
parentName:String,
|
||||||
|
parentId:String,
|
||||||
|
},
|
||||||
|
observers: {
|
||||||
|
"parentPhone": function (newPhone) {
|
||||||
|
this.setData({ phone: newPhone })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
phone: "",
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
async onSubmit() {
|
||||||
|
const { phone, tenement, park, type } = this.data;
|
||||||
|
if (!phone) {
|
||||||
|
alertInfo("请输入手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const { code, message } = await updateAdminPhone({tenement, phone: phone })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
this.setData({ phone: "" })
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
phone: e.detail,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({ phone: "" })
|
||||||
|
this.triggerEvent("cancel")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
|
"search-select": "/components/searchSelect/index",
|
||||||
|
"van-field": "@vant/weapp/field/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<!--pages/workBench/components/account/components/updatePhoneModa/index.wxml-->
|
||||||
|
<van-dialog
|
||||||
|
use-slot
|
||||||
|
title="编辑管理员手机号"
|
||||||
|
show="{{ visible }}"
|
||||||
|
show-cancel-button
|
||||||
|
bind:confirm="onSubmit"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
>
|
||||||
|
<view class="modalContentWrapper">
|
||||||
|
<van-field
|
||||||
|
value="{{ phone }}"
|
||||||
|
placeholder="请输入新管理员手机号"
|
||||||
|
label="手机号"
|
||||||
|
border="{{ false }}"
|
||||||
|
title-width="120rpx"
|
||||||
|
data-name="phone"
|
||||||
|
bind:change="onChange"
|
||||||
|
>
|
||||||
|
</van-field>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</van-dialog>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/account/components/updatePhoneModa/index.wxss */
|
||||||
224
pages/workBenchNew/components/workBenchWxUser/index.js
Normal file
224
pages/workBenchNew/components/workBenchWxUser/index.js
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
// pages/workBenchNew/components/workBenchWxUser/index.js
|
||||||
|
import request from "../../../../utils/request"
|
||||||
|
import { getTenementBackInfo, updateUserApp} from "../../../../service/tenement"
|
||||||
|
import { getBackApproveList, removeUser } from "../../../../service/user"
|
||||||
|
import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
list: [],
|
||||||
|
tenementInfo: {},
|
||||||
|
},
|
||||||
|
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 that = this;
|
||||||
|
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,
|
||||||
|
}, () => {
|
||||||
|
that.initUserList();
|
||||||
|
that.getTenementInfo();
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async setAdmin(e) {
|
||||||
|
const { id, name } = e.currentTarget.dataset;
|
||||||
|
const { tenement } = this.data;
|
||||||
|
await wxModal({ content: `确认要将${name}设置为管理吗?` })
|
||||||
|
const { code, message } = await updateUserApp({ userId: id, type: 2, tenement: tenement })
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("转交成功")
|
||||||
|
this.initUserList();
|
||||||
|
this.getTenementInfo();
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(e) {
|
||||||
|
const { id, name } = e.currentTarget.dataset;
|
||||||
|
const { tenement } = this.data;
|
||||||
|
const that = this;
|
||||||
|
wx.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: `确认要移除${name}吗?`,
|
||||||
|
complete: async (res) => {
|
||||||
|
if (res.cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (res.confirm) {
|
||||||
|
const { code, message } = await removeUser(id, tenement)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
alertSuccess("删除成功")
|
||||||
|
that.initUserList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onEditConfirm() {
|
||||||
|
this.initUserList()
|
||||||
|
this.handleCancel();
|
||||||
|
},
|
||||||
|
onUpdatePhoneConfirm() {
|
||||||
|
this.setData({ parentPhone: "", phone: "", type: "", title: "" })
|
||||||
|
this.getTenementInfo();
|
||||||
|
this.initUserList()
|
||||||
|
},
|
||||||
|
async getTenementInfo() {
|
||||||
|
const { tenement, park } = this.data;
|
||||||
|
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
tenementInfo: data,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async initUserList() {
|
||||||
|
const { tenement } = this.data;
|
||||||
|
const { code, message, data } = await getBackApproveList(tenement, 1);
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
list: data,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleAddSon() {
|
||||||
|
this.setData({
|
||||||
|
visible: true,
|
||||||
|
type: "add",
|
||||||
|
title: "新建子账号"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleChangeMain() {
|
||||||
|
const { tenementInfo = {} } = this.data;
|
||||||
|
this.setData({
|
||||||
|
updatePhoneVisible: true,
|
||||||
|
type: "update",
|
||||||
|
title: "编辑管理员",
|
||||||
|
parentPhone: tenementInfo.phone,
|
||||||
|
// name: main.WechatUserName,
|
||||||
|
// id: main.WechatUserID,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdatePhoneCancel() {
|
||||||
|
this.setData({
|
||||||
|
updatePhoneVisible: false,
|
||||||
|
type: "",
|
||||||
|
phone: "",
|
||||||
|
parentPhone: "",
|
||||||
|
name: "",
|
||||||
|
id: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.setData({
|
||||||
|
visible: false,
|
||||||
|
type: "",
|
||||||
|
phone: "",
|
||||||
|
name: "",
|
||||||
|
id: "",
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
22
pages/workBenchNew/components/workBenchWxUser/index.json
Normal file
22
pages/workBenchNew/components/workBenchWxUser/index.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"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",
|
||||||
|
"updatePhoneModal": "./components/updatePhoneModal/index",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"searchSelectWrapper": "/components/searchSelectWrapper/index",
|
||||||
|
"van-image": "@vant/weapp/image/index",
|
||||||
|
"navigator": "/components/navigator/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
143
pages/workBenchNew/components/workBenchWxUser/index.wxml
Normal file
143
pages/workBenchNew/components/workBenchWxUser/index.wxml
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<!--pages/workBench/components/account/index.wxml-->
|
||||||
|
<navigator title="C端账号" canBack="{{true}}" />
|
||||||
|
<view>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="园区"
|
||||||
|
placeholder="请选择园区"
|
||||||
|
text="{{ parkName }}"
|
||||||
|
bind:search="onParkFocus"
|
||||||
|
/>
|
||||||
|
<searchSelectWrapper
|
||||||
|
label="商户"
|
||||||
|
placeholder="请选择商户"
|
||||||
|
text="{{ tenementName }}"
|
||||||
|
bind:search="onTenementFocus"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<van-empty wx:if="{{!tenement}}" description="选择园区和商户后查看" />
|
||||||
|
<view wx:else>
|
||||||
|
<view class="operateBox">
|
||||||
|
<van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleAddSon"> 添加子账号 </van-button>
|
||||||
|
<van-button type="info" size="small" style="margin-right: 20rpx;" bind:click="handleChangeMain"> 修改主账号 </van-button>
|
||||||
|
</view>
|
||||||
|
<view class="customTable">
|
||||||
|
<view class="customTableTile">
|
||||||
|
<van-row>
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableTitleRow">
|
||||||
|
<view class="tableTitleRow">
|
||||||
|
<view class="tbody">
|
||||||
|
<view class="tr">
|
||||||
|
<view class="th" style="width: 200rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
|
||||||
|
<view> {{tenementInfo.fullName}} </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="24">
|
||||||
|
<view class="tableTitleRow">
|
||||||
|
<view class="tbody">
|
||||||
|
<view class="tr">
|
||||||
|
<view
|
||||||
|
class="th"
|
||||||
|
style="width: 200rpx;text-align: center;"
|
||||||
|
wx:if="{{tenementInfo.feeType === 0}}"
|
||||||
|
> 华昌宝能收费 </view>
|
||||||
|
<view
|
||||||
|
class="th"
|
||||||
|
style="width: 200rpx;text-align: center;"
|
||||||
|
wx:if="{{tenementInfo.feeType === 1}}"
|
||||||
|
> 物业代收1 </view>
|
||||||
|
<view
|
||||||
|
class="th"
|
||||||
|
style="width: 200rpx;text-align: center;"
|
||||||
|
wx:if="{{tenementInfo.feeType === 2}}"
|
||||||
|
> 物业代收2 </view>
|
||||||
|
<view
|
||||||
|
class="th"
|
||||||
|
style="width: 200rpx;text-align: center;"
|
||||||
|
wx:if="{{tenementInfo.feeType === 3}}"
|
||||||
|
> 物业代收线损 </view>
|
||||||
|
<view style="margin-left: 26rpx;"> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
<view class="customTableContent">
|
||||||
|
<van-row wx:if="{{list.length}}">
|
||||||
|
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||||
|
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
|
<view class="tbody">
|
||||||
|
<view class="tr tableRow">
|
||||||
|
<view class="th" style="width: 200rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatUserName }} </view>
|
||||||
|
<view class="th" style="width: 250rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatPhone }} </view>
|
||||||
|
<view class="th" style="display: flex;">
|
||||||
|
<view style="margin-left: 16rpx;">
|
||||||
|
<view wx:if="{{!item.Permissions}}" style="display: inline-block;">
|
||||||
|
<view
|
||||||
|
class="primaryTextBtn"
|
||||||
|
bind:tap="handleDelete"
|
||||||
|
data-id="{{item.WechatUserID}}"
|
||||||
|
data-name="{{item.WechatUserName}}"
|
||||||
|
>
|
||||||
|
<van-image width="40rpx" height="40rpx" src="/assets/images/stop.png" />
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="primaryTextBtn"
|
||||||
|
bind:tap="setAdmin"
|
||||||
|
data-id="{{item.WechatUserID}}"
|
||||||
|
data-name="{{item.WechatUserName}}"
|
||||||
|
style="margin-left: 16rpx;"
|
||||||
|
>
|
||||||
|
<van-image width="40rpx" height="40rpx" src="/assets/images/tihuan.png" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<van-tag type="primary" wx:else>管理员</van-tag>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</block>
|
||||||
|
</van-radio-group>
|
||||||
|
</van-row>
|
||||||
|
<empty wx:else bind:refresh="initUserList" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
isBack="{{true}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
||||||
|
<edit-modal
|
||||||
|
visible="{{visible}}"
|
||||||
|
type="{{type}}"
|
||||||
|
title="{{title}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
park="{{park}}"
|
||||||
|
parentPhone="{{phone}}"
|
||||||
|
parentName="{{name}}"
|
||||||
|
parentId="{{id}}"
|
||||||
|
bind:ok="onEditConfirm"
|
||||||
|
bind:cancel="handleCancel"
|
||||||
|
/>
|
||||||
|
<updatePhoneModal
|
||||||
|
visible="{{updatePhoneVisible}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
park="{{park}}"
|
||||||
|
parentPhone="{{parentPhone}}"
|
||||||
|
bind:ok="onUpdatePhoneConfirm"
|
||||||
|
bind:cancel="handleUpdatePhoneCancel"
|
||||||
|
/>
|
||||||
71
pages/workBenchNew/components/workBenchWxUser/index.wxss
Normal file
71
pages/workBenchNew/components/workBenchWxUser/index.wxss
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
/* pages/workBench/components/account/index.wxss */
|
||||||
|
|
||||||
|
.operateBox {
|
||||||
|
margin: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.tr {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tbody .th {
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.primaryTextBtn {
|
||||||
|
color: #1989fa;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTable {
|
||||||
|
margin: 20rpx;
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.customTableTile {
|
||||||
|
background-color: var(--light-green);
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableTitleRow {
|
||||||
|
padding: 16rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tableRow {
|
||||||
|
padding: 16rpx;
|
||||||
|
border: 1rpx solid #ccc;
|
||||||
|
border-top: 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: rgb(228,240,236);
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
112
pages/workBenchNew/index.js
Normal file
112
pages/workBenchNew/index.js
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
// pages/workBench/index.js
|
||||||
|
import { getWorkBenchHome } from "../../service/workBench"
|
||||||
|
import { alertError, alertSuccess, loadingFunc } from "../../utils/index"
|
||||||
|
import request from "../../utils/request"
|
||||||
|
const { OK } = request
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
this.init()
|
||||||
|
const user = wx.getStorageSync('user')
|
||||||
|
this.setData({
|
||||||
|
workStatus: !!user.workStatus
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async init() {
|
||||||
|
const { code, message, data } = await getWorkBenchHome()
|
||||||
|
if (code !== OK) {
|
||||||
|
alertError(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.setData({ data })
|
||||||
|
},
|
||||||
|
jumpToMeter() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/workBenchNew/components/workBenchMeter/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToTenement() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/workBenchNew/components/workBenchTenement/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToPay() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/workBenchNew/components/workBenchApprove/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToWxUser() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/workBenchNew/components/workBenchWxUser/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToRoute() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '/pages/workBenchNew/components/workBenchReading/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
jumpToHome() {
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/home/index',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
9
pages/workBenchNew/index.json
Normal file
9
pages/workBenchNew/index.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {
|
||||||
|
"navigator": "/components/navigator/index",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"van-button": "@vant/weapp/button/index"
|
||||||
|
},
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
80
pages/workBenchNew/index.wxml
Normal file
80
pages/workBenchNew/index.wxml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<!--pages/workBench/index.wxml-->
|
||||||
|
<navigator title="工作台" canBack="{{false}}" />
|
||||||
|
|
||||||
|
<view class="wrapper">
|
||||||
|
<van-row gutter="10">
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="contentWrapper" bind:tap="jumpToMeter">
|
||||||
|
<view class="image">
|
||||||
|
<view class="imageContent">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
电表信息
|
||||||
|
</view>
|
||||||
|
<view class="number">
|
||||||
|
{{data.meter}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="contentWrapper" bind:tap="jumpToTenement">
|
||||||
|
<view class="image">
|
||||||
|
<view class="imageContent">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
商户信息
|
||||||
|
</view>
|
||||||
|
<view class="number">
|
||||||
|
{{data.tenement}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="contentWrapper" bind:tap="jumpToPay">
|
||||||
|
<view class="image">
|
||||||
|
<view class="imageContent">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
充值审核
|
||||||
|
</view>
|
||||||
|
<view class="number">
|
||||||
|
{{data.pay}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="contentWrapper" bind:tap="jumpToWxUser">
|
||||||
|
<view class="image">
|
||||||
|
<view class="imageContent">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
C端账号
|
||||||
|
</view>
|
||||||
|
<view class="number">
|
||||||
|
{{data.wxUser}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="contentWrapper" bind:tap="jumpToRoute">
|
||||||
|
<view class="image">
|
||||||
|
<view class="imageContent">
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
抄表记录录入
|
||||||
|
</view>
|
||||||
|
<view class="number">
|
||||||
|
{{data.route}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
<view class="operate">
|
||||||
|
<van-button type="info" block bind:click="jumpToHome"> 回到首页 </van-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
48
pages/workBenchNew/index.wxss
Normal file
48
pages/workBenchNew/index.wxss
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/* pages/workBench/index.wxss */
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
margin: 20rpx 0rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contentWrapper {
|
||||||
|
background-color: white;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
padding: 50rpx 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
/* margin-top: 30rpx; */
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.number {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--deep-green);
|
||||||
|
text-align: center;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.imageContent {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
background-color: var(--light-green);
|
||||||
|
}
|
||||||
|
|
||||||
|
page {
|
||||||
|
background-color: rgb(242,243,245);
|
||||||
|
}
|
||||||
|
|
||||||
|
.operate {
|
||||||
|
padding-bottom: 24rpx;
|
||||||
|
}
|
||||||
31
pages/writeReading/components/meterInfo/index.js
Normal file
31
pages/writeReading/components/meterInfo/index.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// pages/writeReading/components/meterInfo/index.js
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
meterInfo: Object,
|
||||||
|
routeId: String,
|
||||||
|
disabled: Boolean,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
jumpToHistory() {
|
||||||
|
const { meterInfo, routeId, disabled } = this.data;
|
||||||
|
wx.navigateTo({
|
||||||
|
url: `/pages/readingHistory/index?meter=${meterInfo?.id}&park=${meterInfo?.parkId}&routeId=${routeId}&disabled=${disabled}`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
9
pages/writeReading/components/meterInfo/index.json
Normal file
9
pages/writeReading/components/meterInfo/index.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"component": true,
|
||||||
|
"usingComponents": {
|
||||||
|
"van-tag": "@vant/weapp/tag/index",
|
||||||
|
"van-row": "@vant/weapp/row/index",
|
||||||
|
"van-col": "@vant/weapp/col/index",
|
||||||
|
"van-button": "@vant/weapp/button/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
81
pages/writeReading/components/meterInfo/index.wxml
Normal file
81
pages/writeReading/components/meterInfo/index.wxml
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<!--pages/writeReading/components/meterInfo/index.wxml-->
|
||||||
|
<view class="wrapper">
|
||||||
|
<view class="title" style="display: flex; justify-content: space-between; align-items: center;">
|
||||||
|
<text> 电表详情 </text>
|
||||||
|
<view class="time">
|
||||||
|
<!-- 2025年9月5日 -->
|
||||||
|
<van-button size="small" type="info" bind:click="jumpToHistory">
|
||||||
|
历史记录
|
||||||
|
</van-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="info">
|
||||||
|
<view class="title">
|
||||||
|
<view class="address">
|
||||||
|
{{ meterInfo.address }}
|
||||||
|
</view>
|
||||||
|
<view class="meterType">
|
||||||
|
<van-tag type="primary" custom-style="width: 100%;" wx:if="{{meterInfo.feeType === 1}}">物业代收1</van-tag>
|
||||||
|
<van-tag type="primary" custom-style="width: 100%;" wx:elif="{{meterInfo.feeType === 2}}">物业代收2</van-tag>
|
||||||
|
<van-tag type="primary" custom-style="width: 100%;" wx:elif="{{meterInfo.feeType === 3}}">物业代收线损</van-tag>
|
||||||
|
<van-tag type="primary" custom-style="width: 100%;" wx:else>华昌宝能收费</van-tag>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
<view class="detail">
|
||||||
|
<van-row gutter="20">
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view class="titleText">
|
||||||
|
编号
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
{{meterInfo.meterSn}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view class="titleText">
|
||||||
|
类型
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{meterInfo.meterBelongType === 0}}">
|
||||||
|
商户电表
|
||||||
|
</view>
|
||||||
|
<view wx:elif="{{meterInfo.meterBelongType === 1}}">
|
||||||
|
公区电表
|
||||||
|
</view>
|
||||||
|
<view wx:elif="{{meterInfo.meterBelongType === 2}}">
|
||||||
|
公摊电表
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view class="titleText">
|
||||||
|
建筑
|
||||||
|
</view>
|
||||||
|
<!-- <view wx:if="{{meterInfo.enabled}}">
|
||||||
|
正常
|
||||||
|
</view>
|
||||||
|
<view wx:else>
|
||||||
|
停用
|
||||||
|
</view> -->
|
||||||
|
<view> {{ meterInfo.buildingName || "-" }} </view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
<van-col span="12">
|
||||||
|
<view class="text">
|
||||||
|
<view class="titleText">
|
||||||
|
楼层
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
{{ meterInfo.floor || "-" }}
|
||||||
|
<!-- {{meterInfo.overall}} -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-col>
|
||||||
|
</van-row>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
50
pages/writeReading/components/meterInfo/index.wxss
Normal file
50
pages/writeReading/components/meterInfo/index.wxss
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/* pages/writeReading/components/meterInfo/index.wxss */
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
padding: 0 20rpx 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info .title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info .title .address {
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
flex: 1;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info .title .meterType {
|
||||||
|
display: flex;
|
||||||
|
justify-content: end;
|
||||||
|
width: 180rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info .detail {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info .detail .text {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper > .title {
|
||||||
|
font-size: 32rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.titleText {
|
||||||
|
color: rgb(150, 137, 137);
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user