1
0

selectUser.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="main">
  3. <view style="padding: 15px 0">
  4. <u-search placeholder="患者姓名" v-model="param.patientName" bgColor="white" :showAction="false" @search="refresh()" @clear="(param.patientName = ''), refresh()"></u-search>
  5. </view>
  6. <view class="list">
  7. <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)">
  8. <view class="title omit">
  9. <text>{{ item.name }}</text>
  10. </view>
  11. </view>
  12. <u-empty v-if="list.length == 0" text="暂无患者"></u-empty>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. list: [],
  21. param: {
  22. pageNum: 1,
  23. pageSize: 20
  24. },
  25. loadMore: true
  26. };
  27. },
  28. onLoad(e) {
  29. this.getData();
  30. uni.$on('bind', (res) => {
  31. this.getData();
  32. });
  33. },
  34. methods: {
  35. getData() {
  36. this.param.userId = this.getUser().userId;
  37. this.http.request({
  38. url: '/work/visit/patientCard',
  39. data: this.param,
  40. success: (res) => {
  41. this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  42. res.data.rows.forEach((item) => {
  43. this.list.push(item);
  44. });
  45. }
  46. });
  47. },
  48. go(url) {
  49. uni.navigateTo({ url: url });
  50. },
  51. //刷新数据
  52. refresh() {
  53. this.loadMore = true;
  54. this.param.pageNum = 1;
  55. this.list = [];
  56. this.getData();
  57. }
  58. },
  59. //上拉加载
  60. onReachBottom() {
  61. if (this.loadMore) {
  62. this.param.pageNum++;
  63. this.getData();
  64. }
  65. }
  66. };
  67. </script>
  68. <style lang="scss">
  69. .list {
  70. background-color: white;
  71. border-radius: 10px;
  72. .item {
  73. padding: 16px 12px 16px 12px;
  74. border-bottom: 1px solid $line;
  75. overflow: hidden;
  76. .title {
  77. font-size: 15px;
  78. font-weight: bold;
  79. .check {
  80. color: #737373;
  81. font-size: 13px;
  82. font-weight: normal;
  83. padding-left: 5px;
  84. }
  85. }
  86. .del {
  87. color: #f44336;
  88. float: right;
  89. margin-top: -20px;
  90. font-size: 20px;
  91. }
  92. }
  93. }
  94. </style>