完成样式改动和设置为管理员

This commit is contained in:
qiaomu 2025-02-28 10:33:20 +08:00
parent edcaa7701c
commit 5fbd34d9f8
6 changed files with 93 additions and 57 deletions

View File

@ -1,8 +1,8 @@
// pages/workBench/components/account/index.js // pages/workBench/components/account/index.js
import request from "../../../../utils/request" import request from "../../../../utils/request"
import { getTenementBackInfo, } from "../../../../service/tenement" import { getTenementBackInfo, } from "../../../../service/tenement"
import { getBackApproveList, removeUser } from "../../../../service/user" import { getBackApproveList, removeUser, approveUser } from "../../../../service/user"
import { alertInfo, alertSuccess } from "../../../../utils/index" import { alertInfo, alertSuccess, wxModal } from "../../../../utils/index"
const { OK } = request const { OK } = request
Component({ Component({
@ -68,6 +68,19 @@ Component({
break; break;
} }
}, },
async setAdmin(e) {
const { id, name } = e.currentTarget.dataset;
const { tenement } = this.data;
await wxModal({ content: `确认要将${name}设置为管理吗?` })
const { code, message } = await approveUser({ userId: id, type: 2, tenement: tenement })
if (code !== OK) {
alertInfo(message)
return;
}
alertSuccess("转交成功")
this.initUserList();
this.getTenementInfo();
},
onCancel() { onCancel() {
this.setData({ this.setData({
show: false, show: false,

View File

@ -24,26 +24,44 @@
<van-row> <van-row>
<van-col span="24"> <van-col span="24">
<view class="tableTitleRow"> <view class="tableTitleRow">
<van-row gutter="5"> <view class="tableTitleRow">
<van-col span="8"> <view class="tbody">
<view style="text-align:center;">{{tenementInfo.shortName}}</view> <view class="tr">
</van-col> <view class="th" style="width: 200rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
<van-col span="16">{{tenementInfo.fullName}}</van-col> <view> {{tenementInfo.fullName}} </view>
</van-row> </view>
</view>
</view>
</view> </view>
</van-col> </van-col>
<van-col span="24"> <van-col span="24">
<view class="tableTitleRow"> <view class="tableTitleRow">
<van-row gutter="5"> <view class="tbody">
<van-col span="8" wx:if="{{tenementInfo.feeType === 0}}"> <view class="tr">
<view style="text-align: center;"> 华昌宝能收费 </view> </van-col> <view
<van-col span="8" wx:elif="{{tenementInfo.feeType === 1}}"> class="th"
<view style="text-align: center;"> 物业代收1 </view> </van-col> style="width: 200rpx;text-align: center;"
<van-col span="8" wx:elif="{{tenementInfo.feeType === 2}}"> wx:if="{{tenementInfo.feeType === 0}}"
<view style="text-align: center;"> 物业代收2 </view> </van-col> > 华昌宝能收费 </view>
<van-col span="8" wx:else> <view style="text-align: center;"> 物业代收线损 </view> </van-col> <view
<van-col span="16">{{tenementInfo.contact}} {{tenementInfo.phone}} </van-col> class="th"
</van-row> style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 1}}"
> 物业代收1 </view>
<view
class="th"
style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 2}}"
> 物业代收2 </view>
<view
class="th"
style="width: 200rpx;text-align: center;"
wx:if="{{tenementInfo.feeType === 3}}"
> 物业代收线损 </view>
<view style="margin-left: 26rpx;"> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
</view>
</view>
</view> </view>
</van-col> </van-col>
@ -54,23 +72,35 @@
<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="{{list}}" wx:for-index="itemIndex" wx:key="item">
<view class="tbody"> <view class="tbody">
<view class="tr"> <view class="tr tableRow">
<view class="th" style="width: 70rpx"> {{ itemIndex + 1 }} </view> <view class="th" style="width: 200rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatUserName }} </view>
<view class="th" style="width: 200rpx"> {{ item.WechatUserName }} </view> <view class="th" style="width: 250rpx;border-right: 1rpx solid #ccc;"> {{ item.WechatPhone }} </view>
<view class="th" style="width: 300rpx"> {{ item.WechatPhone }} </view> <view class="th" style="display: flex;">
<view class="th" style="width: 100rpx; display: flex;"> <view style="margin-left: 16rpx;">
<view wx:if="{{!item.Permissions}}" style="display: inline-block;">
<view <view
class="primaryTextBtn" class="primaryTextBtn"
bind:tap="handleDelete" bind:tap="handleDelete"
data-id="{{item.WechatUserID}}" data-id="{{item.WechatUserID}}"
data-name="{{item.WechatUserName}}" data-name="{{item.WechatUserName}}"
wx:if="{{!item.Permissions}}"
> >
移除 移除
</view> </view>
<view
class="primaryTextBtn"
bind:tap="setAdmin"
data-id="{{item.WechatUserID}}"
data-name="{{item.WechatUserName}}"
style="margin-left: 16rpx;"
>
设为管理
</view>
</view>
<van-tag type="primary" wx:else>管理员</van-tag> <van-tag type="primary" wx:else>管理员</van-tag>
</view> </view>
</view>
</view> </view>
</view> </view>

View File

@ -28,13 +28,8 @@
} }
.tbody {
width: 890rpx;
}
.tbody .tr { .tr {
padding: 20rpx;
border-bottom: 1rpx solid #EEEEEE;
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: nowrap; flex-wrap: nowrap;
@ -46,6 +41,7 @@
} }
.primaryTextBtn { .primaryTextBtn {
color: #1989fa; color: #1989fa;
display: inline-block;
} }
.customTable { .customTable {

View File

@ -35,7 +35,7 @@
<van-col span="8"> <van-col span="8">
<view style="text-align: center;"> {{item.tenement.shortName}} </view> <view style="text-align: center;"> {{item.tenement.shortName}} </view>
</van-col> </van-col>
<van-col span="16">{{item.tenement.name}}</van-col> <van-col span="16"><view style="margin-left: 16rpx;">{{item.tenement.name}}</view> </van-col>
</van-row> </van-row>
</view> </view>
<view class="customTableContent"> <view class="customTableContent">
@ -44,11 +44,11 @@
<view class="tableRow"> <view class="tableRow">
<van-row gutter="5"> <van-row gutter="5">
<van-col span="8" wx:if="{{item.type === 0}}"> <van-col span="8" wx:if="{{item.type === 0}}">
<view style="text-align: center;"> 商户电表 </view></van-col> <view style="text-align: center;border-right: 1rpx solid #ccc;"> 商户电表 </view></van-col>
<van-col span="8" wx:elif="{{item.type === 2}}"> <van-col span="8" wx:elif="{{item.type === 2}}">
<view style="text-align: center;"> 公摊电表 </view></van-col> <view style="text-align: center;border-right: 1rpx solid #ccc;"> 公摊电表 </view></van-col>
<van-col span="8" wx:else> <van-col span="8" wx:else>
<view style="text-align: center;"> 园区电表 </view></van-col> <view style="text-align: center;border-right: 1rpx solid #ccc;"> 园区电表 </view></van-col>
<van-col span="16">表号:{{item.meterNo}}</van-col> <van-col span="16">表号:{{item.meterNo}}</van-col>
</van-row> </van-row>
</view> </view>
@ -57,7 +57,7 @@
<view class="tableRow"> <view class="tableRow">
<van-row gutter="5"> <van-row gutter="5">
<van-col span="8"> <van-col span="8">
<view style="text-align: center;"> {{item.address}} </view> <view style="text-align: center;border-right: 1rpx solid #ccc;"> {{item.address}} </view>
</van-col> </van-col>
<van-col span="16">SN{{item.meterSn}}</van-col> <van-col span="16">SN{{item.meterSn}}</van-col>
</van-row> </van-row>
@ -67,7 +67,7 @@
<view class="tableRow"> <view class="tableRow">
<van-row gutter="5"> <van-row gutter="5">
<van-col span="8"> <van-col span="8">
<view style="text-align: center;"> 表字:{{item.amount}} </view> <view style="text-align: center;border-right: 1rpx solid #ccc;"> 表字:{{item.amount}} </view>
</van-col> </van-col>
<van-col span="16">余额:{{item.money}}</van-col> <van-col span="16">余额:{{item.money}}</van-col>
</van-row> </van-row>
@ -77,8 +77,8 @@
<view class="tableRow"> <view class="tableRow">
<van-row gutter="5"> <van-row gutter="5">
<van-col span="8" wx:if="{{item.onPosition === 0}}"> <van-col span="8" wx:if="{{item.onPosition === 0}}">
<view style="text-align: center;">合闸</view> </van-col> <view style="text-align: center;border-right: 1rpx solid #ccc;">合闸</view> </van-col>
<van-col span="8" wx:else><view style="text-align: center;">拉闸</view> </van-col> <van-col span="8" wx:else><view style="text-align: center;border-right: 1rpx solid #ccc;">拉闸</view> </van-col>
<van-col span="8" wx:if="{{item.canConnect}}"><view style="text-align: center;">在线</view> </van-col> <van-col span="8" wx:if="{{item.canConnect}}"><view style="text-align: center;">在线</view> </van-col>
<van-col span="8" wx:else><view style="text-align: center;">失联</view> </van-col> <van-col span="8" wx:else><view style="text-align: center;">失联</view> </van-col>
</van-row> </van-row>

View File

@ -39,15 +39,9 @@
<view class="tableTitleRow"> <view class="tableTitleRow">
<view class="tbody"> <view class="tbody">
<view class="tr"> <view class="tr">
<view class="th" style="width: 250rpx;text-align: center;"> {{tenementInfo.shortName}} </view> <view style="width: 250rpx;text-align: center;"> {{tenementInfo.shortName}} </view>
<view> {{tenementInfo.fullName}} </view> <view> {{tenementInfo.fullName}} </view>
</view> </view>
</view>
</view>
</van-col>
<van-col span="24">
<view class="tableTitleRow">
<view class="tbody">
<view class="tr"> <view class="tr">
<view wx:if="{{tenementInfo.feeType === 0}}" class="th" style="width: 250rpx;text-align: center;"> 华昌宝能收费 </view> <view wx:if="{{tenementInfo.feeType === 0}}" class="th" style="width: 250rpx;text-align: center;"> 华昌宝能收费 </view>
<view wx:if="{{tenementInfo.feeType === 1}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收1 </view> <view wx:if="{{tenementInfo.feeType === 1}}" class="th" style="width: 250rpx;text-align: center;"> 物业代收1 </view>
@ -56,6 +50,10 @@
<view> {{tenementInfo.contact}} {{tenementInfo.phone}} </view> <view> {{tenementInfo.contact}} {{tenementInfo.phone}} </view>
</view> </view>
</view> </view>
</view>
</van-col>
<!-- <van-row gutter="5"> <!-- <van-row gutter="5">
<van-col span="8"> <van-col span="8">
<view style="text-align: center;"> 华昌宝能收费 </view> </van-col> <view style="text-align: center;"> 华昌宝能收费 </view> </van-col>
@ -66,8 +64,7 @@
<van-col span="8" wx:else> <view style="text-align: center;"> 物业代收线损 </view> </van-col> <van-col span="8" wx:else> <view style="text-align: center;"> 物业代收线损 </view> </van-col>
<van-col span="16">{{tenementInfo.contact}} {{tenementInfo.phone}} </van-col> <van-col span="16">{{tenementInfo.contact}} {{tenementInfo.phone}} </van-col>
</van-row> --> </van-row> -->
</view>
</van-col>
</van-row> </van-row>
</view> </view>

View File

@ -5,7 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
active: 1, active: 0,
}, },
/** /**