持续集成分支

This commit is contained in:
aixianling
2024-10-31 14:34:57 +08:00
parent 6a833be062
commit 8c56cf808b
2165 changed files with 4116 additions and 8716 deletions

View File

@@ -0,0 +1,165 @@
<template>
<div class="AddGird">
<AiGroup>
<AiItem label="网格名称" required>
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="form.girdName"
maxlength="50"/>
</AiItem>
</AiGroup>
<AiGroup>
<AiItem label="网格长" topLabel>
<AiPagePicker type="sysUser" :selected.sync="form.girdMemberManageList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id">
<AiMore :value="getArrayLabel(form.girdMemberManageList)"/>
</AiPagePicker>
</AiItem>
</AiGroup>
<AiGroup>
<AiItem label="网格员" topLabel>
<AiPagePicker type="sysUser" :selected.sync="form.girdMemberList" action="/app/wxcp/wxuser/list?status=1" nodeKey="id">
<AiMore :value="getArrayLabel(form.girdMemberList)"/>
</AiPagePicker>
</AiItem>
</AiGroup>
<div class="footer" @click="$u.debounce(confirm)">{{ fromType == 'add' ? '确认添加' : '确认修改' }}</div>
</div>
</template>
<script>
export default {
data() {
return {
id: '',
form: {
girdMemberManageList: [],
girdMemberList: []
},
fromType: 'add', //add新增 edit编辑,
}
},
onLoad(option) {
this.id = option.id
this.fromType = option.fromType
this.getDetail()
},
onShow() {
if (this.fromType == 'add') {
document.title = '添加网格'
} else {
document.title = '编辑网格'
}
},
methods: {
getDetail() {
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
if (this.fromType == 'edit') {
this.form = res.data
this.form.girdMemberList?.map(e => e.id = e.wxUserId)
this.form.girdMemberManageList?.map(e => e.id = e.wxUserId)
}
if (this.fromType == 'add') {
this.form.parentGirdId = res.data.id
this.form.parentGirdName = res.data.girdName
this.$forceUpdate()
}
}
})
},
confirm() {
if (!this.form.girdName) {
return this.$u.toast('请输入网格名称')
}
let girdMemberManageList = this.form.girdMemberManageList?.map((item) => {
return {
wxUserId: item.id,
phone: item.mobile,
photo: item.avatar,
name: item.name
}
})
let girdMemberList = this.form.girdMemberList?.map((item) => {
return {
wxUserId: item.id,
phone: item.mobile,
photo: item.avatar,
name: item.name
}
})
this.$http.post(`/app/appgirdinfo/addOrUpdateByEw`, {...this.form, girdMemberManageList, girdMemberList}).then((res) => {
if (res?.code == 0) {
this.$u.toast('提交成功')
uni.$emit('update')
setTimeout(() => {
uni.navigateBack({})
}, 600)
}
}).catch((err) => {
this.$u.toast(err)
})
},
getArrayLabel(arr, key = 'name', separation = '') {
return arr?.map(e => e[key])?.join(separation)
}
}
}
</script>
<style lang="scss" scoped>
.AddGird {
.item-flex {
display: flex;
padding: 34px 32px;
background-color: #fff;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
margin-bottom: 16px;
.label {
font-weight: 400;
color: #333333;
line-height: 22px;
width: 150px;
.tips {
display: inline-block;
width: 16px;
color: #F46;
line-height: 44px;
}
}
.value {
width: calc(100% - 150px);
line-height: 44px;
text-align: right;
color: #666;
img {
width: 44px;
height: 44px;
vertical-align: middle;
}
}
.color-999 {
color: #999;
}
}
.footer {
width: 100%;
height: 112px;
line-height: 112px;
background: #1365DD;
position: fixed;
bottom: 0;
left: 0;
text-align: center;
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
}
</style>

View File

@@ -0,0 +1,230 @@
<template>
<div class="AddMerchan">
<AiTopFixed>
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="businessName" confirm-type="search" @clear="current = 1, getList()" @search="current = 1, getList()"/>
</AiTopFixed>
<div class="userList" v-if="list.length">
<ul v-for="(item,index) in list" :key="index">
<li class="main">
<div class="user">
<div>
<img src="./components/img/xz.png" alt="" class="checkbox" v-if="!item.checked" @click="userClick(index)">
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click="userClick(index)">
</div>
<div class="userInfo">
<div class="item-title">
<img :src="$cdn + 'xincheng/icon.png'" alt="">
<p>{{ item.businessName }}</p>
</div>
<div class="info">
<img :src="$cdn + 'xincheng/dh.png'" alt="">
<div>{{ item.bossName }} {{ item.telephone }}</div>
</div>
<div class="info" style="margin-bottom: 0;">
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
<div>{{ item.businessAddress }}</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
<div style="height:70px;"></div>
<div class="footer" @click="confirm">确定选择</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
list: [],
current: 1,
value: '',
checked: true,
girdMemberId: '',
girdId: '',
businessName: ''
}
},
computed: { ...mapState(['user']) },
onLoad (query) {
this.girdMemberId = query.id
this.girdId = query.girdId
this.getList()
uni.$on('update', () => {
this.current = 1
this.getList()
})
},
methods: {
getList(){
if (this.current > this.pages && this.current !== 1) return
this.$loading()
this.$http.post('/app/appgirdmembercompany/getUnbindCompany', null, {
params: {
size: 10,
current: this.current,
businessName: this.businessName
}
}).then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records.map(v => {
return {
...v,
checked: false
}
})] : res.data.records.map(v => {
return {
...v,
checked: false
}
})
this.pages = res.data.pages
}
})
},
userClick(index) {
this.list[index].checked = !this.list[index].checked
},
confirm() {
var checkUserList = this.list.filter(v => v.checked).map(item => {
return {
companyId: item.id,
name: item.businessName,
girdId: this.girdId,
girdMemberId: this.girdMemberId
}
})
if (!checkUserList.length) {
return this.$u.toast('请选择责任商户')
}
this.$http.post(`/app/appgirdmembercompany/add`, { companyList: checkUserList}).then((res) => {
if (res.code == 0) {
this.$u.toast('提交成功')
setTimeout(() => {
uni.navigateBack()
uni.$emit('updateList')
}, 600)
}
}).catch((err) => {
this.$u.toast(err)
})
}
},
onReachBottom() {
this.current = this.current + 1
this.getList()
}
}
</script>
<style lang="scss" scoped>
.AddMerchan {
.userList {
width: 100%;
margin-top: 24px;
ul {
padding: 0 32px 0 0;
li {
list-style-type: none;
.user {
display: flex;
justify-content: flex-start;
padding-top: 24px;
padding-left: 32px;
height: 100%;
.checkbox{
margin-top: 20px;
margin-right: 32px;
width: 48px;
height: 48px;
}
.userInfo {
width: 100%;
background: #FFF;
border-radius: 16px;
padding: 32px 24px 32px 32px;
box-sizing: border-box;
margin-bottom: 30px;
.item-title{
display: flex;
align-items: center;
margin-bottom: 32px;
margin-bottom: 32px;
img{
width: 72px;
height: 72px;
margin-right: 16px;
vertical-align: middle;
}
p{
flex: 1;
font-size: 32px;
font-weight: 500;
color: #000;
line-height: 1.3;
}
span{
display: inline-block;
width: calc(100% - 488px);
text-align: right;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 24px;
}
}
.info{
line-height: 1;
margin-bottom: 20px;
img{
width: 28px;
height: 28px;
margin-right: 16px;
}
div{
display: inline-block;
width: calc(100% - 44px);
word-break: break-all;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
vertical-align: text-top;
}
}
}
}
}
}
}
.footer {
position: fixed;
left: 0px;
bottom: 0px;
width: 100%;
height: 112px;
background-color: #1365DD;
line-height: 112px;
text-align: center;
font-size: 36px;
color: #FFFFFF;
}
}
</style>

