Scheduling.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. <template>
  2. <div class="scheduling">
  3. <div>
  4. <div class="toolBox">
  5. <div class="toolOne" @click="typeShow = true">
  6. <div style="display: flex;align-items: center;">
  7. {{ type }}
  8. <van-icon name="arrow-down" />
  9. </div>
  10. </div>
  11. <div class="toolOne" @click="startShow = true">
  12. <div style="display: flex;align-items: center;">
  13. {{ startTime }}
  14. <van-icon name="arrow-down" />
  15. </div>
  16. </div>
  17. <div class="toolOne" @click="endShow = true">
  18. <div style="display: flex;align-items: center;">
  19. {{ endTime }}
  20. <van-icon name="arrow-down" />
  21. </div>
  22. </div>
  23. </div>
  24. <div class="adviceBox" v-if="scheduLing.length > 0">
  25. <van-list
  26. v-model="loading"
  27. :finished="finished"
  28. finished-text="没有更多了"
  29. @load="onLoad"
  30. :immediate-check="immediateCheck"
  31. >
  32. <div class="adviceMain">
  33. <div class="adviceOne" v-for="(item,index) in scheduLing" :key="index">
  34. <div class="adviceTitle">
  35. <p>{{getTime(item.schedule_date)}}</p>
  36. <van-icon
  37. class="ellipsis"
  38. name="ellipsis"
  39. @click="toDelete(item.id,index)"
  40. />
  41. </div>
  42. <div class="orderContent">
  43. <p>班次:
  44. <span>{{item.schedule_type}}</span>
  45. </p>
  46. <p>分区:{{item.name}}</p>
  47. <p>机号:{{item.number}}</p>
  48. <p>治疗模式:{{item.mode_id}}</p>
  49. </div>
  50. <div class="all" @click="toEditSchduling(item.id)">全部</div>
  51. </div>
  52. </div>
  53. </van-list>
  54. </div>
  55. <div class="noimgBox" v-else>
  56. <img src="../../../assets/images/none.png" alt />
  57. </div>
  58. </div>
  59. <!-- <div class="add">
  60. <div style="display: flex;align-items: center;">
  61. <van-icon class="addIcon" name="add" />新增
  62. </div>
  63. </div> -->
  64. <!-- 弹出层 -->
  65. <div>
  66. <van-popup
  67. v-model="typeShow"
  68. position="bottom"
  69. :style="{ height: '40%' }"
  70. >
  71. <van-picker
  72. show-toolbar
  73. :columns="columns"
  74. @cancel="onCancel"
  75. @confirm="onConfirm"
  76. />
  77. </van-popup>
  78. <van-popup
  79. v-model="startShow"
  80. position="bottom"
  81. :style="{ height: '40%' }"
  82. >
  83. <van-datetime-picker
  84. v-model="currentDate"
  85. type="date"
  86. :min-date="minDate"
  87. :max-date="maxDate"
  88. @confirm="getstartTime"
  89. @cancel="startShow = false"
  90. />
  91. </van-popup>
  92. <van-popup v-model="endShow" position="bottom" :style="{ height: '40%' }">
  93. <van-datetime-picker
  94. v-model="currentDate"
  95. type="date"
  96. :min-date="minDate"
  97. :max-date="maxDate"
  98. @confirm="getstartTime2"
  99. @cancel="endShow = false"
  100. />
  101. </van-popup>
  102. <van-action-sheet
  103. v-model="newShow"
  104. :actions="actions"
  105. cancel-text="取消"
  106. @select="onCancelOne"
  107. />
  108. </div>
  109. </div>
  110. </template>
  111. <script>
  112. import {
  113. getPatientDetail,
  114. getScheduling,
  115. DeleteScheduling
  116. } from "@/api/patient/patient";
  117. import { uParseTime } from "@/utils/tools";
  118. import Vue from "vue";
  119. import { Dialog } from "vant";
  120. const moment = require("moment");
  121. export default {
  122. props: {
  123. active: Number,
  124. schedulingId: String
  125. },
  126. data() {
  127. return {
  128. newShow: false,
  129. typeShow: false,
  130. startShow: false,
  131. endShow: false,
  132. type: "全部",
  133. types: 0,
  134. columns: [
  135. "HD",
  136. "HDF",
  137. "HD+HP",
  138. "HP",
  139. "HF",
  140. "SCUF",
  141. "IUF",
  142. "HFHD",
  143. "HFHD+HP",
  144. "PHF",
  145. "HFR",
  146. "HDF+HP",
  147. "CRRT",
  148. "腹水回输"
  149. ],
  150. startTime: "请选择",
  151. endTime: "请选择",
  152. minDate: new Date(1970, 0, 1),
  153. maxDate: new Date(2025, 10, 1),
  154. currentDate: new Date(),
  155. actions: [{ name: "删除" }],
  156. showOne: true,
  157. showTwo: false,
  158. limit: 10,
  159. page: 1,
  160. total: 0,
  161. loading: false,
  162. finished: false,
  163. list: [],
  164. patient_id: "",
  165. scheduLing: [],
  166. list: [],
  167. id: 0,
  168. index: 0,
  169. immediateCheck: false,
  170. flag: true
  171. };
  172. },
  173. methods: {
  174. onCancel() {
  175. this.typeShow = false;
  176. },
  177. onConfirm(value) {
  178. this.page = 1;
  179. if (value === "全部") {
  180. this.types = 0;
  181. }
  182. if (value === "HD") {
  183. this.types = 1;
  184. }
  185. if (value === "HDF") {
  186. this.types = 2;
  187. }
  188. if (value === "HD+HP") {
  189. this.types = 3;
  190. }
  191. if (value === "HP") {
  192. this.types = 4;
  193. }
  194. if (value === "HF") {
  195. this.types = 5;
  196. }
  197. if (value === "SCUF") {
  198. this.types = 6;
  199. }
  200. if (value === "IUF") {
  201. this.types = 7;
  202. }
  203. if (value === "HFHD") {
  204. this.types = 8;
  205. }
  206. if (value === "HFHD+HP") {
  207. this.types = 9;
  208. }
  209. if (value === "PHF") {
  210. this.types = 10;
  211. }
  212. if (value === "HFR") {
  213. this.types = 11;
  214. }
  215. if (value === "HDF+HP") {
  216. this.types = 12;
  217. }
  218. if (value === "CRRT") {
  219. this.types = 13;
  220. }
  221. if (value === "腹水回输") {
  222. this.types = 14;
  223. }
  224. this.type = value;
  225. this.typeShow = false;
  226. this.scheduLing = [];
  227. this.getScheduling(
  228. this.patient_id,
  229. this.limit,
  230. this.page,
  231. this.startTime,
  232. this.endTime,
  233. this.types
  234. );
  235. },
  236. getstartTime(value) {
  237. this.page = 1;
  238. let year = value.getFullYear();
  239. let month = value.getMonth() + 1;
  240. let day = value.getDate();
  241. if (month >= 1 && month <= 9) {
  242. month = `0${month}`;
  243. }
  244. if (day >= 1 && day <= 9) {
  245. day = `0${day}`;
  246. }
  247. this.startTime = `${year}-${month}-${day}`;
  248. this.scheduLing = [];
  249. this.getScheduling(
  250. this.patient_id,
  251. this.limit,
  252. this.page,
  253. this.startTime,
  254. this.endTime,
  255. this.types
  256. );
  257. this.startShow = false;
  258. },
  259. getstartTime2(value) {
  260. this.page = 1;
  261. let year = value.getFullYear();
  262. let month = value.getMonth() + 1;
  263. let day = value.getDate();
  264. if (month >= 1 && month <= 9) {
  265. month = `0${month}`;
  266. }
  267. if (day >= 1 && day <= 9) {
  268. day = `0${day}`;
  269. }
  270. this.endTime = `${year}-${month}-${day}`;
  271. this.scheduLing = [];
  272. this.getScheduling(
  273. this.patient_id,
  274. this.limit,
  275. this.page,
  276. this.startTime,
  277. this.endTime,
  278. this.types
  279. );
  280. this.endShow = false;
  281. },
  282. getPatientDetail(patientid) {
  283. getPatientDetail(patientid).then(response => {
  284. if (response.data.state === 1) {
  285. var patientDetail = response.data.data.patientDetail;
  286. if (patientDetail.blood_patients == 0) {
  287. this.showOne = false;
  288. this.showTwo = true;
  289. }
  290. if (patientDetail.blood_patients == 1) {
  291. this.showOne = true;
  292. this.showTwo = false;
  293. }
  294. // console.log('病人详情', patientDetail)
  295. this.patientName = patientDetail.name;
  296. }
  297. });
  298. },
  299. getScheduling(id) {
  300. getScheduling(
  301. id,
  302. this.limit,
  303. this.page,
  304. this.startTime,
  305. this.endTime,
  306. this.types
  307. ).then(response => {
  308. if (response.data.state === 1) {
  309. var scheduling = response.data.data.scheduling;
  310. for (let i = 0; i < scheduling.length; i++) {
  311. if (scheduling[i].schedule_type === 1) {
  312. scheduling[i].schedule_type = "上午";
  313. }
  314. if (scheduling[i].schedule_type === 2) {
  315. scheduling[i].schedule_type = "中午";
  316. }
  317. if (scheduling[i].schedule_type === 3) {
  318. scheduling[i].schedule_type = "下午";
  319. }
  320. if (scheduling[i].mode_id === 1) {
  321. scheduling[i].mode_id = "HD";
  322. }
  323. if (scheduling[i].mode_id === 2) {
  324. scheduling[i].mode_id = "HDF";
  325. }
  326. if (scheduling[i].mode_id === 3) {
  327. scheduling[i].mode_id = "HD+HP";
  328. }
  329. if (scheduling[i].mode_id === 4) {
  330. scheduling[i].mode_id = "HP";
  331. }
  332. if (scheduling[i].mode_id === 5) {
  333. scheduling[i].mode_id = "HF";
  334. }
  335. if (scheduling[i].mode_id === 6) {
  336. scheduling[i].mode_id = "SCUF";
  337. }
  338. if (scheduling[i].mode_id === 7) {
  339. scheduling[i].mode_id = "IUF";
  340. }
  341. if (scheduling[i].mode_id === 8) {
  342. scheduling[i].mode_id = "HFHD";
  343. }
  344. if (scheduling[i].mode_id === 9) {
  345. scheduling[i].mode_id = "HFHD+HP";
  346. }
  347. if (scheduling[i].mode_id === 10) {
  348. scheduling[i].mode_id = "PHF";
  349. }
  350. if (scheduling[i].mode_id === 11) {
  351. scheduling[i].mode_id = "HFR";
  352. }
  353. if (scheduling[i].mode_id === 12) {
  354. scheduling[i].mode_id = "HDF+HP";
  355. }
  356. if (scheduling[i].mode_id === 13) {
  357. scheduling[i].mode_id = "CRRT";
  358. }
  359. if (scheduling[i].mode_id === 14) {
  360. scheduling[i].mode_id = "腹水回输";
  361. }
  362. }
  363. let arr = this.scheduLing;
  364. arr.push(...scheduling);
  365. // console.log('班次', scheduling)
  366. this.scheduLing = arr;
  367. var total = response.data.data.total;
  368. // console.log('total', total)
  369. this.total = total;
  370. this.loading = false;
  371. // console.log('1823792742736487362847623876执行这里')
  372. }
  373. });
  374. },
  375. getScheduling1(id) {
  376. getScheduling(
  377. id,
  378. this.limit,
  379. this.page,
  380. this.startTime,
  381. this.endTime,
  382. this.types
  383. ).then(response => {
  384. if (response.data.state === 1) {
  385. var scheduling = response.data.data.scheduling;
  386. for (let i = 0; i < scheduling.length; i++) {
  387. if (scheduling[i].schedule_type === 1) {
  388. scheduling[i].schedule_type = "上午";
  389. }
  390. if (scheduling[i].schedule_type === 2) {
  391. scheduling[i].schedule_type = "中午";
  392. }
  393. if (scheduling[i].schedule_type === 3) {
  394. scheduling[i].schedule_type = "下午";
  395. }
  396. if (scheduling[i].mode_id === 1) {
  397. scheduling[i].mode_id = "HD";
  398. }
  399. if (scheduling[i].mode_id === 2) {
  400. scheduling[i].mode_id = "HDF";
  401. }
  402. if (scheduling[i].mode_id === 3) {
  403. scheduling[i].mode_id = "HD+HP";
  404. }
  405. if (scheduling[i].mode_id === 4) {
  406. scheduling[i].mode_id = "HP";
  407. }
  408. if (scheduling[i].mode_id === 5) {
  409. scheduling[i].mode_id = "HF";
  410. }
  411. if (scheduling[i].mode_id === 6) {
  412. scheduling[i].mode_id = "SCUF";
  413. }
  414. if (scheduling[i].mode_id === 7) {
  415. scheduling[i].mode_id = "IUF";
  416. }
  417. if (scheduling[i].mode_id === 8) {
  418. scheduling[i].mode_id = "HFHD";
  419. }
  420. if (scheduling[i].mode_id === 9) {
  421. scheduling[i].mode_id = "HFHD+HP";
  422. }
  423. if (scheduling[i].mode_id === 10) {
  424. scheduling[i].mode_id = "PHF";
  425. }
  426. if (scheduling[i].mode_id === 11) {
  427. scheduling[i].mode_id = "HFR";
  428. }
  429. if (scheduling[i].mode_id === 12) {
  430. scheduling[i].mode_id = "HDF+HP";
  431. }
  432. if (scheduling[i].mode_id === 13) {
  433. scheduling[i].mode_id = "CRRT";
  434. }
  435. if (scheduling[i].mode_id === 14) {
  436. scheduling[i].mode_id = "腹水回输";
  437. }
  438. }
  439. this.scheduLing = scheduling;
  440. var total = response.data.data.total;
  441. this.total = total;
  442. this.loading = false;
  443. }
  444. });
  445. },
  446. getTime(time) {
  447. // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
  448. return uParseTime(time, "{y}-{m}-{d}");
  449. },
  450. onLoad() {
  451. setTimeout(() => {
  452. this.page++;
  453. // console.log(this.page)
  454. if (this.page <= Math.ceil(this.total / 10)) {
  455. this.getScheduling(
  456. this.patient_id,
  457. this.startTime,
  458. this.endTimes,
  459. this.limit,
  460. this.page,
  461. this.types
  462. );
  463. } else {
  464. this.loading = false;
  465. this.finished = true;
  466. }
  467. }, 3000);
  468. },
  469. toEditSchduling(id) {
  470. var patientid = this.$route.query.patientid;
  471. this.$router.push(
  472. "/editScheduling?id=" +
  473. id +
  474. "&patientid=" +
  475. patientid +
  476. "&active=" +
  477. this.active
  478. );
  479. },
  480. toDelete(id, index) {
  481. this.id = id;
  482. this.index = index;
  483. this.newShow = true;
  484. },
  485. onCancelOne(value) {
  486. if (value.name == "删除") {
  487. this.DeleteScheduling(this.id, this.index);
  488. }
  489. },
  490. DeleteScheduling(id, index) {
  491. Dialog.confirm({
  492. title: "删除提示!",
  493. message: "确认删除该条信息吗?,删除后将无法恢复!"
  494. }).then(() => {
  495. DeleteScheduling(id).then(response => {
  496. if (response.data.state === 1) {
  497. var msg = response.data.data.msg;
  498. console.log("msg", msg);
  499. this.scheduLing.splice(index, 1);
  500. this.newShow = false;
  501. }
  502. });
  503. });
  504. }
  505. },
  506. created() {
  507. var patientid = this.$route.query.patientid;
  508. this.getPatientDetail(patientid);
  509. this.getScheduling(patientid);
  510. this.patient_id = patientid;
  511. }
  512. };
  513. </script>
  514. <style lang="scss" scoped>
  515. .scheduling {
  516. height: 100%;
  517. // overflow-y: auto;
  518. .toolBox {
  519. display: flex;
  520. height: 3.125rem;
  521. justify-content: space-around;
  522. align-items: center;
  523. .toolOne {
  524. width: 6.25rem;
  525. height: 1.875rem;
  526. background: rgba(246, 246, 246, 1);
  527. border-radius: 5px;
  528. text-align: center;
  529. font-size: 0.8125rem;
  530. color: #8d8d8d;
  531. display: flex;
  532. align-items: center;
  533. justify-content: space-around;
  534. }
  535. }
  536. .adviceBox {
  537. padding: 0 1.125rem;
  538. margin-bottom: 3.125rem;
  539. }
  540. .adviceMain{
  541. >div:last-child{
  542. border: none;
  543. }
  544. }
  545. .adviceOne {
  546. // box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
  547. border-bottom: 1px solid #e5e5e5;
  548. padding-bottom: 0.625rem;
  549. }
  550. .adviceTitle {
  551. padding-top: 0.625rem;
  552. display: flex;
  553. align-items: center;
  554. justify-content: space-between;
  555. p {
  556. color: #000000;
  557. font-weight: bold;
  558. font-size: 0.9375rem;
  559. }
  560. .ellipsis {
  561. font-size: 1.25rem;
  562. color: #cccccc;
  563. }
  564. }
  565. .orderContent {
  566. font-size: 0.875rem;
  567. color: rgba(49, 50, 52, 1);
  568. margin-top: 0.625rem;
  569. display: flex;
  570. flex-wrap: wrap;
  571. p {
  572. line-height: 1.5rem;
  573. width: 50%;
  574. }
  575. }
  576. .doctorBox {
  577. font-size: 0.75rem;
  578. color: rgba(152, 152, 152, 1);
  579. line-height: 1.125rem;
  580. display: flex;
  581. align-items: center;
  582. justify-content: space-between;
  583. margin-top: 0.625rem;
  584. }
  585. .all {
  586. font-size: 0.8125rem;
  587. color: #5b98ff;
  588. margin-top: 0.625rem;
  589. }
  590. .noimgBox {
  591. margin-top: 40%;
  592. img {
  593. width: 9.375rem;
  594. height: 9.375rem;
  595. margin: 0 auto;
  596. display: block;
  597. }
  598. }
  599. .add {
  600. position: fixed;
  601. bottom: 0;
  602. left: 0;
  603. width: 100%;
  604. height: 2.75rem;
  605. background: rgba(255, 255, 255, 1);
  606. box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1);
  607. display: flex;
  608. align-items: center;
  609. justify-content: space-around;
  610. font-size: 0.9375rem;
  611. color: #979798;
  612. .addIcon {
  613. color: #5b98ff;
  614. font-size: 1.25rem;
  615. margin-right: 0.25rem;
  616. }
  617. }
  618. }
  619. ::-webkit-scrollbar {
  620. width: 0;
  621. }
  622. </style>