暂存c端账号管理和商户信息
This commit is contained in:
parent
93ee759092
commit
d6e93d9f36
@ -133,8 +133,8 @@ Component({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`),
|
columns: parks?.map(item => `${item.meterNo}-${item.address}${item.shortName ? '-' + item.shortName : ''}`) || [],
|
||||||
list: parks,
|
list: parks || [],
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async onSearchTenement() {
|
async onSearchTenement() {
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
bind:click="onClickHide"
|
bind:click="onClickHide"
|
||||||
position="bottom"
|
position="bottom"
|
||||||
z-index="100000"
|
z-index="100000"
|
||||||
|
wx:if="{{show}}"
|
||||||
>
|
>
|
||||||
<view wx:if="{{type === 'pay'}}">
|
<view wx:if="{{type === 'pay'}}">
|
||||||
<van-picker
|
<van-picker
|
||||||
|
@ -36,7 +36,7 @@ Component({
|
|||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
const { data = {}, tenement, park, editType } = this.data;
|
const { data = {}, tenement, park, type } = this.data;
|
||||||
if (!data.phone) {
|
if (!data.phone) {
|
||||||
alertInfo("请输入手机号")
|
alertInfo("请输入手机号")
|
||||||
return
|
return
|
||||||
@ -45,17 +45,16 @@ Component({
|
|||||||
alertInfo("请输入昵称")
|
alertInfo("请输入昵称")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (editType === 'add') {
|
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
|
||||||
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
|
if (code !== OK) {
|
||||||
if (code !== OK) {
|
alertInfo(message)
|
||||||
alertInfo(message)
|
this.triggerEvent("cancel")
|
||||||
this.triggerEvent("cancel")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
alertSuccess("操作成功")
|
|
||||||
this.triggerEvent("ok")
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
alertSuccess("操作成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
|
@ -0,0 +1,62 @@
|
|||||||
|
// 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,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
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")
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onChange(e) {
|
||||||
|
|
||||||
|
this.setData({
|
||||||
|
phone: e.detail,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onCancel() {
|
||||||
|
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 */
|
@ -102,6 +102,9 @@ Component({
|
|||||||
this.initUserList()
|
this.initUserList()
|
||||||
this.handleCancel();
|
this.handleCancel();
|
||||||
},
|
},
|
||||||
|
onUpdatePhoneConfirm() {
|
||||||
|
that.getTenementInfo();
|
||||||
|
},
|
||||||
async getTenementInfo() {
|
async getTenementInfo() {
|
||||||
const { tenement, park } = this.data;
|
const { tenement, park } = this.data;
|
||||||
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
|
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
|
||||||
@ -132,20 +135,29 @@ Component({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleChangeMain() {
|
handleChangeMain() {
|
||||||
const { list = [] } = this.data;
|
// const { list = [] } = this.data;
|
||||||
const main = list?.find(item => item.Permissions)
|
// const main = list?.find(item => item.Permissions)
|
||||||
if (!main) {
|
// if (!main) {
|
||||||
alertInfo("没有主账号")
|
// alertInfo("没有主账号")
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
console.log("main", main)
|
// console.log("main", main)
|
||||||
this.setData({
|
this.setData({
|
||||||
visible: true,
|
updatePhoneVisible: true,
|
||||||
type: "update",
|
type: "update",
|
||||||
title: "编辑管理员",
|
title: "编辑管理员",
|
||||||
phone: main.WechatPhone,
|
// phone: main.WechatPhone,
|
||||||
name: main.WechatUserName,
|
// name: main.WechatUserName,
|
||||||
id: main.WechatUserID,
|
// id: main.WechatUserID,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleUpdatePhoneCancel() {
|
||||||
|
this.setData({
|
||||||
|
updatePhoneVisible: false,
|
||||||
|
type: "",
|
||||||
|
phone: "",
|
||||||
|
name: "",
|
||||||
|
id: "",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"van-radio": "@vant/weapp/radio/index",
|
"van-radio": "@vant/weapp/radio/index",
|
||||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||||
"van-tag": "@vant/weapp/tag/index",
|
"van-tag": "@vant/weapp/tag/index",
|
||||||
"edit-modal": "./components/editModal/index"
|
"edit-modal": "./components/editModal/index",
|
||||||
|
"updatePhoneModal": "./components/updatePhoneModal/index"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -83,7 +83,6 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<empty wx:else bind:refresh="initUserList" />
|
<empty wx:else bind:refresh="initUserList" />
|
||||||
{{phone}} {{name}}
|
|
||||||
</view>
|
</view>
|
||||||
<search-select
|
<search-select
|
||||||
show="{{show}}"
|
show="{{show}}"
|
||||||
@ -105,4 +104,12 @@
|
|||||||
parentId="{{id}}"
|
parentId="{{id}}"
|
||||||
bind:ok="onEditConfirm"
|
bind:ok="onEditConfirm"
|
||||||
bind:cancel="handleCancel"
|
bind:cancel="handleCancel"
|
||||||
/>
|
/>
|
||||||
|
<updatePhoneModal
|
||||||
|
visible="{{updatePhoneVisible}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bind:ok="onUpdatePhoneConfirm"
|
||||||
|
bind:cancel="handleUpdatePhoneCancel"
|
||||||
|
/>
|
||||||
|
{{updatePhoneVisible}}
|
@ -1,11 +1,21 @@
|
|||||||
// pages/workBench/components/tenement/components/bindMeter/index.js
|
// pages/workBench/components/tenement/components/bindMeter/index.js
|
||||||
|
// 0015980101
|
||||||
|
import { bindMeter, } from "../../../../../../service/tenement"
|
||||||
|
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||||
|
import request from "../../../../../../utils/request"
|
||||||
|
import dayjs from "../../../../../../utils/dayjs"
|
||||||
|
const { OK } = request
|
||||||
Component({
|
Component({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组件的属性列表
|
* 组件的属性列表
|
||||||
*/
|
*/
|
||||||
properties: {
|
properties: {
|
||||||
|
tenement: String,
|
||||||
|
tenementName: String,
|
||||||
|
park: String,
|
||||||
|
visible: Boolean,
|
||||||
|
meterId: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,6 +43,38 @@ Component({
|
|||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
this.triggerEvent("close")
|
this.triggerEvent("close")
|
||||||
}
|
},
|
||||||
|
onChange(e) {
|
||||||
|
const { name } = e.currentTarget.dataset;
|
||||||
|
this.setData({
|
||||||
|
[name]: e.detail
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
|
const { overall, critical, peak, valley, park, tenement, meter } = 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,
|
||||||
|
valley : valley ? Number(valley) : valley, 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.name,
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -3,6 +3,7 @@
|
|||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
"van-dialog": "@vant/weapp/dialog/index",
|
"van-dialog": "@vant/weapp/dialog/index",
|
||||||
"search-select": "/components/searchSelect/index",
|
"search-select": "/components/searchSelect/index",
|
||||||
"van-field": "@vant/weapp/field/index"
|
"van-field": "@vant/weapp/field/index",
|
||||||
|
"van-button": "@vant/weapp/button/index"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,14 +2,14 @@
|
|||||||
<van-dialog
|
<van-dialog
|
||||||
use-slot
|
use-slot
|
||||||
title="绑定表计"
|
title="绑定表计"
|
||||||
show="{{ show }}"
|
show="{{ visible }}"
|
||||||
show-cancel-button
|
show-cancel-button
|
||||||
bind:confirm="onSubmit"
|
bind:confirm="onSubmit"
|
||||||
bind:close="onClose"
|
bind:close="onClose"
|
||||||
>
|
>
|
||||||
<view class="modalContentWrapper">
|
<view class="modalContentWrapper">
|
||||||
<van-field
|
<van-field
|
||||||
value=""
|
value="{{tenementName}}"
|
||||||
label="商户名称"
|
label="商户名称"
|
||||||
readonly
|
readonly
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@ -31,12 +31,64 @@
|
|||||||
</van-button>
|
</van-button>
|
||||||
</van-field>
|
</van-field>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{ money }}"
|
value="{{ overall }}"
|
||||||
label="表字"
|
label="表字"
|
||||||
readonly
|
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
border="{{false}}"
|
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="{{ overall }}"
|
||||||
|
label="平"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="overall"
|
||||||
|
placeholder="请输入有功(平)"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<van-field
|
||||||
|
value="{{ valley }}"
|
||||||
|
label="谷"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="valley"
|
||||||
|
type="number"
|
||||||
|
placeholder="请输入有功(谷)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</van-dialog>
|
</van-dialog>
|
||||||
|
|
||||||
|
<search-select
|
||||||
|
show="{{show}}"
|
||||||
|
title="{{title}}"
|
||||||
|
type="{{type}}"
|
||||||
|
park="{{park}}"
|
||||||
|
bindconfirm="onConfirm"
|
||||||
|
bindcancel="onCancel"
|
||||||
|
/>
|
@ -0,0 +1,71 @@
|
|||||||
|
// 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
|
||||||
|
|
||||||
|
Component({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的属性列表
|
||||||
|
*/
|
||||||
|
properties: {
|
||||||
|
tenement: String,
|
||||||
|
park: String,
|
||||||
|
tenementName: String,
|
||||||
|
meterId: String,
|
||||||
|
meterAddress: String,
|
||||||
|
visible:Boolean,
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件的方法列表
|
||||||
|
*/
|
||||||
|
methods: {
|
||||||
|
onMeterFocus(e) {
|
||||||
|
const { park } = this.data;
|
||||||
|
if (!park) {
|
||||||
|
alertInfo("请先选择园区")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setData({
|
||||||
|
show: true,
|
||||||
|
title: "电表",
|
||||||
|
type: 'meter'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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 } = 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,
|
||||||
|
valley : valley ? Number(valley) : valley,
|
||||||
|
});
|
||||||
|
if (code !== OK) {
|
||||||
|
alertInfo(message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
alertSuccess("解绑成功")
|
||||||
|
this.triggerEvent("ok")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
@ -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,81 @@
|
|||||||
|
<!--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="{{ 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="{{ overall }}"
|
||||||
|
label="平"
|
||||||
|
title-width="132rpx"
|
||||||
|
border="{{false}}"
|
||||||
|
bind:change="onChange"
|
||||||
|
data-name="overall"
|
||||||
|
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>
|
@ -0,0 +1 @@
|
|||||||
|
/* pages/workBench/components/tenement/components/bindMeter/index.wxss */
|
@ -128,26 +128,50 @@ Component({
|
|||||||
const that = this;
|
const that = this;
|
||||||
const { park, tenement } = this.data;
|
const { park, tenement } = this.data;
|
||||||
const { address, id } = e.currentTarget.dataset;
|
const { address, id } = e.currentTarget.dataset;
|
||||||
wx.showModal({
|
this.setData({
|
||||||
title: '提示',
|
unbindVisible: true,
|
||||||
content: `确认要解绑${address}吗?`,
|
meterId: id,
|
||||||
complete: async (res) => {
|
meterAddress: address
|
||||||
if (res.cancel) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.confirm) {
|
|
||||||
const { code, message, } = await unbindMeter(park, tenement, id);
|
|
||||||
if (code !== OK) {
|
|
||||||
alertInfo(message)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
alertSuccess("解绑成功")
|
|
||||||
that.getTenementMeters();
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
// 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -6,6 +6,7 @@
|
|||||||
"search-select": "/components/searchSelect/index",
|
"search-select": "/components/searchSelect/index",
|
||||||
"van-empty": "@vant/weapp/empty/index",
|
"van-empty": "@vant/weapp/empty/index",
|
||||||
"kaihu": "./components/kaihu/index",
|
"kaihu": "./components/kaihu/index",
|
||||||
"bindMeter": "./components/bindMeter/index"
|
"bindMeter": "./components/bindMeter/index",
|
||||||
|
"unBindMeter": "./components/unBindMeter/index"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -29,8 +29,18 @@
|
|||||||
</view>
|
</view>
|
||||||
<view style="display: flex; align-items: center;margin: 20rpx">
|
<view style="display: flex; align-items: center;margin: 20rpx">
|
||||||
<view wx:if="{{tenement}}">
|
<view wx:if="{{tenement}}">
|
||||||
<van-button style="margin-right: 20rpx;" type="info" size="small" bind:click="startBind"> 绑定电表 </van-button>
|
<van-button
|
||||||
<van-button style="margin-right: 20rpx;" type="info" size="small" bind:tap="startUpdateInfo"> 修改信息 </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>
|
</view>
|
||||||
<van-button type="info" size="small" bind:click="startKh" wx:if="{{!!park}}"> 开户 </van-button>
|
<van-button type="info" size="small" bind:click="startKh" wx:if="{{!!park}}"> 开户 </van-button>
|
||||||
</view>
|
</view>
|
||||||
@ -70,7 +80,12 @@
|
|||||||
<view class="th" style="width: 250rpx"> {{ item.address }} </view>
|
<view class="th" style="width: 250rpx"> {{ item.address }} </view>
|
||||||
<view class="th" style="width: 250rpx"> {{ item.meterSn }} </view>
|
<view class="th" style="width: 250rpx"> {{ item.meterSn }} </view>
|
||||||
<view class="th" style="width: 200rpx">
|
<view class="th" style="width: 200rpx">
|
||||||
<view class="primaryTextBtn" bind:tap="unbind" data-id="{{item.meterId}}" data-address="{{item.address}}">
|
<view
|
||||||
|
class="primaryTextBtn"
|
||||||
|
bind:tap="unbind"
|
||||||
|
data-id="{{item.meterId}}"
|
||||||
|
data-address="{{item.address}}"
|
||||||
|
>
|
||||||
解绑
|
解绑
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -101,4 +116,20 @@
|
|||||||
title="{{title}}"
|
title="{{title}}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<bindMeter />
|
<bindMeter
|
||||||
|
visible="{{bindVisible}}"
|
||||||
|
park="{{park}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
tenementName="{{tenementName}}"
|
||||||
|
bind:ok="onBindOk"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<unBindMeter
|
||||||
|
visible="{{unbindVisible}}"
|
||||||
|
park="{{park}}"
|
||||||
|
tenement="{{tenement}}"
|
||||||
|
tenementName="{{tenementName}}"
|
||||||
|
meterId="{{meterId}}"
|
||||||
|
meterAddress="{{meterAddress}}"
|
||||||
|
bind:ok="onUnbindOk"
|
||||||
|
/>
|
@ -5,7 +5,7 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
active: 1
|
active: 3
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,8 +40,8 @@ export const updateTenement = async function(pid, data) {
|
|||||||
return await POST(`/vx/tenement/${pid}`, data)
|
return await POST(`/vx/tenement/${pid}`, data)
|
||||||
}
|
}
|
||||||
// 解绑电表
|
// 解绑电表
|
||||||
export const unbindMeter = async function(pid, tid, code) {
|
export const unbindMeter = async function(pid, tid, code, data) {
|
||||||
return await PUT(`/tenement/${pid}/${tid}/binding/${code}/unbind`)
|
return await PUT(`/vx/${pid}/${tid}/binding/${code}/unbind`,data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取b端用户
|
// 获取b端用户
|
||||||
@ -66,4 +66,14 @@ export const createBackTenement = async function(pid, data) {
|
|||||||
// 修改商户信息
|
// 修改商户信息
|
||||||
export const updateTenementBackInfo = async function(pid, tid, data) {
|
export const updateTenementBackInfo = async function(pid, tid, data) {
|
||||||
return await PUT(`/vx/${pid}/${tid}`, data)
|
return await PUT(`/vx/${pid}/${tid}`, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// c端给商户绑定一个表计
|
||||||
|
export const bindMeter = async function(pid, tid, data) {
|
||||||
|
return await POST(`/vx/${pid}/${tid}/binding`,data)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改管理员手机号
|
||||||
|
export const updateAdminPhone = async function(data) {
|
||||||
|
return await PUT(`/vx/updatePhone`, data)
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user