View File

@@ -0,0 +1,138 @@
<template>
<section class="AddGird">
<div class="item-flex">
<div class="label">
<span class="tips">*</span>姓名
</div>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="name" maxlength="50"/>
</div>
</div>
<div class="item-flex">
<div class="label">
<span class="tips">*</span>手机号
</div>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="phone" maxlength="50"/>
</div>
</div>
<div class="item-flex">
<div class="label">
<span class="tips">*</span>所属网格
</div>
<div class="value">
<AiPagePicker type="gird" v-model="selectGird" valueObj nodeKey="id" formType="2">
<AiMore v-model="selectGird.girdName"/>
</AiPagePicker>
</div>
<div class="footer" @click="confirm">确认添加</div>
</div>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
name: '',
phone: '',
selectGird: {}
}
},
computed: {...mapState(['user'])},
onLoad() {
this.name = this.user.name || ''
this.phone = this.user.phone || ''
},
onShow() {
document.title = '网格员信息申报'
},
methods: {
confirm() {
if (!this.name) {
return this.$u.toast('请输入姓名')
}
if (!this.phone) {
return this.$u.toast('请输入手机号')
}
if (!this.selectGird.girdName) {
return this.$u.toast('请选择所属网格')
}
this.$http.post(`/app/appgirdmemberapply/girdMemberCheck?name=${this.name}&phone=${this.phone}&girdName=${this.selectGird.girdName}`).then((res) => {
if (res.code == 0) {
uni.$emit('updateGird')
this.linkTo('./AddUserSuccess?status=1')
}
}).catch((err) => {
this.linkTo('./AddUserSuccess?status=0')
})
},
linkTo(url) {
uni.navigateTo({url})
},
}
}
</script>
<style lang="scss" scoped>
.AddGird {
.item-flex {
display: flex;
padding: 34px 32px;
background-color: #fff;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
margin-bottom: 16px;
.label {
font-weight: 400;
color: #333333;
line-height: 22px;
width: 150px;
.tips {
display: inline-block;
width: 16px;
color: #F46;
line-height: 44px;
}
}
.value {
width: calc(100% - 150px);
line-height: 44px;
text-align: right;
color: #666;
img {
width: 32px;
height: 32px;
vertical-align: middle;
margin-left: 8px;
}
}
.color-999 {
color: #999;
}
}
.footer {
width: 100%;
height: 112px;
line-height: 112px;
background: #1365DD;
position: fixed;
bottom: 0;
left: 0;
text-align: center;
font-size: 36px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
}
</style>

View File

@@ -0,0 +1,85 @@
<template>
<div class="success">
<img src="./components/img/success.png" alt="" v-if="status">
<img src="./components/img/fail.png" alt="" v-else>
<p>{{ status == 1 ? '信息申报成功!' : '信息申报失败!' }}</p>
<p class="text">{{ status == 1 ? '重新进入即可开始正常使用' : '系统无法匹配该申报信息,请联系管理人员进行处理' }}</p>
<div class="footer" @click="back">{{ status == 1 ? '确定' : '我知道了' }}</div>
</div>
</template>
<script>
import {mapActions} from 'vuex'
export default {
name: "AddUserSuccess",
data() {
return {
status: 1
}
},
onShow() {
document.title = '网格员信息申报'
},
onLoad(option) {
this.status = option.status
},
methods: {
...mapActions(['getAccount']),
back() {
this.getAccount().then(() => {
uni.reLaunch({url: './AppGridManagement'})
})
}
},
}
</script>
<style lang="scss" scoped>
uni-page-body {
height: 100%;
background-color: #fff;
}
.success {
text-align: center;
img {
width: 192px;
height: 192px;
margin: 96px 0 16px 0;
}
p {
line-height: 50px;
color: #333;
font-size: 36px;
font-weight: 500;
text-align: center;
margin-bottom: 16px;
}
.footer {
width: calc(100% - 96px);
height: 88px;
line-height: 88px;
background: #1365DD;
box-shadow: inset 0px 1px 0px 0px #EEEEEE;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
text-align: center;
border-radius: 8px;
margin-left: 48px;
}
.text {
line-height: 44px;
font-size: 28px;
width: 500px;
margin: 0 auto 72px;
word-break: break-all;
}
}
</style>

View File

@@ -0,0 +1,312 @@
<template>
<div class="AppMerchanGird">
<template v-if="isGridMember">
<div class="pad-t32" />
<div class="select-gird" flex>
<AiPagePicker type="custom" class="fill" @select="handleSelectGird" nodeKey="id" :ops="{url:'./pickGrid',label:'name'}">
<div flex>
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
<AiMore v-model="userGird.girdName" icon="arrow-down"/>
</div>
</AiPagePicker>
<span @click="linkTo('./SetGird?id='+userGird.id)" v-if="isGridAdmin&&!!userGird.id">网格配置</span>
</div>
<div class="title">网格人员</div>
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="item.id">
<div>
<!-- <image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" /> -->
<img :src="item.photo" alt="" v-if="item.photo">
<img src="./components/img/big-user.png" alt="" v-else>
</div>
<div class="right">
<div class="name">{{ item.name }}
<div class="gird">{{ item.checkType == 2 ? '网格长' : '网格员' }}</div>
<span class="family-btn" @click.stop="linkTo(`./merchanList?id=${item.id}&girdId=${userGird.id}`)">网格成员 ></span>
</div>
<p>{{ item.girdName }}</p>
</div>
</div>
<div class="user-content user-item" v-for="(item, index) in dataInfo.girdMembers" :key="item.id" @click="viewUser(item.wxUserId)">
<div>
<!-- <image :src="item.photo" alt="" mode="aspectFill" v-if="item.photo" /> -->
<img :src="item.photo" alt="" v-if="item.photo">
<img src="./components/img/big-user.png" alt="" v-else>
</div>
<div class="right">
<div class="name">{{ item.name }}
<span class="gird">{{ item.checkType == 2 ? '网格长' : '网格员' }}</span>
<span class="family-btn" @click.stop="linkTo(`./merchanList?id=${item.id}&girdId=${userGird.id}`)">网格成员 ></span>
</div>
<p>{{ item.girdName }} </p>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap"
v-if="dataInfo.parentGirdMembers && !dataInfo.parentGirdMembers.length && !dataInfo.girdMembers.length"></AiEmpty>
<AiGap h="112"/>
</template>
<div v-if="!isGridMember" class="empty">
<img src="./components/img/no-admin.png" alt="">
<p>没有网格员权限<br/>无法查看网格信息哦~</p>
<div class="add-btn" @click="linkTo('./AddUser')">网格员信息申报</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'AppMerchanGird',
appName: '网格构成',
data() {
return {
dataInfo: {},
userGird: {}
}
},
computed: {
...mapState(['user']),
isGridMember() {
return this.user.girdCheckType > 0
},
isGridAdmin() {
return this.user.girdCheckType == 2
}
},
onLoad() {
this.handleSelectGird(this.user.gridInfo)
},
onShow() {
document.title = '网格构成'
},
mounted() {
this.getGirdUserList()
uni.$on('goback', (res) => {
this.userGird = res
this.getGirdUserList()
})
},
methods: {
handleSelectGird(v) {
this.userGird = v || {}
this.getGirdUserList()
},
getGirdUserList() {
this.$http.post(`/app/appgirdmemberinfo/listGirdMemberByGirdId?girdId=${this.userGird.id}`).then((res) => {
if (res.code == 0) {
this.dataInfo = res.data
}
})
},
linkTo(url) {
uni.navigateTo({url})
},
viewUser(userid) {
userid && this.injectJWeixin('openUserProfile').then(() => {
this.wxInvoke(['openUserProfile', {type: 1, userid}, () => 0])
})
},
},
}
</script>
<style lang="scss" scoped>
.AppMerchanGird {
background-color: #f5f5f5;
.title {
font-size: 38px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
line-height: 52px;
padding-left: 32px;
margin-bottom: 32px;
}
.user-content {
width: calc(100% - 64px);
margin: 0 0 32px 32px;
background-color: #fff;
padding: 32px;
box-sizing: border-box;
display: flex;
img {
display: inline-block;
width: 200px;
height: 200px;
margin-right: 32px;
}
image {
width: 200px;
height: 200px;
margin-right: 32px;
}
.right {
width: 100%;
.name {
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 44px;
margin-bottom: 12px;
}
.gird {
display: inline-block;
line-height: 44px;
background: #E8EFFF;
border-radius: 8px;
padding: 0 8px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #26F;
margin-bottom: 12px;
}
p {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
line-height: 36px;
}
}
}
.user-item {
img {
width: 96px;
height: 96px;
border-radius: 50%;
}
image {
width: 96px;
height: 96px;
border-radius: 50%;
}
.gird {
display: inline-block;
margin-left: 16px;
margin-bottom: 0 !important;
}
.name {
margin-bottom: 8px !important;
}
}
.family-btn {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #3975C6;
line-height: 36px;
float: right;
}
.pad-b112 {
padding-bottom: 112px;
}
}
.pad-t32 {
padding-top: 32px;
}
.gird-icon {
margin-right: 8px;
}
.select-gird {
width: calc(100% - 60px);
padding: 24px 32px;
background: #FFFFFF;
border-radius: 16px;
margin: 0 30px 32px;
box-sizing: border-box;
img {
width: 32px;
height: 32px;
vertical-align: middle;
}
span {
display: inline-block;
width: 112px;
height: 48px;
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #3F8DF5;
line-height: 48px;
}
}
.tabs {
width: 100%;
height: 98px;
background: #fff;
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
.item {
flex: 1;
text-align: center;
img {
width: 56px;
height: 56px;
margin-top: 8px;
}
p {
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #c4cad4;
line-height: 8px;
}
.color-3267F0 {
color: #3267f0;
}
}
}
.empty {
text-align: center;
img {
width: 282px;
height: 306px;
margin: 136px auto 0;
}
p {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
}
.add-btn {
width: 400px;
height: 88px;
line-height: 88px;
text-align: center;
border-radius: 8px;
background-color: #3267f0;
color: #fff;
font-size: 30px;
margin: 200px auto 0;
}
}
</style>

