1
0

list.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="main">
  3. <view class="top">
  4. <view class="nameBox">
  5. <view class="name">{{patientName}}</view>
  6. <text class="icon arrow" style="margin-left: 10px;">&#xeb73;</text>
  7. <view class="change" @click="go('/pages/detection/doctor/selectUser')">切换就诊人</view>
  8. </view>
  9. <view class="cardNum">{{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/detection/doctor/detail?orcId=${item.orcId}&patientName=${patientName}&id=${item.id}&reportDate=${item.reportDate}&sampleReceivedDate=${item.sampleReceivedDate}`)">
  23. <view class="title omit">{{ item.medTechProName }}</view>
  24. <view class="time">{{ item.reportCompleteTime }}</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. },
  49. loadMore: true,
  50. calendar: false,
  51. user:{},
  52. patId:null,
  53. patientName:null,
  54. }
  55. },
  56. onLoad(e) {
  57. console.log(e);
  58. this.setDefTime()
  59. this.patId = e.patId
  60. this.patientName = e.patientName
  61. this.cardId = e.cardId
  62. this.getData();
  63. },
  64. methods: {
  65. setDefTime() {
  66. const today = new Date();
  67. const todayYear = today.getFullYear()
  68. const todayMonth = (today.getMonth() + 1) < 10 ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1)
  69. const todayDay = today.getDate() < 10 ? "0" + today.getDate() : today.getDate()
  70. this.param.endTime = todayYear + todayMonth + todayDay
  71. this.endTime = todayYear + '-' + todayMonth + '-' + todayDay
  72. let beforeTime = new Date(today.getTime() - 24 * 60 * 60 * 1000 * 30);
  73. //一个月前
  74. let beforeTimeYear = beforeTime.getFullYear();
  75. let beforeTimeMonth = beforeTime.getMonth() + 1;
  76. let beforeTimeDay = beforeTime.getDate();
  77. beforeTimeMonth = beforeTimeMonth < 10 ? "0" + beforeTimeMonth : beforeTimeMonth;
  78. beforeTimeDay = beforeTimeDay < 10 ? "0" + beforeTimeDay : beforeTimeDay;
  79. this.param.startTime = beforeTimeYear + beforeTimeMonth + beforeTimeDay
  80. this.startTime = beforeTimeYear + "-" + beforeTimeMonth + "-" + beforeTimeDay
  81. },
  82. confirm(e) {
  83. this.calendar = false;
  84. this.param.startTime = e[0].replace(/-/g, '');;
  85. this.param.endTime = e[e.length - 1].replace(/-/g, '');;
  86. this.startTime = e[0]
  87. this.endTime = e[e.length - 1]
  88. this.refresh();
  89. },
  90. close() {
  91. this.calendar = false;
  92. },
  93. getData() {
  94. this.http.request({
  95. url: '/work/request/patid/' + this.patId,
  96. data:this.param,
  97. success: (res) => {
  98. this.list = res.data.rows
  99. this.loadMore = false
  100. //暂时没有分页
  101. // this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  102. // this.list.push(...res.data.rows);
  103. }
  104. });
  105. },
  106. click(e) {
  107. this.current = e.index;
  108. this.param.type = e.dictValue;
  109. this.refresh();
  110. },
  111. selectTime(e) {
  112. console.log(e);
  113. },
  114. go(url) {
  115. uni.navigateTo({
  116. url: url
  117. });
  118. },
  119. //刷新数据
  120. refresh() {
  121. this.loadMore = true;
  122. // this.param.pageNum = 1;
  123. this.list = [];
  124. this.getData();
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss">
  130. .top {
  131. padding: 15px;
  132. background-color: white;
  133. border-radius: 8px;
  134. .nameBox {
  135. display: flex;
  136. align-items: center;
  137. .name {
  138. font-weight: bold;
  139. font-size: 16px;
  140. }
  141. .change {
  142. color: royalblue;
  143. margin-left: 20px;
  144. }
  145. }
  146. .cardNum {
  147. padding-top: 10px;
  148. font-size: 14px;
  149. }
  150. }
  151. .content {
  152. padding: 15px;
  153. background-color: white;
  154. border-radius: 8px;
  155. .list {
  156. .item {
  157. overflow: hidden;
  158. padding: 13px 0;
  159. border-bottom: 1px solid $line;
  160. margin-bottom: 10px;
  161. .title {
  162. font-size: 18px;
  163. font-weight: bold;
  164. }
  165. .time {
  166. font-size: 14px;
  167. padding-top: 15px;
  168. color: $font-c;
  169. }
  170. }
  171. }
  172. }
  173. .userChangeTitle {
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. height: 48px;
  178. font-weight: bold;
  179. }
  180. .userChangeItem {
  181. width: 100%;
  182. .userChangeItemName {
  183. padding: 5px 10px;
  184. }
  185. .userChangeCartNo {
  186. padding: 5px 10px;
  187. }
  188. }
  189. </style>