index.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div class="page_patientManagement">
  3. <!-- <div class="header">
  4. <el-input
  5. placeholder=" 姓名 / 首拼 / 透析号"
  6. prefix-icon="el-icon-search"
  7. v-model="searchVal"
  8. ></el-input>
  9. </div>
  10. <div class="searchList">
  11. <van-tabs
  12. v-model="active"
  13. title-active-color="#000000"
  14. title-inactive-color="#3C3C3C"
  15. @click="getType"
  16. >
  17. <van-tab title="全部">
  18. <van-list
  19. v-model="loading"
  20. :finished="finished"
  21. finished-text="没有更多了"
  22. loading-text="加载中..."
  23. @load="onLoad"
  24. :immediate-check="false"
  25. >
  26. <van-cell>
  27. <template slot="title">
  28. <div
  29. class="searchOne"
  30. v-for="(item, index) in list"
  31. :key="index"
  32. >
  33. <img :src="item.avatar" alt />
  34. <span>{{ item.name }}</span>
  35. </div>
  36. </template>
  37. </van-cell>
  38. </van-list>
  39. </van-tab>
  40. <van-tab title="血透">
  41. <van-list
  42. v-model="loading"
  43. :finished="finished"
  44. loading-text="加载中..."
  45. finished-text="没有更多了"
  46. @load="onLoad"
  47. immediate-check
  48. >
  49. <van-cell>
  50. <template slot="title">
  51. <div
  52. class="searchOne"
  53. v-for="(item, index) in list"
  54. :key="index"
  55. @click="toPatientDetail(item.id, item.user_org_id)"
  56. >
  57. <img :src="item.avatar" alt />
  58. <span>{{ item.name }}</span>
  59. </div>
  60. </template>
  61. </van-cell>
  62. </van-list>
  63. </van-tab>
  64. <van-tab title="慢病">
  65. <van-list
  66. v-model="loading"
  67. :finished="finished"
  68. loading-text="加载中..."
  69. finished-text="没有更多了"
  70. @load="onLoad"
  71. immediate-check
  72. >
  73. <van-cell>
  74. <template slot="title">
  75. <div
  76. class="searchOne"
  77. v-for="(item, index) in list"
  78. :key="index"
  79. @click="toPatientDetail(item.id, item.user_org_id)"
  80. >
  81. <img :src="item.avatar" alt />
  82. <span>{{ item.name }}</span>
  83. </div>
  84. </template>
  85. </van-cell>
  86. </van-list>
  87. </van-tab>
  88. <van-tab title="会员">
  89. <van-list
  90. v-model="loading"
  91. :finished="finished"
  92. loading-text="加载中..."
  93. finished-text="没有更多了"
  94. @load="onLoad"
  95. immediate-check
  96. >
  97. <van-cell>
  98. <template slot="title">
  99. <div
  100. class="searchOne"
  101. v-for="(item, index) in list"
  102. :key="index"
  103. @click="toPatientDetail(item.id, item.user_org_id)"
  104. >
  105. <img :src="item.avatar" alt />
  106. <span>{{ item.name }}</span>
  107. </div>
  108. </template>
  109. </van-cell>
  110. </van-list>
  111. </van-tab>
  112. <van-tab title="电商">电商</van-tab>
  113. </van-tabs>
  114. </div>
  115. <div class="add" @click="ToAddPatient()">
  116. <img src="../../assets/images/add.png" alt />
  117. </div>-->
  118. <van-sticky>
  119. <div class="patientManagementTitle">
  120. <i class="iconfont icon-zuojiantou jiantou"></i>
  121. <span class="titleName">患者中心</span>
  122. <div class="iconBox">
  123. <i class="iconfont icon-sousuo iconOne"></i>
  124. <van-icon class="iconOne add" name="add-o" />
  125. </div>
  126. </div>
  127. </van-sticky>
  128. <div class="searchBox">
  129. <van-search v-model="value" placeholder="搜索患者透析号/姓名/首拼" />
  130. </div>
  131. <div class="chooseBox">
  132. <van-tabs v-model="active" sticky>
  133. <van-tab title="标签 1">
  134. <div class="toolBox">
  135. <div class="toolOne" @click="typeShow = true">
  136. <div style="display: flex;align-items: center;">
  137. {{ type }}
  138. <van-icon name="arrow-down" />
  139. </div>
  140. </div>
  141. <div class="toolOne" @click="typeShow = true">
  142. <div style="display: flex;align-items: center;">
  143. {{ type }}
  144. <van-icon name="arrow-down" />
  145. </div>
  146. </div>
  147. </div>
  148. <div class="patientBox">
  149. <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
  150. <div class="patientOne" v-for="item in list" :key="item">
  151. <img src="../../assets/images/one.jpg" alt />
  152. <p>名字</p>
  153. </div>
  154. </van-list>
  155. </div>
  156. </van-tab>
  157. <van-tab title="标签 2">内容 2</van-tab>
  158. <van-tab title="标签 3">内容 3</van-tab>
  159. <van-tab title="标签 4">内容 4</van-tab>
  160. </van-tabs>
  161. </div>
  162. <!-- 弹出层 -->
  163. <div>
  164. <van-popup v-model="typeShow" position="bottom" :style="{ height: '40%' }">
  165. <van-picker show-toolbar :columns="columns" @cancel="onCancel" @confirm="onConfirm" />
  166. </van-popup>
  167. <van-popup v-model="startShow" position="bottom" :style="{ height: '40%' }">
  168. <van-datetime-picker
  169. v-model="currentDate"
  170. type="date"
  171. :min-date="minDate"
  172. :max-date="maxDate"
  173. @confirm="getstartTime"
  174. @cancel="startShow = false"
  175. />
  176. </van-popup>
  177. <van-popup v-model="endShow" position="bottom" :style="{ height: '40%' }">
  178. <van-datetime-picker
  179. v-model="currentDate"
  180. type="date"
  181. :min-date="minDate"
  182. :max-date="maxDate"
  183. @confirm="getstartTime2"
  184. @cancel="endShow = false"
  185. />
  186. </van-popup>
  187. <van-action-sheet v-model="newShow" :actions="actions" cancel-text="取消" @cancel="onCancel" />
  188. </div>
  189. </div>
  190. </template>
  191. <script>
  192. import { getBloodDialysisPatient } from "@/api/login/login";
  193. export default {
  194. data() {
  195. return {
  196. typeShow: false,
  197. startShow: false,
  198. endShow: false,
  199. type: "归转状态",
  200. columns: [
  201. "杭州",
  202. "宁波",
  203. "温州",
  204. "嘉兴",
  205. "湖州",
  206. "杭州",
  207. "宁波",
  208. "温州",
  209. "嘉兴",
  210. "湖州"
  211. ],
  212. searchVal: "",
  213. active: 0,
  214. list: [],
  215. loading: false,
  216. finished: false,
  217. page: 0,
  218. limit: 10,
  219. total: 0,
  220. //
  221. value1: 0,
  222. value2: "a",
  223. value3: "a",
  224. option1: [
  225. { text: "患者类型", value: 0 },
  226. { text: "新款商品新款商品新款商品", value: 1 },
  227. { text: "活动商品", value: 2 }
  228. ],
  229. option2: [
  230. { text: "转规状态", value: "a" },
  231. { text: "好评排序", value: "b" },
  232. { text: "销量排序", value: "c" }
  233. ],
  234. option3: [
  235. { text: "患者来源", value: "a" },
  236. { text: "好评排序", value: "b" },
  237. { text: "销量排序", value: "c" }
  238. ],
  239. list: [],
  240. loading: false,
  241. finished: false
  242. };
  243. },
  244. methods: {
  245. onCancel() {
  246. this.typeShow = false;
  247. },
  248. onConfirm(value) {
  249. this.type = value;
  250. this.typeShow = false;
  251. },
  252. onLoad() {
  253. setTimeout(() => {
  254. for (let i = 0; i < 10; i++) {
  255. this.list.push(this.list.length + 1);
  256. }
  257. // 加载状态结束
  258. this.loading = false;
  259. // 数据全部加载完成
  260. if (this.list.length >= 40) {
  261. this.finished = true;
  262. }
  263. }, 1000);
  264. //
  265. // this.page++;
  266. // console.log(this.page);
  267. // console.log(this.total);
  268. // if (this.page <= Math.ceil(this.total / 10)) {
  269. // this.getBloodDialysisPatient(this.page, this.limit);
  270. // this.finished = false;
  271. // } else {
  272. // // eslint-disable-next-line no-irregular-whitespace
  273. // // this.finished = true
  274. // // eslint-disable-next-line no-irregular-whitespace
  275. // this.loading = false;
  276. // this.finished = true;
  277. // }
  278. },
  279. getType(type) {
  280. console.log("type是什么", type);
  281. if (type === 0) {
  282. this.loading = false;
  283. this.finished = false;
  284. this.getBloodDialysisPatient();
  285. }
  286. // eslint-disable-next-line no-empty
  287. if (type === 1) {
  288. // eslint-disable-next-line no-irregular-whitespace
  289. this.loading = false;
  290. this.finished = false;
  291. this.getBloodDialysisPatient();
  292. }
  293. if (type === 2) {
  294. this.loading = false;
  295. this.finished = false;
  296. this.getBloodDialysisPatient();
  297. }
  298. if (type === 3) {
  299. this.loading = false;
  300. this.finished = false;
  301. this.getBloodDialysisPatient();
  302. }
  303. },
  304. getBloodDialysisPatient() {
  305. // eslint-disable-next-line no-undef
  306. var id = this.$route.query.id;
  307. setTimeout(() => {
  308. getBloodDialysisPatient(this.page, this.limit, id).then(response => {
  309. // eslint-disable-next-line no-empty
  310. if (response.data.state === 1) {
  311. var patients = response.data.data.patients;
  312. console.log("patients", patients);
  313. this.list.push(...patients);
  314. console.log("this.list是什么", this.list);
  315. var total = response.data.data.total;
  316. this.total = total;
  317. this.onLoad();
  318. }
  319. this.loading = false;
  320. });
  321. }, 500);
  322. },
  323. toPatientDetail(patientid, orgid) {
  324. this.$router.push(
  325. "/patientdetail?patientid=" + patientid + "&orgid=" + orgid
  326. );
  327. },
  328. ToAddPatient() {
  329. var id = this.$route.query.id;
  330. this.$router.push("/addpatient?id=" + id);
  331. }
  332. },
  333. created() {}
  334. };
  335. </script>
  336. <style lang="scss" scoped>
  337. .page_patientManagement {
  338. overflow-y: auto;
  339. height: 100%;
  340. .patientManagementTitle {
  341. background: #fff;
  342. padding: 0 1.125rem;
  343. height: 3.125rem;
  344. display: flex;
  345. align-items: center;
  346. justify-content: space-between;
  347. }
  348. .jiantou {
  349. font-size: 1.5rem;
  350. font-weight: 600;
  351. margin-right: 3rem;
  352. }
  353. .titleName {
  354. font-size: 1.125rem;
  355. font-weight: 600;
  356. }
  357. .iconBox {
  358. display: flex;
  359. align-items: center;
  360. float: right;
  361. }
  362. .iconOne {
  363. font-size: 1.5rem;
  364. }
  365. .add {
  366. margin-left: 1.25rem;
  367. }
  368. .toolBox {
  369. display: flex;
  370. height: 3.125rem;
  371. align-items: center;
  372. .toolOne {
  373. width: 5.625rem;
  374. height: 1.875rem;
  375. background: rgba(246, 246, 246, 1);
  376. border-radius: 5px;
  377. text-align: center;
  378. font-size: 0.8125rem;
  379. color: #8d8d8d;
  380. display: flex;
  381. align-items: center;
  382. justify-content: space-around;
  383. margin-left: 0.875rem;
  384. }
  385. }
  386. .van-dropdown-menu__title {
  387. width: 5.625rem;
  388. height: 1.875rem;
  389. line-height: 1.875rem;
  390. background: rgba(246, 246, 246, 1);
  391. border-radius: 5px;
  392. color: #8d8d8d;
  393. font-size: 0.875rem;
  394. }
  395. .van-dropdown-menu__title::after {
  396. right: 0.5rem;
  397. }
  398. .patientBox {
  399. padding: 0 0.875rem;
  400. .patientOne {
  401. display: flex;
  402. align-items: center;
  403. height: 3.75rem;
  404. img {
  405. width: 2.5rem;
  406. height: 2.5rem;
  407. margin-right: 0.875rem;
  408. }
  409. }
  410. }
  411. }
  412. ::-webkit-scrollbar {
  413. width: 0;
  414. }
  415. </style>
  416. <style lang="scss">
  417. .page_patientManagement {
  418. .searchBox {
  419. .van-cell__value {
  420. display: flex;
  421. align-items: center;
  422. }
  423. .van-field__body {
  424. width: 100%;
  425. }
  426. }
  427. }
  428. </style>