list.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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" @click="calendar = true">
  11. <input placeholder="点击选择时间" :disabled="true" v-model="startTime" type="select" />
  12. <view>至</view>
  13. <input placeholder="点击选择时间" :disabled="true" v-model="endTime" type="select" />
  14. </view>
  15. </view>
  16. <view class="tab">
  17. <u-tabs :list="tab" :current="current" keyName="label" @click="click"></u-tabs>
  18. </view>
  19. <view class="content">
  20. <view class="list">
  21. <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}`)">
  22. <view class="title omit">{{ item.medTechProName }}</view>
  23. <view class="time">{{ item.reportCompleteTime }}</view>
  24. </view>
  25. </view>
  26. <u-empty v-if="list.length == 0"></u-empty>
  27. </view>
  28. <u-calendar :show="calendar" monthNum="120" mode="range" :maxDate="util.getDate()" minDate="2020-01-01" @confirm="confirm" @close="close()" :closeOnClickOverlay="true"></u-calendar>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. userList: [],
  36. current: 0,
  37. time: null,
  38. tab: [
  39. {
  40. label: '就诊记录'
  41. }
  42. ],
  43. startTime: null,
  44. endTime: null,
  45. list: [],
  46. param: {},
  47. calendar: false,
  48. user: {},
  49. patId: null,
  50. patientName: null
  51. };
  52. },
  53. onLoad(e) {
  54. console.log(e);
  55. //this.setDefTime()
  56. this.patId = e.patId;
  57. this.patientName = e.patientName;
  58. this.cardId = e.cardId;
  59. this.getData();
  60. },
  61. methods: {
  62. setDefTime() {
  63. const today = new Date();
  64. const todayYear = today.getFullYear();
  65. const todayMonth = today.getMonth() + 1 < 10 ? '0' + (today.getMonth() + 1) : today.getMonth() + 1;
  66. const todayDay = today.getDate() < 10 ? '0' + today.getDate() : today.getDate();
  67. this.param.endTime = todayYear + todayMonth + todayDay;
  68. this.endTime = todayYear + '-' + todayMonth + '-' + todayDay;
  69. let beforeTime = new Date(today.getTime() - 24 * 60 * 60 * 1000 * 30);
  70. //一个月前
  71. let beforeTimeYear = beforeTime.getFullYear();
  72. let beforeTimeMonth = beforeTime.getMonth() + 1;
  73. let beforeTimeDay = beforeTime.getDate();
  74. beforeTimeMonth = beforeTimeMonth < 10 ? '0' + beforeTimeMonth : beforeTimeMonth;
  75. beforeTimeDay = beforeTimeDay < 10 ? '0' + beforeTimeDay : beforeTimeDay;
  76. this.param.startTime = beforeTimeYear + beforeTimeMonth + beforeTimeDay;
  77. this.startTime = beforeTimeYear + '-' + beforeTimeMonth + '-' + beforeTimeDay;
  78. },
  79. confirm(e) {
  80. this.calendar = false;
  81. this.param.startTime = e[0].replace(/-/g, '');
  82. this.param.endTime = e[e.length - 1].replace(/-/g, '');
  83. this.startTime = e[0];
  84. this.endTime = e[e.length - 1];
  85. this.refresh();
  86. },
  87. close() {
  88. this.calendar = false;
  89. },
  90. getData() {
  91. this.http.request({
  92. url: '/work/request/patid/' + this.patId,
  93. data: this.param,
  94. success: (res) => {
  95. this.list = res.data.data;
  96. }
  97. });
  98. },
  99. click(e) {
  100. this.current = e.index;
  101. this.param.type = e.dictValue;
  102. this.refresh();
  103. },
  104. selectTime(e) {
  105. console.log(e);
  106. },
  107. go(url) {
  108. uni.navigateTo({
  109. url: url
  110. });
  111. },
  112. //刷新数据
  113. refresh() {
  114. this.list = [];
  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>