处理冲突

This commit is contained in:
2025-11-12 09:01:25 +08:00
63 changed files with 3184 additions and 167 deletions

View File

@@ -11,46 +11,6 @@
</view>
<view class="customTable" wx:if="{{list.length}}">
<!-- <view class="customTableTile">
<van-row>
<van-col span="4">
<view style="text-align: center;"> 日期 </view>
</van-col>
<van-col span="6">
<view style="text-align: center;"> 充值金额 </view>
</van-col>
<van-col span="6">
<view style="text-align: center;"> 电费 </view>
</van-col>
<van-col span="8">
<view style="text-align: center;"> 电表余额 </view>
</van-col>
</van-row>
</view>
<view class="customTableContent" wx:for="{{list}}" wx:key="id">
<view class="tableRow">
<van-row>
<van-col span="4">
<view style="text-align: center;"> {{ item.day }} </view>
</van-col>
<van-col span="6">
<view style="text-align: center;" wx:if="{{item.type === 1 || item.type === 7}}"> {{ item.topFee }} </view>
<view style="text-align: center;" wx:elif="{{item.type === 5 || item.type === 6 || item.type === 8}}"> -{{ item.topFee }} </view>
<view style="text-align: center;" wx:else> 0 </view>
</van-col>
<van-col span="6">
<view style="text-align: center;" wx:if="{{item.type == 1 || item.type === 5 || item.type === 6 || item.type === 7 || item.type === 8}}">
0
</view>
<view style="text-align: center;" wx:else> {{item.money}} </view>
</van-col>
<van-col span="8">
<view style="text-align: center;"> {{item.balance}} </view>
</van-col>
</van-row>
</view>
</view> -->
<table
header="{{header}}"
list="{{list}}"

View 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 })
}
}
})

View 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"
}
}

View 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>

View File

@@ -0,0 +1 @@
/* pages/readingHistory/components/detailModal/index.wxss */

View File

@@ -104,6 +104,13 @@ Page({
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;

View File

@@ -6,7 +6,8 @@
"van-icon": "@vant/weapp/icon/index",
"editModal": "./components/editModal/index",
"pagination": "/components/pagination/index",
"empty": "/components/empty/index"
"empty": "/components/empty/index",
"detailModal": "./components/detailModal/index"
},
"navigationStyle": "custom"
}

View File

@@ -14,8 +14,8 @@
<view class="table">
<view class="thead">
<view class="th" style="width: 40%; text-align: center;"> 抄表时间 </view>
<view class="th" style="width: 35%; text-align: center;"> 抄表读数 </view>
<view class="th" style="width: 25%; 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">
@@ -23,13 +23,14 @@
<view class="th" style="width: 40%; text-align: center; font-size: 30rpx;">
{{ item.readAt }}
</view>
<view class="th" style="width: 35%; text-align: center; font-size: 30rpx;">
<view class="th" style="width: 30%; text-align: center; font-size: 30rpx;">
{{ item.overall }}
</view>
<view class="th" style="width: 25%; text-align: center; justify-content: center; display: flex; align-items: center;">
<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>
@@ -58,4 +59,9 @@
bind:ok="onEditFinish"
startTime="{{startTime}}"
routeId="{{routeId}}"
/>
<detailModal
visible="{{detailVisible}}"
detail="{{detail}}"
/>

View File

