patientList.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <view class="patientList">
  3. <view class="search-box">
  4. <seiminSearch class="mSearch-input-box" :mode="2" button="inside" placeholder="输入床号或姓名支持拼音检索" @input="debounceInp"
  5. v-model="keyword"></seiminSearch>
  6. </view>
  7. <view class="search-keyword">
  8. <view class="orderList_listItem" v-for="patient in patientList" :key="patient.id">
  9. <view class="orderList_listItem_header">
  10. <view class="orderList_listItem_header_title">
  11. <block v-if="patient.illnessState">
  12. <view class="associationType_icon red" v-if="patient.illnessState.value === '2'">危</view>
  13. <view class="associationType_icon red" v-else-if="patient.illnessState.value === '3'">重</view>
  14. </block>
  15. <block v-if="patient.careLevel">
  16. <view class="associationType_icon red" v-if="patient.careLevel.value === '0'">特</view>
  17. <view class="associationType_icon red" v-else-if="patient.careLevel.value === '1'">1</view>
  18. <view class="associationType_icon green" v-else-if="patient.careLevel.value === '2'">2</view>
  19. <view class="associationType_icon green" v-else-if="patient.careLevel.value === '3'">3</view>
  20. </block>
  21. <view class="taskNameAndWorkerName">
  22. <text class="workerName">{{patient.patientName || '暂无'}}</text>
  23. </view>
  24. </view>
  25. <text class="orderList_listItem_header_more">{{patient.bedNum }}床</text>
  26. </view>
  27. <view class="orderList_listItem_item">
  28. <view class="orderList_listItem_item_content">
  29. <text class="orderList_listItem_item_name">{{patient.residenceNo || '暂无'}}</text>
  30. <text class="orderList_listItem_item_time">待检{{patient.watingCount}}</text>
  31. </view>
  32. <view class="orderList_listItem_item_btns">
  33. <button type="primary" class="btn" @click.stop="toDetail(patient.patientCode)">患者详情</button>
  34. <button type="primary" class="btn" @click.stop="openRecallModal(patient.id)">一键建单</button>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <seiminFooterNav></seiminFooterNav>
  40. <seiminModel ref="seiminModel"></seiminModel>
  41. </view>
  42. </template>
  43. <script>
  44. import {
  45. debounce
  46. } from 'lodash/function';
  47. import {
  48. reqFetchDataList,
  49. } from "../../request/api.js";
  50. import {
  51. mapState,
  52. } from "vuex";
  53. export default {
  54. data() {
  55. return {
  56. debounceInp: null,
  57. keyword: "",
  58. patientList: [],
  59. totalNum: 0, //工单总数量
  60. idx: 0, //页码
  61. };
  62. },
  63. computed: {
  64. ...mapState("login", ["loginInfo"]),
  65. ...mapState('other', ["deptDisplay"]),
  66. },
  67. methods: {
  68. // 跳转患者详情
  69. toDetail(patientCode) {
  70. uni.navigateTo({
  71. url: `/pages/patientDetail/patientDetail?id=${patientCode}`
  72. })
  73. },
  74. //监听输入
  75. inputChange(event = '', idxPlus = false) {
  76. let keyWord = event.detail ? event.detail.value : event;
  77. if (idxPlus) {
  78. //累加
  79. ++this.idx;
  80. } else {
  81. this.idx = 0;
  82. }
  83. let postData = {
  84. "idx": this.idx,
  85. "sum": 9999,
  86. "patient": {
  87. keyWord,
  88. "department": {
  89. "id": this.loginInfo.user.dept.id
  90. }
  91. }
  92. };
  93. uni.showLoading({
  94. title: "加载中",
  95. mask: true,
  96. });
  97. reqFetchDataList("nurse", "patient", postData).then((res) => {
  98. uni.hideLoading();
  99. if (res.status == 200) {
  100. res.list = res.list || [];
  101. if (idxPlus) {
  102. //累加
  103. this.patientList = this.patientList.concat(res.list);
  104. } else {
  105. this.patientList = res.list;
  106. }
  107. this.totalNum = res.totalNum || 0;
  108. } else {
  109. this.$refs.seiminModel.show({
  110. skin: "toast",
  111. icon: "error",
  112. content: res.msg || "获取数据失败",
  113. });
  114. throw new Error(res.msg || "获取数据失败");
  115. }
  116. });
  117. },
  118. // 查询最新列表(上拉)
  119. reachBottom() {
  120. //没有更多
  121. if (this.patientList.length == this.totalNum) {
  122. uni.showToast({
  123. icon: 'none',
  124. title: '没有更多数据了'
  125. })
  126. return;
  127. }
  128. this.inputChange(this.keyword, true);
  129. },
  130. },
  131. onReachBottom() {
  132. this.reachBottom();
  133. },
  134. created() {
  135. this.debounceInp = debounce(this.inputChange, 500);
  136. },
  137. beforeDestroy() {
  138. this.debounceInp.cancel()
  139. },
  140. onLoad() {
  141. this.inputChange('');
  142. },
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. .patientList {
  147. padding-bottom: 108rpx;
  148. .search-box {
  149. background-color: rgb(242, 242, 242);
  150. padding: 15rpx 2.5%;
  151. position: fixed;
  152. z-index: 99;
  153. width: 100%;
  154. @include flex(space-between);
  155. .mSearch-input-box {
  156. width: 100%;
  157. }
  158. .input-box {
  159. width: 85%;
  160. flex-shrink: 1;
  161. @include flex(center, center);
  162. &>input {
  163. width: 100%;
  164. height: 60rpx;
  165. font-size: 32rpx;
  166. border: 0;
  167. border-radius: 60rpx;
  168. appearance: none;
  169. padding: 0 3%;
  170. margin: 0;
  171. background-color: #ffffff;
  172. }
  173. }
  174. .search-btn {
  175. width: 15%;
  176. margin: 0 0 0 2%;
  177. flex-shrink: 0;
  178. font-size: 28rpx;
  179. color: #fff;
  180. background: linear-gradient(to right, #ff9801, #ff570a);
  181. border-radius: 60rpx;
  182. @include flex(center, center);
  183. }
  184. }
  185. .search-keyword {
  186. padding: 88rpx 24rpx 0;
  187. // 列表项
  188. .orderList_listItem {
  189. width: 702rpx;
  190. min-height: 320rpx;
  191. background-color: #fff;
  192. position: relative;
  193. margin-top: 8rpx;
  194. border-radius: 8rpx;
  195. padding: 0 24rpx;
  196. font-size: 32rpx;
  197. @include border;
  198. @include semicircle(#F9FAFB, 82rpx);
  199. @include flex(flex-start, stretch, column);
  200. .orderList_listItem_header {
  201. height: 86rpx;
  202. @include border($directive:bottom, $style:dashed);
  203. @include flex(space-between, center);
  204. .orderList_listItem_header_title {
  205. color: #333;
  206. flex: 1;
  207. @include flex(flex-start, center);
  208. .associationType_icon {
  209. width: 48rpx;
  210. height: 48rpx;
  211. border-radius: 50%;
  212. font-size: 24rpx;
  213. margin-right: 8rpx;
  214. @include border($color:#39b199);
  215. @include flex(center, center);
  216. &.green {
  217. color: $defaultColor;
  218. border: 1px solid $defaultColor;
  219. background-color: rgba(73, 184, 86, 0.1);
  220. }
  221. &.red {
  222. color: #FF3B53;
  223. border: 1px solid #FF3B53;
  224. background-color: #FFE8EB;
  225. }
  226. }
  227. .taskNameAndWorkerName {
  228. flex: 1;
  229. @include flex;
  230. .taskName {
  231. max-width: 10em;
  232. @include clamp;
  233. }
  234. .workerName {
  235. flex: 1;
  236. @include clamp;
  237. }
  238. }
  239. }
  240. .orderList_listItem_header_more {
  241. color: #333;
  242. font-weight: bold;
  243. @include clamp;
  244. }
  245. }
  246. .orderList_listItem_item {
  247. height: 88rpx;
  248. color: #333;
  249. font-size: 30rpx;
  250. flex: 1;
  251. @include border(bottom);
  252. @include flex(flex-start, stretch, column);
  253. &:last-of-type {
  254. border-bottom: none;
  255. }
  256. .orderList_listItem_item_content {
  257. min-height: 143rpx;
  258. flex: 1;
  259. @include flex(space-between, center);
  260. .orderList_listItem_item_name {
  261. font-size: 34rpx;
  262. }
  263. .orderList_listItem_item_time {
  264. color: #333;
  265. font-size: 34rpx;
  266. font-weight: bold;
  267. }
  268. }
  269. .orderList_listItem_item_btns {
  270. position: relative;
  271. left: -24rpx;
  272. width: 698rpx;
  273. height: 88rpx;
  274. @include btn_background;
  275. @include flex;
  276. .btn {
  277. flex: 1;
  278. background-color: transparent;
  279. position: relative;
  280. @include flex(center, center);
  281. &::before {
  282. content: '';
  283. position: absolute;
  284. right: 0;
  285. top: 0;
  286. width: 1px;
  287. height: 100%;
  288. @include border(right, #fff);
  289. }
  290. &:last-of-type::before {
  291. border-right: none;
  292. }
  293. &::after {
  294. border: none;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. </style>