1
0

list.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <view class="main">
  3. <view class="top">
  4. <view class="nameBox">
  5. <view class="name">{{ param.patientName }}</view>
  6. <text class="icon arrow" style="margin-left: 10px">&#xeb73;</text>
  7. <view class="change" @click="go('/pages/visit/doctor/selectUser')">切换就诊人</view>
  8. </view>
  9. <view style="display: flex; text-align: center; margin: 5px; padding: 13px; font-size: 13px" @click="calendar = true">
  10. <input placeholder="点击选择时间" :disabled="true" v-model="startTime" type="select" />
  11. <view>至</view>
  12. <input placeholder="点击选择时间" :disabled="true" v-model="endTime" type="select" />
  13. </view>
  14. </view>
  15. <view class="tab">
  16. <u-tabs :list="tab" :current="current" keyName="label" @click="click"></u-tabs>
  17. </view>
  18. <view class="content">
  19. <view class="list">
  20. <view class="item" v-for="(item, index) in list" @click="go(`/pages/visit/doctor/detail?cardId=${param.cardId}&patientName=${param.patientName}&id=${item.id}`)">
  21. <view class="title omit">{{ item.department }}</view>
  22. <view class="time">{{ item.admissionTime }}</view>
  23. </view>
  24. </view>
  25. <u-empty v-if="list.length == 0"></u-empty>
  26. </view>
  27. <u-calendar :show="calendar" monthNum="120" mode="range" :maxDate="util.getDate()" minDate="2020-01-01" @confirm="confirm" @close="close()" :closeOnClickOverlay="true"></u-calendar>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. userList: [],
  35. current: 0,
  36. time: null,
  37. tab: [{ label: '就诊记录' }],
  38. startTime: null,
  39. endTime: null,
  40. list: [],
  41. param: {},
  42. calendar: false,
  43. user: {}
  44. };
  45. },
  46. onLoad(e) {
  47. this.param.patId = e.patId;
  48. this.param.patientName = e.patientName;
  49. this.getData();
  50. },
  51. methods: {
  52. groupChange(n) {
  53. uni.showModal({
  54. title: '提示',
  55. content: '确定切换就诊人',
  56. success: (res) => {
  57. if (res.confirm) {
  58. this.http.request({
  59. url: '/app/user/bind/change/' + n.id,
  60. success: (res) => {
  61. this.param.patientName = n.patientName;
  62. this.closePopup();
  63. this.refresh();
  64. }
  65. });
  66. }
  67. }
  68. });
  69. },
  70. confirm(e) {
  71. this.calendar = false;
  72. this.param.startTime = e[0].replace(/-/g, '');
  73. this.param.endTime = e[e.length - 1].replace(/-/g, '');
  74. this.startTime = e[0];
  75. this.endTime = e[e.length - 1];
  76. this.refresh();
  77. },
  78. close() {
  79. this.calendar = false;
  80. },
  81. getData() {
  82. this.http.request({
  83. url: '/work/visit/list',
  84. data: this.param,
  85. success: (res) => {
  86. this.list = res.data.data;
  87. }
  88. });
  89. },
  90. click(e) {
  91. this.current = e.index;
  92. this.param.type = e.dictValue;
  93. this.refresh();
  94. },
  95. selectTime(e) {
  96. console.log(e);
  97. },
  98. go(url) {
  99. uni.navigateTo({
  100. url: url
  101. });
  102. },
  103. //刷新数据
  104. refresh() {
  105. this.loadMore = true;
  106. this.param.pageNum = 1;
  107. this.list = [];
  108. this.getData();
  109. }
  110. },
  111. //上拉加载
  112. onReachBottom() {
  113. if (this.loadMore) {
  114. this.param.pageNum++;
  115. this.getData();
  116. }
  117. }
  118. };
  119. </script>
  120. <style lang="scss">
  121. .top {
  122. padding: 15px;
  123. background-color: white;
  124. border-radius: 8px;
  125. .nameBox {
  126. display: flex;
  127. align-items: center;
  128. .name {
  129. font-weight: bold;
  130. font-size: 16px;
  131. }
  132. .change {
  133. color: royalblue;
  134. margin-left: 20px;
  135. }
  136. }
  137. .cardNum {
  138. padding-top: 10px;
  139. font-size: 14px;
  140. }
  141. }
  142. .content {
  143. padding: 15px;
  144. background-color: white;
  145. border-radius: 8px;
  146. .list {
  147. .item {
  148. overflow: hidden;
  149. padding: 13px 0;
  150. border-bottom: 1px solid $line;
  151. margin-bottom: 10px;
  152. &:last-child {
  153. border: 0px;
  154. }
  155. .title {
  156. font-size: 18px;
  157. font-weight: bold;
  158. }
  159. .time {
  160. font-size: 14px;
  161. padding-top: 15px;
  162. color: $font-c;
  163. }
  164. }
  165. }
  166. }
  167. .userChangeTitle {
  168. display: flex;
  169. justify-content: center;
  170. align-items: center;
  171. height: 48px;
  172. font-weight: bold;
  173. }
  174. .userChangeItem {
  175. width: 100%;
  176. .userChangeItemName {
  177. padding: 5px 10px;
  178. }
  179. .userChangeCartNo {
  180. padding: 5px 10px;
  181. }
  182. }
  183. </style>