改造上架版网格
This commit is contained in:
@@ -2,82 +2,41 @@
|
||||
<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>
|
||||
<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 && item.girdLevel != 2">
|
||||
<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 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" />
|
||||
<img src="./components/img/gird--select-icon.png" alt="" class="avatras"/>
|
||||
</div>
|
||||
<div class="rightes">
|
||||
<div class="applicationNames" @click="showGirdInfo(item)">{{ item.girdName }}</div>
|
||||
<div class="right-icon" v-if="item.girdLevel != 2" @click="itemClick(item)" >
|
||||
<img src="./components/img/right-icon.png" alt="" class="imgs" />
|
||||
</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></AiEmpty>
|
||||
<AiEmpty description="暂无数据" class="emptyWrap" v-else/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div style="padding-bottom: 70px;"></div> -->
|
||||
<div class="subBtn" @click="toAddGird" v-if="slectList.length && slectList[slectList.length-1].girdLevel != 1">
|
||||
<div class="subBtn" @click="toAddGird">
|
||||
<div>添加网格</div>
|
||||
</div>
|
||||
|
||||
<u-popup v-model="show" mode="bottom" border-radius="14" height="1000">
|
||||
<div class="popup">
|
||||
<div class="bg"></div>
|
||||
<div class="title">{{ form.girdName }}</div>
|
||||
<div class="info-flex">
|
||||
<span class="label">网格类型</span>
|
||||
<span class="value">{{ $dict.getLabel('girdType', form.girdType) }}</span>
|
||||
</div>
|
||||
<div class="info-flex">
|
||||
<span class="label">网格层级</span>
|
||||
<span class="value">{{ $dict.getLabel('girdLevel', form.girdLevel) }}</span>
|
||||
</div>
|
||||
<div v-if="form.girdMemberManageList && form.girdMemberManageList.length">
|
||||
<div class="info-flex" v-for="(item, index) in form.girdMemberManageList" :key="index">
|
||||
<span class="label">网格长</span>
|
||||
<span class="value">
|
||||
<AiOpenData v-if="item.wxUserId" type="userName" :openid="item.wxUserId" style="display:inline-block;" />
|
||||
<!-- {{ item.phone }}
|
||||
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
|
||||
v-if="item.phone"> -->
|
||||
</span>
|
||||
</div>
|
||||
</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="value">
|
||||
<AiOpenData v-if="item.wxUserId" type="userName" :openid="item.wxUserId" style="display:inline-block;" />
|
||||
<!-- {{ item.phone }}
|
||||
<img :src="$cdn + 'common/phone.png'" alt="" @click="callPhone(item.phone)" class="phone-icon"
|
||||
v-if="item.phone"> -->
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:56px;"></div>
|
||||
<div class="btn" v-if="form.girdRight == 1">
|
||||
<span class="del" @click="del">删除网格</span>
|
||||
<span class="edit" @click="edit">编辑网格</span>
|
||||
</div>
|
||||
</div>
|
||||
</u-popup>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
`
|
||||
<script>
|
||||
export default {
|
||||
name: 'setGird',
|
||||
@@ -88,17 +47,12 @@ export default {
|
||||
treeList: [],
|
||||
slectList: [],
|
||||
userList: [],
|
||||
|
||||
show: false,
|
||||
form: {},
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$dict.load('girdType', 'girdLevel')
|
||||
this.isGirdUser()
|
||||
uni.$on('update', () => {
|
||||
this.show = false
|
||||
this.getTree()
|
||||
uni.$on('update', () => {
|
||||
this.getAllGrids()
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
@@ -110,75 +64,71 @@ export default {
|
||||
if (res.code == 0) {
|
||||
if (res.data.checkType) {
|
||||
this.userGird = res.data
|
||||
this.getTree()
|
||||
this.getAllGrids()
|
||||
} else {
|
||||
this.$u.toast('当前人员不是网格员或网格管理员')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
getTree() {
|
||||
getAllGrids() {
|
||||
this.slectList = []
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=0&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=`).then((res) => {
|
||||
let {girdMemberId} = this.userGird
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel`, null, {
|
||||
params: {girdMemberId}
|
||||
}).then((res) => {
|
||||
if (res?.data) {
|
||||
this.allData = 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
|
||||
this.treeList = this.allData.filter(e => !e.parentGirdId)
|
||||
this.treeList.map((item) => {
|
||||
item.isChecked = false
|
||||
})
|
||||
var obj = {
|
||||
let obj = {
|
||||
girdName: '可选范围',
|
||||
id: '',
|
||||
girdLevel: '0'
|
||||
}
|
||||
this.slectList.push(obj)
|
||||
},
|
||||
|
||||
itemClick(row) {
|
||||
if(row.girdLevel == 2) return
|
||||
var obj = {
|
||||
let obj = {
|
||||
girdName: row.girdName,
|
||||
id: row.id,
|
||||
girdLevel: row.girdLevel
|
||||
}
|
||||
|
||||
this.slectList.push(obj)
|
||||
this.searckGird(row)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
},
|
||||
|
||||
searckGird(row) {
|
||||
if(row.girdLevel == 2) return
|
||||
var girdLevel = Number(row.girdLevel)+1
|
||||
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel?girdLevel=${girdLevel}&girdMemberId=${this.userGird.girdMemberId}&parentGirdId=${row.id}`).then((res) => {
|
||||
if (res?.data) {
|
||||
this.treeList = res.data
|
||||
this.setGird = {}
|
||||
}
|
||||
})
|
||||
getGridsByGridMemberAndParent(row) {
|
||||
let {id: parentGirdId} = row
|
||||
this.setGird = {}
|
||||
this.treeList = this.allData.filter(e => e.parentGirdId == parentGirdId)
|
||||
},
|
||||
|
||||
girdNameClick(row, index) {
|
||||
this.userList = []
|
||||
if(!index) { //第一级别
|
||||
if (!index) { //第一级别
|
||||
this.slectList = []
|
||||
this.treeInit()
|
||||
}else {
|
||||
} else {
|
||||
var list = []
|
||||
this.slectList.map((item, i) => {
|
||||
if(i <= index) {
|
||||
if (i <= index) {
|
||||
list.push(item)
|
||||
}
|
||||
})
|
||||
this.slectList = list
|
||||
this.searckGird(row)
|
||||
this.getGridsByGridMemberAndParent(row)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
girdClick(row, index) {
|
||||
if (this.treeList[index].isChecked) {//取消
|
||||
@@ -195,29 +145,9 @@ export default {
|
||||
},
|
||||
|
||||
showGirdInfo(row) {
|
||||
this.show = true
|
||||
this.form = row
|
||||
uni.navigateTo({url: `./gridMembers?id=${row.id}`})
|
||||
},
|
||||
|
||||
del() {
|
||||
this.$confirm('删除网格后,会清除网格内网格员和责任家庭信息,如有下级网格,会同步删除下级网格所有数据', `您确认要删除该网格?`).then(() => {
|
||||
this.$http.post(`/app/appgirdinfo/delete?ids=${this.form.id}`).then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('删除成功!')
|
||||
this.show = false
|
||||
this.form = {}
|
||||
this.treeList = []
|
||||
this.isGirdUser()
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$u.toast(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
edit() {
|
||||
uni.navigateTo({url: `./AddGird?id=${this.form.id}&fromType=edit`})
|
||||
},
|
||||
|
||||
callPhone(phone) {
|
||||
uni.makePhoneCall({phoneNumber: phone})
|
||||
@@ -239,6 +169,7 @@ export default {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
padding-bottom: 140px;
|
||||
|
||||
.header-top {
|
||||
background: #fff;
|
||||
padding: 20px 32px;
|
||||
@@ -285,34 +216,36 @@ export default {
|
||||
margin: 0 20px 0 36px;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
width: 74px;
|
||||
height: 74px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rightes {
|
||||
width: calc(100% - 178px);
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
display: flex;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 16px;
|
||||
|
||||
.applicationNames {
|
||||
display: inline-block;
|
||||
width: calc(100% - 100px);
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.right-icon{
|
||||
|
||||
.right-icon {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.imgs {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -336,6 +269,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
|
||||
.imgselect {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
@@ -357,11 +291,13 @@ export default {
|
||||
margin-left: 32px;
|
||||
border-bottom: 1px solid #e4e5e6;
|
||||
padding-right: 40px;
|
||||
|
||||
.applicationNames {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.idNumbers {
|
||||
color: #666;
|
||||
}
|
||||
@@ -377,6 +313,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 118px;
|
||||
background: #f4f8fb;
|
||||
|
||||
div {
|
||||
width: 192px;
|
||||
height: 80px;
|
||||
@@ -402,76 +339,7 @@ export default {
|
||||
margin: 32px 0 32px 344px;
|
||||
}
|
||||
|
||||
.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;
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
.border-b0{
|
||||
border-bottom: 0;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user