View File

@@ -0,0 +1,257 @@
<template>
<div class="SelectUser">
<div class="header-middle">
<div class="hint">
<u-search v-model="name" placeholder="请输入姓名" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999" color="#999" height="58" @search="getListInit" :clearabled="false"></u-search>
</div>
<div class="showUsers">
<div v-if="userList.length > 0">
<div class="cards" v-for="(e, index) in userList" :key="index">
<div class="imges">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(index)" />
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(index)" />
<img src="./components/img/tx@2x.png" alt="" class="avatras" />
</div>
<div class="rights">
<div class="applicationNames">{{ e.name }}</div>
<div class="idNumbers">{{ e.phone }}</div>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else></AiEmpty>
</div>
</div>
<div class="pad-b140"></div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</div>
</template>
<script>
export default {
name: 'SelectUser',
data() {
return {
selectUserList: [],
userList: [],
name: '',
current: 1
}
},
onLoad() {
this.selectUserList = uni.getStorageSync('selectUserList')
this.selectUserList.map((item) => {
item.id =item.wxUserId
item.mobile = item.phone
item.avatar = item.photo
})
this.getList()
},
methods: {
getListInit() {
this.userList = []
this.current = 1
this.getList()
},
getList() {
this.$http.post(`/app/wxcp/wxuser/list?name=${this.name}&current=${this.current}&size=10000`).then((res) => {
if (res?.data) {
res.data.records.map((item) => {
item.isChecked = false
})
this.userList = this.current > 1 ? [...this.userList, ...res.data.records] : res.data.records
this.userList.map((item) => {
this.selectUserList.map((e) => {
if(e.id == item.id) {
item.isChecked = true
}
})
})
}
})
},
userClick(index) {
this.userList[index].isChecked = !this.userList[index].isChecked
this.$forceUpdate()
},
submit() {
var selectUserList = []
this.userList.map((item) => {
if(item.isChecked) {
selectUserList.push(item)
}
})
uni.$emit('selectUser', selectUserList)
uni.navigateBack()
// if (!selectUserList.length) {
// return this.$u.toast('请选择人员')
// } else {
// }
},
},
onReachBottom() {
this.current ++
this.getList()
}
}
</script>
<style scoped lang="scss">
.SelectUser {
height: 100%;
background: #fff;
.pad-b140{
padding-bottom: 140px;
}
.header-top {
background: #fff;
padding: 20px 32px;
}
.header-middle {
.hint {
padding: 28px 20px 28px 32px;
line-height: 56px;
box-shadow: 0px 1px 0px 0px #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.showTypes {
.empty-div {
height: 16px;
background: #f5f5f5;
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
// background: pink;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
// width: 200px;
.imgselect {
width: 48px;
height: 48px;
vertical-align: middle;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
}
.imgs {
width: 40px;
height: 40px;
margin-right: 20px;
}
}
}
}
.showUsers {
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
// background: pink;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
width: 200px;
.imgselect {
width: 48px;
height: 48px;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
.rights {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
padding-right: 40px;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
}
.idNumbers {
color: #666;
}
}
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin: 20px 34px 0 0;
float: right;
}
}
}
</style>

