西城
238
src/project/xicheng/AppMerchanGird/AddFamily.vue
Normal file
@@ -0,0 +1,238 @@
|
||||
<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" @search="getListInit" @clear="value='',getListInit"></u-search>
|
||||
</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?areaId=${this.areaId}&householdName=1¤t=${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>
|
||||
|
||||
|
||||
|
||||
|
||||
165
src/project/xicheng/AppMerchanGird/AddGird.vue
Normal 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>
|
||||
138
src/project/xicheng/AppMerchanGird/AddUser.vue
Normal 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>
|
||||
85
src/project/xicheng/AppMerchanGird/AddUserSuccess.vue
Normal 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>
|
||||
223
src/project/xicheng/AppMerchanGird/AppMerchanGrid.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<div class="AppMerchanGrid">
|
||||
<template v-if="isGridMember">
|
||||
<div class="pad-t32" v-if="component != 'Map'"/>
|
||||
<div class="select-gird" v-if="component != 'Map'" flex>
|
||||
<AiPagePicker type="gird" class="fill" @select="handleSelectGird">
|
||||
<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?id='+params.id)" v-if="isGridAdmin&&!!params.id">网格配置</span>
|
||||
</div>
|
||||
<component v-if="refresh" :is="component" @change="onChange" :params="params"/>
|
||||
<!-- <div class="tabs" v-if="isTab">
|
||||
<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="{'color-3267F0':tabIndex == index}" v-text="item.text"/>
|
||||
</div>
|
||||
</div> -->
|
||||
</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 Organization from './Organization.vue'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppMerchanGrid',
|
||||
appName: '网格管理',
|
||||
data() {
|
||||
return {
|
||||
component: 'Organization',
|
||||
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,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
isGridMember() {
|
||||
return this.user.girdCheckType > 0
|
||||
},
|
||||
isGridAdmin() {
|
||||
return this.user.girdCheckType == 2
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Organization,
|
||||
},
|
||||
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>
|
||||
.AppMerchanGrid {
|
||||
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;
|
||||
|
||||
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>
|
||||
221
src/project/xicheng/AppMerchanGird/FamilyList.vue
Normal file
@@ -0,0 +1,221 @@
|
||||
<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="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: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.$http.post(`/app/appgirdmemberresident/listByGirdMember?current=${this.current}&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.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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
181
src/project/xicheng/AppMerchanGird/Organization.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="Organization">
|
||||
<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>
|
||||
<div class="gird">{{ item.checkType == 2 ? '网格长' : '网格员' }}</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(`./FamilyList?id=${item.id}&girdId=${userGird.id}`)" v-if="item.checkType == 1">责任家庭 ></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"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userGird: {},
|
||||
dataInfo: {},
|
||||
}
|
||||
},
|
||||
props: ['params'],
|
||||
onShow() {
|
||||
document.title = '网格管理'
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.userGird = this.params
|
||||
this.getGirdUserList()
|
||||
uni.$on('goback', (res) => {
|
||||
this.userGird = res
|
||||
this.getGirdUserList()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
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>
|
||||
.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 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
257
src/project/xicheng/AppMerchanGird/SelectUser.vue
Normal 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}¤t=${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>
|
||||
184
src/project/xicheng/AppMerchanGird/SetGird.vue
Normal 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>
|
||||
BIN
src/project/xicheng/AppMerchanGird/components/img/big-user.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/down-icon.png
Normal file
|
After Width: | Height: | Size: 314 B |
BIN
src/project/xicheng/AppMerchanGird/components/img/fail.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/gird-icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/jujue.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/local-icon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/map-icon.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/no-admin.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/org-icon.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/right-icon.png
Normal file
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 766 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/success.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/tx@2x.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/user-img.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/xz.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/project/xicheng/AppMerchanGird/components/img/xzh.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
188
src/project/xicheng/AppMerchanGird/gridMembers.vue
Normal 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">
|
||||
<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 @click="gotoFamilyList(item)">责任家庭</div>
|
||||
<!-- <div @click="handleTag(item)">标签设置</div>-->
|
||||
</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>
|
||||
298
src/project/xicheng/AppMerchanGird/selectGridMember.vue
Normal 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>
|
||||
0
src/project/xicheng/AppMerchantManage/add.vue
Normal file
0
src/project/xicheng/AppMerchantManage/detail.vue
Normal file
321
src/project/xicheng/AppMerchantMap/AppMerchantMap.vue
Normal file
@@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<div class="AppMerchantMap">
|
||||
<div class="grid-select">
|
||||
<AiPagePicker type="gird" class="fill" @select="handleSelectGird">
|
||||
<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) in form.girdMemberManageList" :key="item.id" flex>
|
||||
<div class="label">网格长</div>
|
||||
<div class="value fill" v-text='[item.name, item.phone].join(" ")'/>
|
||||
<AiPhone :phone="item.phone"/>
|
||||
</div>
|
||||
<div class="info-flex" v-for="(item) in form.girdMemberList" :key="item.id" flex>
|
||||
<div class="label">网格员</div>
|
||||
<div class="value fill" v-text='[item.name, item.phone].join(" ")'/>
|
||||
<AiPhone :phone="item.phone"/>
|
||||
</div>
|
||||
</scroll-view>
|
||||
</div>
|
||||
</u-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'AppMerchantMap',
|
||||
appName: '商户地图',
|
||||
data() {
|
||||
return {
|
||||
areaId: '',
|
||||
lib: null,
|
||||
map: null,
|
||||
show: false,
|
||||
form: {girdName: '', id: ''},
|
||||
treeList: [],
|
||||
showSelect: false,
|
||||
editor: null,
|
||||
polygons: [],
|
||||
labels: []
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user', 'config'])},
|
||||
created() {
|
||||
this.$dict.load('girdType')
|
||||
this.areaId = this.user.areaId
|
||||
},
|
||||
onShow() {
|
||||
document.title = "网格管理"
|
||||
},
|
||||
methods: {
|
||||
getGridList(id) {
|
||||
this.$loading()
|
||||
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
const arr = res.data.map(v => {
|
||||
return {
|
||||
id: v.id,
|
||||
girdName: v.girdName,
|
||||
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
|
||||
}
|
||||
})
|
||||
this.renderGridMap(arr)
|
||||
}
|
||||
}).finally(() => {
|
||||
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 && 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) {
|
||||
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
|
||||
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) => {
|
||||
if (path.points?.length > 0) {
|
||||
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]))
|
||||
const 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,
|
||||
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})
|
||||
},
|
||||
handleSelectGird(v) {
|
||||
this.form = v || {}
|
||||
this.getGridList(v?.id, true)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body{
|
||||
height: 100%;
|
||||
}
|
||||
.AppMerchantMap {
|
||||
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 {
|
||||
flex-shrink: 0;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
58
src/project/xicheng/AppPageMerchant/AppPageMerchant.vue
Normal file
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="AppPageMerchant">
|
||||
<AiListPage :label="label" :appList="appList" :headerBg="headerBg" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AppPageMerchant',
|
||||
appName: '西城-商户管理',
|
||||
data() {
|
||||
return {
|
||||
label: '西城-商户管理',
|
||||
appList: [
|
||||
{
|
||||
name: '商户档案',
|
||||
icon: require('./img/police-logo.jpg'),
|
||||
url: '../AppMerchantManage/AppMerchantManage',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '网格管理',
|
||||
icon: require('./img/jmqgl.png'),
|
||||
url: '../AppMerchanGird/AppMerchanGird',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '商户地图',
|
||||
icon: require('./img/police-logo.jpg'),
|
||||
url: '../AppMerchantMap/AppMerchantMap',
|
||||
isBottom: true
|
||||
},
|
||||
{
|
||||
name: '网格统计',
|
||||
icon: require('./img/police-logo.jpg'),
|
||||
url: '../AppMerchanStatistics/AppMerchanStatistics'
|
||||
}
|
||||
],
|
||||
headerBg: require('./img/header-bg.png'),
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
document.title = '西城-商户管理'
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
uni-page-body{
|
||||
height: 100%;
|
||||
}
|
||||
.AppPageMerchant{
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
BIN
src/project/xicheng/AppPageMerchant/img/header-bg.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
src/project/xicheng/AppPageMerchant/img/jmda.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src/project/xicheng/AppPageMerchant/img/jmqgl.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
src/project/xicheng/AppPageMerchant/img/jmxxgl.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
src/project/xicheng/AppPageMerchant/img/police-logo.jpg
Normal file
|
After Width: | Height: | Size: 64 KiB |