Blood.vue 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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 { getAllBloodDialysisPatient } from "@/api/patient/patient";
  66. export default {
  67. props: {
  68. searchValue: String
  69. },
  70. data() {
  71. return {
  72. value: "",
  73. typeShow: false,
  74. typeShowOne: false,
  75. startShow: false,
  76. endShow: false,
  77. type: "归转状态",
  78. typeOne: "患者来源",
  79. columns: ["留治", "转出"],
  80. columnsOne: ["门诊", "转院"],
  81. searchVal: "",
  82. active: 0,
  83. list: [],
  84. loading: false,
  85. finished: false,
  86. page: 1,
  87. limit: 10,
  88. total: 0,
  89. value1: 0,
  90. value2: "a",
  91. value3: "a",
  92. option1: [
  93. { text: "患者类型", value: 0 },
  94. { text: "新款商品新款商品新款商品", value: 1 },
  95. { text: "活动商品", value: 2 }
  96. ],
  97. option2: [
  98. { text: "转规状态", value: "a" },
  99. { text: "好评排序", value: "b" },
  100. { text: "销量排序", value: "c" }
  101. ],
  102. option3: [
  103. { text: "患者来源", value: "a" },
  104. { text: "好评排序", value: "b" },
  105. { text: "销量排序", value: "c" }
  106. ],
  107. list: [],
  108. loading: false,
  109. finished: false,
  110. patients: []
  111. };
  112. },
  113. methods: {
  114. onCancel(value) {
  115. this.typeShow = false;
  116. },
  117. onConfirm(value) {
  118. this.type = value;
  119. this.typeShow = false;
  120. },
  121. onCancelOne(value) {
  122. this.typeOne = value;
  123. this.typeShowOne = false;
  124. },
  125. onConfirmOne(value) {
  126. this.typeOne = value;
  127. this.typeShowOne = false;
  128. },
  129. getAllBloodDialysisPatient() {
  130. getAllBloodDialysisPatient(this.page, this.limit).then(response => {
  131. if (response.data.state === 1) {
  132. var patient = response.data.data.bloodpatient;
  133. let arr = this.patients;
  134. arr.push(...patient);
  135. this.patients = arr;
  136. var total = response.data.data.total;
  137. this.total = total;
  138. }
  139. });
  140. },
  141. onLoad() {
  142. setTimeout(() => {
  143. for (let i = 0; i < this.limit; i++) {
  144. this.list.push(this.list.length + 1);
  145. }
  146. // 加载状态结束
  147. this.loading = false;
  148. console.log("长度", this.patients.length);
  149. if (this.patients.length >= 10) {
  150. this.page++;
  151. this.getAllBloodDialysisPatient(this.page, this.limit);
  152. }
  153. console.log("页数", this.page);
  154. // 数据全部加载完成
  155. if (this.list.length >= this.total) {
  156. this.finished = true;
  157. }
  158. }, 1000);
  159. },
  160. toPatientDetail(id) {
  161. this.$router.push("/patientdetail?patientid=" + id);
  162. }
  163. },
  164. created() {
  165. console.log(this.searchValue);
  166. this.getAllBloodDialysisPatient();
  167. },
  168. watch: {
  169. searchValue(newVal) {
  170. console.log(newVal);
  171. }
  172. }
  173. };
  174. </script>
  175. <style lang="scss" scoped>
  176. .page_patientManagement {
  177. overflow-y: auto;
  178. height: 100%;
  179. background: #fff;
  180. .patientManagementTitle {
  181. background: #fff;
  182. padding: 0 1.125rem;
  183. height: 3.125rem;
  184. display: flex;
  185. align-items: center;
  186. justify-content: space-between;
  187. }
  188. .jiantou {
  189. font-size: 1.5rem;
  190. font-weight: 600;
  191. margin-right: 3rem;
  192. }
  193. .titleName {
  194. font-size: 1.125rem;
  195. font-weight: 600;
  196. }
  197. .iconBox {
  198. display: flex;
  199. align-items: center;
  200. float: right;
  201. }
  202. .iconOne {
  203. font-size: 1.5rem;
  204. }
  205. .add {
  206. margin-left: 1.25rem;
  207. }
  208. .toolBox {
  209. display: flex;
  210. height: 3.125rem;
  211. align-items: center;
  212. .toolOne {
  213. width: 5.625rem;
  214. height: 1.875rem;
  215. background: rgba(246, 246, 246, 1);
  216. border-radius: 5px;
  217. text-align: center;
  218. font-size: 0.8125rem;
  219. color: #8d8d8d;
  220. display: flex;
  221. align-items: center;
  222. justify-content: space-around;
  223. margin-left: 0.875rem;
  224. }
  225. }
  226. .van-dropdown-menu__title {
  227. width: 5.625rem;
  228. height: 1.875rem;
  229. line-height: 1.875rem;
  230. background: rgba(246, 246, 246, 1);
  231. border-radius: 5px;
  232. color: #8d8d8d;
  233. font-size: 0.875rem;
  234. }
  235. .van-dropdown-menu__title::after {
  236. right: 0.5rem;
  237. }
  238. .patientBox {
  239. padding: 0 0.875rem;
  240. .patientOne {
  241. display: flex;
  242. align-items: center;
  243. height: 3.75rem;
  244. img {
  245. width: 2.5rem;
  246. height: 2.5rem;
  247. margin-right: 0.875rem;
  248. }
  249. }
  250. }
  251. }
  252. ::-webkit-scrollbar {
  253. width: 0;
  254. }
  255. </style>
  256. <style lang="scss">
  257. .page_patientManagement {
  258. .searchBox {
  259. .van-cell__value {
  260. display: flex;
  261. align-items: center;
  262. }
  263. .van-field__body {
  264. width: 100%;
  265. }
  266. }
  267. }
  268. </style>