View File

@@ -0,0 +1,184 @@
<template>
<div class="setGird">
<AiGroup>
<AiItem :label="detail.girdName" :border="false" labelBold>
<u-icon name="arrow-right" label="查看网格成员" label-pos="left" label-color="#3F8DF5" @click="showGirdInfo()"/>
</AiItem>
</AiGroup>
<AiGroup>
<AiItem label="下级网格" top-label :border="false" labelBold>
<div v-if="treeList.length > 0">
<div class="cards" v-for="(item, index) in treeList" :key="index">
<div class="rightes fill" flex>
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
<div class="applicationNames fill" @click="showGirdInfo(item)">{{ item.girdName }}</div>
<u-icon @click="itemClick(item)" name="arrow-right" color="#ddd"/>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
</AiItem>
</AiGroup>
<div class="subBtn" v-if="detail.girdRight==1" flex>
<div class="delete" @click="handleDelete">删除网格</div>
<div @click="edit">编辑网格</div>
<div @click="toAddGird">添加下级网格</div>
</div>
</div>
</template>
<script>
import {mapState} from "vuex"
export default {
name: 'setGird',
data() {
return {
detail: {},
treeList: [],
}
},
computed: {
...mapState(['user'])
},
onShow() {
this.getAllGrids()
document.title = '网格配置'
},
methods: {
getAllGrids() {
let {id: parentGirdId} = this.$route.query
this.$http.post(`/app/appgirdinfo/listByInfo`, null, {
params: {parentGirdId}
}).then(res => {
if (res?.data) {
let parents = [...new Set(res.data.map(e => e.parentGirdId))]
this.detail = res.data.find(e => e.id == parentGirdId) || {}
this.treeList = res.data.filter(e => e.parentGirdId == parentGirdId).map(e => ({...e, hasChildren: parents.includes(e.id)}))
}
})
},
itemClick(row) {
uni.navigateTo({url: `./SetGird?id=${row.id}`})
},
showGirdInfo(row = {id: this.$route.query.id}) {
uni.navigateTo({url: `./gridMembers?id=${row.id}`})
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
toAddGird() {
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=add`})
},
edit() {
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=edit`})
},
handleDelete() {
this.$confirm('删除网格后,会清除网格内网格员的责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
this.$http.post(`/app/appgirdinfo/delete?ids=${this.detail.id}`).then((res) => {
if (res?.code == 0) {
this.$u.toast('删除成功!')
uni.navigateBack({})
}
})
})
},
}
}
</script>
<style scoped lang="scss">
.setGird {
min-height: 100vh;
background: #F5F6F7;
padding-bottom: 140px;
box-sizing: border-box;
.empty-div {
height: 16px;
background: #f5f5f5;
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
// background: pink;
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-right: 20px;
}
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
display: flex;
border-bottom: 1px solid #e4e5e6;
padding-right: 16px;
.applicationNames {
display: inline-block;
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: bottom;
}
.imgs {
width: 40px;
height: 40px;
margin-right: 0;
vertical-align: middle;
}
.u-icon {
padding: 0 16px;
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
font-family: PingFangSC-Medium, PingFang SC;
justify-content: flex-end;
div {
padding: 0 32px;
height: 88px;
line-height: 88px;
text-align: center;
background: #1365dd;
border-radius: 8px;
font-size: 32px;
color: #fff;
margin-left: 22px;
border: 2px #1365dd solid;
&.delete {
background: #fff;
color: #f46;
border-color: #f46;
}
&:last-of-type {
margin-right: 32px;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,186 @@
<template>
<section class="gridMembers">
<div class="title">{{ detail.girdName }}</div>
<div flex v-for="(item, index) in list" :key="index" class="listItem">
<!-- <img class="avatar" :src="item.photo"/>-->
<div class="fill">
<div class="memberName" v-text="item.name"/>
<div flex>
<div class="color-999" v-text="item.userRole"/>
<div v-if="item.label" class="tag" v-text="item.label"/>
</div>
</div>
<div class="btns">
</div>
</div>
<AiEmpty v-if="!list.length"/>
<div class="btn" v-if="detail.girdRight == 1">
<span class="del" @click="del" v-if="!!detail.parentGirdId">删除网格</span>
<span class="edit" @click="edit">编辑网格</span>
</div>
</section>
</template>
<script>
export default {
name: "gridMembers",
appName: "网格成员",
computed: {
list() {
let {girdMemberManageList, girdMemberList} = this.detail
return [girdMemberManageList?.map(e => ({...e, userRole: "网格长"})) || [],
girdMemberList?.map(e => ({
...e,
userRole: "网格员"
})) || []].flat()
}
},
data() {
return {
detail: {}
}
},
methods: {
getDetail() {
let {id} = this.$route.query
this.$http.post("/app/appgirdinfo/queryDetailById", null, {
params: {id}
}).then(res => {
if (res?.data) {
this.detail = res.data
}
})
},
del() {
this.$confirm('删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
this.$http.post(`/app/appgirdinfo/delete?ids=${this.detail.id}`).then((res) => {
if (res?.code == 0) {
this.$u.toast('删除成功!')
this.getDetail()
}
})
})
},
edit() {
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=edit`})
},
handleTag({id, label}) {
uni.showModal({
title: "设置标签",
content: label,
editable: true,
placeholderText: "请输入标签,最多10字",
success: res => {
if (res.confirm) {
if (res.content && res.content.length <= 10) {
this.$http.post("/app/appgirdmemberinfo/updateGirdMemberLabelById", null, {
params: {id, label: res.content}
}).then(res => {
if (res?.code == 0) {
this.$u.toast("设置成功")
this.getDetail()
} else this.handleTag({id, label})
}).catch(() => this.handleTag({id, label}))
} else {
this.$u.toast("请输入标签,最多10字")
this.handleTag({id, label})
}
}
}
})
},
gotoFamilyList(item) {
uni.navigateTo({url: `./FamilyList?id=${item.id}&girdId=${item.girdId}`})
}
},
onShow() {
this.getDetail()
},
}
</script>
<style lang="scss" scoped>
.gridMembers {
padding: 16px 32px 170px;
min-height: 100vh;
box-sizing: border-box;
.color-999 {
color: #999;
}
.avatar {
width: 96px;
height: 96px;
margin-right: 32px;
}
.btns {
margin-left: 32px;
line-height: 48px;
color: #26f;
}
.title {
font-size: 36px;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #333;
line-height: 50px;
margin-bottom: 24px;
}
.listItem {
padding: 20px 0;
border-bottom: 1px solid #ddd;
}
.btn {
width: 100%;
padding: 32px;
box-sizing: border-box;
background-color: #fff;
display: flex;
position: fixed;
bottom: 0;
left: 0;
span {
display: inline-block;
height: 92px;
line-height: 90px;
border-radius: 8px;
font-size: 34px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
box-sizing: border-box;
text-align: center;
}
.del {
color: #f46;
border: 1px solid #f46;
flex: 1;
margin-right: 32px;
}
.edit {
background-color: #3671EE;
color: #fff;
flex: 2;
}
}
.memberName {
height: 40px;
}
.tag {
margin-left: 32px;
padding: 4px 8px;
border-radius: 8px;
background: #26f;
color: #fff;
}
}
</style>

View File

@@ -0,0 +1,241 @@
<template>
<div class="merchanList">
<AiTopFixed>
<u-search placeholder="请输入店名、店主、电话" :show-action="false" v-model="businessName" @clear="current = 1, getList()" @search="current = 1, getList()"/>
<div class="title">
<div>商户列表({{ pages }})</div>
<div v-if="list.length">
<span style="font-size: 14px; color: #2979ff;" @click="changeType" v-if="edit">修改</span>
<span style="font-size: 14px; color: #2979ff;" @click="edit = true" v-else>取消</span>
</div>
</div>
</AiTopFixed>
<div class="main" v-if="list.length">
<ul v-for="(item,index) in list" :key="index" @click="linkTo('../AppMerchantManage/detail?id=' + item.id)">
<li>
<div class="user">
<div v-if="!edit">
<img src="./components/img/xz.png" alt="" class="checkbox" v-if="!item.checked" @click.stop="userClick(index)">
<img src="./components/img/xzh.png" alt="" class="checkbox" v-else @click.stop="userClick(index)">
</div>
<div class="item-info">
<div class="item-title">
<img :src="$cdn + 'xincheng/icon.png'" alt="">
<p>{{ item.businessName }}</p>
</div>
<div class="info">
<img :src="$cdn + 'xincheng/dh.png'" alt="">
<div>{{ item.bossName }} {{ item.telephone }}</div>
</div>
<div class="info" style="margin-bottom: 0;">
<img :src="$cdn + 'xincheng/dz@2x.png'" alt="">
<div>{{ item.businessAddress }}</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
<div style="height:70px;"></div>
<div class="footer" @click="toAddFamily()" v-if="edit">新增责任商户</div>
<div class="footer" @click="delFamily()" v-else>删除</div>
</div>
</template>
<script>
export default {
appName: '责任商户',
data () {
return {
list: [],
pages: 0,
current: 1,
userId: '',
edit: true,
checked: true,
girdId: '',
businessName: ''
}
},
onLoad (option) {
this.userId = option.id
this.girdId = option.girdId
this.getList()
uni.$on('updateList', () => {
this.current = 1
this.getList()
})
},
methods: {
getList () {
if (this.current > this.pages && this.current !== 1) return
this.$loading()
this.$http.post(`/app/appgirdmembercompany/listByGirdMember`, null, {
params: {
size: 10,
current: this.current,
name: this.businessName,
girdMemberId: this.userId,
girdId: this.girdId
}
}).then((res) => {
if (res.code == 0) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.pages = res.data.total
}
})
},
toAddFamily() {
uni.navigateTo({url: `./AddMerchan?id=${this.userId}&girdId=${this.girdId}`})
},
userClick(index) {
this.list[index].checked = !this.list[index].checked
this.$forceUpdate()
},
delFamily() {
const ids = this.list.filter(v => v.checked).map(v => v.gmcId)
if (!ids.length) {
return this.$u.toast('请选择需要删除的责任商户')
}
this.$confirm(`是否删除这些关联责任商户?`).then(() => {
this.$http.post(`/app/appgirdmembercompany/delete?ids=${ids.join(',')}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功')
uni.$emit('updateList')
this.$forceUpdate()
this.edit = true
}
})
})
},
linkTo (url) {
uni.navigateTo({
url
})
},
changeType() {
this.edit = false
this.list.map((item) => {
item.checked = false
})
}
},
onReachBottom() {
this.current = this.current + 1
this.getList()
}
}
</script>
<style lang="scss" scoped>
.merchanList {
min-height: 100vh;
.title {
display: flex;
justify-content: space-between;
padding: 24px 32px;
background-color: #fff;
font-size: 34px;
font-weight: 800;
}
.main {
padding-bottom: 112px;
ul {
padding: 0 32px;
li {
list-style-type: none;
.user {
display: flex;
justify-content: flex-start;
padding-top: 24px;
.checkbox {
margin-top: 20px;
margin-right: 32px;
width: 48px;
height: 48px;
}
.item-info {
width: 100%;
background: #FFF;
border-radius: 16px;
padding: 32px 24px 32px 32px;
box-sizing: border-box;
margin-bottom: 30px;
.item-title{
display: flex;
align-items: center;
margin-bottom: 32px;
img{
width: 72px;
height: 72px;
margin-right: 16px;
vertical-align: middle;
}
p{
flex: 1;
font-size: 32px;
font-weight: 500;
color: #000;
line-height: 1.3;
}
span{
display: inline-block;
width: calc(100% - 488px);
text-align: right;
font-size: 24px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 24px;
}
}
.info{
line-height: 1;
margin-bottom: 20px;
img{
width: 28px;
height: 28px;
margin-right: 16px;
}
div{
display: inline-block;
width: calc(100% - 44px);
word-break: break-all;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 40px;
vertical-align: text-top;
}
}
}
}
}
}
}
.footer {
position: fixed;
left: 0px;
bottom: 0px;
width: 100%;
height: 112px;
background-color: #1365DD;
line-height: 112px;
text-align: center;
font-size: 36px;
color: #FFFFFF;
}
}
</style>