@@ -0,0 +1,431 @@
// pages/workBenchNew/components/createMeter/index.js
import dayjs from "../../../../utils/dayjs"
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index"
import { uploadInstallMeter } from "../../../../service/public"
import request from "../../../../utils/request"
import { installMeter } from "../../../../service/meter"
const { OK } = request
Page({
/**
* 页面的初始数据
*/
data: {
time: "",
area: "",
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
time: dayjs().format("YYYY-MM-DD HH:mm:ss")
})
},
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: 'inventoryMeter'
})
},
onBuildingFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "建筑",
type: 'building'
})
},
clearImage() {
this.setData({
url: ""
})
},
onMeterBoxFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "电表箱",
type: 'meterBox'
})
},
onMeterTypeFocus() {
this.setData({
show: true,
title: "电表类型",
type: 'meterType'
})
},
onBindCard() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "卡",
type: 'card'
})
},
onBindCollectionA() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "互感器A",
type: 'collection',
collection: "A"
})
},
onBindCollectionB() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "互感器B",
type: 'collection',
collection: "B"
})
},
onBindCollectionC() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "互感器C",
type: 'collection',
collection: "C"
})
},
uploadImage() {
const that = this;
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success: async function(res) {
console.log("res", res)
const path = res.tempFiles?.[0]?.tempFilePath.toLowerCase()
if (!/(\.jpg|\.png|\.jpeg)$/.test(path)) {
wx.showToast({
title: '请上传jpg、png或jpeg格式的图片',
icon: 'none',
});
return;
}
var tempFilePaths = path;
loadingFunc(async () => {
const { code, message, url } = await uploadInstallMeter(tempFilePaths)
if (code !== OK) {
alertError(message)
return
}
that.setData({
url: url
})
})
}
})
},
changeSn(e) {
this.setData({
sn: e.detail,
})
},
onConfirm(e) {
console.log("e", e)
const { type, data = {}, way } = e.detail;
const {collection, park, tenement} = this.data;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
selfManagement: data.selfManagement,
})
if (park !== data.id) {
this.setData({
tenement: null,
tenementName: null,
building: null,
buildingName: null,
meterBox: null,
meterBoxName: null,
meter: null,
meterName: null,
card: null,
cardName: null,
collectionA: null,
collectionAName: null,
collectionB: null,
collectionBName: null,
collectionB: null,
collectionBName: null,
address: null,
sharp: null,
peak: null,
flat: null,
valley: null,
area: null,
})
}
break;
case "tenement":
this.setData({
tenement: data.id,
tenementName: data.name,
})
break;
case "inventoryMeter":
this.setData({
meter: data.id,
meterName: data?.sn,
})
break;
case "building":
this.setData({
building: data.id,
buildingName: data.name,
});
break;
case "meterBox":
this.setData({
meterBox: data.id,
meterBoxName: data.address,
});
break;
case "tenement":
this.setData({
tenement: data.id,
tenementName: data.name,
})
break;
case "meterType":
this.setData({
meterType: way,
meterTypeName: data,
});
break;
case "meter":
this.setData({
meter: data.id,
meterName: data.address,
});
break;
case "card":
this.setData({
card: data.id,
cardName: data.sim_number,
});
break;
case "collection":
let newData = {}
if (collection === "A") {
newData = {
collectionA: data.id,
collectionAName: `${data.transformerId}-倍率:${data.ratio}-${data.manufacturer}`,
collectionARatio: data.ratio,
}
}
if (collection === "B") {
newData = {
collectionB: data.id,
collectionBName: `${data.transformerId}-倍率:${data.ratio}-${data.manufacturer}`,
collectionBRatio: data.ratio,
}
}
if (collection === "C") {
newData = {
collectionC: data.id,
collectionCName: `${data.transformerId}-倍率:${data.ratio}-${data.manufacturer}`,
collectionCRatio: data.ratio,
}
}
this.setData(newData);
break;
}
this.onCancel();
},
changeAddress(e) {
this.setData({
address: e.detail
})
},
changeArea(e) {
this.setData({
area: e.detail
})
},
changeOverall(e) {
this.setData({
overall: e.detail
})
},
changeSharp(e) {
this.setData({
sharp: e.detail
})
},
changePeak(e) {
this.setData({
peak: e.detail
})
},
changeFlat(e) {
this.setData({
flat: e.detail
})
},
changeValley(e) {
this.setData({
valley: e.detail
})
},
changeRatio(e) {
this.setData({
ratio: e.detail,
})
},
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
},
onTenementFocus(e) {
const { park } = this.data;
const that = this;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "商户",
type: 'tenement'
})
},
async handleSubmit() {
const {
park, meter, address, building, meterBox, meterType,
ratio, area, card, collectionA, collectionB, collectionC,
tenement, sharp, peak, flat, valley, overall, url, sn,
collectionARatio, collectionBRatio, collectionCRatio
} = this.data;
if (!park || !(meter || sn) || !address || meterType == null || !building || !meterBox) {
alertInfo("请填写必填项后保存")
return;
}
if (
(collectionA == collectionB && collectionA != null && collectionB != null) ||
(collectionA == collectionC&& collectionA != null && collectionC != null) ||
(collectionC == collectionB && collectionB != null && collectionC != null)
) {
alertInfo("互感器不能重复选择")
return;
}
if (
(collectionARatio != collectionBRatio && collectionARatio != null && collectionBRatio != null) ||
(collectionARatio != collectionCRatio&& collectionARatio != null && collectionCRatio != null) ||
(collectionCRatio != collectionBRatio && collectionBRatio != null && collectionCRatio != null)
) {
alertInfo("互感器倍率不一致")
return;
}
const { code, data, message } = await installMeter({
park, meter, address, building, meterBox, meterType,
ratio, area, card, collectionA, collectionB, collectionC,
tenement, sharp, peak, flat, valley, overall, url, sn
})
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("新增成功")
},
goback() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,12 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-popup": "@vant/weapp/popup/index",
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"van-image": "@vant/weapp/image/index",
"searchSelectWrapper": "/components/searchSelectWrapper/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,192 @@
<!--pages/workBenchNew/components/createMeter/index.wxml-->
<navigator canBack="{{true}}" title="新装电表" />
<view class="wrapper">
<searchSelectWrapper
label="当前时间"
placeholder="请选择园区"
useSlot
type=""
hideBorder="{{true}}"
>
<view> {{time}} </view>
</searchSelectWrapper>
<searchSelectWrapper
label="选择园区"
placeholder="请选择园区"
text="{{parkName}}"
bind:search="onParkFocus"
required="{{true}}"
/>
<searchSelectWrapper
label="选择电表"
placeholder="请选择电表"
text="{{meterName}}"
bind:search="onMeterFocus"
required="{{true}}"
wx:if="{{selfManagement === 0}}"
/>
<searchSelectWrapper
label="SN"
placeholder="请输入sn"
text="{{sn}}"
type="input"
bind:changeText="changeSn"
required="{{true}}"
wx:if="{{selfManagement === 1}}"
/>
<searchSelectWrapper
label="选择建筑"
placeholder="请选择建筑"
text="{{buildingName}}"
bind:search="onBuildingFocus"
required="{{true}}"
/>
<searchSelectWrapper
label="电表箱"
placeholder="请选择电表箱"
text="{{meterBoxName}}"
bind:search="onMeterBoxFocus"
required="{{true}}"
/>
<searchSelectWrapper
label="电表类型"
placeholder="请选择电表类型"
text="{{meterTypeName}}"
bind:search="onMeterTypeFocus"
required="{{true}}"
/>
<searchSelectWrapper
label="倍率"
placeholder="请输入倍率"
type="input"
text="ratio"
bind:changeText="changeRatio"
/>
<searchSelectWrapper
label="电表地址"
placeholder="请输入电表地址"
text="area"
type="input"
required="{{true}}"
bind:changeText="changeAddress"
/>
<searchSelectWrapper
label="所辖面积"
placeholder="请输入所辖面积"
text="area"
type="input"
bind:changeText="changeArea"
/>
<searchSelectWrapper
label="绑定卡"
placeholder="请选择卡绑定(选填)"
text="{{cardName}}"
bind:search="onBindCard"
/>
<searchSelectWrapper
label="互感器A"
placeholder="请选择互感器绑定"
text="{{collectionAName}}"
bind:search="onBindCollectionA"
/>
<searchSelectWrapper
label="互感器B"
placeholder="请选择互感器绑定"
text="{{collectionBName}}"
bind:search="onBindCollectionB"
/>
<searchSelectWrapper
label="互感器C"
placeholder="请选择互感器绑定"
text="{{collectionCName}}"
bind:search="onBindCollectionC"
/>
<searchSelectWrapper
label="商户"
placeholder="请选择商户"
text="{{ tenementName }}"
bind:search="onTenementFocus"
/>
<searchSelectWrapper
label="总"
placeholder="请输入总"
type="input"
bind:changeText="changeOverall"
/>
<searchSelectWrapper
label="尖"
placeholder="请输入尖"
type="input"
bind:changeText="changeSharp"
/>
<searchSelectWrapper
label="峰"
placeholder="请输入峰"
type="input"
bind:changeText="changePeak"
/>
<searchSelectWrapper
label="平"
placeholder="请输入平"
type="input"
bind:changeText="changeFlat"
/>
<searchSelectWrapper
label="谷"
placeholder="请输入谷"
type="input"
bind:changeText="changeValley"
/>
<searchSelectWrapper
label="图片"
useSlot="{{true}}"
type=""
hideBorder="{{true}}"
>
<view style="display: flex; align-items: center;">
<view>
<van-button type="info" size="small" bind:click="uploadImage" custom-style="margin-right: 20rpx;"> 上传 </van-button>
<view style="margin-top: 20rpx" wx:if="{{!!url}}">
<van-button type="danger" size="small" bind:click="clearImage" custom-style="margin-right: 20rpx;"> 清除 </van-button>
</view>
</view>
<van-image wx:if="{{!!url}}" width="100" height="100" src="{{url}}" custom-style="margin-left: 20rpx;" />
</view>
</searchSelectWrapper>
<view class="operate">
<view class="submit"> <van-button type="info" block bind:click="handleSubmit"> 提交 </van-button> </view>
<view class="cancel"> <van-button block bind:tap="goback"> 返回 </van-button> </view>
</view>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onCancel"
wx:if="{{show}}"
/>
<van-popup
show="{{ imageShow }}"
bind:close="onClose"
z-index="99999"
>
<van-image
width="100vw"
height="99.1vh"
fit="contain"
src="{{url}}"
bind:click="onClose"
/>
</van-popup>

