整合上架版进入标准流程

This commit is contained in:
aixianling
2022-07-04 15:48:17 +08:00
parent 993b90857d
commit 16bbd9080f
311 changed files with 15 additions and 34 deletions

View File

@@ -0,0 +1,256 @@
<template>
<div class="AddFamily">
<div class="search">
<!-- <div class="left">
<AiAreaPicker v-model="areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="areaName" style="color: #666">
<u-icon name="map-fill" color="#3192F4" size="20px" style="vertical-align: text-bottom"></u-icon>
<span style="margin-left: 4px" v-if="areaName">{{ areaName }}</span>
<span v-else>请选择</span>
<u-icon name="arrow-down" color="#666" size="28" style="margin-left: 4px" />
</AiAreaPicker>
</div> -->
<u-search v-model="value" placeholder:clearabled="true" placeholder="请输入姓名/身份证/手机号" :show-action="false" bg-color="#F5F5F5" search-icon-color="#999"
color="#999" height="58" @change="getListInit"/>
</div>
<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>
<img :src="item.photo" alt="" class="userImg" v-if="item.photo">
<img src="./components/img/user-img.png" alt="" class="userImg" v-else>
</div>
<div class="info">
<div class="name">
<span class="user-name">{{ item.name }}</span>
<span class="user-tel">{{ item.phone }}</span>
</div>
<div class="idCard">{{ item.idNumber && item.idNumber.replace(/^(\d{6})\d{8}(.{4}$)/g, `$1${Array(9).join('*')}$2`) }}</div>
<div class="address">{{ item.currentAreaName || '' }}{{ item.currentAddress || '' }}</div>
</div>
</div>
</div>
</li>
</ul>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-if="!list.length"></AiEmpty>
<div style="height:70px;"></div>
<div class="btn">
<div class="handleCheck" @click="confirm">确定选择</div>
</div>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
list: [],
current: 1,
value: '',
checked: true,
userList: {},
userId: '',
areaId: '',
areaName: '',
girdId: ''
}
},
computed: {...mapState(['user'])},
methods: {
getList() {
this.$http.post(`/app/appresident/list?householdName=1&current=${this.current}&con=${this.value}`).then((res) => {
if (res.code == 0) {
res.data.records.map((item) => {
item.checked = false
item.girdMemberId = this.userId
item.residentId = item.id
})
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
}
})
},
getListInit() {
this.list = []
this.current = 1
this.getList()
},
userClick(index) {
this.list[index].checked = !this.list[index].checked
},
confirm() {
var checkUserList = []
this.list.map((item) => {
if (item.checked) {
var info = {
girdMemberId: this.userId,
residentId: item.id,
name: item.name,
girdId: this.girdId
}
checkUserList.push(info)
}
})
if (!checkUserList.length) {
return this.$u.toast('请选择户主')
}
this.$http.post(`/app/appgirdmemberresident/add`, {residentList: checkUserList}).then((res) => {
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('updateList')
setTimeout(() => {
uni.navigateBack()
}, 600)
}
}).catch((err) => {
this.$u.toast(err)
})
},
areaSelect(e) {
this.areaId = e
this.getListInit()
},
},
onLoad(option) {
this.userId = option.id
this.areaId = this.user.areaId
this.areaName = this.user.areaName
this.girdId = option.girdId
},
onShow() {
document.title = '新增责任家庭'
this.getList()
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>
<style lang="scss" scoped>
.AddFamily {
.search {
width: 100%;
height: 112px;
padding: 32px;
box-sizing: border-box;
background: #FFF;
display: flex;
margin-bottom: 8px;
.left {
width: calc(100% - 450px);
}
}
.userList {
width: 100%;
background-color: #FFFFFF;
ul {
padding-left: 0px;
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 {
display: flex;
justify-content: flex-start;
border-bottom: 1px solid #E4E5E6;
padding-right: 48px;
width: calc(100% - 100px);
.userImg {
margin-right: 32px;
width: 80px;
height: 80px;
border-radius: 50%;
}
.info {
width: calc(100% - 120px);
padding-bottom: 32px;
.name {
display: flex;
justify-content: space-between;
font-size: 32px;
margin-bottom: 8px;
.user-name {
font-weight: 800;
}
.user-tel {
font-size: 26px;
color: #999999;
}
}
.idCard {
margin-bottom: 16px;
font-size: 26px;
color: #999999;
}
.address {
max-width: 100%;
word-break: break-all;
font-size: 26px;
color: #999999;
}
}
}
}
}
}
}
.btn {
position: fixed;
bottom: 0px;
right: 0px;
width: 100%;
height: 120px;
background-color: #F3F6F9;
.handleCheck {
position: fixed;
bottom: 18px;
right: 34px;
width: 192px;
height: 80px;
line-height: 80px;
text-align: center;
background-color: #1365DD;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,193 @@
<template>
<div 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="form.girdName" maxlength="50"/>
</div>
</div>
<div class="item-flex">
<div class="label">
<span class="tips"></span>网格长
</div>
<div class="value" @click="toAddUser('manage')">
<span v-if="form.girdMemberManageList && form.girdMemberManageList.length">
<!-- <span v-for="(item, index) in form.girdMemberManageList" :key="index"><span v-if="index>0">,</span>{{item.name}}</span> -->
已选择<span style="color:#3F8DF5;margin:0 4px;">{{ form.girdMemberManageList.length }}</span>
</span>
<span style="color:#999;" v-else>请选择</span>
<img src="./components/img/right-icon.png" alt=""/></div>
</div>
<div class="item-flex">
<div class="label">
<span class="tips"></span>网格员
</div>
<div class="value" @click="toAddUser('member')">
<span v-if="form.girdMemberList && form.girdMemberList.length">
已选择<span style="color:#3F8DF5;margin:0 4px;">{{ form.girdMemberList.length }}</span>
<!-- <span v-for="(item, index) in form.girdMemberList" :key="index"><span v-if="index>0">,</span>{{item.name}}</span> -->
</span>
<span style="color:#999;" v-else>请选择</span>
<img src="./components/img/right-icon.png" alt=""/>
</div>
</div>
<div class="footer" @click="confirm">{{ fromType == 'add' ? '确认添加' : '确认修改' }}</div>
</div>
</template>
<script>
import {mapActions} from "vuex";
export default {
data() {
return {
id: '',
form: {
girdMemberManageList: [],
girdMemberList: []
},
detailInfo: {},
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: {
...mapActions(['selectPrivilegedContact']),
getDetail() {
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.detailInfo = res.data
if (this.fromType == 'edit') {
this.form = res.data
}
if (this.fromType == 'add') {
this.form.parentGirdId = this.detailInfo.id
this.form.parentGirdName = this.detailInfo.girdName
this.$forceUpdate()
}
}
})
},
toAddUser(type) {
let obj = type == 'manage' ? "girdMemberManageList" : "girdMemberList",
selectedOpenUserIds = this.form?.[obj]?.map(e => e.id) || []
selectedOpenUserIds = selectedOpenUserIds || []
this.$loading()
this.selectPrivilegedContact({
fromDepartmentId: 0, selectedOpenUserIds,
selectedTickets: this.form?.[type + "Ticket"] || [],
}).then(res => {
uni.hideLoading()
let isRepeat = false //判断网格长网格员是否选择相同人员
this.form[obj] = res.userList?.map(e => ({id: e.openUserId})) || []
this.form.girdMemberList?.map((item) => {
this.form.girdMemberManageList?.map((items) => {
if (item.id == items.id) {
isRepeat = false
}
})
})
// if (isRepeat) {
// this.form[obj] = []
// return this.$u.toast('网格长网格员不能选择相同人员')
// }
this.form[type + "Ticket"] = res.selectedTicket
}).catch(() => {
uni.hideLoading()
})
},
confirm() {
if (!this.form.girdName) {
return this.$u.toast('请输入网格名称')
}
uni.showLoading({mask: true})
this.$http.post(`/app/appgirdinfo/addOrUpdateByEw`, {...this.form}).then((res) => {
if (res.code == 0) {
this.$u.toast('提交成功')
uni.$emit('update')
setTimeout(() => {
uni.navigateBack({})
}, 600)
}
}).catch((err) => {
this.$u.toast(err)
}).finally(() => uni.hideLoading())
}
}
}
</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,222 @@
<template>
<div class="AppGridManagement">
<div class="pad-t32" v-if="component != 'Map' && isGridMember"></div>
<div class="select-gird" v-if="component != 'Map' && isGridMember" flex>
<AiPagePicker type="custom" class="fill" @select="handleSelectGird"
:ops="{url:'./SelectGird',label: 'girdName'}">
<div flex>
<img src="./components/img/gird-icon.png" alt="" class="gird-icon">
<AiMore v-model="params.girdName" icon="arrow-down"/>
</div>
</AiPagePicker>
<span @click="linkTo('./SetGird')" v-if="isGridAdmin">网格配置</span>
</div>
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params"/>
<div class="tabs" v-if="isTab && isGridMember">
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
</div>
</div>
<div v-if="!isGridMember" class="empty">
<img src="./components/img/no-admin.png" alt="">
<p>没有网格员权限<br/>无法查看网格信息哦~</p>
</div>
</div>
</template>
<script>
import Statistics from './Statistics.vue'
import Organization from './Organization.vue'
import Map from './Map.vue'
import {mapState} from "vuex";
export default {
name: 'AppGridManagement',
appName: '网格管理',
computed: {
...mapState(['user']),
isGridMember() {
return this.user.girdCheckType > 0
},
isGridAdmin() {
return this.user.girdCheckType == 2
}
},
data() {
return {
component: 'Statistics',
params: {},
refresh: true,
tabIndex: 0,
tabs: [
{
img: require('./components/img/statistics-icon.png'),
activeImg: require('./components/img/statistics-icon-active.png'),
text: '统计',
component: 'Statistics',
},
{
img: require('./components/img/org-icon.png'),
activeImg: require('./components/img/org-icon-active.png'),
text: '组织',
component: 'Organization',
},
{
img: require('./components/img/map-icon.png'),
activeImg: require('./components/img/map-icon-active.png'),
text: '地图',
component: 'Map'
}
],
isTab: true,
}
},
components: {
Organization,
Statistics,
Map,
},
methods: {
onChange(e) {
this.params = e.params
this.component = e.type
},
refreshHome() {
this.refresh = false
this.$nextTick(() => {
this.refresh = true
})
}, tabClick(index, component) {
this.tabIndex = index
this.component = component
this.refreshHome();
},
linkTo(url) {
uni.navigateTo({url})
},
handleSelectGird(v) {
this.params = v || {}
this.refreshHome()
}
},
onLoad() {
this.handleSelectGird(this.user.gridInfo)
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
})
},
onShow() {
document.title = '网格管理'
},
onReachBottom() {
if (!this.tabIndex) {
uni.$emit('nextList')
}
},
}
</script>
<style lang="scss" scoped>
.AppGridManagement {
height: 100vh;
}
.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;
.gird-name {
display: inline-block;
max-width: calc(100% - 108px);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
margin: 0 16px;
}
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;
}
}
</style>

