Files
dvcp_v2_wxcp_app/src/saas/AppSpecialPeople/AppSpecialPeople.vue

465 lines
11 KiB
Vue
Raw Normal View History

2022-01-25 16:31:39 +08:00
<template>
2022-05-06 18:57:58 +08:00
<div class="detail">
<div class="tab-select">
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{ item }}<span></span>
</div>
</div>
<div class="area-select">
<div class="select-content">
<div class="search-input" v-if="tabIndex">
<u-search placeholder="请输入姓名、身份证号、手机号" v-model="name" maxlength="20" placeholder-style="color:#999;font-size:13px;" :show-action="false" height="18"
@search="getUserList" @clear="getUserList"></u-search>
</div>
</div>
</div>
<div v-show="!tabIndex">
<div class="info-content">
<div class="title">特殊人群</div>
<div class="num-content">
<div class="num-item" v-for="(item, index) in statisticsList" :key="index">
<h3>
{{ item.value }}
</h3>
<p>{{ item.label }}</p>
</div>
<AiEmpty v-if="!statisticsList.length"/>
</div>
</div>
<div class="info-content">
<div class="title">本月新增</div>
<div class="num-content color-org">
<div class="num-item" v-for="(item, index) in statisticsListMon" :key="index">
<h3>{{ item.value }}</h3>
<p>{{ item.label }}</p>
</div>
<AiEmpty v-if="!statisticsListMon.length"/>
</div>
</div>
</div>
<div v-show="tabIndex">
<div class="item-content" v-for="(item, index) in typeList" :key="index">
<div class="title" @click="showUserType(item)">
<h2>
{{ item.dictName }}
</h2>
<img src="./img/down-icon.png" alt="" :class="type === item.dictValue ? 'img-active' : ''">
</div>
<div class="user-list" v-if="type == item.dictValue && type !== ''">
<div class="user-item" v-for="(e, indexs) in userList" :key="indexs">
<div class="user-img">
<img src="./img/user-img.png" alt="">
</div>
<div class="user-info">
<p class="name">{{ e.name }}
<span class="btn-icon" v-if="isGridMember && user.wxUserId == e.createUserId">
<img src="./img/edit-icon.png" alt="" @click="toEdit(e,item.dictValue)">
<img src="./img/del-icon.png" alt="" @click="del(e,item.dictValue)">
</span>
</p>
<div class="phone">
<span>{{ idNumberInit(e.idNumber) }}</span>
<span>{{ e.phone }}</span>
</div>
</div>
</div>
<p class="text" v-if="!userList.length">{{ '暂无' + item.dictName + '信息' }}</p>
</div>
</div>
<div class="footer" @click="toAdd" v-if="isGridMember">
<div class="btn">新增特殊人群信息</div>
</div>
</div>
2022-01-25 16:31:39 +08:00
</div>
</template>
<script>
2022-05-06 18:57:58 +08:00
import {mapState} from 'vuex'
2022-01-25 16:31:39 +08:00
export default {
name: 'AppSpecialPeople',
appName: '特殊人群',
data() {
return {
2022-05-06 18:57:58 +08:00
areaId: '',
areaName: '',
tabs: ['统计信息', '人员信息'],
tabIndex: 0,
addressArea: '',
statisticsList: [],
statisticsListMon: [],
userList: [],
name: '',
typeList: [],
type: '',
current: 1,
2022-01-25 16:31:39 +08:00
}
},
2022-05-06 18:57:58 +08:00
computed: {
...mapState(['user']),
isGridMember() {
return this.user.girdCheckType > 0
}
},
created() {
this.$dict.load('appSpecialTypeFive').then(() => {
this.typeList = this.$dict.getDict('appSpecialTypeFive')
this.areaId = this.user.areaId
this.areaName = this.user.areaName
})
uni.$on('specialPeopleList', () => {
this.getStatistic()
this.getUserList()
})
},
onShow() {
document.title = '特殊人群管理'
this.getStatistic()
this.getUserList()
},
2022-01-25 16:31:39 +08:00
methods: {
2022-05-06 18:57:58 +08:00
areaSelect(e) {
this.areaId = e
this.getStatistic()
this.getUserList()
},
tabClick(index) {
this.tabIndex = index
},
getStatistic() {
this.statisticsList = []
this.statisticsListMon = []
this.$http.post(`app/appspecialadjustment/statistic?type=0&range=0`).then((res) => {
if (res?.data) {
for (let i in res.data.map) {
var obj = {
label: i,
value: res.data.map[i],
}
this.statisticsList.push(obj)
}
for (let n in res.data.monthMap) {
var objmon = {
label: n,
value: res.data.monthMap[n]
}
this.statisticsListMon.push(objmon)
}
}
})
},
getUserList() {
this.userList = []
this.$http.post(`app/appspecialadjustment/allList?size=20&current=${this.current}`, {type: this.type, name: this.name}).then((res) => {
if (res?.data) {
if (this.current > res.data.total) {
return
}
this.userList = this.current > 1 ? [...this.userList, ...res.data.records] : res.data.records
}
})
},
toAdd() {
uni.navigateTo({url: './add'})
},
idNumberInit(idNumber) {
if (!idNumber) {
idNumber = ''
} else {
idNumber = idNumber.substring(0, 6) + '********' + idNumber.substring(14, 18)
}
return idNumber
},
showUserType(item) {
if (item.dictValue != this.type) {
this.type = item.dictValue
this.current = 1
this.userList = []
this.getUserList()
} else {
this.type = ''
}
},
toEdit(row, index) {
uni.navigateTo({
url: `./add?id=${row.id}&index=${index}`
})
},
del(row, indexs) {
var delUrl = ['/app/appspecialdisabled/delete', '/app/appspecialmental/delete',
'/app/appspecialadjustment/delete', '/app/appspecialdrug/delete', '/app/appspecialprison/delete'
]
this.$confirm('确定删除该数据?').then(() => {
uni.showLoading()
this.$http.post(delUrl[indexs], null, {params: {ids: row.id}}).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getUserList()
}
uni.hideLoading()
})
}).catch(() => {
2022-01-25 16:31:39 +08:00
})
}
},
2022-05-06 18:57:58 +08:00
onReachBottom() {
this.current++
this.getUserList()
}
2022-01-25 16:31:39 +08:00
}
</script>
<style lang="scss" scoped>
2022-05-06 18:57:58 +08:00
.detail {
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975C6;
display: flex;
.item {
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #CDDCF0;
}
.active {
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
span {
width: 48px;
height: 4px;
background: #FFF;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.area-select {
width: 100%;
background: #FFF;
padding-left: 32px;
box-sizing: border-box;
.select-content {
width: 100%;
padding: 24px 32px 24px 0;
display: flex;
justify-content: space-between;
font-family: PingFangSC-Regular, PingFang SC;
color: #333;
line-height: 44px;
box-sizing: border-box;
display: flex;
.area-content {
width: calc(100% - 402px);
line-height: 64px;
img {
width: 42px;
vertical-align: middle;
margin-right: 16px;
}
.u-icon {
margin-left: 6px;
}
}
.search-input {
width: 100%;
height: 64px;
background: #F5F5F5;
border-radius: 32px;
box-sizing: border-box;
position: relative;
line-height: 64px;
}
}
}
.info-content {
width: calc(100% - 64px);
background: #FFF;
border-radius: 8px;
margin: 24px 32px 0;
.title {
padding-left: 32px;
line-height: 94px;
border-bottom: 1px solid #ddd;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
}
.num-content {
overflow: hidden;
.num-item {
float: left;
width: 33%;
padding: 40px 0;
text-align: center;
h3 {
font-size: 64px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #3192F4;
line-height: 74px;
margin-bottom: 10px;
}
p {
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #999;
line-height: 40px;
}
}
}
.color-org {
.num-item {
h3 {
color: #FF8700;
}
}
}
}
.item-content {
margin-bottom: 4px;
.title {
width: 100%;
height: 108px;
line-height: 108px;
background: #FFF;
padding: 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
h2 {
font-size: 32px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #333;
}
img {
width: 34px;
height: 34px;
margin-top: 38px;
transition: all .3s ease-in-out;
}
.img-active {
transform: rotate(180deg);
}
}
.user-list {
background-color: #fff;
.user-item {
padding: 24px 32px;
display: flex;
.user-img {
width: 112px;
img {
width: 80px;
height: 80px;
}
}
.user-info {
width: 100%;
border-bottom: 1px solid #ddd;
.name {
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333;
line-height: 44px;
margin-bottom: 8px;
.btn-icon {
float: right;
img {
width: 48px;
height: 48px;
margin-left: 40px;
vertical-align: baseline;
}
}
}
.phone {
width: 100%;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 36px;
display: flex;
justify-content: space-between;
}
}
}
.user-item:nth-last-child(1) {
.user-info {
border-bottom: none;
}
}
}
}
.text {
height: 96px;
line-height: 96px;
color: #999;
font-size: 28px;
text-align: center;
}
.footer {
width: 100%;
position: fixed;
bottom: 0;
left: 0;
}
2022-01-25 16:31:39 +08:00
2022-05-06 18:57:58 +08:00
.btn {
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
background: #1365DD;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFF;
}
2022-01-25 16:31:39 +08:00
}
</style>