123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view class="main">
- <view style="padding: 15px 0;">
- <u-search placeholder="患者姓名" v-model="param.patientName" bgColor="white" :showAction="false" @search="refresh()" @clear="(param.patientName = ''), refresh()"></u-search>
- </view>
- <view class="list">
- <view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/detection/doctor/list?cardId='+item.cardId+'&patId=' + item.patId+'&patientName='+ item.name)">
- <view class="title omit">
- <text>{{ item.name }}</text>
- <text class="check">({{ item.cardId }})</text>
- </view>
- </view>
- <u-empty v-if="list.length == 0" text="暂无患者"></u-empty>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- list: [],
- param:{
- pageNum:1,
- pageSize:20,
- },
- loadMore: true
- };
- },
- onLoad(e) {
- this.getData();
- uni.$on('bind', (res) => {
- this.getData();
- });
- },
- methods: {
- getData() {
- this.http.request({
- url: '/system/user/deptTree',
- success: (res) => {
- console.log(res);
- this.param.departmentName = res.data.data[0].label
- this.http.request({
- url: '/work/visit/patientCard',
- data: this.param,
- success: (res) => {
- this.loadMore = res.data.pages > this.param.pageNum ? true : false;
- res.data.rows.forEach((item) => {
- this.list.push(item);
- });
- }
- });
- }
- });
- },
- go(url) {
- uni.navigateTo({ url: url });
- },
- //刷新数据
- refresh() {
- this.loadMore = true;
- this.param.pageNum = 1;
- this.list = [];
- this.getData();
- },
-
- },
- //上拉加载
- onReachBottom() {
- if (this.loadMore) {
- this.param.pageNum++;
- this.getData();
- }
- }
- };
- </script>
- <style lang="scss">
- .list {
- background-color: white;
- border-radius: 10px;
- .item {
- padding: 16px 12px 16px 12px;
- border-bottom: 1px solid $line;
- overflow: hidden;
- .title {
- font-size: 15px;
- font-weight: bold;
- .check {
- color: #737373;
- font-size: 13px;
- font-weight: normal;
- padding-left: 5px;
- }
- }
- .del {
- color: #f44336;
- float: right;
- margin-top: -20px;
- font-size: 20px;
- }
- }
- }
- </style>
|