View File

@@ -0,0 +1,15 @@
/* pages/workBenchNew/components/createMeter/index.wxss */
.operate {
display: flex;
padding-top: 24rpx;
padding-bottom: 36rpx;
}
.submit, .cancel {
flex: 1;
}
.submit {
margin-right: 30rpx;
}

View File

@@ -0,0 +1,149 @@
// pages/workBenchNew/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;
Page({
/**
* 页面的初始数据
*/
data: {
},
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
onBuildingFocus() {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "建筑",
type: 'building'
})
},
onChange(e) {
const { name } = e.currentTarget.dataset;
this.setData({
[name]: e.detail
})
},
onFeeTypeFocus() {
this.setData({
show: true,
title: "收费类型",
type: 'feeType'
})
},
onCancel() {
this.setData({ show: false })
},
async onSubmit() {
const { name, shortName, address, contact,
phone, building, feeType, park, editType, id, parkName,
} = this.data;
const { code, message } = await createBackTenement(park, { name, shortName, address, contact, phone, building, feeType })
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("开户成功")
// wx.navigateBack()
wx.redirectTo({
url: `/pages/workBenchNew/components/workBenchTenement/index?park=${park}&parkName=${parkName}&name=${name}`,
})
},
handleBack() {
wx.navigateBack()
},
onConfirm(e) {
const { type, data, way } = e.detail;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
show: false,
})
return;
case "building":
this.setData({
building: data.id,
buildingName: data.name,
show: false,
})
return;
case "feeType":
this.setData({
feeTypeName: data,
feeType: way,
show: false,
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,10 @@
{
"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"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,111 @@
<!--pages/workBenchNew/components/kaihu/index.wxml-->
<navigator canBack="{{true}}" title="开户" />
<view class="modalContentWrapper">
<van-field
value="{{ parkName }}"
placeholder="请选择园区"
label="园区"
use-button-slot
readonly
title-width="120rpx"
required
>
<van-button slot="button" size="small" type="info" bind:click="onParkFocus">
选择
</van-button>
</van-field>
<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>
<view class="operate">
<view style="margin-top: 60rpx; margin-bottom: 60rpx;display: flex; justify-content: center; align-items: center;">
<van-button type="info" size="small" style="margin-right: 30rpx;" bind:click="onSubmit" data-status="0"> 保存 </van-button>
<van-button size="small" bind:click="handleBack" data-status="1"> 返回 </van-button>
</view>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onCancel"
/>

View File

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

View File

@@ -0,0 +1,27 @@
// pages/workBenchNew/components/operateButton/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
text: String,
style: String,
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
handleClick() {
this.triggerEvent("click")
}
}
})