View File

@@ -0,0 +1,242 @@
<template>
<div class="FamilyList">
<div class="title">
<div>户主列表({{ total }})</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>
<div class="seachObjs">
<u-search v-model="keyword" :clearabled="true" placeholder="姓名/联系方式/身份证后6位" :show-action="false"
bg-color="#F5F5F5" search-icon-color="#E2E8F1" color="#666" height="58" @change="handerSearch"/>
</div>
<div class="main" v-if="list.length">
<ul v-for="(item,index) in list" :key="index">
<li>
<div class="user">
<div v-if="!edit">
<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="info">
<div>
<img :src="item.photo" class="userImg" v-if="item.photo">
<img src="./components/img/user-img.png" alt="" class="userImg" v-else>
</div>
<div class="userInfo">
<div class="name">
<span class="user-name">{{ item.name }}</span>
<span class="user-tel">{{ item.phone }}</span>
</div>
<div class="idCard">{{ item.idNumber && item.idNumber.replace(/(.{6}).*(.{4})/, "$1********$2") }}</div>
<div class="address">{{ item.currentAreaName || '' }}{{ item.currentAddress || '' }}</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 {
data() {
return {
list: [],
total: 0,
current: 1,
userId: '',
edit: true,
checked: true,
girdId: '',
keyword: ''
}
},
methods: {
handerSearch() {
this.list = []
this.current = 1
this.getList()
},
handerClear() {
this.keyword = ''
this.handerSearch()
},
getList() {
this.$http.post(`/app/appgirdmemberresident/listByGirdMember?current=${this.current}&girdMemberId=${this.userId}&girdId=${this.girdId}&name=${this.keyword}`).then((res) => {
if (res?.data) {
this.list = this.current > 1 ? [...this.list, ...res.data.records] : res.data.records
this.total = res.data.total
}
})
},
toAddFamily() {
uni.navigateTo({url: `./AddFamily?id=${this.userId}&girdId=${this.girdId}`})
},
userClick(index) {
this.list[index].checked = !this.list[index].checked
this.$forceUpdate()
},
// 点击删除
delFamily() {
var ids = []
this.list.map((item) => {
if (item.checked) {
ids.push(item.gmrId)
}
})
if (!ids.length) {
return this.$u.toast('请选中需要删除的家庭户主')
}
this.$confirm(`是否删除这些关联家庭信息?`).then(() => {
this.$http.post(`/app/appgirdmemberresident/delete?ids=${ids.join(',')}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功')
uni.$emit('updateList')
this.$forceUpdate()
this.edit = true
}
})
})
},
changeType() {
this.edit = false
this.list.map((item) => {
item.checked = false
})
}
},
onLoad(option) {
this.userId = option.id
this.girdId = option.girdId
},
onShow() {
document.title = '责任家庭'
this.getList()
uni.$on('updateList', () => {
this.current = 1
this.getList()
})
},
onReachBottom() {
this.current = this.current + 1
this.getList()
},
}
</script>
<style lang="scss" scoped>
.FamilyList {
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-left: 32px;
background-color: #fff;
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;
}
.info {
display: flex;
justify-content: flex-start;
width: 100%;
.userImg {
margin-right: 32px;
width: 80px;
height: 80px;
border-radius: 50%;
}
.userInfo {
width: 100%;
padding-right: 32px;
border-bottom: 1px solid #E4E5E6;
.name {
display: flex;
justify-content: space-between;
font-size: 32px;
margin-bottom: 8px;
.user-name {
font-weight: 800;
}
.user-tel {
font-size: 26px;
color: #999999;
}
}
.idCard {
margin-bottom: 16px;
font-size: 26px;
color: #999999;
}
.address {
max-width: 100%;
word-break: break-all;
margin-bottom: 18px;
font-size: 26px;
color: #999999;
}
}
}
}
}
}
}
.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;
}
.seachObjs {
border-bottom: 2px solid #f5f5f5;
border-top: 2px solid #f5f5f5;
padding: 20px 32px;
background: #fff;
}
}
</style>

View File

@@ -0,0 +1,397 @@
<template>
<div class="detail">
<div class="grid-select">
<AiPagePicker type="custom" class="fill" @select="handleSelectGird"
:ops="{url:'./SelectGird',label: 'girdName'}">
<div class="gird-content">
<div class="label">网格选择</div>
<div class="grid-select__right">
<span>{{ form.girdName || '请选择' }}</span>
<u-icon name="arrow-right" color="#cccccc" size="26" style="margin-left:4px;"></u-icon>
</div>
</div>
</AiPagePicker>
</div>
<div class="map-content">
<AiTMap ref="AiTMap" :map.sync="map" :lib.sync="lib" :libraries="['geometry','service', 'tools']"/>
</div>
<u-popup v-model="show" mode="bottom" border-radius="14">
<div class="popup">
<div class="bg"></div>
<div class="title">{{ form.girdName }}</div>
<scroll-view scroll-y="true" class="grid-info">
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
<span class="label">网格长</span>
<span class="value">
<AiOpenData v-if="item.name" type="userName" :openid="item.name"/>
<!-- &nbsp;&nbsp;{{ item.phone }}
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
v-if="item.phone"> -->
</span>
</div>
<div class="info-flex" v-for="(item, index) in form.girdMemberList" :key="index">
<span class="label">网格员</span>
<span class="value">
<AiOpenData v-if="item.name" type="userName" :openid="item.name"/>
<!-- &nbsp;&nbsp;{{ item.phone }}
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
v-if="item.phone"> -->
</span>
</div>
</scroll-view>
</div>
</u-popup>
</div>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
areaId: '',
lib: null,
map: null,
show: false,
form: {girdName: '', id: ''},
treeList: [],
showSelect: false,
editor: null,
polygons: [],
labels: [],
latLngCenter: [], //中心点
}
},
computed: {...mapState(['user', 'config'])},
created() {
this.areaId = this.user.areaId
// this.getLeafNodes()
uni.$on('goback', e => {
this.form.girdName = e.girdName
this.getGridList(e.id, true)
})
},
methods: {
handleSelectGird(v) {
this.form = v || {}
this.getGridList(v?.id, true)
},
toChoose() {
uni.navigateTo({
url: './SelectGird?isFormMap=1'
})
},
getLeafNodes() {
this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById`).then((res) => {
if (res?.data) {
this.treeList = res.data
const arr = res.data.filter(v => v.points).map(e => {
return {
id: e.id,
girdName: e.girdName,
points: e.points.map(p => [p.lng, p.lat])
}
})
arr.length > 0 && this.renderGridMap(arr)
}
})
},
getGridList(id) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
this.$hideLoading()
if (res?.data) {
const arr = []
res.data.map(v => {
if (v.points) {
arr.push(
{
id: v.id,
girdName: v.girdName,
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
}
)
if (this.latLngCenter.length) {
} else {
this.latLngCenter.push(v.points[0].lat, v.points[0].lng)
}
}
})
if (!arr.filter(v => v.points).length) {
return this.$u.toast('该网格还未标会')
}
this.renderGridMap(arr.filter(v => v.points))
}
}).catch(() => {
this.$hideLoading()
})
},
getGridInfo(id, flag) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => {
this.$hideLoading()
if (res?.data) {
this.form = res.data
if (res.data.points.length > 0 && flag) {
const arr = [{
id: res.data.id,
girdName: res.data.girdName,
points: res.data.points.map(p => [p.lng, p.lat])
}]
this.renderGridMap(arr)
}
this.$nextTick(() => {
!flag && (this.show = true)
})
}
}).catch(() => {
this.$hideLoading()
})
},
renderGridMap(paths, count = 0) {
let {map, lib: TMap, $refs: {AiTMap: {fitBounds}}} = this
if (TMap) {
if (this.latLngCenter.length) {
map.setCenter(this.latLngCenter)
this.map.setZoom(14)
}
if (this.polygons.length > 0) {
this.polygons.forEach(e => e.destroy())
this.labels.forEach(e => {
e.destroy(e.id)
})
this.polygons = []
this.labels = []
}
if (paths?.length > 0) {
let bounds = []
paths.forEach((path, i) => {
let polygon = new TMap.MultiPolygon({
map, styles: {
default: new TMap.PolygonStyle({
showBorder: true,
borderColor: '#5088FF',
borderWidth: 2,
color: this.$colorUtils.Hex2RGBA('#5088FF', 0.1)
})
},
id: path.id,
geometries: [{paths: path.points.map(e => new TMap.LatLng(e[1], e[0]))}]
})
this.polygons.push(polygon)
bounds.push(fitBounds(path.points.map(e => new TMap.LatLng(e[1], e[0]))))
polygon.on('click', e => {
const id = e.target.id
this.getGridInfo(id)
})
const points = path.points.map(e => new TMap.LatLng(e[1], e[0]))
var position = TMap.geometry.computeCentroid(points)
let label = new TMap.MultiLabel({
id: `label~${path.id}`,
data: path.id,
map: map,
styles: {
building: new TMap.LabelStyle({
color: '#3777FF',
size: 20,
alignment: 'center',
verticalAlignment: 'middle'
})
},
geometries: [
{
id: `label-class-${i}`,
styleId: 'building',
position: position,
content: path.girdName,
}
]
})
this.labels.push(label)
label.on('click', e => {
this.getGridInfo(e.target.id.split('~')[1])
});
})
bounds = bounds.reduce((a, b) => {
return fitBounds([
a.getNorthEast(),
a.getSouthWest(),
b.getNorthEast(),
b.getSouthWest(),
]);
});
map.fitBounds(bounds, {padding: 100})
} else {
// map.setCenter(this.config.latlng)
}
} else {
if (count < 5) {
setTimeout(() => {
this.renderGridMap(paths, ++count)
}, 1000)
}
}
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
handleSelect(e) {
if (e?.points?.length > 0) {
this.form = e
const points = e.points.map(e => new TMap.LatLng(e.lat, e.lng))
var position = TMap.geometry.computeCentroid(points)
this.map.setCenter(position)
this.map.setZoom(18)
} else {
this.$u.toast("所选网格没有标绘!")
}
},
}
}
</script>
<style lang="scss" scoped>
.detail {
height: 100%;
.grid-select {
width: 100%;
padding: 34px 32px;
box-sizing: border-box;
background: #FFF;
display: flex;
justify-content: space-between;
line-height: 44px;
color: #333;
.grid-select__right {
width: calc(100% - 140px);
text-align: right;
}
.gird-content {
display: flex;
justify-content: space-between;
}
.label {
display: inline-block;
width: 140px;
font-size: 32px;
}
.value {
font-size: 28px;
.u-icon {
margin-left: 8px;
}
}
}
.map-content {
width: 100%;
height: calc(100% - 210px);
}
.popup {
padding: 0 32px 16px;
.bg {
width: 64px;
height: 10px;
background: #CCC;
border-radius: 6px;
margin: 32px auto 32px auto;
}
.grid-info {
height: 800px;
}
.title {
font-size: 36px;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #333;
line-height: 50px;
margin-bottom: 24px;
}
.info-flex {
padding: 26px 0 30px 0;
width: 100%;
border-bottom: 1px solid #D8DDE6;
line-height: 40px;
font-size: 28px;
&:last-of-type {
border-bottom: none;
}
.label {
display: inline-block;
width: 160px;
font-weight: 800;
color: #333;
}
.value {
color: #666;
font-size: 26px;
.phone-icon {
width: 40px;
height: 40px;
vertical-align: sub;
margin-left: 16px;
}
div {
display: inline-block;
}
}
}
}
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: 99999;
display: flex;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
height: 112px;
line-height: 112px;
text-align: center;
.btn {
flex: 2;
background: #1365DD;
color: #FFF;
}
}
</style>

