chuangte_bike_newxcx/page_fenbao/yunwei/index.vue

267 lines
5.6 KiB
Vue
Raw Normal View History

2025-04-17 17:12:42 +08:00
<template>
<view class="page">
2025-12-20 14:29:10 +08:00
<u-navbar title="运维人员列表" :border-bottom="false" :background="bgc" title-color='#000' back-icon-color="#000"
title-size='36' height='50'></u-navbar>
2025-04-17 17:12:42 +08:00
<view class="box">
2025-12-20 14:29:10 +08:00
<view class="list" v-for="(item,index) in wateringList" :key="index">
<!-- 顶部名称 + 操作按钮 -->
<view class="card-header">
<view class="name">
{{item.remark || '--'}}
<text class="type-tag" v-if="item.type == 3">运维</text>
</view>
<view class="actions">
<view class="action-btn edit" @click.stop="btnedit(item)">
<u-icon name="edit-pen" color="#4C97E7" size="32"></u-icon>
2025-04-17 17:12:42 +08:00
</view>
2025-12-20 14:29:10 +08:00
<view class="action-btn delete" @click.stop="btnshanchu(item)">
<u-icon name="trash" color="#FF4D4F" size="32"></u-icon>
2025-04-17 17:12:42 +08:00
</view>
</view>
</view>
2025-12-20 14:29:10 +08:00
<!-- 电话 -->
<view class="phone">联系电话{{item.userPhone || '--'}}</view>
<!-- 数据区域 -->
<view class="data-box">
<view class="data-item">
<view class="label">运营区</view>
<view class="value">{{item.areaName || '--'}}</view>
2025-04-17 17:12:42 +08:00
</view>
2025-12-20 14:29:10 +08:00
<view class="data-item">
<view class="label">分成比例</view>
<view class="value">{{item.point == null ? '--' : item.point + '%'}}</view>
2025-04-17 17:12:42 +08:00
</view>
</view>
2025-12-20 14:29:10 +08:00
<!-- 创建时间 -->
<view class="time">创建时间{{item.createTime || '--'}}</view>
2025-04-17 17:12:42 +08:00
</view>
2025-12-20 14:29:10 +08:00
<view class="" style="width: 100%;text-align: center;margin-top: 50rpx;"
v-if="wateringList.length == 0">
<view class="" style="font-size: 28rpx;color: #ccc;">没有更多运维人员啦...</view>
2025-04-17 17:12:42 +08:00
</view>
2025-12-20 14:29:10 +08:00
<!-- 底部占位防止被按钮遮挡 -->
<view style="height: 150rpx;"></view>
2025-04-17 17:12:42 +08:00
</view>
2025-12-20 14:29:10 +08:00
2025-04-17 17:12:42 +08:00
<view class="xinjian" @click="btnadd">
2025-12-20 14:29:10 +08:00
新建运维人员
2025-04-17 17:12:42 +08:00
</view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "#fff"
},
wateringList: [],
2025-12-20 14:29:10 +08:00
keyword: '',
areaId: ''
2025-04-17 17:12:42 +08:00
}
},
2025-04-28 15:40:26 +08:00
onLoad(option) {
this.areaId = option.areaId
2025-04-17 17:12:42 +08:00
},
onShow() {
this.getlist()
},
methods: {
2025-12-20 14:29:10 +08:00
// 点击删除运维人员
btnshanchu(item) {
2025-04-17 17:12:42 +08:00
let that = this
uni.showModal({
title: '温馨提示',
2025-12-20 14:29:10 +08:00
content: '您确定要删除此运维人员吗?',
2025-04-17 17:12:42 +08:00
showCancel: true,
success: function(res) {
if (res.confirm) {
that.$u.delete(`/bst/areaJoin/${item.id}`).then(res => {
if (res.code == 200) {
that.getlist()
uni.showToast({
title: '删除成功',
icon: 'success',
duration: 2000
})
2025-12-20 14:29:10 +08:00
} else {
2025-04-17 17:12:42 +08:00
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
}
}
})
},
2025-12-20 14:29:10 +08:00
// 点击跳转编辑
btnedit(item) {
2025-04-17 17:12:42 +08:00
uni.navigateTo({
2025-12-20 14:29:10 +08:00
url: '/page_fenbao/yunwei/addyunwei?item=' + JSON.stringify(item)
2025-04-17 17:12:42 +08:00
})
},
2025-12-20 14:29:10 +08:00
btnadd() {
2025-04-17 17:12:42 +08:00
uni.navigateTo({
2025-12-20 14:29:10 +08:00
url: '/page_fenbao/yunwei/addyunwei'
2025-04-17 17:12:42 +08:00
})
},
getlist() {
2025-04-28 15:40:26 +08:00
this.$u.get(`/bst/areaJoin/list?pageNum=1&pageSize=999&types=3&areaId=${this.areaId}`).then(res => {
2025-04-17 17:12:42 +08:00
if (res.code == 200) {
this.wateringList = res.rows
}
})
},
}
}
</script>
<style lang="scss">
2025-12-20 14:29:10 +08:00
page {
background: #F7F7F7;
2025-04-17 17:12:42 +08:00
}
2025-12-20 14:29:10 +08:00
.page {
width: 750rpx;
min-height: 100vh;
background: #F7F7F7;
2025-04-17 17:12:42 +08:00
}
2025-12-20 14:29:10 +08:00
.box {
width: 750rpx;
padding: 20rpx 30rpx;
box-sizing: border-box;
2025-04-17 17:12:42 +08:00
}
2025-12-20 14:29:10 +08:00
.list {
width: 100%;
background: #FFFFFF;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 24rpx;
box-sizing: border-box;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.02);
.card-header {
2025-04-17 17:12:42 +08:00
display: flex;
justify-content: space-between;
align-items: center;
2025-12-20 14:29:10 +08:00
margin-bottom: 16rpx;
.name {
font-size: 32rpx;
font-weight: 600;
color: #333;
2025-04-17 17:12:42 +08:00
display: flex;
align-items: center;
2025-12-20 14:29:10 +08:00
.type-tag {
font-size: 22rpx;
font-weight: normal;
background: #EBF4FF;
color: #4C97E7;
padding: 4rpx 12rpx;
border-radius: 8rpx;
margin-left: 12rpx;
2025-04-17 17:12:42 +08:00
}
}
2025-12-20 14:29:10 +08:00
.actions {
display: flex;
gap: 20rpx;
.action-btn {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
2025-04-17 17:12:42 +08:00
display: flex;
2025-12-20 14:29:10 +08:00
align-items: center;
justify-content: center;
&.edit {
background: #EBF4FF;
2025-04-17 17:12:42 +08:00
}
2025-12-20 14:29:10 +08:00
&.delete {
background: #FFF1F0;
2025-04-17 17:12:42 +08:00
}
}
2025-12-20 14:29:10 +08:00
}
}
.phone {
font-size: 26rpx;
color: #666;
margin-bottom: 24rpx;
}
.data-box {
background: #F8F9FB;
border-radius: 12rpx;
padding: 24rpx 30rpx;
2025-04-17 17:12:42 +08:00
display: flex;
justify-content: space-between;
2025-12-20 14:29:10 +08:00
align-items: center;
2025-04-17 17:12:42 +08:00
2025-12-20 14:29:10 +08:00
.data-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
.label {
font-size: 24rpx;
color: #999;
margin-bottom: 12rpx;
}
.value {
font-size: 28rpx;
font-weight: 600;
color: #333;
}
2025-04-17 17:12:42 +08:00
}
}
2025-12-20 14:29:10 +08:00
.time {
font-size: 24rpx;
color: #999;
margin-top: 20rpx;
text-align: right;
}
2025-04-17 17:12:42 +08:00
}
2025-12-20 14:29:10 +08:00
.xinjian {
width: 690rpx;
height: 88rpx;
background: #4C97E7;
border-radius: 44rpx;
font-weight: 600;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
line-height: 88rpx;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 40rpx;
box-shadow: 0 8rpx 20rpx rgba(76, 151, 231, 0.3);
z-index: 10;
&:active {
opacity: 0.9;
2025-04-17 17:12:42 +08:00
}
}
</style>