Scheduling.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  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" @click="toEditSchduling(item.id)">
  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: '查看全部' }, { 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.scheduLing = []
  288. this.showOne = false
  289. this.showTwo = true
  290. }
  291. if (patientDetail.blood_patients == 1) {
  292. this.showOne = true
  293. this.showTwo = false
  294. }
  295. // console.log('病人详情', patientDetail)
  296. this.patientName = patientDetail.name
  297. }
  298. })
  299. },
  300. getScheduling (id) {
  301. getScheduling(
  302. id,
  303. this.limit,
  304. this.page,
  305. this.startTime,
  306. this.endTime,
  307. this.types
  308. ).then(response => {
  309. if (response.data.state === 1) {
  310. var scheduling = response.data.data.scheduling
  311. for (let i = 0; i < scheduling.length; i++) {
  312. if (scheduling[i].schedule_type === 1) {
  313. scheduling[i].schedule_type = '上午'
  314. }
  315. if (scheduling[i].schedule_type === 2) {
  316. scheduling[i].schedule_type = '中午'
  317. }
  318. if (scheduling[i].schedule_type === 3) {
  319. scheduling[i].schedule_type = '下午'
  320. }
  321. if (scheduling[i].mode_id === 1) {
  322. scheduling[i].mode_id = 'HD'
  323. }
  324. if (scheduling[i].mode_id === 2) {
  325. scheduling[i].mode_id = 'HDF'
  326. }
  327. if (scheduling[i].mode_id === 3) {
  328. scheduling[i].mode_id = 'HD+HP'
  329. }
  330. if (scheduling[i].mode_id === 4) {
  331. scheduling[i].mode_id = 'HP'
  332. }
  333. if (scheduling[i].mode_id === 5) {
  334. scheduling[i].mode_id = 'HF'
  335. }
  336. if (scheduling[i].mode_id === 6) {
  337. scheduling[i].mode_id = 'SCUF'
  338. }
  339. if (scheduling[i].mode_id === 7) {
  340. scheduling[i].mode_id = 'IUF'
  341. }
  342. if (scheduling[i].mode_id === 8) {
  343. scheduling[i].mode_id = 'HFHD'
  344. }
  345. if (scheduling[i].mode_id === 9) {
  346. scheduling[i].mode_id = 'HFHD+HP'
  347. }
  348. if (scheduling[i].mode_id === 10) {
  349. scheduling[i].mode_id = 'PHF'
  350. }
  351. if (scheduling[i].mode_id === 11) {
  352. scheduling[i].mode_id = 'HFR'
  353. }
  354. if (scheduling[i].mode_id === 12) {
  355. scheduling[i].mode_id = 'HDF+HP'
  356. }
  357. if (scheduling[i].mode_id === 13) {
  358. scheduling[i].mode_id = 'CRRT'
  359. }
  360. if (scheduling[i].mode_id === 14) {
  361. scheduling[i].mode_id = '腹水回输'
  362. }
  363. }
  364. let arr = this.scheduLing
  365. arr.push(...scheduling)
  366. // console.log('班次', scheduling)
  367. this.scheduLing = arr
  368. var total = response.data.data.total
  369. // console.log('total', total)
  370. this.total = total
  371. this.loading = false
  372. // console.log('1823792742736487362847623876执行这里')
  373. }
  374. })
  375. },
  376. getScheduling1 (id) {
  377. getScheduling(
  378. id,
  379. this.limit,
  380. this.page,
  381. this.startTime,
  382. this.endTime,
  383. this.types
  384. ).then(response => {
  385. if (response.data.state === 1) {
  386. var scheduling = response.data.data.scheduling
  387. for (let i = 0; i < scheduling.length; i++) {
  388. if (scheduling[i].schedule_type === 1) {
  389. scheduling[i].schedule_type = '上午'
  390. }
  391. if (scheduling[i].schedule_type === 2) {
  392. scheduling[i].schedule_type = '中午'
  393. }
  394. if (scheduling[i].schedule_type === 3) {
  395. scheduling[i].schedule_type = '下午'
  396. }
  397. if (scheduling[i].mode_id === 1) {
  398. scheduling[i].mode_id = 'HD'
  399. }
  400. if (scheduling[i].mode_id === 2) {
  401. scheduling[i].mode_id = 'HDF'
  402. }
  403. if (scheduling[i].mode_id === 3) {
  404. scheduling[i].mode_id = 'HD+HP'
  405. }
  406. if (scheduling[i].mode_id === 4) {
  407. scheduling[i].mode_id = 'HP'
  408. }
  409. if (scheduling[i].mode_id === 5) {
  410. scheduling[i].mode_id = 'HF'
  411. }
  412. if (scheduling[i].mode_id === 6) {
  413. scheduling[i].mode_id = 'SCUF'
  414. }
  415. if (scheduling[i].mode_id === 7) {
  416. scheduling[i].mode_id = 'IUF'
  417. }
  418. if (scheduling[i].mode_id === 8) {
  419. scheduling[i].mode_id = 'HFHD'
  420. }
  421. if (scheduling[i].mode_id === 9) {
  422. scheduling[i].mode_id = 'HFHD+HP'
  423. }
  424. if (scheduling[i].mode_id === 10) {
  425. scheduling[i].mode_id = 'PHF'
  426. }
  427. if (scheduling[i].mode_id === 11) {
  428. scheduling[i].mode_id = 'HFR'
  429. }
  430. if (scheduling[i].mode_id === 12) {
  431. scheduling[i].mode_id = 'HDF+HP'
  432. }
  433. if (scheduling[i].mode_id === 13) {
  434. scheduling[i].mode_id = 'CRRT'
  435. }
  436. if (scheduling[i].mode_id === 14) {
  437. scheduling[i].mode_id = '腹水回输'
  438. }
  439. }
  440. this.scheduLing = scheduling
  441. var total = response.data.data.total
  442. this.total = total
  443. this.loading = false
  444. }
  445. })
  446. },
  447. getTime (time) {
  448. // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
  449. return uParseTime(time, '{y}-{m}-{d}')
  450. },
  451. onLoad () {
  452. setTimeout(() => {
  453. this.page++
  454. // console.log(this.page)
  455. if (this.page <= Math.ceil(this.total / 10)) {
  456. this.getScheduling(
  457. this.patient_id,
  458. this.startTime,
  459. this.endTimes,
  460. this.limit,
  461. this.page,
  462. this.types
  463. )
  464. } else {
  465. this.loading = false
  466. this.finished = true
  467. }
  468. }, 3000)
  469. },
  470. toEditSchduling (id) {
  471. var patientid = this.$route.query.patientid
  472. this.$router.push(
  473. '/editScheduling?id=' +
  474. id +
  475. '&patientid=' +
  476. patientid +
  477. '&active=' +
  478. this.active
  479. )
  480. },
  481. toDelete (id, index) {
  482. this.id = id
  483. this.index = index
  484. this.newShow = true
  485. },
  486. onCancelOne (value) {
  487. if (value.name == '查看全部') {
  488. var patientid = this.$route.query.patientid
  489. this.$router.push(
  490. '/editScheduling?id=' +
  491. this.id +
  492. '&patientid=' +
  493. patientid +
  494. '&active=' +
  495. this.active
  496. )
  497. }
  498. if (value.name == '全部删除') {
  499. this.DeleteScheduling(this.id, this.index)
  500. }
  501. },
  502. DeleteScheduling (id, index) {
  503. Dialog.confirm({
  504. title: '删除提示!',
  505. message: '确认删除该条信息吗?,删除后将无法恢复!'
  506. }).then(() => {
  507. DeleteScheduling(id).then(response => {
  508. if (response.data.state === 1) {
  509. var msg = response.data.data.msg
  510. console.log('msg', msg)
  511. this.scheduLing.splice(index, 1)
  512. this.newShow = false
  513. }
  514. })
  515. })
  516. }
  517. },
  518. created () {
  519. var patientid = this.$route.query.patientid
  520. this.getPatientDetail(patientid)
  521. this.getScheduling(patientid)
  522. this.patient_id = patientid
  523. }
  524. }
  525. </script>
  526. <style lang="scss" scoped>
  527. .scheduling {
  528. height: 100%;
  529. // overflow-y: auto;
  530. .toolBox {
  531. display: flex;
  532. height: 3.125rem;
  533. justify-content: space-around;
  534. align-items: center;
  535. .toolOne {
  536. width: 6.25rem;
  537. height: 1.875rem;
  538. background: rgba(246, 246, 246, 1);
  539. border-radius: 5px;
  540. text-align: center;
  541. font-size: 0.8125rem;
  542. color: #8d8d8d;
  543. display: flex;
  544. align-items: center;
  545. justify-content: space-around;
  546. }
  547. }
  548. .adviceBox {
  549. padding: 0 1.125rem;
  550. margin-bottom: 3.125rem;
  551. }
  552. .adviceMain {
  553. > div:last-child {
  554. border: none;
  555. }
  556. }
  557. .adviceOne {
  558. // box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
  559. border-bottom: 1px solid #e5e5e5;
  560. padding-bottom: 0.625rem;
  561. }
  562. .adviceTitle {
  563. padding-top: 0.625rem;
  564. display: flex;
  565. align-items: center;
  566. justify-content: space-between;
  567. p {
  568. color: #000000;
  569. font-weight: bold;
  570. font-size: 0.9375rem;
  571. }
  572. .ellipsis {
  573. font-size: 1.25rem;
  574. color: #cccccc;
  575. }
  576. }
  577. .orderContent {
  578. font-size: 0.875rem;
  579. color: rgba(49, 50, 52, 1);
  580. margin-top: 0.625rem;
  581. display: flex;
  582. flex-wrap: wrap;
  583. p {
  584. line-height: 1.5rem;
  585. width: 50%;
  586. }
  587. }
  588. .doctorBox {
  589. font-size: 0.75rem;
  590. color: rgba(152, 152, 152, 1);
  591. line-height: 1.125rem;
  592. display: flex;
  593. align-items: center;
  594. justify-content: space-between;
  595. margin-top: 0.625rem;
  596. }
  597. .all {
  598. font-size: 0.8125rem;
  599. color: #5b98ff;
  600. margin-top: 0.625rem;
  601. }
  602. .noimgBox {
  603. margin-top: 40%;
  604. img {
  605. width: 9.375rem;
  606. height: 9.375rem;
  607. margin: 0 auto;
  608. display: block;
  609. }
  610. }
  611. .add {
  612. position: fixed;
  613. bottom: 0;
  614. left: 0;
  615. width: 100%;
  616. height: 2.75rem;
  617. background: rgba(255, 255, 255, 1);
  618. box-shadow: 0px -1px 0px 0px rgba(0, 0, 0, 0.1);
  619. display: flex;
  620. align-items: center;
  621. justify-content: space-around;
  622. font-size: 0.9375rem;
  623. color: #979798;
  624. .addIcon {
  625. color: #5b98ff;
  626. font-size: 1.25rem;
  627. margin-right: 0.25rem;
  628. }
  629. }
  630. }
  631. ::-webkit-scrollbar {
  632. width: 0;
  633. }
  634. </style>