Files
dvcp_v2_wxcp_app/library/apps/AppHelpEffect/AppHelpEffect.vue

158 lines
3.7 KiB
Vue
Raw Normal View History

2022-07-21 10:19:50 +08:00
<template>
<div class="AppHelpEffect">
2022-07-21 15:03:23 +08:00
<AiTopFixed>
2022-08-17 15:00:02 +08:00
<u-tabs :list="tabs" :is-scroll="false" :current="currentTab" height="96" bar-width="150" @change="v=>{currentTab=v,current=1,con=null}"/>
2022-08-15 18:39:33 +08:00
<div class="search">
2022-08-17 14:57:35 +08:00
<u-search :placeholder="`请搜索姓名${currentTab==1?'':'、身份证号'}`" @clear="con='',getList()" clearable v-model="con" :show-action="false"
@search="search"/>
2022-08-15 18:39:33 +08:00
</div>
2022-07-21 15:03:23 +08:00
<div class="select">
2022-08-15 18:39:33 +08:00
<AiAreaPicker class="fill" v-model="areaId" :area-id="user.areaId" :name.sync="areaName" @select="areaSelect" selectRoot>
<div flex class="center">
<u-icon name="map-fill" size="32" color="#999" class="mar-r8"/>
<AiMore icon="arrow-down" v-model="areaName" placeholder="所在地区"/>
</div>
</AiAreaPicker>
<AiSelect v-if="currentTab=='0'" class="fill center" flex v-model="houseType" :list="typeList" @data="typeSelect">
<AiMore class="fill" icon="arrow-down" v-model="$dict.getLabel('fpHouseType', houseType)" placeholder="户类型"/>
</AiSelect>
2022-07-21 15:03:23 +08:00
</div>
</AiTopFixed>
<div class="cardList">
2022-08-15 18:39:33 +08:00
<component ref="List" :is="currentPage.list" v-bind="{current,search:{areaId,houseType,con}}"/>
2022-07-21 15:03:23 +08:00
</div>
2022-07-21 10:19:50 +08:00
</div>
</template>
<script>
2022-07-21 16:03:34 +08:00
import {mapState} from 'vuex'
2022-08-15 18:39:33 +08:00
import HelpedResidentList from "./helpedResidentList";
import NormalFarmerList from "./normalFarmerList";
2022-07-21 10:19:50 +08:00
export default {
name: "AppHelpEffect",
2022-08-15 18:39:33 +08:00
components: {NormalFarmerList, HelpedResidentList},
2022-07-21 10:19:50 +08:00
appName: '帮扶成效',
data() {
2022-07-21 15:03:23 +08:00
return {
2022-08-15 18:39:33 +08:00
con: "",
2022-07-21 15:03:23 +08:00
current: 1,
typeList: [],
2022-07-21 16:03:34 +08:00
areaId: '',
areaName: '',
houseType: '',
2022-08-15 18:39:33 +08:00
currentTab: '0'
2022-07-21 15:03:23 +08:00
}
},
2022-07-21 16:03:34 +08:00
computed: {
2022-08-15 18:39:33 +08:00
...mapState(['user']),
tabs: () => [
{name: "监测对象", list: HelpedResidentList},
{name: "一般农户", list: NormalFarmerList}
],
currentPage: v => v.tabs[v.currentTab] || {}
2022-07-21 16:03:34 +08:00
},
2022-07-21 15:03:23 +08:00
methods: {
2022-07-21 16:03:34 +08:00
areaSelect(e) {
2022-07-21 18:02:04 +08:00
this.areaId = e
2022-08-15 18:39:33 +08:00
this.refreshList()
2022-07-21 16:03:34 +08:00
},
typeSelect(v) {
this.houseType = v?.[0].value
2022-08-15 18:39:33 +08:00
this.refreshList()
2022-07-21 16:03:34 +08:00
},
2022-07-21 18:02:04 +08:00
search(value) {
this.name = value
2022-08-15 18:39:33 +08:00
this.refreshList()
2022-07-21 18:02:04 +08:00
},
2022-08-15 18:39:33 +08:00
refreshList() {
this.current = 1
this.$nextTick(() => this.$refs.List.getList(true))
}
},
onLoad() {
this.areaId = this.user.areaId
this.$dict.load('fpHouseType').then(() => {
this.typeList = this.$dict.getDict('fpHouseType').map((item) => {
return {
label: item.dictName,
value: item.dictValue
2022-07-21 15:03:23 +08:00
}
})
2022-08-15 18:39:33 +08:00
this.typeList.unshift({label: '全部类型', value: ''})
})
2022-07-21 10:19:50 +08:00
},
onShow() {
document.title = '帮扶成效'
2022-08-17 14:55:41 +08:00
this.refreshList()
2022-08-15 18:39:33 +08:00
},
onReachBottom() {
this.current++
2022-07-21 10:19:50 +08:00
}
}
</script>
<style lang="scss" scoped>
.AppHelpEffect {
2022-07-21 15:03:23 +08:00
.search {
height: 100px;
line-height: 100px;
}
2022-08-15 18:39:33 +08:00
.center {
justify-content: center;
text-align: center;
}
2022-07-21 15:03:23 +08:00
.select {
width: 100%;
display: flex;
2022-07-21 16:03:34 +08:00
height: 86px;
line-height: 86px;
text-align: center;
2022-07-21 10:19:50 +08:00
}
2022-08-15 18:39:33 +08:00
::v-deep .cardList {
2022-07-21 15:03:23 +08:00
padding: 32px;
box-sizing: border-box;
2022-08-15 18:39:33 +08:00
2022-07-21 15:03:23 +08:00
.card {
padding: 32px;
box-sizing: border-box;
margin-bottom: 32px;
background: #FFF;
2022-08-15 18:39:33 +08:00
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.0200);
2022-07-21 15:03:23 +08:00
border-radius: 16px;
2022-08-15 18:39:33 +08:00
2022-07-21 15:03:23 +08:00
.user {
display: flex;
justify-content: space-between;
2022-08-15 18:39:33 +08:00
2022-07-21 15:03:23 +08:00
.name {
font-size: 36px;
font-weight: 600;
}
}
2022-08-15 18:39:33 +08:00
2022-07-21 15:03:23 +08:00
.idCard,
.tel,
.address {
margin-top: 8px;
color: #999999;
2022-08-15 18:39:33 +08:00
2022-07-21 15:03:23 +08:00
img {
2022-07-21 17:24:40 +08:00
margin-right: 16px;
2022-07-21 15:03:23 +08:00
width: 28px;
height: 28px;
}
}
2022-08-15 18:39:33 +08:00
2022-07-21 17:24:40 +08:00
.tel,
.address {
color: #333;
}
2022-07-21 15:03:23 +08:00
}
}
2022-07-21 10:19:50 +08:00
}
2022-08-15 18:39:33 +08:00
</style>