View File

@@ -0,0 +1,219 @@
<template>
<div class="Organization">
<div class="title">网格人员</div>
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="index" @click="viewUser(item.wxUserIdId)">
<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 flex class="name spb">
<AiOpenData v-if="item.wxUserId" type="userName" :openid="item.wxUserId"/>
<div class="gird dark" v-text="item.label"/>
</div>
<div class="gird" v-text="item.checkType == 2 ? '网格长' : '网格员'"/>
<p>{{ item.girdName }}</p>
</div>
</div>
<div class="user-content user-item" v-for="(item, index) in dataInfo.girdMembers" :key="index" @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">
<div flex>
<AiOpenData v-if="item.wxUserId" type="userName" :openid="item.wxUserId"/>
<div class="gird dark" v-text="item.label"/>
</div>
<span class="gird">{{ item.checkType == 2 ? '网格长' : '网格员' }}</span>
<span class="num" v-if="item.checkType == 1">家庭数({{ item.residentNumber }})</span>
</div>
<div class="gird-name">
<span class="text">{{ item.girdName }}</span>
<span class="family-btn" @click.stop="toFamily(item)" v-if="item.checkType == 1">责任家庭 ></span>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap"
v-if="dataInfo.parentGirdMembers && !dataInfo.parentGirdMembers.length && !dataInfo.girdMembers.length"></AiEmpty>
<div class="pad-b112"></div>
</div>
</template>
<script>
import {mapActions} from 'vuex'
export default {
data() {
return {
userGird: {},
dataInfo: {},
}
},
props: ['params'],
onShow() {
document.title = '网格管理'
uni.$on('updateList', () => {
this.current = 1
this.getGirdUserList()
})
},
mounted() {
this.userGird = this.params
this.getGirdUserList()
uni.$on('goback', (res) => {
this.userGird = res
this.getGirdUserList()
})
},
methods: {
...mapActions(['injectJWeixin', 'wxInvoke']),
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) {
this.injectJWeixin('openUserProfile').then(() => {
this.wxInvoke([
'openUserProfile',
{
type: 1,
userid: userId,
},
() => 0,
])
})
},
toFamily(item) {
uni.navigateTo({url: `./FamilyList?id=${item.id}&girdId=${this.userGird.id}`})
}
},
}
</script>
<style lang="scss" scoped>
.Organization {
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 {
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;
&.dark {
color: #fff;
background: #26f;
margin-left: 16px;
}
}
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;
}
.num {
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
line-height: 36px;
float: right;
}
.pad-b112 {
padding-bottom: 112px;
}
}
</style>

