This commit is contained in:
yanran200730
2022-06-09 10:45:27 +08:00
22 changed files with 185 additions and 388 deletions

View File

@@ -20,7 +20,7 @@
</AiPagePicker>
</AiItem>
</AiGroup>
<div class="footer" @click="confirm">{{ fromType == 'add' ? '确认添加' : '确认修改' }}</div>
<div class="footer" @click="$u.debounce(confirm)">{{ fromType == 'add' ? '确认添加' : '确认修改' }}</div>
</div>
</template>
@@ -34,7 +34,6 @@ export default {
girdMemberManageList: [],
girdMemberList: []
},
detailInfo: {},
fromType: 'add', //add新增 edit编辑,
}
},
@@ -54,13 +53,14 @@ export default {
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
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 = this.detailInfo.id
this.form.parentGirdName = this.detailInfo.girdName
this.form.parentGirdId = res.data.id
this.form.parentGirdName = res.data.girdName
this.$forceUpdate()
}
}
@@ -86,7 +86,6 @@ export default {
name: item.name
}
})
uni.showLoading({mask: true})
this.$http.post(`/app/appgirdinfo/addOrUpdateByEw`, {...this.form, girdMemberManageList, girdMemberList}).then((res) => {
if (res?.code == 0) {
this.$u.toast('提交成功')
@@ -97,8 +96,7 @@ export default {
}
}).catch((err) => {
this.$u.toast(err)
}).finally(() => uni.hideLoading())
})
},
getArrayLabel(arr, key = 'name', separation = '') {
return arr?.map(e => e[key])?.join(separation)

View File

@@ -1,11 +1,11 @@
<template>
<div class="AddGird">
<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" />
<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">
@@ -13,25 +13,26 @@
<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" />
<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" @click="linkTo('./SelectGird?formType=2')">
<span v-if="selectGird.girdName">{{selectGird.girdName}}</span>
<span style="color:#999;" v-else>请选择</span>
<img src="./components/img/right-icon.png" alt="" /></div>
<div class="value">
<AiPagePicker type="custom" v-model="selectGird" valueObj nodeKey="id" :ops="{url:'./SelectGird',label: 'girdName'}" formType="2">
<AiMore v-model="selectGird.girdName"/>
</AiPagePicker>
</div>
<div class="footer" @click="confirm">确认添加</div>
</div>
<div class="footer" @click="confirm">确认添加</div>
</div>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
@@ -42,25 +43,21 @@ export default {
},
computed: {...mapState(['user'])},
onLoad() {
console.log(this.user)
this.name = this.user.name || ''
this.phone = this.user.phone || ''
uni.$on('goback', (res) => {
this.selectGird = res
})
},
onShow() {
document.title = '网格员信息申报'
},
methods: {
confirm() {
if(!this.name){
if (!this.name) {
return this.$u.toast('请输入姓名')
}
if(!this.phone){
if (!this.phone) {
return this.$u.toast('请输入手机号')
}
if(!this.selectGird.girdName){
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) => {
@@ -74,7 +71,7 @@ export default {
},
linkTo(url) {
uni.navigateTo({ url })
uni.navigateTo({url})
},
}
}
@@ -82,42 +79,48 @@ export default {
<style lang="scss" scoped>
.AddGird {
.item-flex{
.item-flex {
display: flex;
padding: 34px 32px;
background-color: #fff;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
margin-bottom: 16px;
.label{
.label {
font-weight: 400;
color: #333333;
line-height: 22px;
width: 150px;
.tips{
.tips {
display: inline-block;
width: 16px;
color: #F46;
line-height: 44px;
}
}
.value{
.value {
width: calc(100% - 150px);
line-height: 44px;
text-align: right;
color: #666;
img{
img {
width: 32px;
height: 32px;
vertical-align: middle;
margin-left: 8px;
}
}
.color-999{
.color-999 {
color: #999;
}
}
.footer{
.footer {
width: 100%;
height: 112px;
line-height: 112px;

View File

@@ -2,9 +2,9 @@
<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>
<p>{{ status == 1 ? '信息申报成功!' : '信息申报失败!' }}</p>
<p class="text">{{ status == 1 ? '重新进入即可开始正常使用' : '系统无法匹配该申报信息,请联系管理人员进行处理' }}</p>
<div class="footer" @click="back">{{ status == 1 ? '确定' : '我知道了' }}</div>
</div>
</template>
@@ -23,25 +23,32 @@ export default {
},
methods: {
back() {
uni.navigateBack({delta: 2})
uni.navigateBack({
delta: 2, success() {
location.reload()
}
})
}
},
}
</script>
<style lang="scss" scoped>
uni-page-body{
uni-page-body {
height: 100%;
background-color: #fff;
}
.success {
text-align: center;
img{
img {
width: 192px;
height: 192px;
margin: 96px 0 16px 0;
}
p{
p {
line-height: 50px;
color: #333;
font-size: 36px;
@@ -49,7 +56,8 @@ uni-page-body{
text-align: center;
margin-bottom: 16px;
}
.footer{
.footer {
width: calc(100% - 96px);
height: 88px;
line-height: 88px;
@@ -63,7 +71,8 @@ uni-page-body{
border-radius: 8px;
margin-left: 48px;
}
.text{
.text {
line-height: 44px;
font-size: 28px;
width: 500px;

View File

@@ -10,7 +10,7 @@
<AiMore v-model="params.girdName" icon="arrow-down"/>
</div>
</AiPagePicker>
<span @click="linkTo('./SetGird?id='+params.id)" v-if="isGridAdmin">网格配置</span>
<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">

View File

@@ -23,20 +23,20 @@
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
<span class="label">网格长</span>
<span class="value">
{{ [item.name,item.phone].join(" ") }}
{{ [item.name, item.phone].join(" ") }}
</span>
</div>
<div v-if="form.girdMemberList && form.girdMemberList.length">
<div class="info-flex" v-for="(item, index) in form.girdMemberList" :key="index">
<span class="label">网格</span>
<span class="label">网格</span>
<span class="value">{{ item.name }}&nbsp;&nbsp;{{ item.phone }}
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
v-if="item.phone">
v-if="item.phone">
</span>
</div>
</div>
</scroll-view>
</scroll-view>
</div>
</u-popup>
</div>
@@ -65,43 +65,14 @@ export default {
created() {
this.$dict.load('girdType')
this.areaId = this.user.areaId
// this.getLeafNodes()
uni.$on('goback', e => {
this.getGridList(e.id, true)
})
},
onShow() {
document.title = "网格管理"
},
methods: {
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) {
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 => {
return {
@@ -112,12 +83,11 @@ export default {
})
this.renderGridMap(arr)
}
}).catch(() => {
}).finally(() => {
this.$hideLoading()
})
},
getGridInfo (id, flag) {
getGridInfo(id, flag) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => {
this.$hideLoading()
@@ -142,7 +112,6 @@ export default {
this.$hideLoading()
})
},
renderGridMap(paths, count = 0) {
let {map, lib: TMap, $refs: {AiTMap: {fitBounds}}} = this
if (TMap) {
@@ -157,58 +126,54 @@ export default {
}
if (paths?.length > 0) {
let bounds = []
paths.forEach((path, i) => {
let color = colors[i % colors.length]
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])
});
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([
@@ -234,16 +199,9 @@ export default {
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("所选网格没有标绘!")
}
handleSelectGird(v) {
this.form = v || {}
this.getGridList(v?.id, true)
},
}
}

View File

@@ -1,7 +1,7 @@
<template>
<div class="Organization">
<div class="title">网格人员</div>
<div class="user-content" v-for="(item, index) in dataInfo.parentGirdMembers" :key="index">
<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">
@@ -13,7 +13,7 @@
<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 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">
@@ -29,7 +29,7 @@
</div>
<AiEmpty description="暂无数据" class="emptyWrap"
v-if="dataInfo.parentGirdMembers && !dataInfo.parentGirdMembers.length && !dataInfo.girdMembers.length"></AiEmpty>
<div class="pad-b112"></div>
<AiGap h="112"/>
</div>
</template>

View File

@@ -53,13 +53,16 @@ export default {
},
isGridMember() {
return this.user.girdCheckType > 0
}
},
//是否是网格员申报
isApply: v => v.$route.query.formType == 2,
selected: v => [v.$route.query.selected].flat()
},
onLoad(option) {
if (option.isFormMap) {
this.isFormMap = option.isFormMap
}
this.isGridMember ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格长')
this.isGridMember || this.isApply ? this.getAllGrids() : this.$u.toast('当前人员不是网格员或网格长')
},
methods: {
getAllGrids() {
@@ -67,6 +70,10 @@ export default {
let {girdMemberId} = this.user,
url = `/app/appgirdinfo/queryAppGirdInfoByGirdLevel`,
params = {girdMemberId}
if (this.isApply) {
url = `/app/appgirdinfo/listByInfo`
params = {}
}
if (this.isMyGirds) {
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`
params = {}
@@ -81,7 +88,7 @@ export default {
},
treeInit(isClick) {
let last = uni.getStorageSync("lastSelectedGrid")
if (!isClick && last) {
if (!isClick && last && !this.isApply) {
this.$http.post("/app/appgirdinfo/listFatherGirdInfo", null, {
params: {girdId: last}
}).then(res => {
@@ -92,7 +99,7 @@ export default {
})
} else {
this.treeList = this.allData.filter(e => !e.parentGirdId || this.isMyGirds)
this.treeList.map((item) => item.isChecked = false)
this.treeList.map((item) => item.isChecked = this.selected.includes(item.id))
let obj = {girdName: '可选范围', id: ''}
this.slectList.push(obj)
}

View File

@@ -12,17 +12,17 @@
<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 v-if="item.hasChildren" @click="itemClick(item)" name="arrow-right" color="#ddd"/>
<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">
<div class="subBtn" v-if="detail.girdRight==1" flex>
<div class="delete" @click="handleDelete">删除网格</div>
<div @click="edit">编辑网格</div>
<div @click="toAddGird">添加下级网格</div>
<div @click="handleDelete">编辑网格</div>
<div class="delete" @click="toAddGird">删除网格</div>
</div>
</div>
</template>
@@ -57,7 +57,6 @@ export default {
}
})
},
itemClick(row) {
uni.navigateTo({url: `./SetGird?id=${row.id}`})
},
@@ -74,11 +73,11 @@ export default {
uni.navigateTo({url: `./AddGird?id=${this.detail.id}&fromType=edit`})
},
handleDelete() {
this.$confirm('删除网格后,会清除网格内网格员责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
this.$confirm('删除网格后,会清除网格内网格员责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
this.$http.post(`/app/appgirdinfo/delete?ids=${this.detail.id}`).then((res) => {
if (res?.code == 0) {
this.$u.toast('删除成功!')
this.getDetail()
uni.navigateBack({})
}
})
})
@@ -156,6 +155,7 @@ export default {
height: 118px;
background: #f4f8fb;
font-family: PingFangSC-Medium, PingFang SC;
justify-content: flex-end;
div {
padding: 0 32px;
@@ -167,7 +167,6 @@ export default {
font-size: 32px;
color: #fff;
margin-left: 22px;
float: right;
border: 2px #1365dd solid;
&.delete {
@@ -176,7 +175,7 @@ export default {
border-color: #f46;
}
&:first-of-type {
&:last-of-type {
margin-right: 32px;
}
}

View File

@@ -2,7 +2,7 @@
<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"/>-->
<!-- <img class="avatar" :src="item.photo"/>-->
<div class="fill">
<div class="memberName" v-text="item.name"/>
<div flex>
@@ -12,9 +12,10 @@
</div>
<div class="btns">
<div @click="gotoFamilyList(item)">责任家庭</div>
<!-- <div @click="handleTag(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>

View File

@@ -158,10 +158,7 @@ export default {
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;
word-break: break-all;
}
.empty-div {
@@ -219,6 +216,7 @@ export default {
}
.imgs {
flex-shrink: 0;
width: 40px;
height: 40px;
margin-right: 20px;

View File

@@ -151,7 +151,7 @@
<div class="item" v-else-if="item.type == 'gird'">
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
<div class="value" flex>
<AiPagePicker type="custom" @select="v=>handleSelectGird(v,item)" self :ops="{url:'./SelectGird',label: 'girdName'}">
<AiPagePicker type="custom" @select="v=>handleSelectGird(v,item)" :ops="{url:'../AppGridManagement/SelectGird',label: 'girdName'}">
<AiMore v-model="formData[item.fieldDbName + '_name']" :placeholder="item.fieldTips"/>
</AiPagePicker>
</div>
@@ -462,7 +462,7 @@ export default {
return obj?.toString() || "-"
},
handleSelectGird(gird, item) {
let info = gird?.[0] || {}
let info = gird || {}
this.formData[item.fieldDbName] = [info.id, info.girdName].join("_")
this.formData[item.fieldDbName + "_name"] = info.girdName
this.$forceUpdate()