Blood.vue 6.3KB

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