View File

@@ -0,0 +1,246 @@
<template>
<div class="pickGrid">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in selectList" :key="index">
<span v-if="index" style="margin:0 4px;" v-text="`/`"/>
<span style="color:#3F8DF5" @click="girdNameClick(item, index)" v-text="item.girdName"/>
</span>
</div>
<div class="showTypes">
<div v-if="options.length > 0">
<div class="cards" v-for="(item, index) in options" :key="index">
<div class="imges">
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
</div>
<div class="rightes fill">
<div class="applicationNames fill" @click="itemClick(item)">{{ item.girdName }}</div>
<u-icon class="more" name="arrow-right" @click="girdClick(item, index)"/>
</div>
</div>
</div>
<AiEmpty :description="isGridMember?`暂无数据`:`当前人员不是网格员或网格长`" class="emptyWrap" v-else/>
</div>
</div>
</div>
</template>
<script>
import {mapState} from "vuex";
export default {
name: 'pickGrid',
appName: "网格选择",
data() {
return {
SelectGird: {},
allData: null,
options: [],
selectList: [],
parentGirdId: '',
isFormMap: 0, //1为网格地图 一级不允许选中
}
},
computed: {
...mapState(['user']),
isMyGirds() {
return this.$route?.query.self == true
},
isGridMember() {
return this.user.girdCheckType > 0
},
//是否是网格员申报
isApply: v => v.$route?.query.formType == 2,
clearable: v => v.$route?.query.clearable,
selected: v => [v.$route?.query.selected].flat()
},
onLoad(option) {
if (option.isFormMap) {
this.isFormMap = option.isFormMap
}
this.isGridMember || this.isApply ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格长')
},
methods: {
getAllGrids() {
this.selectList = []
let {girdMemberId} = this.user,
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`,
params = {girdMemberId}
if (this.isApply) {
url = `/app/appgirdinfo/listByInfo`
params = {}
}
if (this.isMyGirds) {
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2`
}
this.$http.post(url, null, {params}).then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentGirdId)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
this.treeInit()
}
})
},
treeInit(isClick) {
let last = uni.getStorageSync("lastSelectedGrid")
if (!isClick && last && !this.isApply) {
this.$http.post("/app/appgirdinfo/listFatherGirdInfo", null, {
params: {girdId: last}
}).then(res => {
if (res?.data) {
this.selectList = [{girdName: '可选范围', id: ''}, res.data.filter(e => !!this.allData.find(a => a.id == e.id))].flat()
this.getGridsByGridMemberAndParent({id: last})
}
})
} else {
this.options = this.allData.filter((e, i, arr) => !arr.map(e => e.id).includes(e.parentGirdId) || this.isMyGirds)
this.options.map((item) => item.isChecked = this.selected.includes(item.id))
let obj = {girdName: '可选范围', id: ''}
this.selectList.push(obj)
}
},
itemClick(row) {
if (row.hasChildren) {
let obj = {
girdName: row.girdName,
id: row.id,
}
this.selectList.push(obj)
this.getGridsByGridMemberAndParent(row)
}
},
getGridsByGridMemberAndParent(row) {
let {id: parentGirdId} = row
this.options = this.allData.filter(e => e.parentGirdId == parentGirdId)
this.options.map((item) => item.isChecked = this.selected.includes(item.id))
},
girdNameClick(row, index) {
if (!index) { //第一级别
this.selectList = []
this.treeInit(true)
} else {
this.selectList.splice(index, 8)
this.getGridsByGridMemberAndParent(row)
}
},
girdClick(row) {
this.SelectGird = row
this.$forceUpdate()
this.submit()
},
submit() {
if (this.SelectGird.id != null) {
if (!this.isApply && !this.isMyGirds) {
uni.setStorageSync("lastSelectedGrid", this.SelectGird.parentGirdId)
}
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:custom", this.SelectGird)
}
})
} else {
return this.$u.toast('请选择网格')
}
},
}
}
</script>
<style scoped lang="scss">
.pickGrid {
min-height: 100vh;
background: #fff;
padding-bottom: 140px;
box-sizing: border-box;
.more {
width: 80px;
justify-content: center;
}
.header-middle {
.hint {
padding: 28px 20px 28px 32px;
line-height: 56px;
box-shadow: 0px 1px 0px 0px #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.showTypes {
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
// background: pink;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
// width: 200px;
.imgselect {
width: 48px;
height: 48px;
vertical-align: middle;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
}
}
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
display: flex;
border-bottom: 1px solid #e4e5e6;
padding: 0 16px;
.applicationNames {
display: inline-block;
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: bottom;
}
}
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
justify-content: flex-end;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
border: 2px solid #1365dd;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin-right: 32px;
}
}
}
</style>

