patientList.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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="showAppraise(patient.id)">患者详情</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. inputChange(event = '', idxPlus = false) {
  70. let keyWord = event.detail ? event.detail.value : event;
  71. if (idxPlus) {
  72. //累加
  73. ++this.idx;
  74. } else {
  75. this.idx = 0;
  76. }
  77. let postData = {
  78. "idx": this.idx,
  79. "sum": 9999,
  80. "patient": {
  81. keyWord,
  82. "department": {
  83. "id": this.loginInfo.user.dept.id
  84. }
  85. }
  86. };
  87. uni.showLoading({
  88. title: "加载中",
  89. mask: true,
  90. });
  91. reqFetchDataList("nurse", "patient", postData).then((res) => {
  92. uni.hideLoading();
  93. if (res.status == 200) {
  94. res.list = res.list || [];
  95. if (idxPlus) {
  96. //累加
  97. this.patientList = this.patientList.concat(res.list);
  98. } else {
  99. this.patientList = res.list;
  100. }
  101. this.totalNum = res.totalNum || 0;
  102. } else {
  103. this.$refs.seiminModel.show({
  104. skin: "toast",
  105. icon: "error",
  106. content: res.msg || "获取数据失败",
  107. });
  108. throw new Error(res.msg || "获取数据失败");
  109. }
  110. });
  111. },
  112. // 查询最新列表(上拉)
  113. reachBottom() {
  114. //没有更多
  115. if (this.patientList.length == this.totalNum) {
  116. uni.showToast({
  117. icon: 'none',
  118. title: '没有更多数据了'
  119. })
  120. return;
  121. }
  122. this.inputChange(this.keyword, true);
  123. },
  124. },
  125. onReachBottom() {
  126. this.reachBottom();
  127. },
  128. created() {
  129. this.debounceInp = debounce(this.inputChange, 500);
  130. },
  131. beforeDestroy() {
  132. this.debounceInp.cancel()
  133. },
  134. onLoad() {
  135. this.inputChange('');
  136. },
  137. };
  138. </script>
  139. <style lang="scss" scoped>
  140. .patientList {
  141. padding-bottom: 108rpx;
  142. .search-box {
  143. background-color: rgb(242, 242, 242);
  144. padding: 15rpx 2.5%;
  145. position: fixed;
  146. z-index: 99;
  147. width: 100%;
  148. @include flex(space-between);
  149. .mSearch-input-box {
  150. width: 100%;
  151. }
  152. .input-box {
  153. width: 85%;
  154. flex-shrink: 1;
  155. @include flex(center, center);
  156. &>input {
  157. width: 100%;
  158. height: 60rpx;
  159. font-size: 32rpx;
  160. border: 0;
  161. border-radius: 60rpx;
  162. appearance: none;
  163. padding: 0 3%;
  164. margin: 0;
  165. background-color: #ffffff;
  166. }
  167. }
  168. .search-btn {
  169. width: 15%;
  170. margin: 0 0 0 2%;
  171. flex-shrink: 0;
  172. font-size: 28rpx;
  173. color: #fff;
  174. background: linear-gradient(to right, #ff9801, #ff570a);
  175. border-radius: 60rpx;
  176. @include flex(center, center);
  177. }
  178. }
  179. .search-keyword {
  180. padding: 88rpx 24rpx 0;
  181. // 列表项
  182. .orderList_listItem {
  183. width: 702rpx;
  184. min-height: 320rpx;
  185. background-color: #fff;
  186. position: relative;
  187. margin-top: 8rpx;
  188. border-radius: 8rpx;
  189. padding: 0 24rpx;
  190. font-size: 32rpx;
  191. @include border;
  192. @include semicircle(#F9FAFB, 82rpx);
  193. @include flex(flex-start, stretch, column);
  194. .orderList_listItem_header {
  195. height: 86rpx;
  196. @include border($directive:bottom, $style:dashed);
  197. @include flex(space-between, center);
  198. .orderList_listItem_header_title {
  199. color: #333;
  200. flex: 1;
  201. @include flex(flex-start, center);
  202. .associationType_icon {
  203. width: 48rpx;
  204. height: 48rpx;
  205. border-radius: 50%;
  206. font-size: 24rpx;
  207. margin-right: 8rpx;
  208. @include border($color:#39b199);
  209. @include flex(center, center);
  210. &.green {
  211. color: $defaultColor;
  212. border: 1px solid $defaultColor;
  213. background-color: rgba(73, 184, 86, 0.1);
  214. }
  215. &.red {
  216. color: #FF3B53;
  217. border: 1px solid #FF3B53;
  218. background-color: #FFE8EB;
  219. }
  220. }
  221. .taskNameAndWorkerName {
  222. flex: 1;
  223. @include flex;
  224. .taskName {
  225. max-width: 10em;
  226. @include clamp;
  227. }
  228. .workerName {
  229. flex: 1;
  230. @include clamp;
  231. }
  232. }
  233. }
  234. .orderList_listItem_header_more {
  235. color: #333;
  236. font-weight: bold;
  237. @include clamp;
  238. }
  239. }
  240. .orderList_listItem_item {
  241. height: 88rpx;
  242. color: #333;
  243. font-size: 30rpx;
  244. flex: 1;
  245. @include border(bottom);
  246. @include flex(flex-start, stretch, column);
  247. &:last-of-type {
  248. border-bottom: none;
  249. }
  250. .orderList_listItem_item_content {
  251. min-height: 143rpx;
  252. flex: 1;
  253. @include flex(space-between, center);
  254. .orderList_listItem_item_name {
  255. font-size: 34rpx;
  256. }
  257. .orderList_listItem_item_time {
  258. color: #333;
  259. font-size: 34rpx;
  260. font-weight: bold;
  261. }
  262. }
  263. .orderList_listItem_item_btns {
  264. position: relative;
  265. left: -24rpx;
  266. width: 698rpx;
  267. height: 88rpx;
  268. @include btn_background;
  269. @include flex;
  270. .btn {
  271. flex: 1;
  272. background-color: transparent;
  273. position: relative;
  274. @include flex(center, center);
  275. &::before {
  276. content: '';
  277. position: absolute;
  278. right: 0;
  279. top: 0;
  280. width: 1px;
  281. height: 100%;
  282. @include border(right, #fff);
  283. }
  284. &:last-of-type::before {
  285. border-right: none;
  286. }
  287. &::after {
  288. border: none;
  289. }
  290. }
  291. }
  292. }
  293. }
  294. }
  295. }
  296. </style>