View File

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

View File

@@ -0,0 +1,2 @@
<!--pages/workBenchNew/components/operateButton/index.wxml-->
<view class="buttonWrapper" style="{{style}}" bind:tap="handleClick"> {{ text }} </view>

View File

@@ -0,0 +1,12 @@
/* pages/workBenchNew/components/operateButton/index.wxss */
.buttonWrapper {
height: 100rpx;
display: flex;
justify-content: center;
align-items: center;
border: 1rpx solid #ccc;
border-radius: 10rpx;
margin-bottom: 24rpx;
margin-top: 24rpx;
}

View File

@@ -0,0 +1,192 @@
// pages/workBenchNew/components/recharge/index.js
import { handleRecharge } from "../../../../service/recharge";
import { alertInfo, alertSuccess, loadingFunc } from "../../../../utils/index";
import request from '../../../../utils/request'
const { OK } = request;
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
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)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,11 @@
{
"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",
"navigator": "/components/navigator"
},
"navigationStyle": "custom"
}

View File

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

View File

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

View File

@@ -0,0 +1,243 @@
// pages/workBenchNew/components/uninstallMeter/index.js
import { uninstallMeter, } from "../../../../service/meter";
import dayjs from "../../../../utils/dayjs"
import request from "../../../../utils/request"
import { alertInfo, alertSuccess, loadingFunc} from "../../../../utils/index"
import { uploadUninstallMeter } from "../../../../service/public"
const { OK } = request;
Page({
/**
* 页面的初始数据
*/
data: {
},
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 { type, data = {} } = e.detail;
const {collection} = this.data;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
})
break;
case "tenement":
this.setData({
tenement: data.id,
tenementName: data.name,
})
break;
case "building":
this.setData({
building: data.id,
buildingName: data.name,
});
break;
case "meterBox":
this.setData({
meterBox: data.id,
meterBoxName: data.address,
});
break;
case "meterType":
this.setData({
meterType: data.way,
meterTypeName: data,
});
break;
case "meter":
this.setData({
meter: data.id,
meterName: data.address,
meterInfo: data,
});
break;
case "card":
this.setData({
card: data.id,
cardName: data.sim_number,
});
break;
case "collection":
let newData = {}
if (collection === "A") {
newData = {
collectionA: data.id,
collectionAName: data.name,
}
}
if (collection === "B") {
newData = {
collectionB: data.id,
collectionBName: data.name,
}
}
if (collection === "C") {
newData = {
collectionC: data.id,
collectionCName: data.name,
}
}
this.setData(newData);
break;
}
this.onCancel();
},
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
},
async onSubmit() {
const { meter, reason, url, meterInfo } = this.data;
if (!meter) {
alertInfo("请选择表号")
return;
}
const { code, message } = await uninstallMeter({sn: meterInfo.meterSn, images: url, reason})
if (code !== OK) {
alertInfo(message)
return
}
alertSuccess("拆除成功")
setTimeout(() => {
wx.navigateTo({
url: '/pages/workBenchTodoList/index',
})
}, 300)
},
uploadImage() {
const that = this;
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success: async function(res) {
console.log("res", res)
const path = res.tempFiles?.[0]?.tempFilePath.toLowerCase()
if (!/(\.jpg|\.png|\.jpeg)$/.test(path)) {
wx.showToast({
title: '请上传jpg、png或jpeg格式的图片',
icon: 'none',
});
return;
}
var tempFilePaths = path;
loadingFunc(async () => {
const { code, message, url } = await uploadUninstallMeter(tempFilePaths)
if (code !== OK) {
alertError(message)
return
}
that.setData({
url: url
})
})
}
})
},
clearImage() {
this.setData({
url: ""
})
},
showImage() {
this.setData({
imageShow: true
})
},
onClose() {
this.setData({
imageShow: false
})
},
goback() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
time: dayjs().format("YYYY-MM-DD HH:mm:ss")
})
},
changeReason(e) {
this.setData({
reason: e.detail,
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,12 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"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",
"van-image": "@vant/weapp/image/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,83 @@
<!--pages/workBenchNew/components/uninstallMeter/index.wxml-->
<navigator canBack="{{true}}" title="拆表" />
<view class="wrapper">
<searchSelectWrapper
label="当前时间"
placeholder="请选择园区"
useSlot
type=""
hideBorder="{{true}}"
>
<view> {{time}} </view>
</searchSelectWrapper>
<searchSelectWrapper
label="选择园区"
placeholder="请选择园区"
text="{{parkName}}"
bind:search="onParkFocus"
required="{{true}}"
/>
<searchSelectWrapper
label="选择电表"
placeholder="请选择电表"
text="{{meterName}}"
bind:search="onMeterFocus"
required="{{true}}"
/>
<searchSelectWrapper
label="原因"
placeholder="请输入原因"
text="reason"
type="input"
bind:changeText="changeReason"
/>
<searchSelectWrapper
label="图片"
useSlot="{{true}}"
type=""
hideBorder="{{true}}"
>
<view style="display: flex; align-items: center;">
<view>
<van-button type="info" size="small" bind:click="uploadImage" custom-style="margin-right: 20rpx;"> 上传 </van-button>
<view style="margin-top: 20rpx" wx:if="{{!!url}}">
<van-button type="danger" size="small" bind:click="clearImage" custom-style="margin-right: 20rpx;"> 清除 </van-button>
</view>
</view>
<van-image wx:if="{{!!url}}" width="100" height="100" src="{{url}}" custom-style="margin-left: 20rpx;" bind:tap="showImage" />
</view>
</searchSelectWrapper>
<view class="operate">
<view class="submit"> <van-button type="info" block bind:click="onSubmit"> 提交 </van-button> </view>
<view class="cancel"> <van-button block bind:tap="goback"> 返回 </van-button> </view>
</view>
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onCancel"
wx:if="{{show}}"
/>
<van-popup
show="{{ imageShow }}"
bind:close="onClose"
z-index="99999"
>
<van-image
width="100vw"
height="99.1vh"
fit="contain"
src="{{url}}"
bind:click="onClose"
/>
</van-popup>

View File

@@ -0,0 +1,15 @@
/* pages/workBenchNew/components/uninstallMeter/index.wxss */
.operate {
display: flex;
padding-top: 24rpx;
padding-bottom: 36rpx;
}
.submit, .cancel {
flex: 1;
}
.submit {
margin-right: 30rpx;
}

View File

@@ -1,17 +1,14 @@
<!--pages/workBench/components/recharge/index.wxml-->
<navigator title="充值审核" canBack="{{true}}" />
<view style="">
<view>
<view class="typeQuery">
<van-row>
<van-col span="8">
<van-col span="12">
<view class="typeQueryText" style="color: {{active === 0 ? '#0958d9' : '#000'}}" bind:tap="changeQueryType" data-type="{{0}}"> 待审核 </view>
</van-col>
<van-col span="8">
<van-col span="12">
<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>

View File

@@ -0,0 +1,279 @@
// 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'
})
},
onModeFocus(e) {
this.setData({
show: true,
title: "强控类型",
type: 'meterMode'
})
},
onMeterFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "电表",
type: 'meter'
})
},
onConfirm(e) {
const { data, type, way } = e.detail;
const that = this;
switch(type) {
case "park":
this.setData({
parkName: data.name,
park: data.id,
})
break;
case "meterMode":
this.setData({
modeName: data,
mode: way,
})
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 })
},
changeDays(e) {
this.setData({
days: e.detail,
})
},
handleSubmit() {
const { } = this.data;
},
uploadImage() {
const that = this;
wx.chooseMedia({
count: 1,
mediaType: ['image'],
sourceType: ['album', 'camera'],
success: async function(res) {
console.log("res", res)
const path = res.tempFiles?.[0]?.tempFilePath.toLowerCase()
if (!/(\.jpg|\.png|\.jpeg)$/.test(path)) {
wx.showToast({
title: '请上传jpg、png或jpeg格式的图片',
icon: 'none',
});
return;
}
var tempFilePaths = path;
loadingFunc(async () => {
const { code, message, url } = await uploadInstallMeter(tempFilePaths)
if (code !== OK) {
alertError(message)
return
}
that.setData({
url: url
})
})
}
})
},
clearImage() {
this.setData({
url: ""
})
},
changeReason(e) {
this.setData({
reason: 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() {
}
})

View File

@@ -0,0 +1,20 @@
{
"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",
"van-popup": "@vant/weapp/popup/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,163 @@
<!--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="display: flex;align-items: center;">
<view style="text-align: center; margin-right: 24rpx;">在线</view>
<view wx:if="{{item.mode === 0}}"> 预付费 </view>
<view wx:if="{{item.mode === 1}}"> 强控 </view>
<view wx:if="{{item.mode === 2}}"> 临时强控 </view>
</view>
</van-col>
<van-col span="8" wx:else>
<view style="display: flex;align-items: center; margin-right: 24rpx;">
<view style="text-align: center;">失联</view>
<view wx:if="{{item.mode === 0}}"> 预付费 </view>
<view wx:if="{{item.mode === 1}}"> 强控 </view>
<view wx:if="{{item.mode === 2}}"> 临时强控 </view>
</view>
</van-col>
</van-row>
</view>
</van-col>
</van-row>
</view>
</view>
<view class="wrapper">
<searchSelectWrapper
label="强控类型"
placeholder="请选择强控类型"
text="{{modeName}}"
bind:search="onModeFocus"
required="{{true}}"
/>
<searchSelectWrapper
wx:if="{{mode === 2}}"
label="天数"
placeholder="请输入天数"
text="{{days}}"
type="input"
bind:changeText="changeDays"
/>
<searchSelectWrapper
label="原因"
placeholder="请输入原因"
text="{{reason}}"
type="input"
bind:changeText="changeReason"
/>
<searchSelectWrapper
label="图片"
useSlot="{{true}}"
type=""
hideBorder="{{true}}"
>
<view style="display: flex; align-items: center;">
<view>
<van-button type="info" size="small" bind:click="uploadImage" custom-style="margin-right: 20rpx;"> 上传 </van-button>
<view style="margin-top: 20rpx" wx:if="{{!!url}}">
<van-button type="danger" size="small" bind:click="clearImage" custom-style="margin-right: 20rpx;"> 清除 </van-button>
</view>
</view>
<van-image wx:if="{{!!url}}" width="100" height="100" src="{{url}}" custom-style="margin-left: 20rpx;" />
</view>
</searchSelectWrapper>
<view class="operate">
<view class="submit"> <van-button type="info" block bind:click="handleSubmit"> 提交 </van-button> </view>
<view class="cancel"> <van-button block bind:tap="goback"> 返回 </van-button> </view>
</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}}"
/>

