Files
dvcp_v2_wxcp_app/library/apps/AppHelpDeclaration/AppHelpDeclaration.vue

323 lines
7.8 KiB
Vue
Raw Normal View History

2022-05-19 13:35:55 +08:00
<template>
2022-08-22 16:11:17 +08:00
<div class="AppHelpDeclaration">
2022-05-19 13:35:55 +08:00
<AiTopFixed>
<div class="tab-select">
2022-08-22 16:11:17 +08:00
<div class="item" :class="tabIndex == index ? 'active' : ''" v-for="(item, index) in tabs" :key="index" @click="tabClick(index)">{{ item }}<span></span>
</div>
2022-05-19 13:35:55 +08:00
</div>
<div class="select-box">
2022-05-20 09:55:14 +08:00
<div class="left">
2022-05-20 10:37:11 +08:00
<AiAreaPicker v-model="areaId" :areaId="user.areaId" :name.sync="areaName" @select="areaSelect" selectRoot>
2022-05-20 09:22:13 +08:00
<div>
2022-05-20 10:14:39 +08:00
<span v-if="areaId" style="color:#333;fontSize: 14px;" class="areaName">{{ areaName }}</span>
2022-05-19 13:35:55 +08:00
<span v-else style="color: #999;fontSize: 14px;" class="areaName">所在地区</span>
2022-08-22 16:11:17 +08:00
<u-icon name="arrow-down" color="#999" size="24" style="margin-left: 4px;width: 14px;display:inline-block;margin-top:18px"
@select="areaSelect(e)"></u-icon>
2022-05-19 13:35:55 +08:00
</div>
</AiAreaPicker>
</div>
2022-05-20 09:55:14 +08:00
<div class="right">
2022-05-20 16:21:11 +08:00
<AiSelect v-model="declareReason" :list="riskList" @data="typeSelect">
2022-05-19 15:41:49 +08:00
<span v-if="!declareReason" style="color: #999;">风险类型</span>
<span v-else>{{ $dict.getLabel('helpDeclarationReason', declareReason) }}</span>
2022-05-19 13:35:55 +08:00
<u-icon name="arrow-down" color="#999" size="24" style="margin-left: 4px;width: 14px;display:inline-block;"></u-icon>
2022-05-20 16:10:00 +08:00
<!-- <u-icon name="close-circle" v-if="declareReason" @click="clearReason" color="#999" size="24"></u-icon> -->
2022-05-19 13:35:55 +08:00
</AiSelect>
</div>
</div>
</AiTopFixed>
<div v-if="list.length">
2022-05-19 15:41:49 +08:00
<div class="card_list">
<div class="card" v-for="(item,index) in list" :key="index" @click="toDetail(item.id)">
2022-05-19 13:35:55 +08:00
<div class="top">
<div class="title">{{ item.riskDescription }}</div>
2022-05-20 16:37:29 +08:00
2022-08-22 16:11:17 +08:00
<div class="info"><p>申请人姓名</p>
<p>{{ item.name }}</p></div>
<div class="info"><p>所在地区</p>
<p>{{ item.areaName }}</p></div>
<div class="info"><p>风险类型</p>
<p>{{ item.reason }}</p></div>
2022-05-19 13:35:55 +08:00
</div>
<div class="bottom">
<span :style="{background: item.status == 0? '#FF883C':item.status == 1? '#1AAAFF': item.status==2? '#FF4466': '#42D784'}"></span>
2022-08-22 16:11:17 +08:00
<span :class="item.status == 0? 'status0': item.status==1? 'status1': item.status==2? 'status3': 'status2'">{{
$dict.getLabel('helpDeclarationStatus', item.status)
}}</span>
2022-05-19 13:35:55 +08:00
</div>
</div>
</div>
</div>
<AiEmpty v-else description="暂无数据"/>
2022-05-19 16:12:11 +08:00
<!-- <AiFixedBtn>
2022-05-19 13:35:55 +08:00
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAdd()"/>
2022-05-19 16:12:11 +08:00
</AiFixedBtn> -->
<div style="height: 56px"></div>
<div class="btn" @click="toAdd">申请帮扶</div>
2022-05-19 13:35:55 +08:00
</div>
</template>
<script>
2022-08-22 16:11:17 +08:00
import {mapState} from 'vuex'
2022-05-19 13:35:55 +08:00
export default {
2022-08-22 16:11:17 +08:00
name: "AppHelpDeclaration",
appName: "申报审批",
2022-05-19 13:35:55 +08:00
data() {
return {
2022-08-22 16:11:17 +08:00
tabs: ['全部待办', '办理历史'],
2022-05-19 13:35:55 +08:00
tabIndex: 0,
current: 1,
areaId: '',
areaName: '',
2022-05-19 15:41:49 +08:00
declareReason: '',
2022-05-20 09:22:13 +08:00
list: [],
2022-05-20 15:41:08 +08:00
riskList: [],
2022-05-19 13:35:55 +08:00
}
},
2022-05-20 10:37:11 +08:00
computed: {
...mapState(['user'])
},
2022-05-19 13:35:55 +08:00
onShow() {
2022-07-21 09:49:21 +08:00
this.$dict.load('helpDeclarationReason', 'helpDeclarationStatus').then(() => {
2022-05-20 15:41:08 +08:00
this.riskList = this.$dict.getDict('helpDeclarationReason').map((item) => ({
label: item.dictName,
value: item.dictValue
}))
this.riskList.unshift({label: "全部", value: ""})
2022-05-20 17:02:58 +08:00
})
uni.$on('update', () => {
this.getList()
2022-05-19 15:41:49 +08:00
})
2022-05-19 13:35:55 +08:00
this.getList()
},
methods: {
tabClick(index) {
this.current = 1,
2022-08-22 16:11:17 +08:00
this.list = [],
this.tabIndex = index,
this.getList()
2022-05-19 13:35:55 +08:00
},
2022-05-20 10:37:11 +08:00
areaSelect(e) {
2022-08-22 16:11:17 +08:00
this.areaId = e
2022-05-20 10:37:11 +08:00
this.$nextTick(() => {
this.getList()
})
},
2022-05-20 16:21:11 +08:00
typeSelect(e) {
this.declareReason = e[0].value
this.current = 1,
2022-08-22 16:11:17 +08:00
this.list = [],
this.getList()
2022-05-20 16:21:11 +08:00
},
2022-05-20 09:22:13 +08:00
clearArea() {
2022-05-20 09:55:14 +08:00
this.areaId = '',
2022-08-22 16:11:17 +08:00
this.areaName = '',
this.current = 1,
this.list = [],
this.getList()
2022-05-20 09:22:13 +08:00
},
clearReason() {
2022-05-20 09:55:14 +08:00
this.declareReason = '',
2022-08-22 16:11:17 +08:00
this.current = 1,
this.list = [],
this.getList()
2022-05-20 09:22:13 +08:00
},
2022-05-19 13:35:55 +08:00
getList() {
2022-08-22 16:11:17 +08:00
this.$http.post('/app/apphelpdeclarationinfo/listByEw', null, {
2022-05-19 13:35:55 +08:00
params: {
current: this.current,
2022-05-19 15:41:49 +08:00
searchType: this.tabIndex,
2022-05-20 09:22:13 +08:00
areaId: this.areaId,
2022-05-19 15:41:49 +08:00
declareReason: this.declareReason // 风险类型
2022-05-19 13:35:55 +08:00
}
}).then((res) => {
2022-08-22 16:11:17 +08:00
if (res?.data) {
this.list = this.current == 1 ? res.data.records : [...this.list, ...res.data.records]
2022-05-19 13:35:55 +08:00
}
})
},
toAdd() {
2022-08-22 16:11:17 +08:00
uni.navigateTo({url: './add'})
2022-05-19 13:35:55 +08:00
},
2022-05-19 15:41:49 +08:00
toDetail(id) {
uni.navigateTo({url: `./details?id=${id}`})
},
2022-05-19 13:35:55 +08:00
onReachBottom() {
2022-08-22 16:11:17 +08:00
this.current++
2022-05-19 13:35:55 +08:00
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
2022-08-22 16:11:17 +08:00
.AppHelpDeclaration {
2022-08-22 15:47:29 +08:00
padding: 0;
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
::v-deep .AiTopFixed .content {
padding: 0;
}
2022-08-22 16:11:17 +08:00
::v-deep .AiSelect .display {
2022-05-20 09:55:14 +08:00
justify-content: center;
}
2022-05-19 13:35:55 +08:00
.tab-select {
width: 100%;
height: 96px;
line-height: 96px;
background: #3975C6;
display: flex;
2022-08-22 16:11:17 +08:00
.item {
2022-05-19 13:35:55 +08:00
flex: 1;
text-align: center;
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #CDDCF0;
}
2022-08-22 16:11:17 +08:00
.active {
2022-05-19 13:35:55 +08:00
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
position: relative;
color: #fff;
2022-08-22 16:11:17 +08:00
span {
2022-05-19 13:35:55 +08:00
width: 48px;
height: 4px;
background: #FFF;
position: absolute;
bottom: 14px;
left: 50%;
margin-left: -24px;
}
}
}
.select-box {
display: flex;
height: 96px;
line-height: 96px;
width: 100%;
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.left,
.right {
flex: 1;
text-align: center !important;
font-size: 28px;
2022-05-20 09:55:14 +08:00
2022-08-22 16:11:17 +08:00
::v-deep .u-icon .uicon-close-circle {
2022-05-20 09:55:14 +08:00
top: -96px !important;
left: 80px;
2022-05-20 10:37:11 +08:00
margin-left: 30px;
width: 14px;
2022-08-22 16:11:17 +08:00
display: inline-block;
2022-05-20 09:55:14 +08:00
}
2022-05-19 13:35:55 +08:00
}
}
.card_list {
2022-05-19 15:41:49 +08:00
padding: 24px 32px;
2022-05-19 13:35:55 +08:00
box-sizing: border-box;
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.card {
background: #FFFFFF;
box-shadow: 0px 0px 8px 0px #00000005;
border-radius: 16px;
margin-bottom: 24px;
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.top {
padding: 32px;
box-sizing: border-box;
border-bottom: 2px solid #DDDDDD;
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.title {
color: #333333;
font-size: 32px;
font-weight: 600;
2022-08-22 16:11:17 +08:00
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
2022-05-20 16:37:29 +08:00
margin-bottom: 24px;
2022-05-19 13:35:55 +08:00
}
2022-08-22 16:11:17 +08:00
2022-05-20 16:37:29 +08:00
.info {
2022-05-20 18:16:27 +08:00
p:first-child {
vertical-align: center;
2022-05-20 16:37:29 +08:00
color: #999999;
font-size: 26px;
display: inline-block;
width: 160px;
}
2022-08-22 16:11:17 +08:00
2022-05-20 18:16:27 +08:00
p:last-child {
vertical-align: bottom;
2022-05-20 16:37:29 +08:00
display: inline-block;
width: calc(100% - 160px);
2022-08-22 16:11:17 +08:00
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
2022-05-20 16:37:29 +08:00
}
2022-05-19 13:35:55 +08:00
}
}
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.bottom {
padding: 32px;
box-sizing: border-box;
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
span:first-child {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
margin-right: 8px;
background: #FF4466;
}
}
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.status0 {
color: #FF883C
}
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.status1 {
color: #1AAAFF
}
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.status2 {
color: #42D784
}
2022-08-22 16:11:17 +08:00
2022-05-19 13:35:55 +08:00
.status3 {
color: #FF4466
}
}
}
2022-05-19 16:12:11 +08:00
.btn {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 112px;
line-height: 112px;
text-align: center;
color: #FFF;
background: #3975C6;
}
2022-05-19 13:35:55 +08:00
}
2022-08-22 15:47:29 +08:00
</style>