index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <view class="main">
  3. <view class="top">
  4. <view class="nameBox">
  5. <view class="name">{{ param.patientName ? param.patientName : '还未绑定就诊人' }}</view>
  6. <text class="icon arrow" style="margin-left: 10px;">&#xeb73;</text>
  7. <view class="change" @click="showChange = true">切换就诊人</view>
  8. </view>
  9. <view class="cardNum">{{param.patientName ? param.patientId : '还未绑定就诊人'}}</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"
  23. @click="go(`/pages/detection/detail?id=${item.id}&orcId=${item.orcId}&patientName=${param.patientName}&patientId=${param.patientId}&reportCompleteTime=${item.reportCompleteTime}&sampleReceivedDate=${item.sampleReceivedDate}`)">
  24. <view class="title omit">{{ item.medTechProName }}</view>
  25. <view class="time">{{ item.dischargeTime }}</view>
  26. </view>
  27. </view>
  28. <view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
  29. <u-empty v-if="!loadMore && list.length == 0"></u-empty>
  30. </view>
  31. <u-calendar :show="calendar" monthNum="120" mode="range" :maxDate="util.getDate()" minDate="2020-01-01"
  32. @confirm="confirm" @close="close()" :closeOnClickOverlay="true"></u-calendar>
  33. <u-popup :show="showChange" @close="closePopup" @open="openPopup" :round="10" :closeable="true">
  34. <view>
  35. <view class="userChangeTitle">请选择就诊人</view>
  36. <scroll-view scroll-y="true" class="scroll-Y" style="max-height: 300px;">
  37. <u-radio-group v-model="param.patientId" iconPlacement="left" placement="column">
  38. <u-radio v-for="(item,index) in userList" :name="item.patientId" @change="groupChange(item)"
  39. :customStyle="{ backgroundColor: '#F8F8F8', margin:'5px 20px',borderRadius: '10px',padding: '10px'}">
  40. <view class="userChangeItem" @click="groupChange(item)">
  41. <view class="userChangeItemName">{{ item.patientName }}</view>
  42. <view class="userChangeCartNo">{{ item.patientId }}</view>
  43. </view>
  44. </u-radio>
  45. </u-radio-group>
  46. </scroll-view>
  47. </view>
  48. </u-popup>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. userList: [],
  56. showChange: false,
  57. current: 0,
  58. time: null,
  59. tab: [{
  60. label: '检测报告'
  61. }, ],
  62. startTime: null,
  63. endTime: null,
  64. list: [],
  65. param: {
  66. // pageNum: 1,
  67. // pageSize: 10,
  68. patientId: '',
  69. patientName: '',
  70. },
  71. loadMore: true,
  72. calendar: false,
  73. user: {},
  74. userInfo: {},
  75. }
  76. },
  77. onLoad() {
  78. this.setDefTime()
  79. this.user = this.getUser();
  80. this.getUserList();
  81. this.getUserInfo()
  82. },
  83. methods: {
  84. getUserInfo() {
  85. this.http.request({
  86. url: '/app/user/info',
  87. success: (res) => {
  88. this.user = res.data.data;
  89. this.param.patientId = res.data.data.patientId
  90. this.param.patientName = res.data.data.patientName
  91. this.getData();
  92. }
  93. });
  94. },
  95. groupChange(n) {
  96. uni.showModal({
  97. title: '提示',
  98. content: '确定切换就诊人',
  99. success: (res) => {
  100. if (res.confirm) {
  101. this.http.request({
  102. url: '/app/user/bind/change/' + n.id,
  103. success: (res) => {
  104. this.param.patientName = n.patientName
  105. this.param.patientId = n.patientId
  106. this.closePopup()
  107. this.refresh()
  108. }
  109. });
  110. }
  111. }
  112. });
  113. },
  114. getUserList() {
  115. this.http.request({
  116. url: '/app/user/bind/list',
  117. success: (res) => {
  118. this.userList = res.data.data
  119. }
  120. });
  121. },
  122. openPopup() {
  123. },
  124. closePopup() {
  125. this.showChange = false
  126. },
  127. setDefTime() {
  128. const today = new Date();
  129. const todayYear = today.getFullYear()
  130. const todayMonth = (today.getMonth() + 1) < 10 ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1)
  131. const todayDay = today.getDate() < 10 ? "0" + today.getDate() : today.getDate()
  132. this.param.endTime = todayYear + todayMonth + todayDay
  133. this.endTime = todayYear + '-' + todayMonth + '-' + todayDay
  134. let beforeTime = new Date(today.getTime() - 24 * 60 * 60 * 1000 * 30);
  135. //一个月前
  136. let beforeTimeYear = beforeTime.getFullYear();
  137. let beforeTimeMonth = beforeTime.getMonth() + 1;
  138. let beforeTimeDay = beforeTime.getDate();
  139. beforeTimeMonth = beforeTimeMonth < 10 ? "0" + beforeTimeMonth : beforeTimeMonth;
  140. beforeTimeDay = beforeTimeDay < 10 ? "0" + beforeTimeDay : beforeTimeDay;
  141. this.param.startTime = beforeTimeYear + beforeTimeMonth + beforeTimeDay
  142. this.startTime = beforeTimeYear + "-" + beforeTimeMonth + "-" + beforeTimeDay
  143. },
  144. confirm(e) {
  145. this.calendar = false;
  146. this.param.startTime = e[0].replace(/-/g, '');;
  147. this.param.endTime = e[e.length - 1].replace(/-/g, '');;
  148. this.startTime = e[0]
  149. this.endTime = e[e.length - 1]
  150. this.refresh();
  151. },
  152. close() {
  153. this.calendar = false;
  154. },
  155. getData() {
  156. //判断是否有绑定患者
  157. if (this.param.patientName) {
  158. this.http.request({
  159. url: '/app/obrRequest/' + this.param.patientId,
  160. data: this.param,
  161. success: (res) => {
  162. this.list = res.data.data
  163. this.loadMore = false
  164. // this.loadMore = res.data.pages > this.param.pageNum ? true : false;
  165. // this.list.push(...res.data.rows);
  166. }
  167. });
  168. } else {
  169. this.loadMore = false
  170. }
  171. },
  172. click(e) {
  173. this.current = e.index;
  174. this.param.type = e.dictValue;
  175. this.refresh();
  176. },
  177. selectTime(e) {
  178. console.log(e);
  179. },
  180. go(url) {
  181. uni.navigateTo({
  182. url: url
  183. });
  184. },
  185. //刷新数据
  186. refresh() {
  187. this.loadMore = true;
  188. this.param.pageNum = 1;
  189. this.list = [];
  190. this.getData();
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang="scss">
  196. .top {
  197. padding: 15px;
  198. background-color: white;
  199. border-radius: 8px;
  200. .nameBox {
  201. display: flex;
  202. align-items: center;
  203. .name {
  204. font-weight: bold;
  205. font-size: 16px;
  206. }
  207. .change {
  208. color: royalblue;
  209. margin-left: 20px;
  210. }
  211. }
  212. .cardNum {
  213. padding-top: 10px;
  214. font-size: 14px;
  215. }
  216. }
  217. .content {
  218. padding: 15px;
  219. background-color: white;
  220. border-radius: 8px;
  221. .list {
  222. .item {
  223. overflow: hidden;
  224. padding: 13px 0;
  225. border-bottom: 1px solid $line;
  226. margin-bottom: 10px;
  227. .title {
  228. font-size: 18px;
  229. font-weight: bold;
  230. }
  231. .time {
  232. font-size: 14px;
  233. padding-top: 15px;
  234. color: $font-c;
  235. }
  236. }
  237. }
  238. }
  239. .userChangeTitle {
  240. display: flex;
  241. justify-content: center;
  242. align-items: center;
  243. height: 48px;
  244. font-weight: bold;
  245. }
  246. .userChangeItem {
  247. width: 100%;
  248. .userChangeItemName {
  249. padding: 5px 10px;
  250. }
  251. .userChangeCartNo {
  252. padding: 5px 10px;
  253. }
  254. }
  255. </style>