暂存商户信息
This commit is contained in:
parent
b078bbf26a
commit
93ee759092
@ -33,6 +33,7 @@ Component({
|
|||||||
columns: [],
|
columns: [],
|
||||||
searchText: "",
|
searchText: "",
|
||||||
payWays,
|
payWays,
|
||||||
|
feeType,
|
||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
attached() {
|
attached() {
|
||||||
@ -84,6 +85,17 @@ Component({
|
|||||||
})
|
})
|
||||||
this.triggerEvent("confirm", { data: item, way: index, type } );
|
this.triggerEvent("confirm", { data: item, way: index, type } );
|
||||||
},
|
},
|
||||||
|
onFeeTypeConfirm(event) {
|
||||||
|
const { index } = event.detail;
|
||||||
|
const { feeType = [], type } = this.data;
|
||||||
|
const item = feeType[index];
|
||||||
|
this.setData({
|
||||||
|
columns: [],
|
||||||
|
list: [],
|
||||||
|
searchText: ""
|
||||||
|
})
|
||||||
|
this.triggerEvent("confirm", { data: item, way: index, type } );
|
||||||
|
},
|
||||||
onSearch() {
|
onSearch() {
|
||||||
const { type } = this.data;
|
const { type } = this.data;
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
@ -5,7 +5,27 @@
|
|||||||
position="bottom"
|
position="bottom"
|
||||||
z-index="100000"
|
z-index="100000"
|
||||||
>
|
>
|
||||||
<view wx:if="{{type !== 'pay'}}">
|
<view wx:if="{{type === 'pay'}}">
|
||||||
|
<van-picker
|
||||||
|
custom-style="width: 100%;"
|
||||||
|
columns="{{ payWays }}"
|
||||||
|
title="{{title}}"
|
||||||
|
show-toolbar="{{true}}"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
bind:confirm="onPayConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view wx:elif="{{type === 'feeType'}}">
|
||||||
|
<van-picker
|
||||||
|
custom-style="width: 100%;"
|
||||||
|
columns="{{ feeType }}"
|
||||||
|
title="{{title}}"
|
||||||
|
show-toolbar="{{true}}"
|
||||||
|
bind:cancel="onCancel"
|
||||||
|
bind:confirm="onFeeTypeConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<view wx:elif="{{type !== 'pay'}}">
|
||||||
<van-search
|
<van-search
|
||||||
value="{{ value }}"
|
value="{{ value }}"
|
||||||
placeholder="{{type === 'tenement' ? '请输入关键词搜索后选择' : '请输入搜索关键词'}}"
|
placeholder="{{type === 'tenement' ? '请输入关键词搜索后选择' : '请输入搜索关键词'}}"
|
||||||
@ -27,26 +47,7 @@
|
|||||||
bind:confirm="onConfirm"
|
bind:confirm="onConfirm"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view wx:elif="{{type === 'pay'}}">
|
|
||||||
<van-picker
|
|
||||||
custom-style="width: 100%;"
|
|
||||||
columns="{{ payWays }}"
|
|
||||||
title="{{title}}"
|
|
||||||
show-toolbar="{{true}}"
|
|
||||||
bind:cancel="onCancel"
|
|
||||||
bind:confirm="onPayConfirm"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view wx:elif="{{type === 'feeType'}}">
|
|
||||||
<van-picker
|
|
||||||
custom-style="width: 100%;"
|
|
||||||
columns="{{ feeType }}"
|
|
||||||
title="{{title}}"
|
|
||||||
show-toolbar="{{true}}"
|
|
||||||
bind:cancel="onCancel"
|
|
||||||
bind:confirm="onPayConfirm"
|
|
||||||
/>
|
|
||||||
</view>
|
|
||||||
<view wx:else>
|
<view wx:else>
|
||||||
<van-picker
|
<van-picker
|
||||||
custom-style="width: 100%;"
|
custom-style="width: 100%;"
|
||||||
|
@ -152,9 +152,9 @@ Page({
|
|||||||
tenementName: data.name,
|
tenementName: data.name,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.onConcal();
|
this.onCancel();
|
||||||
},
|
},
|
||||||
onConcal() {
|
onCancel() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
|
@ -88,6 +88,6 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -15,23 +15,14 @@ Component({
|
|||||||
onCancel: Function,
|
onCancel: Function,
|
||||||
park: String,
|
park: String,
|
||||||
tenement: String,
|
tenement: String,
|
||||||
|
parentPhone:String,
|
||||||
|
parentName:String,
|
||||||
|
parentId:String,
|
||||||
},
|
},
|
||||||
observers: {
|
observers: {
|
||||||
"name": function(newValue) {
|
"parentName,parentId,parentPhone": function(newName, newId, newPhone) {
|
||||||
const newData = this.data;
|
this.setData({ data: { name: newName, id: newId, phone: newPhone } })
|
||||||
newData.name = newValue
|
|
||||||
this.setData({ data: newData })
|
|
||||||
},
|
},
|
||||||
"id": function(newValue) {
|
|
||||||
const newData = this.data;
|
|
||||||
newData.id = newValue
|
|
||||||
this.setData({ data: newData })
|
|
||||||
},
|
|
||||||
"phone": function(newValue) {
|
|
||||||
const newData = this.data;
|
|
||||||
newData.phone = newValue
|
|
||||||
this.setData({ data: newData })
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
@ -45,7 +36,7 @@ Component({
|
|||||||
*/
|
*/
|
||||||
methods: {
|
methods: {
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
const { data = {}, tenement, park } = this.data;
|
const { data = {}, tenement, park, editType } = this.data;
|
||||||
if (!data.phone) {
|
if (!data.phone) {
|
||||||
alertInfo("请输入手机号")
|
alertInfo("请输入手机号")
|
||||||
return
|
return
|
||||||
@ -54,18 +45,20 @@ 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")
|
|
||||||
},
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
console.log('e', e)
|
|
||||||
const { name } = e.currentTarget.dataset;
|
const { name } = e.currentTarget.dataset;
|
||||||
const newData = this.data.data;
|
const newData = this.data.data;
|
||||||
newData[name] = e.detail;
|
newData[name] = e.detail;
|
||||||
|
@ -69,7 +69,7 @@ Component({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onConcal() {
|
onCancel() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
})
|
})
|
||||||
@ -133,21 +133,22 @@ Component({
|
|||||||
},
|
},
|
||||||
handleChangeMain() {
|
handleChangeMain() {
|
||||||
const { list = [] } = this.data;
|
const { list = [] } = this.data;
|
||||||
const main = list?.find(item => item.isAdmin)
|
const main = list?.find(item => item.Permissions)
|
||||||
if (!main) {
|
if (!main) {
|
||||||
|
alertInfo("没有主账号")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log("main", main)
|
||||||
this.setData({
|
this.setData({
|
||||||
visible: true,
|
visible: true,
|
||||||
type: "update",
|
type: "update",
|
||||||
title: "编辑管理员",
|
title: "编辑管理员",
|
||||||
phone: main.phone,
|
phone: main.WechatPhone,
|
||||||
name: main.name,
|
name: main.WechatUserName,
|
||||||
id: main.id,
|
id: main.WechatUserID,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
console.log("-------------")
|
|
||||||
this.setData({
|
this.setData({
|
||||||
visible: false,
|
visible: false,
|
||||||
type: "",
|
type: "",
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
"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"
|
||||||
"van-tag": "@vant/weapp/tag/index"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -66,10 +66,10 @@
|
|||||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
<view class="tr">
|
<view class="tr">
|
||||||
<view class="th" style="width: 70rpx"> {{ itemIndex + 1 }} </view>
|
<view class="th" style="width: 70rpx"> {{ itemIndex + 1 }} </view>
|
||||||
<view class="th" style="width: 200rpx"> {{ item.name }} </view>
|
<view class="th" style="width: 200rpx"> {{ item.WechatUserName }} </view>
|
||||||
<view class="th" style="width: 300rpx"> {{ item.phone }} </view>
|
<view class="th" style="width: 300rpx"> {{ item.WechatPhone }} </view>
|
||||||
<view class="th" style="width: 100rpx; display: flex;">
|
<view class="th" style="width: 100rpx; display: flex;">
|
||||||
<view class="primaryTextBtn" bind:tap="handleDelete" data-id="{{item.id}}" data-name="{{item.name}}" wx:if="{{!item.isAdmin}}">
|
<view class="primaryTextBtn" bind:tap="handleDelete" data-id="{{item.WechatUserID}}" data-name="{{item.WechatUserName}}" wx:if="{{!item.Permissions}}">
|
||||||
移除
|
移除
|
||||||
</view>
|
</view>
|
||||||
<van-tag type="primary" wx:else>管理员</van-tag>
|
<van-tag type="primary" wx:else>管理员</van-tag>
|
||||||
@ -83,7 +83,7 @@
|
|||||||
|
|
||||||
</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}}"
|
||||||
@ -92,7 +92,7 @@
|
|||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
isBack="{{true}}"
|
isBack="{{true}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
/>
|
/>
|
||||||
<edit-modal
|
<edit-modal
|
||||||
visible="{{visible}}"
|
visible="{{visible}}"
|
||||||
@ -100,6 +100,9 @@
|
|||||||
title="{{title}}"
|
title="{{title}}"
|
||||||
tenement="{{tenement}}"
|
tenement="{{tenement}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
|
parentPhone="{{phone}}"
|
||||||
|
parentName="{{name}}"
|
||||||
|
parentId="{{id}}"
|
||||||
bind:ok="onEditConfirm"
|
bind:ok="onEditConfirm"
|
||||||
bind:cancel="handleCancel"
|
bind:cancel="handleCancel"
|
||||||
/>
|
/>
|
@ -49,7 +49,7 @@ Component({
|
|||||||
await that.init();
|
await that.init();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.onConcal();
|
this.onCancel();
|
||||||
},
|
},
|
||||||
onChangeKeyword(e) {
|
onChangeKeyword(e) {
|
||||||
this.setData({ keywordTemp: e.detail })
|
this.setData({ keywordTemp: e.detail })
|
||||||
@ -162,7 +162,7 @@ Component({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onConcal() {
|
onCancel() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<van-dialog
|
<van-dialog
|
||||||
|
@ -67,9 +67,9 @@ Component({
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.onConcal();
|
this.onCancel();
|
||||||
},
|
},
|
||||||
onConcal() {
|
onCancel() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
|
@ -76,6 +76,6 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
wx:if="{{show}}"
|
wx:if="{{show}}"
|
||||||
/>
|
/>
|
||||||
|
@ -66,7 +66,7 @@ Component({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.onConcal();
|
this.onCancel();
|
||||||
},
|
},
|
||||||
onChangeKeyword(e) {
|
onChangeKeyword(e) {
|
||||||
this.setData({ keywordTemp: e.detail })
|
this.setData({ keywordTemp: e.detail })
|
||||||
@ -108,7 +108,7 @@ Component({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onConcal() {
|
onCancel() {
|
||||||
this.setData({
|
this.setData({
|
||||||
show: false,
|
show: false,
|
||||||
title: "",
|
title: "",
|
||||||
|
@ -146,6 +146,6 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
wx:if="{{show}}"
|
wx:if="{{show}}"
|
||||||
/>
|
/>
|
||||||
|
@ -31,5 +31,8 @@ Component({
|
|||||||
type: 'meter'
|
type: 'meter'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onClose() {
|
||||||
|
this.triggerEvent("close")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -5,6 +5,7 @@
|
|||||||
show="{{ show }}"
|
show="{{ show }}"
|
||||||
show-cancel-button
|
show-cancel-button
|
||||||
bind:confirm="onSubmit"
|
bind:confirm="onSubmit"
|
||||||
|
bind:close="onClose"
|
||||||
>
|
>
|
||||||
<view class="modalContentWrapper">
|
<view class="modalContentWrapper">
|
||||||
<van-field
|
<van-field
|
||||||
|
@ -70,5 +70,5 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
/>
|
/>
|
@ -1,6 +1,9 @@
|
|||||||
// pages/workBench/components/tenement/components/kaihu/index.js
|
// pages/workBench/components/tenement/components/kaihu/index.js
|
||||||
import { alertInfo } from "../../../../../../utils/index"
|
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({
|
Component({
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -9,14 +12,21 @@ Component({
|
|||||||
properties: {
|
properties: {
|
||||||
park: String,
|
park: String,
|
||||||
visible: Boolean,
|
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]
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// observers: {
|
|
||||||
// 'visible': function(newVisible) {
|
|
||||||
// this.setData({
|
|
||||||
// show: newVisible
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
/**
|
/**
|
||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
*/
|
*/
|
||||||
@ -48,10 +58,67 @@ Component({
|
|||||||
}
|
}
|
||||||
this.setData({
|
this.setData({
|
||||||
show: true,
|
show: true,
|
||||||
title: "建筑",
|
title: "收费类型",
|
||||||
type: 'building'
|
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")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
})
|
})
|
@ -1,56 +1,73 @@
|
|||||||
<!--pages/workBench/components/tenement/components/kaihu/index.wxml-->
|
<!--pages/workBench/components/tenement/components/kaihu/index.wxml-->
|
||||||
<van-dialog
|
<van-dialog
|
||||||
use-slot
|
use-slot
|
||||||
title="开户"
|
title="{{title}}"
|
||||||
show="{{ visible }}"
|
show="{{ visible }}"
|
||||||
show-cancel-button
|
show-cancel-button
|
||||||
|
bind:close="onClose"
|
||||||
bind:confirm="onSubmit"
|
bind:confirm="onSubmit"
|
||||||
>
|
>
|
||||||
<view class="modalContentWrapper">
|
<view class="modalContentWrapper">
|
||||||
<van-field
|
<van-field
|
||||||
value=""
|
value="{{name}}"
|
||||||
|
data-name="name"
|
||||||
|
bind:change="onChange"
|
||||||
label="商户全称"
|
label="商户全称"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
placeholder="请输入商户全称"
|
||||||
autosize="{{true}}"
|
autosize="{{true}}"
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value=""
|
value="{{shortName}}"
|
||||||
|
data-name="shortName"
|
||||||
|
bind:change="onChange"
|
||||||
label="商户简称"
|
label="商户简称"
|
||||||
|
placeholder="请输入商户简称"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
autosize="{{true}}"
|
autosize="{{true}}"
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value=""
|
value="{{address}}"
|
||||||
|
data-name="address"
|
||||||
|
bind:change="onChange"
|
||||||
label="联系地址"
|
label="联系地址"
|
||||||
|
placeholder="请输入联系地址"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
autosize="{{true}}"
|
autosize="{{true}}"
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value=""
|
value="{{contact}}"
|
||||||
|
data-name="contact"
|
||||||
|
bind:change="onChange"
|
||||||
label="联系人"
|
label="联系人"
|
||||||
|
placeholder="请输入联系人"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
autosize="{{true}}"
|
autosize="{{true}}"
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value=""
|
value="{{phone}}"
|
||||||
|
data-name="phone"
|
||||||
|
bind:change="onChange"
|
||||||
label="联系电话"
|
label="联系电话"
|
||||||
|
placeholder="请输入联系电话"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
autosize="{{true}}"
|
autosize="{{true}}"
|
||||||
title-width="132rpx"
|
title-width="132rpx"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{ meterName }}"
|
value="{{ buildingName }}"
|
||||||
placeholder="请选择建筑"
|
placeholder="请选择建筑"
|
||||||
label="建筑"
|
label="建筑"
|
||||||
use-button-slot
|
use-button-slot
|
||||||
|
readonly
|
||||||
title-width="120rpx"
|
title-width="120rpx"
|
||||||
>
|
>
|
||||||
<van-button slot="button" size="small" type="primary" bind:click="onBuildingFocus">
|
<van-button slot="button" size="small" type="primary" bind:click="onBuildingFocus">
|
||||||
@ -58,9 +75,10 @@
|
|||||||
</van-button>
|
</van-button>
|
||||||
</van-field>
|
</van-field>
|
||||||
<van-field
|
<van-field
|
||||||
value="{{ meterName }}"
|
value="{{ feeTypeName }}"
|
||||||
placeholder="请选择收费类型"
|
placeholder="请选择收费类型"
|
||||||
label="收费类型"
|
label="收费类型"
|
||||||
|
readonly
|
||||||
use-button-slot
|
use-button-slot
|
||||||
title-width="120rpx"
|
title-width="120rpx"
|
||||||
>
|
>
|
||||||
@ -77,5 +95,5 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
/>
|
/>
|
@ -1,5 +1,6 @@
|
|||||||
import { alertInfo } from "../../../../utils/index";
|
import { alertInfo, alertSuccess } from "../../../../utils/index";
|
||||||
import { getTenementBackInfo, } from "../../../../service/tenement"
|
import { getTenementBackInfo, unbindMeter, } from "../../../../service/tenement"
|
||||||
|
import { getBackTenementMeters, } from "../../../../service/meter"
|
||||||
import request from "../../../../utils/request"
|
import request from "../../../../utils/request"
|
||||||
const { OK } = request
|
const { OK } = request
|
||||||
// pages/workBench/components/tenement/index.js
|
// pages/workBench/components/tenement/index.js
|
||||||
@ -16,12 +17,10 @@ Component({
|
|||||||
* 组件的初始数据
|
* 组件的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
|
defaultValue: {},
|
||||||
},
|
editType: "",
|
||||||
lifetimes: {
|
meterList: [],
|
||||||
ready() {
|
// bindMeter
|
||||||
console.log("this.data", this.data)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 组件的方法列表
|
* 组件的方法列表
|
||||||
@ -79,18 +78,76 @@ Component({
|
|||||||
show: false,
|
show: false,
|
||||||
} , () => {
|
} , () => {
|
||||||
that.getTenementInfo();
|
that.getTenementInfo();
|
||||||
|
that.getTenementMeters();
|
||||||
})
|
})
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onCancel() {
|
||||||
|
this.setData({
|
||||||
|
show: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
startKh() {
|
startKh() {
|
||||||
this.setData({
|
this.setData({
|
||||||
kaihuVisible: true
|
kaihuVisible: true,
|
||||||
|
editType: "add",
|
||||||
|
title: "开户"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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: "编辑"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onKaihuConfirm() {
|
||||||
|
this.getTenementInfo();
|
||||||
|
this.onKaihuClose();
|
||||||
|
},
|
||||||
|
unbind(e) {
|
||||||
|
const that = this;
|
||||||
|
const { park, tenement } = this.data;
|
||||||
|
const { address, id } = e.currentTarget.dataset;
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// const { park = '', parkName = '', tenement = '', tenementName = '' } = this.data;
|
|
||||||
// wx.navigateTo({
|
|
||||||
// url: `/pages/workBench/components/tenement/components/createTenement/index?park=${park}&tenement=${tenement}&parkName=${parkName}&${tenementName}=${tenementName}`,
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -5,6 +5,7 @@
|
|||||||
"van-button": "@vant/weapp/button/index",
|
"van-button": "@vant/weapp/button/index",
|
||||||
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,22 +55,22 @@
|
|||||||
readonly
|
readonly
|
||||||
title-width="140rpx"
|
title-width="140rpx"
|
||||||
/>
|
/>
|
||||||
<view wx:if="{{list.length}}">
|
<view wx:if="{{meterList.length}}">
|
||||||
<view class="tableWrapper">
|
<view class="tableWrapper">
|
||||||
<view class="table">
|
<view class="table">
|
||||||
<view class="thead">
|
<view class="thead">
|
||||||
<view class="th" style="width: 250rpx"> 电表地址 </view>
|
<view class="th" style="width: 250rpx"> 电表地址 </view>
|
||||||
<view class="th" style="width: 150rpx"> SN </view>
|
<view class="th" style="width: 250rpx"> SN </view>
|
||||||
<view class="th" style="width: 200rpx"> 操作 </view>
|
<view class="th" style="width: 200rpx"> 操作 </view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tbody">
|
<view class="tbody">
|
||||||
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
<van-radio-group value="{{ record }}" bind:change="onChangeSelectRecharge">
|
||||||
<block wx:for="{{list}}" wx:for-index="itemIndex" wx:key="item">
|
<block wx:for="{{meterList}}" wx:for-index="itemIndex" wx:key="item">
|
||||||
<view class="tr">
|
<view class="tr">
|
||||||
<view class="th" style="width: 200rpx"> {{ item.tenement.shortName }} </view>
|
<view class="th" style="width: 250rpx"> {{ item.address }} </view>
|
||||||
<view class="th" style="width: 200rpx"> {{ item.money }} </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="jumpToDetail" data-id="{{item.id}}">
|
<view class="primaryTextBtn" bind:tap="unbind" data-id="{{item.meterId}}" data-address="{{item.address}}">
|
||||||
解绑
|
解绑
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -89,6 +89,16 @@
|
|||||||
type="{{type}}"
|
type="{{type}}"
|
||||||
park="{{park}}"
|
park="{{park}}"
|
||||||
bindconfirm="onConfirm"
|
bindconfirm="onConfirm"
|
||||||
bindcancel="onConcal"
|
bindcancel="onCancel"
|
||||||
/>
|
/>
|
||||||
<kaihu park="{{park}}" visible="{{kaihuVisible}}" />
|
<kaihu
|
||||||
|
park="{{park}}"
|
||||||
|
visible="{{kaihuVisible}}"
|
||||||
|
defaultValue="{{defaultValue}}"
|
||||||
|
bind:close="onKaihuClose"
|
||||||
|
bind:ok="onKaihuConfirm"
|
||||||
|
editType="{{editType}}"
|
||||||
|
title="{{title}}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<bindMeter />
|
@ -1 +1,45 @@
|
|||||||
/* pages/workBench/components/tenement/index.wxss */
|
/* 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 {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryTextBtn {
|
||||||
|
color: #1989fa;
|
||||||
|
}
|
@ -27,8 +27,10 @@ export const getParkSimpleMeterList = async function({park = "", keyword = "", p
|
|||||||
return await GET(`/work/getWorkMeter?page=${page}&park=${park}&keyword=${replaceSpecialIcon(keyword)}`);
|
return await GET(`/work/getWorkMeter?page=${page}&park=${park}&keyword=${replaceSpecialIcon(keyword)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取商户下的电表,后台
|
||||||
|
export const getBackTenementMeters = async function(park, tenement) {
|
||||||
|
return await GET(`/vx/getWorkMeterDetails?park=${park}&tenement=${tenement}`);
|
||||||
|
}
|
||||||
|
|
||||||
// 拉合闸
|
// 拉合闸
|
||||||
export const handleOperateMeterSwitch = async function({ ids = [], status }) {
|
export const handleOperateMeterSwitch = async function({ ids = [], status }) {
|
||||||
|
@ -41,7 +41,7 @@ export const updateTenement = async function(pid, data) {
|
|||||||
}
|
}
|
||||||
// 解绑电表
|
// 解绑电表
|
||||||
export const unbindMeter = async function(pid, tid, code) {
|
export const unbindMeter = async function(pid, tid, code) {
|
||||||
return await POST(`/tenement/${pid}/${tid}/binding/${code}/unbind`)
|
return await PUT(`/tenement/${pid}/${tid}/binding/${code}/unbind`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取b端用户
|
// 获取b端用户
|
||||||
@ -58,3 +58,12 @@ export const getTenementBackInfo = async (pid, tid) => {
|
|||||||
export const createTenementWxUser = async function(data) {
|
export const createTenementWxUser = async function(data) {
|
||||||
return await POST(`/wx/createUser`, data)
|
return await POST(`/wx/createUser`, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 创建商户
|
||||||
|
export const createBackTenement = async function(pid, data) {
|
||||||
|
return await POST(`/vx/tenement/${pid}`, data)
|
||||||
|
}
|
||||||
|
// 修改商户信息
|
||||||
|
export const updateTenementBackInfo = async function(pid, tid, data) {
|
||||||
|
return await PUT(`/vx/${pid}/${tid}`, data)
|
||||||
|
}
|
@ -71,6 +71,6 @@ export const getQuestionList = async function(page) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取扫描二维码的列表
|
// 获取扫描二维码的列表
|
||||||
export const getBackApproveList = async function(tenement, status=0) {
|
export const getBackApproveList = async function(tenement) {
|
||||||
return await GET(`/wx/getApproveList?status=${status}&tenement=${tenement}`);
|
return await GET(`/wx/getWorkUserList?tenement=${tenement}`);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user