index.vue 6.8 KB

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