1
0

list.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. <u-empty v-if="list.length == 0"></u-empty>
  28. </view>
  29. <u-calendar :show="calendar" monthNum="120" mode="range" :maxDate="util.getDate()" minDate="2020-01-01"
  30. @confirm="confirm" @close="close()" :closeOnClickOverlay="true"></u-calendar>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. userList: [],
  38. current: 0,
  39. time: null,
  40. tab: [{
  41. label: '就诊记录'
  42. }, ],
  43. startTime: null,
  44. endTime: null,
  45. list: [],
  46. param: {
  47. },
  48. loadMore: true,
  49. calendar: false,
  50. user:{},
  51. patId:null,
  52. patientName:null,
  53. }
  54. },
  55. onLoad(e) {
  56. console.log(e);
  57. //this.setDefTime()
  58. this.patId = e.patId
  59. this.patientName = e.patientName
  60. this.cardId = e.cardId
  61. this.getData();
  62. },
  63. methods: {
  64. setDefTime() {
  65. const today = new Date();
  66. const todayYear = today.getFullYear()
  67. const todayMonth = (today.getMonth() + 1) < 10 ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1)
  68. const todayDay = today.getDate() < 10 ? "0" + today.getDate() : today.getDate()
  69. this.param.endTime = todayYear + todayMonth + todayDay
  70. this.endTime = todayYear + '-' + todayMonth + '-' + todayDay
  71. let beforeTime = new Date(today.getTime() - 24 * 60 * 60 * 1000 * 30);
  72. //一个月前
  73. let beforeTimeYear = beforeTime.getFullYear();
  74. let beforeTimeMonth = beforeTime.getMonth() + 1;
  75. let beforeTimeDay = beforeTime.getDate();
  76. beforeTimeMonth = beforeTimeMonth < 10 ? "0" + beforeTimeMonth : beforeTimeMonth;
  77. beforeTimeDay = beforeTimeDay < 10 ? "0" + beforeTimeDay : beforeTimeDay;
  78. this.param.startTime = beforeTimeYear + beforeTimeMonth + beforeTimeDay
  79. this.startTime = beforeTimeYear + "-" + beforeTimeMonth + "-" + beforeTimeDay
  80. },
  81. confirm(e) {
  82. this.calendar = false;
  83. this.param.startTime = e[0].replace(/-/g, '');;
  84. this.param.endTime = e[e.length - 1].replace(/-/g, '');;
  85. this.startTime = e[0]
  86. this.endTime = e[e.length - 1]
  87. this.refresh();
  88. },
  89. close() {
  90. this.calendar = false;
  91. },
  92. getData() {
  93. this.http.request({
  94. url: '/work/request/patid/' + this.patId,
  95. data:this.param,
  96. success: (res) => {
  97. this.list = res.data.data;
  98. }
  99. });
  100. },
  101. click(e) {
  102. this.current = e.index;
  103. this.param.type = e.dictValue;
  104. this.refresh();
  105. },
  106. selectTime(e) {
  107. console.log(e);
  108. },
  109. go(url) {
  110. uni.navigateTo({
  111. url: url
  112. });
  113. },
  114. //刷新数据
  115. refresh() {
  116. this.loadMore = true;
  117. // this.param.pageNum = 1;
  118. this.list = [];
  119. this.getData();
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .top {
  126. padding: 15px;
  127. background-color: white;
  128. border-radius: 8px;
  129. .nameBox {
  130. display: flex;
  131. align-items: center;
  132. .name {
  133. font-weight: bold;
  134. font-size: 16px;
  135. }
  136. .change {
  137. color: royalblue;
  138. margin-left: 20px;
  139. }
  140. }
  141. .cardNum {
  142. padding-top: 10px;
  143. font-size: 14px;
  144. }
  145. }
  146. .content {
  147. padding: 15px;
  148. background-color: white;
  149. border-radius: 8px;
  150. .list {
  151. .item {
  152. overflow: hidden;
  153. padding: 13px 0;
  154. border-bottom: 1px solid $line;
  155. margin-bottom: 10px;
  156. .title {
  157. font-size: 18px;
  158. font-weight: bold;
  159. }
  160. .time {
  161. font-size: 14px;
  162. padding-top: 15px;
  163. color: $font-c;
  164. }
  165. }
  166. }
  167. }
  168. .userChangeTitle {
  169. display: flex;
  170. justify-content: center;
  171. align-items: center;
  172. height: 48px;
  173. font-weight: bold;
  174. }
  175. .userChangeItem {
  176. width: 100%;
  177. .userChangeItemName {
  178. padding: 5px 10px;
  179. }
  180. .userChangeCartNo {
  181. padding: 5px 10px;
  182. }
  183. }
  184. </style>