1
0

selectUser.vue 2.1 KB

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