View File

@@ -0,0 +1,298 @@
<template>
<section class="selectGridMember">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in selectGridPath" :key="index"><span v-if="index" style="margin:0 4px;">/</span><span
style="color:#3F8DF5" @click="girdNameClick(item, index)">{{ item.girdName }}</span></span>
</div>
<div class="cards" v-for="(item, index) in treeList" :key="item.id" @click="itemClick(item)">
<div class="imges">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="item.isChecked" @click.stop="girdClick(item, index)"/>
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click.stop="girdClick(item, index)"/>
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
</div>
<div class="rightes">
<div class="applicationNames">{{ item.girdName }}</div>
<img src="./components/img/right-icon.png" alt="" class="imgs"/>
</div>
</div>
<div class="userCards" v-for="(e, index) in userList" :key="e.id">
<div class="imges">
<img src="./components/img/xzh.png" alt="" class="imgselect" v-if="e.isChecked" @click="userClick(e, index)"/>
<img src="./components/img/xz.png" alt="" class="imgselect" v-else @click="userClick(e, index)"/>
<img src="./components/img/tx@2x.png" alt="" class="avatras"/>
</div>
<div class="rights fill">
<div class="applicationNames" v-text="e.name"/>
<div class="idNumbers">{{ e.phone }}</div>
</div>
</div>
<AiEmpty description="暂无数据" v-if="!hasData"/>
</div>
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</section>
</template>
<script>
export default {
name: "selectGridMember",
appName: "选择人员(网格成员)",
data() {
return {
selected: {},
allData: null,
treeList: [],
selectGridPath: [],
userList: [],
}
},
computed: {
hasData() {
return this.treeList?.length > 0 || this.userList?.length > 0
}
},
onLoad() {
this.selected.id = this.$route.query.id
this.getAllGrids()
},
onShow() {
document.title = '选择人员'
},
methods: {
getAllGrids() {
this.$http.post('/app/appgirdinfo/listByInfo').then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentGirdId)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
this.gridInit()
}
})
},
gridInit() {
this.treeList = this.allData.filter(e => !e.parentGirdId)
this.selectGridPath = [{girdName: "可选范围", id: ''}]
},
itemClick({id, girdName}) {
this.selectGridPath.push({girdName, id})
this.getGridsAndUsersByParent(id)
},
getGridsAndUsersByParent(id) {
this.treeList = this.allData.filter(e => e.parentGirdId == id)
this.userList = []
this.$http.post(`/app/appgirdmemberinfo/listByGirdIdByThree?girdId=${id}`).then((res) => {
if (res?.data) {
this.userList = res.data.map(e => ({...e, isChecked: e.id == this.selected.id}))
}
})
},
girdNameClick(row, index) {
this.userList = []
if (!index) { //第一级别
this.gridInit()
} else {
let length = this.selectGridPath.length - index
this.selectGridPath.splice(index, length)
this.getGridsAndUsersByParent(row.id)
}
},
girdClick(row, index) {
if (this.treeList[index].isChecked) {//取消
this.treeList[index].isChecked = false
this.selected = {}
} else {
this.treeList.map((item, i) => {
item.isChecked = index == i
})
this.selected = {...row, kind: "grid"}
}
this.$forceUpdate()
},
userClick(row, index) {
if (this.userList[index].isChecked) {//取消
this.userList[index].isChecked = false
this.selected = {}
} else {
this.userList.map((item, i) => {
item.isChecked = index == i
})
this.selected = {...row, kind: "user"}
}
this.$forceUpdate()
},
submit() {
if (this.selected.id != null) {
uni.navigateBack({
success: () => {
uni.$emit("pagePicker:custom", this.selected)
}
})
} else {
return this.$u.toast('请选择网格或网格员')
}
},
}
}
</script>
<style lang="scss" scoped>
.selectGridMember {
height: 100%;
background: #fff;
.header-top {
background: #fff;
padding: 20px 32px;
}
.header-middle {
padding-bottom: 140px;
.hint {
padding: 28px 20px 28px 32px;
line-height: 56px;
box-shadow: 0 1px 0 0 #e4e5e6;
font-size: 30px;
font-weight: 500;
word-break: break-all;
}
.empty-div {
height: 16px;
background: #f5f5f5;
}
.cards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
.imgselect {
width: 48px;
height: 48px;
vertical-align: middle;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
img {
width: 74px;
height: 74px;
border-radius: 8px;
}
.rightes {
width: calc(100% - 160px);
display: flex;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
.applicationNames {
flex: 1;
min-width: 0;
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.imgs {
flex-shrink: 0;
width: 40px;
height: 40px;
margin-right: 20px;
}
}
}
.userCards {
display: flex;
align-items: center;
height: 120px;
line-height: 120px;
padding: 0 0 0 32px;
.imges {
display: flex;
align-items: center;
.imgselect {
width: 48px;
height: 48px;
}
.avatras {
width: 74px;
height: 74px;
border-radius: 8px;
margin-left: 36px;
}
}
.rights {
display: flex;
justify-content: space-between;
align-items: center;
margin-left: 32px;
border-bottom: 1px solid #e4e5e6;
padding-right: 40px;
height: inherit;
.applicationNames {
font-size: 36px;
font-weight: 500;
color: #333333;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.idNumbers {
color: #666;
}
}
}
}
.subBtn {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 118px;
background: #f4f8fb;
div {
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background: #1365dd;
border-radius: 4px;
font-size: 32px;
color: #fff;
margin: 20px 34px 0 0;
float: right;
}
}
}
</style>