1
0

list.vue 5.4 KB

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