1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<template>
<div class="flex flex-col screening-list" style="height: 100vh">
<div class="p-3 text-black text-center shrink-0 doc-nav-bar" v-if='showNav()'>
<span>慢病筛查记录</span>
</div>
<van-tabs v-model:active='activeTab' class='shrink-0 doc-tabs' v-if='tabList.length'
@change='tabChange'
shrink>
<van-tab v-for='item in tabList' :key='item.name'
:title='item.title' :name='item.name'></van-tab>
</van-tabs>
<div class='grow overflow-y-auto' ref='list'>
<van-pull-refresh v-model='loadingRefresh' @refresh='onRefresh'
:disabled='isRefreshDisable' style="min-height: 100%">
<van-list
v-model:loading='loading'
:finished='finished'
:finished-text="list.length ? '没有更多了' : ''"
:immediate-check='false'
@load='onMore'
>
<div class="p-2 flex flex-col gap-y-2.5 card-list">
<div class="py-3 px-4 card" v-for='item in list' :key="item.id"
@click="toDetail(item)">
<div>
<span class="label">居民姓名</span>
<span>{{ userInfo.residentName }}</span>
</div>
<div>
<span class="label">证件号码</span>
<span>{{ $idCardHide(userInfo.idCard) }}</span>
</div>
<div>
<span class="label">筛查日期</span>
<span>{{ item.screenDate }}</span>
</div>
<div>
<span class="label">筛查机构</span>
<span>{{ item.screenUnitName }}</span>
</div>
<span class="tag tag-red" v-show="activeTab == '1'">高危筛查</span>
<span class="tag tag-blue" v-show="activeTab == '2'">专病筛查</span>
</div>
</div>
</van-list>
<div class='text-center shrink-0 empty' v-if='!list.length'>
<img src='@/assets/image/doctor/empty.png' alt='' style='width: 1.2rem;'>
<p>暂无数据</p>
</div>
</van-pull-refresh>
</div>
</div>
</template>
<script>
import { useStore } from '@/residentWX/store'
import { queryScreenList } from '@/api/residentWX/screening.js'
import { showNav } from '@/utils/common'
export default {
inject:['showNav', 'isResidentInfo'],
data() {
return {
store: useStore(),
activeTab: '1',
tabList: [
{ title: '高危筛查', name: '1' },
{ title: '专病筛查', name: '2' }
],
list: [],
pagination: {
total: 0,
pageIndex: 1,
pageSize: 8
},
loading: false,
finished: false,
loadingRefresh: false,
isRefreshDisable: false
}
},
computed: {
routeQuery() {
return this.$route.query
},
idCard() {
return this.routeQuery.idCard
},
userInfo() {
return this.store.userInfo
},
},
created() {
if (!this.showNav()) {
document.title = '慢病筛查记录'
}
this.load()
},
mounted() {
const list = this.$refs.list
list.addEventListener('scroll', () => {
if (list.scrollTop > 0) {
this.isRefreshDisable = true
} else {
this.isRefreshDisable = false
}
})
},
methods: {
load(loading = true) {
if (!this.isResidentInfo()) return
const query = {
screeningType: this.activeTab,
residentInfoId: this.userInfo.residentInfoId,
pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
queryScreenList(query, loading).then(res => {
if (this.pagination.pageIndex === 1) {
this.list = []
}
this.list = this.list.concat(res.data.dataList || [])
this.pagination.total = res.data.total || 0
this.finished = this.list.length >= this.pagination.total
}).finally(() => {
this.loading = false
this.loadingRefresh = false
})
},
onMore() {
this.pagination.pageIndex++
this.load()
},
onRefresh() {
this.pagination.pageIndex = 1
this.load(false)
},
tabChange() {
this.pagination.pageIndex = 1
this.load()
},
toDetail(record) {
if (!record) return
let path = `/residentWX/screening/firstDetail/${record.id}`
if (this.activeTab == '2') {
path = `/residentWX/screening/SecondDetail/${record.id}`
}
this.$router.push({ path })
}
}
}
</script>
<style lang="less" scoped>
@import url('../utils/common.less');
.screening-list {
background-color: #f9f9f9;
}
.card-list {
padding-bottom: .3rem;
}
.card {
position: relative;
background-color: #fff;
border-radius: 12px;
>div {
display: flex;
margin-bottom: 8px;
&:last-of-type {
margin-bottom: 0!important;
}
}
.label {
min-width: 6em;
color: #8C8C8C;
}
}
.tag {
position: absolute;
top: 8px;
right: 8px;
border-radius: 2px;
padding: 4px 8px;
font-size: 12px;
}
.tag-red {
border: 1px solid #FFA39E;
color: #F5222D;
background-color: #FFF1F0;
}
.tag-blue {
border: 1px solid #ADC6FF;
color: #2F54EB;
background-color: #F0F5FF;
}
</style>