123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- <template>
- <div class="page_patientManagement">
- <div class="patientBox" v-if="patients.length > 0">
- <van-list
- v-model="loading"
- :finished="finished"
- finished-text="没有更多了"
- @load="onLoad"
- >
- <div class="patientMain">
- <div
- class="patientOne"
- v-for="(item, index) in patients"
- :key="index"
- @click="toPatientDetail(item.id)"
- >
- <img :src="item.avatar" alt />
- <p>{{ item.name }}</p>
- </div>
- </div>
- </van-list>
- </div>
- <div class="noData" v-else>
- <img src="../../../assets/images/none.png" alt />
- </div>
- </div>
- </template>
-
- <script>
- import { getAllSlowPatient, getSlowSearchPatient } from "@/api/patient/patient";
- export default {
- props: {
- searchValue: String
- },
- props: {
- seacherActive: Number
- },
- data() {
- return {
- loading: false,
- finished: false,
- limit: 10,
- page: 1,
- total: 0,
- patients: [],
- list: []
- };
- },
- methods: {
- getAllSlowPatient() {
- getAllSlowPatient(this.page, this.limit).then(response => {
- if (response.data.state === 1) {
- var patients = response.data.data.slowpatient;
- let arr = this.patients;
- arr.push(...patients);
- this.patients = arr;
- var total = response.data.data.total;
- this.total = total;
- }
- });
- },
- onLoad() {
- setTimeout(() => {
- for (let i = 0; i < this.limit; i++) {
- this.list.push(this.list.length + 1);
- }
- // 加载状态结束
- this.loading = false;
- if (this.patients.length > 10) {
- this.page++;
- }
- this.getAllSlowPatient(this.page, this.limit);
- // 数据全部加载完成
- if (this.list.length >= this.total) {
- this.finished = true;
- }
- }, 1000);
- },
- toPatientDetail(id) {
- this.$router.push(
- "/patientdetail?patientid=" +
- id +
- "&seacherActive=" +
- this.seacherActive
- );
- },
- getSlowSearchPatient(val) {
- getSlowSearchPatient(val).then(response => {
- if (response.data.state === 1) {
- var slowpatient = response.data.data.slowPatient;
- this.patients = slowpatient;
- }
- });
- }
- },
- created() {
- if (this.searchValue) {
- this.getSlowSearchPatient(this.searchValue);
- } else {
- this.getAllSlowPatient();
- }
- },
- watch: {
- searchValue(newVal) {
- this.getSlowSearchPatient(newVal);
- }
- }
- };
- </script>
-
- <style lang="scss" scoped>
- .page_patientManagement {
- overflow-y: auto;
- height: 100%;
- background: #fff;
- .patientManagementTitle {
- background: #fff;
- padding: 0 1.125rem;
- height: 3.125rem;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .jiantou {
- font-size: 1.5rem;
- font-weight: 600;
- margin-right: 3rem;
- }
- .titleName {
- font-size: 1.125rem;
- font-weight: 600;
- }
- .iconBox {
- display: flex;
- align-items: center;
- float: right;
- }
- .iconOne {
- font-size: 1.5rem;
- }
- .add {
- margin-left: 1.25rem;
- }
- .toolBox {
- display: flex;
- height: 3.125rem;
-
- align-items: center;
-
- .toolOne {
- width: 5.625rem;
- height: 1.875rem;
- background: rgba(246, 246, 246, 1);
- border-radius: 5px;
- text-align: center;
- font-size: 0.8125rem;
- color: #8d8d8d;
- display: flex;
- align-items: center;
- justify-content: space-around;
- margin-left: 0.875rem;
- }
- }
- .van-dropdown-menu__title {
- width: 5.625rem;
- height: 1.875rem;
- line-height: 1.875rem;
- background: rgba(246, 246, 246, 1);
- border-radius: 5px;
- color: #8d8d8d;
- font-size: 0.875rem;
- }
- .van-dropdown-menu__title::after {
- right: 0.5rem;
- }
- .patientBox {
- padding: 0 0.875rem;
- .patientMain{
- >div:last-child{
- border: none;
- }
- }
- .patientOne {
- display: flex;
- align-items: center;
- height: 3.75rem;
- font-size: 1rem;
- border-bottom: 1px solid #e5e5e5;
- img {
- width: 2.5rem;
- height: 2.5rem;
- margin-right: 0.875rem;
- }
- }
- }
- .noData {
- width: 9.375rem;
- height: 9.375rem;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- img {
- width: 100%;
- height: 100%;
- }
- }
- }
- ::-webkit-scrollbar {
- width: 0;
- }
- </style>
-
- <style lang="scss">
- .page_patientManagement {
- .searchBox {
- .van-cell__value {
- display: flex;
- align-items: center;
- }
- .van-field__body {
- width: 100%;
- }
- }
- }
- </style>
|