patientManagement.vue 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <div class="page_patientManagement">
  3. <van-sticky>
  4. <div class="patientManagementTitle">
  5. <i class="iconfont icon-zuojiantou jiantou" @click="toback"></i>
  6. <span class="titleName">患者管理</span>
  7. <div class="iconBox" @click="addPatient">
  8. <van-icon class="iconOne add" name="add-o" />
  9. </div>
  10. </div>
  11. </van-sticky>
  12. <div class="searchBox">
  13. <van-search
  14. v-model="value"
  15. placeholder="搜索患者透析号/姓名/首拼"
  16. @search="SearchAllPatient"
  17. />
  18. </div>
  19. <div class="chooseBox">
  20. <van-tabs v-model="active" sticky>
  21. <van-tab title="全部患者">
  22. <div class="patientBox">
  23. <van-list
  24. v-model="loading"
  25. finished-text="没有更多了"
  26. @load="onLoad"
  27. :finished="finished"
  28. >
  29. <div
  30. class="patientOne"
  31. v-for="(item, index) in patients"
  32. :key="index"
  33. @click="toPatientDetail(item.id)"
  34. >
  35. <img :src="item.avatar" alt />
  36. <p>{{ item.name }}</p>
  37. </div>
  38. </van-list>
  39. </div>
  40. </van-tab>
  41. <van-tab title="血透患者">
  42. <Blood :searchValue="value"></Blood>
  43. </van-tab>
  44. <van-tab title="慢病患者">
  45. <Slow :searchValue="value"></Slow>
  46. </van-tab>
  47. <van-tab title="会员患者">
  48. <Member :searchValue="value"></Member>
  49. </van-tab>
  50. </van-tabs>
  51. </div>
  52. <!-- 弹出层 -->
  53. <div>
  54. <van-popup
  55. v-model="typeShow"
  56. position="bottom"
  57. :style="{ height: '40%' }"
  58. >
  59. <van-picker
  60. show-toolbar
  61. :columns="columns"
  62. @cancel="onCancel"
  63. @confirm="onConfirm"
  64. />
  65. </van-popup>
  66. </div>
  67. </div>
  68. </template>
  69. <script>
  70. import "../../styles/resetStyle.scss";
  71. import {
  72. getBloodDialysisPatient,
  73. SearchAllPatient
  74. } from "@/api/patient/patient";
  75. import Slow from "@/pages/patientManagement/components/Slow";
  76. import Member from "@/pages/patientManagement/components/Member";
  77. import Blood from "@/pages/patientManagement/components/Blood";
  78. import { setRem, setHeight } from "@/libs/functionRem";
  79. export default {
  80. components: {
  81. Slow,
  82. Member,
  83. Blood
  84. },
  85. data() {
  86. return {
  87. value: "",
  88. typeShow: false,
  89. startShow: false,
  90. endShow: false,
  91. type: "归转状态",
  92. columns: [
  93. "杭州",
  94. "宁波",
  95. "温州",
  96. "嘉兴",
  97. "湖州",
  98. "杭州",
  99. "宁波",
  100. "温州",
  101. "嘉兴",
  102. "湖州"
  103. ],
  104. searchVal: "",
  105. active: 0,
  106. list: [],
  107. loading: false,
  108. finished: false,
  109. page: 1,
  110. limit: 10,
  111. total: 0,
  112. patients: []
  113. };
  114. },
  115. methods: {
  116. onCancel() {
  117. this.typeShow = false;
  118. },
  119. onConfirm(value) {
  120. this.type = value;
  121. this.typeShow = false;
  122. },
  123. onLoad() {
  124. setTimeout(() => {
  125. for (let i = 0; i < this.limit; i++) {
  126. this.list.push(this.list.length + 1);
  127. }
  128. // 加载状态结束
  129. this.loading = false;
  130. if (this.patients.length >= 10) {
  131. this.page++;
  132. this.getBloodDialysisPatient(this.page, this.limit);
  133. }
  134. // 数据全部加载完成
  135. if (this.list.length >= this.total) {
  136. this.finished = true;
  137. }
  138. }, 1000);
  139. },
  140. getBloodDialysisPatient() {
  141. getBloodDialysisPatient(this.page, this.limit).then(response => {
  142. if (response.data.state == 1) {
  143. var patient = response.data.data.patient;
  144. // console.log("病人信息", patient);
  145. let arr = this.patients;
  146. arr.push(...patient);
  147. this.patients = arr;
  148. var total = response.data.data.total;
  149. this.total = total;
  150. // console.log("总计", total);
  151. }
  152. });
  153. },
  154. addPatient() {
  155. this.$router.push("/addPatints");
  156. },
  157. toPatientDetail(id) {
  158. this.$router.push("/patientdetail?patientid=" + id);
  159. },
  160. toback() {
  161. this.$router.push("/homeIndex");
  162. },
  163. SearchAllPatient(val) {
  164. SearchAllPatient(val).then(response => {
  165. if (response.data.state === 1) {
  166. var patient = response.data.data.patient;
  167. console.log("patient", patient);
  168. }
  169. });
  170. }
  171. },
  172. created() {
  173. setRem();
  174. setHeight();
  175. this.getBloodDialysisPatient();
  176. }
  177. };
  178. </script>
  179. <style lang="scss" scoped>
  180. .page_patientManagement {
  181. overflow-y: auto;
  182. height: 100%;
  183. .patientManagementTitle {
  184. background: #fff;
  185. padding: 0 1.125rem;
  186. height: 3.125rem;
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. }
  191. .jiantou {
  192. font-size: 1.5rem;
  193. font-weight: 600;
  194. margin-right: 2rem;
  195. }
  196. .titleName {
  197. font-size: 1.125rem;
  198. font-weight: 600;
  199. color: #000;
  200. }
  201. .iconBox {
  202. display: flex;
  203. align-items: center;
  204. float: right;
  205. }
  206. .iconOne {
  207. font-size: 1.5rem;
  208. }
  209. .add {
  210. margin-left: 1.25rem;
  211. }
  212. .toolBox {
  213. display: flex;
  214. height: 3.125rem;
  215. align-items: center;
  216. .toolOne {
  217. width: 5.625rem;
  218. height: 1.875rem;
  219. background: rgba(246, 246, 246, 1);
  220. border-radius: 5px;
  221. text-align: center;
  222. font-size: 0.8125rem;
  223. color: #8d8d8d;
  224. display: flex;
  225. align-items: center;
  226. justify-content: space-around;
  227. margin-left: 0.875rem;
  228. }
  229. }
  230. .van-dropdown-menu__title {
  231. width: 5.625rem;
  232. height: 1.875rem;
  233. line-height: 1.875rem;
  234. background: rgba(246, 246, 246, 1);
  235. border-radius: 5px;
  236. color: #8d8d8d;
  237. font-size: 0.875rem;
  238. }
  239. .van-dropdown-menu__title::after {
  240. right: 0.5rem;
  241. }
  242. .patientBox {
  243. padding: 0 0.875rem;
  244. background: #fff;
  245. .patientOne {
  246. display: flex;
  247. align-items: center;
  248. height: 3.75rem;
  249. img {
  250. width: 2.5rem;
  251. height: 2.5rem;
  252. margin-right: 0.875rem;
  253. }
  254. }
  255. }
  256. }
  257. ::-webkit-scrollbar {
  258. width: 0;
  259. }
  260. </style>
  261. <style lang="scss">
  262. .page_patientManagement {
  263. .searchBox {
  264. .van-cell__value {
  265. display: flex;
  266. align-items: center;
  267. }
  268. .van-field__body {
  269. width: 100%;
  270. }
  271. }
  272. }
  273. </style>