View File

@@ -0,0 +1,78 @@
/* 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;
}
.operate {
display: flex;
padding-top: 24rpx;
padding-bottom: 36rpx;
}
.submit, .cancel {
flex: 1;
}
.submit {
margin-right: 30rpx;
}

View File

@@ -1,5 +1,5 @@
// pages/workBenchNew/components/workBenchReading/index.js
import { getMeterReadingRouteList, changeMeterRouteStatus } from "../../../../service/workBench"
import { getMeterReadingRouteList, changeMeterRouteStatus, checkReadingFinish } from "../../../../service/workBench"
import { alertError, alertSuccess, loadingFunc } from "../../../../utils/index"
import request from "../../../../utils/request"
const { OK } = request
@@ -72,6 +72,10 @@ Page({
that.jumpToReading({ currentTarget: { dataset: { id } } })
}, 500)
},
// async checkFinish(id) {
// return {data, num};
// },
async changeEndStatus(e) {
const that = this;
wx.showModal({
@@ -83,10 +87,38 @@ Page({
}
if (res.confirm) {
const { id, routeid: routeId } = e.currentTarget.dataset;
const { code, message } = await changeMeterRouteStatus({ id, status: 0, routeId })
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("操作成功")

View File

@@ -107,12 +107,12 @@ Component({
return;
}
this.setData({
overall: Number(data?.overall || 0),
critical: Number(data?.sharp || 0),
peak: Number(data?.peak || 0),
flat: Number(data?.flat || 0),
valley: Number(data?.valley || 0),
deepValley: Number(data?.deepValley || 0),
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,
deepValley: data?.deepValley ? Number(data?.deepValley || 0) : null,
meter04kvType: data?.meter04kvType,
status: data?.breakType ? '合闸' : "分闸",
})

View File

@@ -122,6 +122,7 @@
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onCancel"
filterBind="{{true}}"
/>
<date-time-picker

View File

@@ -55,12 +55,12 @@ Component({
return;
}
this.setData({
overall: Number(data?.overall || 0),
critical: Number(data?.sharp || 0),
peak: Number(data?.peak || 0),
flat: Number(data?.flat || 0),
valley: Number(data?.valley || 0),
deepValley: Number(data?.deepValley || 0),
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,
deepValley: data?.deepValley ? Number(data?.deepValley || 0) : null,
meter04kvType: data?.meter04kvType,
status: data?.breakType ? '合闸' : "分闸"
})

View File

@@ -20,7 +20,17 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log("options", options)
const { park, parkName, name, id } = options
this.setData({
park,
parkName,
tenementName: name,
tenement: id
})
if (id) {
this.getTenementInfo();
}
},
onParkFocus(e) {
this.setData({

View File

@@ -61,6 +61,36 @@ Page({
url: '/pages/home/index',
})
},
jumpToRecharge() {
wx.navigateTo({
url: '/pages/workBenchNew/components/recharge/index',
})
},
jumpToInstallMeter() {
wx.navigateTo({
url: '/pages/workBenchNew/components/installMeter/index',
})
},
jumpToUninstallMeter() {
wx.navigateTo({
url: '/pages/workBenchNew/components/uninstallMeter/index',
})
},
jumpToKaihu() {
wx.navigateTo({
url: '/pages/workBenchNew/components/kaihu/index',
})
},
jumpToMeterControl() {
wx.navigateTo({
url: '/pages/workBenchNew/components/workBenchMeterControl/index',
})
},
workOrder() {
wx.navigateTo({
url: '/pages/workBenchTodoList/index',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

View File

@@ -3,7 +3,8 @@
"navigator": "/components/navigator/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"van-button": "@vant/weapp/button/index"
"van-button": "@vant/weapp/button/index",
"operate-button": "./components/operateButton/index"
},
"navigationStyle": "custom"
}

View File

@@ -2,7 +2,7 @@
<navigator title="工作台" canBack="{{false}}" />
<view class="wrapper">
<van-row gutter="10">
<!-- <van-row gutter="10">
<van-col span="12">
<view class="contentWrapper" bind:tap="jumpToMeter">
<view class="image">
@@ -73,7 +73,65 @@
</view>
</view>
</van-col>
</van-row>
</van-row> -->
<view>
<view> 通用操作 </view>
<view>
<van-row gutter="10">
<van-col span="8">
<operate-button text="充值" bind:click="jumpToRecharge" />
</van-col>
<van-col span="8">
<operate-button text="充值审核" bind:click="jumpToPay" />
</van-col>
<van-col span="8">
<operate-button text="其他审核" />
</van-col>
<van-col span="8">
<operate-button text="电表操作" bind:click="jumpToMeter" />
</van-col>
<van-col span="8">
<operate-button text="商户操作" bind:click="jumpToTenement" />
</van-col>
<van-col span="8">
<operate-button text="C端账号" bind:click="jumpToWxUser" />
</van-col>
</van-row>
</view>
<view> 现场操作 </view>
<view>
<van-row gutter="10">
<van-col span="8">
<operate-button text="抄表" bind:click="jumpToRoute" />
</van-col>
<van-col span="8">
<operate-button text="拆表" bind:click="jumpToUninstallMeter" />
</van-col>
<van-col span="8">
<operate-button text="新装" bind:click="jumpToInstallMeter" />
</van-col>
<van-col span="8">
<operate-button text="开户" bind:click="jumpToKaihu" />
</van-col>
<van-col span="8">
<operate-button text="销户" bind:click="jumpToTenement" />
</van-col>
<van-col span="8">
<operate-button text="强控" bind:click="jumpToMeterControl" />
</van-col>
<van-col span="8">
<operate-button text="工单" bind:click="workOrder" />
</van-col>
</van-row>
</view>
</view>
<view class="operate">
<van-button type="info" block bind:click="jumpToHome"> 回到首页 </van-button>
</view>

View File

@@ -1,7 +1,7 @@
/* pages/workBench/index.wxss */
.wrapper {
margin: 20rpx 0rpx;
margin:20rpx 0rpx;
}
.contentWrapper {

View File

@@ -0,0 +1,225 @@
// pages/workBenchTodoList/index.js
import request from "../../utils/request"
import { getWorkOrderList } from "../../service/workBench"
import { alertInfo, loadingFunc } from "../../utils/index";
import { noticeFlowType } from "../../utils/data"
const { OK } = request
Page({
/**
* 页面的初始数据
*/
data: {
page: 1,
size: 20,
noticeFlowType,
actionItems: [{
name: '确认',
value: 'status'
}],
},
showActionMenu(e) {
console.log("e", 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(id);
}
},
jumpToDetail(id) {
// wx.navigateTo({
// url: '/pages/workOrderDetail/index?id=' + id,
// })
},
onConfirm(e) {
const { type, data = {}, way } = e.detail;
const that = this;
switch(type) {
case "park":
this.setData({
park: data.id,
parkName: data.name,
})
break;
case "tenement":
this.setData({
tenement: data.id,
tenementName: data.name,
})
break;
case "noticeFlowType":
this.setData({
noticeFlowType: data,
noticeFlowTypeName: data,
page: 1,
}, () => {
loadingFunc(async () => {
await that.init()
})
});
break;
case "noticeFlowStatus":
this.setData({
noticeFlowStatus: data,
noticeFlowStatusName: data,
page: 1,
}, () => {
loadingFunc(async () => {
await that.init()
})
});
break;
case "meter":
this.setData({
meter: data.id,
meterName: data.address,
meterInfo: data,
page: 1,
}, () => {
loadingFunc(async () => {
await that.init()
})
});
break;
}
this.onCancel();
},
onCancel() {
this.setData({
show: false,
title: "",
type: "",
})
},
onParkFocus(e) {
this.setData({
show: true,
title: "园区",
type: 'park'
})
},
onNoticeFlowFocus() {
this.setData({
show: true,
title: "类型",
type: 'noticeFlowType'
})
},
onNoticeFlowStatusFocus() {
this.setData({
show: true,
title: "确认状态",
type: 'noticeFlowStatus'
})
},
onMeterFocus(e) {
const { park } = this.data;
if (!park) {
alertInfo("请先选择园区")
return;
}
this.setData({
show: true,
title: "电表",
type: 'meter'
})
},
onChangePage(e) {
const that = this;
this.setData({
page: e.detail.currentIndex,
}, () => {
loadingFunc(async () => {
await that.init()
})
})
},
async init() {
const { page, size, park, tenement, meter, noticeFlowType, noticeFlowStatus, time } = this.data;
const { code, message, data, total } = await getWorkOrderList({ page, size, park, tenement, meter, type: noticeFlowType, time, status: noticeFlowStatus })
if (code !== OK) {
alertInfo(message)
return;
}
this.setData({
list: data?.map(item => {
item.time = item?.created_at?.slice(0, 10)
item.address = item?.target?.meter_data?.address;
return item;
}),
totalPage: Math.ceil(total / size),
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
loadingFunc(async () => {
await this.init()
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,23 @@
{
"usingComponents": {
"navigator": "/components/navigator/index",
"van-popup": "@vant/weapp/popup/index",
"van-row": "@vant/weapp/row/index",
"van-col": "@vant/weapp/col/index",
"search-select": "/components/searchSelect/index",
"van-field": "@vant/weapp/field/index",
"van-button": "@vant/weapp/button/index",
"searchSelectWrapper": "/components/searchSelectWrapper/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-icon": "@vant/weapp/icon/index",
"van-action-sheet": "@vant/weapp/action-sheet/index"
},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,99 @@
<!--pages/workBenchTodoList/index.wxml-->
<navigator canBack="{{true}}" title="工单列表" />
<view class="wrapper">
<searchSelectWrapper
label="选择园区"
placeholder="请选择园区"
text="{{parkName}}"
bind:search="onParkFocus"
/>
<searchSelectWrapper
label="选择电表"
placeholder="请选择电表"
text="{{meterName}}"
bind:search="onMeterFocus"
/>
<searchSelectWrapper
label="流程类型"
placeholder="请选择流程类型"
text="{{noticeFlowTypeName}}"
bind:search="onNoticeFlowFocus"
/>
<searchSelectWrapper
label="确认状态"
placeholder="请选择确认状态"
text="{{noticeFlowStatusName}}"
bind:search="onNoticeFlowStatusFocus"
/>
<view>
<view wx:if="{{list.length}}">
<view class="tableWrapper">
<view class="table">
<view class="thead">
<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;">电表地址</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 130rpx;">
{{ item.time }}
</view>
<view class="th" style="flex: 0 0 150rpx;">
{{ noticeFlowType[item.types - 1] }}
</view>
<view class="th" style="flex: 0 0 150rpx;">
{{ item.address }}
</view>
<view class="th" style="flex: 0 0 150rpx;">
{{ item.flow_status === 1 ? "处理中" : "已确认" }}
</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-data="{{index}}" 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
class="primaryTextBtn"
wx:if="{{item.flow_status === 1}}"
data-id="{{item.id}}"
> 确认 </view>
</view>
</view>
</block>
</van-radio-group>
</view>
</view>
</view>
<pagination currentIndex="{{page}}" totalPage="{{totalPage}}" bind:pagingChange="onChangePage" />
</view>
<empty bind:refresh="init" wx:else />
</view>
<search-select
show="{{show}}"
title="{{title}}"
type="{{type}}"
park="{{park}}"
bindconfirm="onConfirm"
bindcancel="onCancel"
wx:if="{{show}}"
/>
</view>

View File

@@ -0,0 +1,71 @@
/* pages/workBenchTodoList/index.wxss */
.table {
width: 500rpx;
}
.tableWrapper {
width: 100vw;
overflow-x: auto;
}
.thead {
display: flex;
flex-wrap: nowrap;
}
.thead .th {
padding: 10rpx;
white-space: nowrap;
text-align: center;
box-sizing: border-box;
}
.primaryTextBtn {
color: #1989fa;
}
.tbody {
width: 500rpx;
}
.tbody .tr {
padding: 10rpx;
border-bottom: 1rpx solid #EEEEEE;
display: flex;
align-items: center;
flex-wrap: nowrap;
}
.tbody .tr {
word-break: break-all;
text-align: center;
}
.more-icon {
padding: 20rpx;
color: #1989fa;
display: flex;
justify-content: center;
align-items: center;
}
/* 基础标签样式 */
.tag {
display: inline-block;
padding: 4px 5px;
margin-right: 0px;
border-radius: 16px;
background: #07c160;
color: white;
font-size: 25rpx;
}
/* 激活状态样式 */
.tag.active {
background: #07c160;
color: white;
}

View File

@@ -0,0 +1,66 @@
// pages/workOrderDetail/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,2 @@
<!--pages/workOrderDetail/index.wxml-->
<text>pages/workOrderDetail/index.wxml</text>

View File

@@ -0,0 +1 @@
/* pages/workOrderDetail/index.wxss */

View File

@@ -43,13 +43,13 @@ Component({
}
var tempFilePaths = res.tempFilePath;
loadingFunc(async () => {
const { code, message, data } = await uploadOcrFile(tempFilePaths)
const { code, message, data, url } = await uploadOcrFile(tempFilePaths)
if (code !== OK) {
alertError(message)
return
}
setTimeout(() => {
that.triggerEvent("finish", { number: data?.integer + "." + data?.decimal || 0, success: data?.integer != null && data?.integer !== "" })
that.triggerEvent("finish", { number: data?.integer + "." + data?.decimal || 0, success: data?.integer != null && data?.integer !== "", url })
}, 100)
})

View File

@@ -72,13 +72,14 @@ Component({
wx.navigateBack()
},
onPhotoFinish(e) {
const { number, success } = e.detail;
const { number, success, url } = e.detail;
const { meterInfo } = this.data;
if (success) {
this.setData({
currentNumber: `${Number(number)}`,
calcNumber: isNaN(Number(number)) ? 0 : Number(number),
diff: isNaN(Number(number)) ? "-" : (Number(number || 0) - Number(meterInfo.overall)).toFixed(2)
diff: isNaN(Number(number)) ? "-" : (Number(number || 0) - Number(meterInfo.overall)).toFixed(2),
url,
})
alertSuccess("获取成功")
} else {
@@ -86,13 +87,14 @@ Component({
}
},
async onSubmit() {
const { meterInfo, currentNumber, routeId } = this.data;
const { meterInfo, currentNumber, routeId, url } = this.data;
const { parkId, id } = meterInfo;
const { code, message } = await createReading(parkId, id, routeId, {
overall: `${currentNumber}`,
flat: `${currentNumber}`,
readAt: dayjs().format("YYYY-MM-DD HH:mm:ss"),
source: 1,
url
})
if (code !== OK) {
alertError(message)