View File

@@ -0,0 +1,254 @@
<template>
<div class="SelectGird">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in slectList" :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="treeList.length > 0">
<div class="cards" v-for="(item, index) in treeList" :key="index" @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 fill">
<div class="applicationNames fill">{{ item.girdName }}</div>
</div>
</div>
</div>
<AiEmpty :description="isGridMember?`暂无数据`:`当前人员不是网格员或网格管理员`" class="emptyWrap" v-else/>
</div>
</div>
<!-- <div style="padding-bottom: 70px;"></div> -->
<div class="subBtn" @click="submit">
<div>确定选择</div>
</div>
</div>
</template>
<script>
import {mapState} from "vuex";
export default {
name: 'SelectGird',
data() {
return {
SelectGird: {},
allData: null,
treeList: [],
slectList: [],
userList: [],
parentGirdId: '',
isFormMap: 0, //1为网格地图 一级不允许选中
}
},
computed: {
...mapState(['user']),
isMyGirds() {
return !!this.$route.query.self
},
isGridMember() {
return this.user.girdCheckType > 0
}
},
onLoad(option) {
if (option.isFormMap) {
this.isFormMap = option.isFormMap
}
this.isGridMember ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格管理员')
},
methods: {
getAllGrids() {
this.slectList = []
let {girdMemberId} = this.user,
url = `/app/appgirdinfo/queryAppGirdInfoByGirdLevel`,
params = {girdMemberId}
if (this.isMyGirds) {
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`
params = {}
}
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() {
let last = uni.getStorageSync("lastSelectedGrid")
if (last) {
this.$http.post("/app/appgirdinfo/listFatherGirdInfo", null, {
params: {girdId: last}
}).then(res => {
if (res?.data) {
this.slectList = [{girdName: '可选范围', id: ''}, res.data].flat()
this.getGridsByGridMemberAndParent({id: last})
}
})
} else {
this.treeList = this.allData.filter(e => !e.parentGirdId || this.isMyGirds)
this.treeList.map((item) => item.isChecked = false)
let obj = {girdName: '可选范围', id: ''}
this.slectList.push(obj)
}
},
itemClick(row) {
if (row.hasChildren) {
let obj = {
girdName: row.girdName,
id: row.id,
}
this.slectList.push(obj)
this.getGridsByGridMemberAndParent(row)
}
},
getGridsByGridMemberAndParent(row) {
let {id: parentGirdId} = row
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
},
girdNameClick(row, index) {
this.userList = []
if (!index) { //第一级别
this.slectList = []
this.treeInit()
} else {
var list = []
this.slectList.map((item, i) => {
if (i <= index) {
list.push(item)
}
})
this.slectList = list
this.getGridsByGridMemberAndParent(row)
}
},
girdClick(row, index) {
if (this.treeList[index].isChecked) {//取消
this.treeList[index].isChecked = false
this.SelectGird = {}
} else {
this.treeList.map((item) => {
item.isChecked = false
})
this.treeList[index].isChecked = true
this.SelectGird = row
}
this.$forceUpdate()
},
submit() {
if (this.SelectGird.id != null) {
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">
.SelectGird {
min-height: 100vh;
background: #fff;
padding-bottom: 140px;
box-sizing: border-box;
.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;
margin-left: 36px;
}
}
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;
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,272 @@
<template>
<div class="setGird">
<div class="header-middle">
<div class="hint">
<span v-for="(item, index) in slectList" :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="showTypes" v-if="!userList.length">
<div v-if="treeList.length > 0">
<div class="cards" v-for="(item, index) in treeList" :key="index">
<div class="imges">
<span v-if="item.girdRight==1">
<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)"/>
</span>
<span v-else style="width:24px;"></span>
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
</div>
<div class="rightes fill">
<div class="applicationNames fill" @click="showGirdInfo(item)">{{ item.girdName }}</div>
<u-icon v-if="item.hasChildren" @click="itemClick(item)" name="arrow-right" color="#ddd"/>
</div>
</div>
</div>
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
</div>
</div>
<!-- <div style="padding-bottom: 70px;"></div> -->
<div class="subBtn" @click="toAddGird">
<div>添加网格</div>
</div>
</div>
</template>
<script>
export default {
name: 'setGird',
data() {
return {
setGird: {},
allData: null,
treeList: [],
slectList: [],
userList: [],
}
},
onLoad() {
this.isGirdUser()
uni.$on('update', () => {
this.getAllGrids()
})
},
onShow() {
document.title = '网格配置'
},
methods: {
isGirdUser() {
this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
if (res.code == 0) {
if (res.data.checkType) {
this.userGird = res.data
this.getAllGrids()
} else {
this.$u.toast('当前人员不是网格员或网格管理员')
}
}
})
},
getAllGrids() {
this.slectList = []
let {girdMemberId} = this.userGird
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel`, null, {
params: {girdMemberId}
}).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() {
this.treeList = this.allData.filter(e => !e.parentGirdId)
this.treeList.map((item) => {
item.isChecked = false
})
let obj = {
girdName: '可选范围',
id: '',
}
this.slectList.push(obj)
},
itemClick(row) {
let obj = {
girdName: row.girdName,
id: row.id,
}
this.slectList.push(obj)
this.getGridsByGridMemberAndParent(row)
},
getGridsByGridMemberAndParent(row) {
let {id: parentGirdId} = row
this.setGird = {}
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
},
girdNameClick(row, index) {
this.userList = []
if (!index) { //第一级别
this.slectList = []
this.treeInit()
} else {
var list = []
this.slectList.map((item, i) => {
if (i <= index) {
list.push(item)
}
})
this.slectList = list
this.getGridsByGridMemberAndParent(row)
}
},
girdClick(row, index) {
if (this.treeList[index].isChecked) {//取消
this.treeList[index].isChecked = false
this.setGird = {}
} else {
this.treeList.map((item) => {
item.isChecked = false
})
this.treeList[index].isChecked = true
this.setGird = row
}
this.$forceUpdate()
},
showGirdInfo(row) {
uni.navigateTo({url: `./gridMembers?id=${row.id}`})
},
callPhone(phone) {
uni.makePhoneCall({phoneNumber: phone})
},
toAddGird() {
if (this.setGird.id != null) {
uni.navigateTo({url: `./AddGird?id=${this.setGird.id}&fromType=add`})
} else {
return this.$u.toast('请选择网格')
}
}
}
}
</script>
<style scoped lang="scss">
.setGird {
min-height: 100vh;
background: #fff;
padding-bottom: 140px;
box-sizing: border-box;
.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: 0 20px 0 36px;
}
}
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;
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,170 @@
<template>
<div class="Statistics">
<div class="middle">
<div class="girdPeople">网格内人员情况</div>
<div class="card">
<div class="box">
<span class="count" v-if="peopleList && peopleList['网格长']">{{ peopleList['网格长'] }}</span>
<span class="count" v-else>0</span>
<span class="girdCount">网格长</span>
</div>
<div class="box">
<span class="count" v-if="peopleList && peopleList['网格员']">{{ peopleList['网格员'] }}</span>
<span class="count" v-else>0</span>
<span class="girdCount">网格员</span>
</div>
<div class="box">
<span class="count" v-if="peopleList && peopleList['责任家庭数']">{{ peopleList['责任家庭数'] }}</span>
<span class="count" v-else>0</span>
<span class="girdCount">责任家庭数</span>
</div>
</div>
</div>
<div class="bottom">
<div class="girdMsg">网格信息</div>
<div class="girdCont">
<div class="boxes">
<span class="boxesLeft">网格名称</span>
<span class="boxesRight">{{ gridInfo.girdName || '' }}</span>
</div>
<div class="boxes">
<span class="boxesLeft">标绘状态</span>
<span class="boxesRight">{{ gridInfo.plottingStatus == 1 ? '已标绘' : '未标绘' }}</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Statistics',
components: {},
props: {
dict: Object,
instance: Function,
params: Object,
},
data() {
return {
peopleList: {},
gridInfo: {},
checkType: '',
}
},
created() {
this.gridInfo = this.params
this.getList()
uni.$on('goback', (res) => {
this.gridInfo = res
this.getList()
})
},
methods: {
getList() {
this.$http.post(`/app/appgirdmemberinfo/girdMemberAndResidentStatistic?girdId=${this.gridInfo.id}`).then((res) => {
if (res?.data) {
this.peopleList = res.data
}
})
},
linkTo(url) {
uni.navigateTo({url})
},
},
}
</script>
<style scoped lang="scss">
.Statistics {
padding: 0 30px;
box-sizing: border-box;
.middle {
background: #ffffff;
border-radius: 16px;
margin-top: 32px;
padding: 32px 0 60px 0;
.girdPeople {
padding: 0 0 56px 24px;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333333;
}
.card {
display: flex;
justify-content: space-around;
.box {
display: flex;
flex-direction: column;
align-items: center;
.count {
font-size: 64px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #3b424a;
}
.girdCount {
margin-top: 8px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
}
}
}
.bottom {
background: #ffffff;
border-radius: 16px;
margin-top: 32px;
padding: 0 24px 64px 24px;
.girdMsg {
padding: 32px 0;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
color: #333333;
}
.girdCont {
.boxes {
padding: 24px 0 30px 0;
box-shadow: inset 0px -1px 0px 0px #d8dde6;
.boxesLeft {
font-size: 30px;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #333333;
display: inline-block;
width: 140px;
vertical-align: top;
}
.boxesRight {
margin-left: 40px;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666666;
display: inline-block;
width: calc(100% - 200px);
}
}
}
}
}
</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: 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: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 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: 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,188 @@
<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">
<AiOpenData class="memberName" v-if="item.wxUserId" type="userName" :openid="item.wxUserId"/>
<div class="memberName" v-else 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 @click="gotoFamilyList(item)">责任家庭</div>
<div @click="handleTag(item)">标签设置</div>
</div>
</div>
<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,305 @@
<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">
<AiOpenData v-if="e.name" type="userName" :openid="e.name" style="display: block;"/>
</div>
<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;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.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 {
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>