index.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <view class="dialysis">
  3. <view class="info">
  4. <!-- <img class="infoImg" src="../../static/images/avatar.png" alt=""> -->
  5. <view class="infoRight">
  6. <view class="infoTitle">
  7. 上次透析时间:<span>{{ sctx.schedule_date ? formatDate(sctx.schedule_date, 'yyyy-MM-dd') : '' }}</span><span>
  8. <text v-if="sctx.schedule_type == 1">上午</text>
  9. <text v-if="sctx.schedule_type == 2">下午</text>
  10. <text v-if="sctx.schedule_type == 3">晚上</text>
  11. <!-- <text v-else>暂无</text> -->
  12. </span> </view>
  13. <view class="infoTitle">
  14. 下次透析时间:<span>{{ patientSchedule.schedule_date ? formatDate(patientSchedule.schedule_date, 'yyyy-MM-dd') : '' }}</span><span>
  15. <text v-if="patientSchedule.schedule_type == 1">上午</text>
  16. <text v-if="patientSchedule.schedule_type == 2">下午</text>
  17. <text v-if="patientSchedule.schedule_type == 3">晚上</text>
  18. <!-- <text v-else>暂无</text> -->
  19. &nbsp;床位:{{patientSchedule.Number ? patientSchedule.Number : ' '}}
  20. </span>
  21. </view>
  22. </view>
  23. <view class="dialysing">
  24. <view class="dia_cxt">
  25. <p v-if='order.created_time > 0 && nowTime<xiaji_time'>{{'正在透析中...'}}</p>
  26. <p v-if='modeid < 1 && order.created_time <= 0'>{{'暂无排班信息'}}</p>
  27. <p v-if='modeid > 0 && order.created_time <= 0'>{{'今天已有排班'}}&nbsp;床位:{{bedname}}</p>
  28. <p v-if="nowTime>xiaji_time && order.created_time > 0">{{'已下机'}}</p>
  29. <view style="margin-top: 40rpx;line-height: 50rpx;" v-if='order.created_time > 0 && nowTime<xiaji_time'>
  30. <p style="text-align: right;font-size: 28rpx;max-width: 570rpx;">
  31. 上机时间:{{formatDate(sahngji_time,'yyyy-MM-dd hh:mm:ss' )}} &nbsp;床位:{{bedname}}</p>
  32. <p style="text-align: right;font-size: 28rpx;max-width: 570rpx;">
  33. 预计下机时间:{{ estimate(order.created_time, 'hh:mm') }}</p>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="appBox">
  39. <view class="app" @click="toPage(1)">
  40. <img class="imgApp" src="../../static/images/app1new.png" alt="">
  41. <view class="intro">透析签到</view>
  42. </view>
  43. <view class="app" @click="toPage(4)">
  44. <img class="imgApp" src="../../static/images/app3new.png" alt="">
  45. <view class="intro">体征记录</view>
  46. </view>
  47. <view class="app" @click="toPage(2)">
  48. <img class="imgApp" src="../../static/images/app2new.png" alt="">
  49. <!-- <img class="imgApp" src="../../subPackages/static/images/app2new.png" alt="" /> -->
  50. <view class="intro">透析记录</view>
  51. </view>
  52. <view class="app" @click="toPage(6)">
  53. <img class="imgApp" src="../../static/images/app4new.png" alt="">
  54. <!-- <img class="imgApp" src="../../subPackages/static/images/app4new.png" alt=""> -->
  55. <view class="intro">预交金查询</view>
  56. </view>
  57. <view class="app" @click="toPage(8)">
  58. <img class="imgApp" src="../../static/images/app5new.png" alt="">
  59. <view class="intro">检查报告</view>
  60. </view>
  61. </view>
  62. <van-toast id="van-toast" />
  63. <!-- <view class="bgLine"></view> -->
  64. <view class="titleBox">
  65. <view class="titleBox_l">
  66. <view class="line"></view>
  67. 我的排班
  68. </view>
  69. <view class="week_sel">
  70. <ren-dropdown-filter :filterData='filterData' :defaultIndex='defaultIndex' @ed='ed' @onSelected='onSelectedop'>
  71. </ren-dropdown-filter>
  72. </view>
  73. </view>
  74. <view class="scheduling">
  75. <view class="schedulingLeft">
  76. <view class="classes"></view>
  77. <view class="classes">上午</view>
  78. <view class="classes">下午</view>
  79. <view class="classes">晚上</view>
  80. </view>
  81. <scroll-view class="scrollBox" scroll-x="true" :scroll-left="scrollLeft">
  82. <view class="scroll-view_H">
  83. <view class="square" v-for="item in mon" style="font-size: 26rpx;">
  84. <view v-if="item.schedule_week == 1">周一</view>
  85. <view v-if="item.schedule_week == 2">周二</view>
  86. <view v-if="item.schedule_week == 3">周三</view>
  87. <view v-if="item.schedule_week == 4">周四</view>
  88. <view v-if="item.schedule_week == 5">周五</view>
  89. <view v-if="item.schedule_week == 6">周六</view>
  90. <view v-if="item.schedule_week == 7">周日</view>
  91. <view>{{ formatDate(item.schedule_date, "dd") }}</view>
  92. </view>
  93. </view>
  94. <!-- :key="index + 222" :key="index + 000" :key="index + 111"-->
  95. <view class="scroll-view_H">
  96. <view :class="item.mode_id != '' ? 'square active' : 'square'" v-for="(item,index) in mon"
  97. >
  98. <text v-if="item.mode_id">
  99. {{ getModeId(item.mode_id) }}
  100. </text>
  101. </view>
  102. </view>
  103. <view class="scroll-view_H">
  104. <view :class="item.mode_id != '' ? 'square active' : 'square'" v-for="(item,index) in aft"
  105. ><text v-if="item.mode_id">{{ getModeId(item.mode_id) }}</text></view>
  106. </view>
  107. <view class="scroll-view_H">
  108. <view :class="item.mode_id != '' ? 'square active' : 'square'" v-for="(item,index) in eve"
  109. ><text v-if="item.mode_id">{{ getModeId(item.mode_id) }}</text></view>
  110. </view>
  111. </scroll-view>
  112. </view>
  113. </view>
  114. </template>
  115. <script>
  116. import Toast from '@/wxcomponents/vant/toast/toast';
  117. import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
  118. import {
  119. getSchedule
  120. } from '@/api/api.js';
  121. import {formatDate} from "@/utils/formatDate.js"
  122. import moment from 'moment'
  123. export default {
  124. components: {
  125. RenDropdownFilter
  126. },
  127. data() {
  128. return {
  129. sel_index:'本周',
  130. value1: 0,
  131. value2: 'a',
  132. filterData: [
  133. [{
  134. text: '本周',
  135. value: 0
  136. }, {
  137. text: '下周',
  138. value: 1
  139. }]
  140. ],
  141. defaultIndex: [0],
  142. patient_id: 0,
  143. schedule: [],
  144. mon: [{
  145. schedule_week: 1,
  146. mode_id: 1
  147. }, {
  148. schedule_week: 2,
  149. mode_id: ""
  150. }, {
  151. schedule_week: 3
  152. }, {
  153. schedule_week: 4
  154. }, {
  155. schedule_week: 5
  156. }, {
  157. schedule_week: 6
  158. }, {
  159. schedule_week: 7
  160. }],
  161. aft: [{
  162. schedule_week: 1,
  163. mode_id: 1
  164. }, {
  165. schedule_week: 2
  166. }, {
  167. schedule_week: 3
  168. }, {
  169. schedule_week: 4
  170. }, {
  171. schedule_week: 5
  172. }, {
  173. schedule_week: 6
  174. }, {
  175. schedule_week: 7
  176. }],
  177. eve: [{
  178. schedule_week: 1,
  179. mode_id: 1
  180. }, {
  181. schedule_week: 2
  182. }, {
  183. schedule_week: 3
  184. }, {
  185. schedule_week: 4,
  186. mode_id: 3
  187. }, {
  188. schedule_week: 5
  189. }, {
  190. schedule_week: 6
  191. }, {
  192. schedule_week: 7
  193. }],
  194. scrollLeft: 0,
  195. patientSchedule: {},
  196. order: {},
  197. patient: {},
  198. prescription: {},
  199. sahngji_time:'',
  200. nowTime:0,
  201. xiaji_time:0,
  202. sctx:'',
  203. list:[],
  204. modeid:0,
  205. bedid:0,
  206. bedname:'',
  207. // zhuoyi:'',
  208. // zhuomo:'',
  209. }
  210. },
  211. onLoad() {
  212. this.patient = this.$store.state.data.userInfo
  213. this.patient_id = this.$store.state.data.userInfo.id
  214. this.getSchedule(this.patient_id)
  215. },
  216. methods: {
  217. async getSchedule(patient_id) {
  218. let params = {
  219. patient_id: patient_id
  220. }
  221. let res = await getSchedule(params, true)
  222. this.order = res.data.data.order
  223. this.patientSchedule = res.data.data.patientSchedule
  224. this.prescription = res.data.data.prescription
  225. this.sahngji_time = res.data.data.order.created_time
  226. this.devicenumber = res.data.data.devicenumber
  227. // this.xiaji_time = res.data.data.order.updated_time
  228. var list =res.data.data.list
  229. // this.list = list
  230. this.estimate2(this.sahngji_time)
  231. let now =new Date()
  232. // var now = new Date().setHours(0,0,0,0);
  233. this.nowTime =Math.round(now.getTime()/1000);
  234. let now2 = new Date().setHours(0,0,0,0);
  235. let ling_time = Math.round(now2/1000)
  236. // this.ling_time = ling_time
  237. console.log(res)
  238. console.log('1111',ling_time,this.xiaji_time);
  239. let mon = []
  240. let aft = []
  241. let eve = []
  242. let shangci = []
  243. res.data.data.array.map(item => {
  244. if (item.schedule_type == 1) {
  245. mon.push(item)
  246. // console.log(mon,'mon')
  247. } else if (item.schedule_type == 2) {
  248. aft.push(item)
  249. } else if (item.schedule_type == 3) {
  250. eve.push(item)
  251. }
  252. })
  253. res.data.data.list.map(item => {
  254. mon.map(it => {
  255. if (item.schedule_date == it.schedule_date && item.schedule_type == it
  256. .schedule_type) {
  257. it.mode_id = item.mode_id
  258. it.name = item.name
  259. it.schedule_date = item.schedule_date
  260. it.schedule_type = item.schedule_type
  261. // it.schedule_week = item.schedule_week
  262. }
  263. })
  264. aft.map(it => {
  265. if (item.schedule_date == it.schedule_date && item.schedule_type == it
  266. .schedule_type) {
  267. it.mode_id = item.mode_id
  268. it.name = item.name
  269. it.schedule_date = item.schedule_date
  270. it.schedule_type = item.schedule_type
  271. it.schedule_week = item.schedule_week
  272. }
  273. })
  274. eve.map(it => {
  275. if (item.schedule_date == it.schedule_date && item.schedule_type == it
  276. .schedule_type) {
  277. it.mode_id = item.mode_id
  278. it.name = item.name
  279. it.schedule_date = item.schedule_date
  280. it.schedule_type = item.schedule_type
  281. it.schedule_week = item.schedule_week
  282. }
  283. })
  284. // console.log(item.schedule_date,'asddfg');
  285. if(item.schedule_date<ling_time){
  286. shangci.push(item)
  287. // // console.log(shangci,'asddfg');
  288. }
  289. if(item.schedule_date==ling_time){
  290. // console.log('bbbb',item);
  291. this.modeid=item.mode_id
  292. this.bedid = item.bed_id
  293. // this.sahngji_time = item.schedule_date
  294. }
  295. })
  296. this.sctx=shangci[shangci.length-1]
  297. console.log(shangci,'this.sel_index')
  298. if(this.sel_index == '本周'){
  299. // console.log('vvvvvv',mon.slice(7,14));
  300. let mon_test = mon.slice(7,14)
  301. let aft_test = aft.slice(7,14)
  302. let eve_test = eve.slice(7,14)
  303. this.mon = mon_test
  304. this.aft = aft_test
  305. this.eve = eve_test
  306. // console.log('zzzzz',this.mon);
  307. }
  308. if(this.sel_index == '下周'){
  309. let mon_test = mon.slice(14,21)
  310. let aft_test = aft.slice(14,21)
  311. let eve_test = eve.slice(14,21)
  312. this.mon = mon_test
  313. this.aft = aft_test
  314. this.eve = eve_test
  315. // console.log('ggggg',this.mon);
  316. }
  317. this.scrollLeft = 427
  318. res.data.data.devicenumber.map(itemdev =>{
  319. if(itemdev.id== this.bedid){
  320. this.bedname=itemdev.number
  321. }
  322. })
  323. },
  324. ed(res) {
  325. // console.log('weqrqwt',res)
  326. },
  327. onSelectedop(val){
  328. // console.log(val,'val')
  329. let arr = val[0]
  330. this.sel_index = arr[0].text
  331. // console.log(this.sel_index,'this.sel_index')
  332. this.getSchedule(this.patient_id)
  333. },
  334. formatDate(value, fmt) {
  335. return formatDate(new Date(value * 1000), fmt)
  336. },
  337. getModeId(id) {
  338. let name = ''
  339. if (id == 1) {
  340. name = "HD"
  341. } else if (id == 2) {
  342. name = "HDF"
  343. } else if (id == 3) {
  344. name = "HD+HP"
  345. } else if (id == 4) {
  346. name = "HP"
  347. } else if (id == 5) {
  348. name = "HF"
  349. } else if (id == 6) {
  350. name = "SCUF"
  351. } else if (id == 7) {
  352. name = "IUF"
  353. } else if (id == 8) {
  354. name = "HFHD"
  355. } else if (id == 9) {
  356. name = "HFHD+HP"
  357. } else if (id == 10) {
  358. name = "PHF"
  359. } else if (id == 11) {
  360. name = "HFR"
  361. } else if (id == 12) {
  362. name = "HDF+HP"
  363. } else if (id == 13) {
  364. name = "CRRT"
  365. } else if (id == 14) {
  366. name = "腹水回输"
  367. } else if (id == 15) {
  368. name = "HD前置换"
  369. } else if (id == 16) {
  370. name = "HD后置换"
  371. } else if (id == 17) {
  372. name = "HDF前置换"
  373. } else if (id == 18) {
  374. name = "HDF后置换"
  375. } else if (id == 19) {
  376. name = "IUF+HD"
  377. } else if (id == 22) {
  378. name = "血浆胆红素吸附+HDF"
  379. } else if (id == 23) {
  380. name = "血浆胆红素吸附"
  381. }
  382. return name
  383. },
  384. estimate(time) {
  385. let mydate = new Date(time * 1000);
  386. mydate.setHours(mydate.getHours() + this.prescription.dialysis_duration_hour);
  387. mydate.setMinutes(mydate.getMinutes() + this.prescription.dialysis_duration_minute)
  388. this.xiaji_time = new Date(mydate).getTime()/1000
  389. // console.log('hhhhhh',new Date(mydate).getTime()/1000);
  390. return formatDate(new Date(mydate), "hh:mm")
  391. },
  392. estimate2(time) {
  393. let mydate = new Date(time * 1000);
  394. mydate.setHours(mydate.getHours() + this.prescription.dialysis_duration_hour);
  395. mydate.setMinutes(mydate.getMinutes() + this.prescription.dialysis_duration_minute)
  396. this.xiaji_time = new Date(mydate).getTime()/1000
  397. console.log('hhhhhh',new Date(mydate).getTime()/1000);
  398. // return formatDate(new Date(mydate), "hh:mm")
  399. },
  400. toPage(index) {
  401. if (index == 1) {
  402. uni.navigateTo({
  403. url: '/pages/code/index'
  404. })
  405. } else if (index == 2) {
  406. // showToast('敬请期待');
  407. Toast('敬请期待');
  408. // uni.navigateTo({
  409. // url: '/subPackages/pages/dialysisRecord/index'
  410. // })
  411. } else if (index == 3) {
  412. uni.navigateTo({
  413. url: '/pages/advice/index'
  414. })
  415. } else if (index == 4) {
  416. uni.navigateTo({
  417. url: '/subpackagesA/pages/PhysicalSigns/index'
  418. })
  419. } else if (index == 6) {
  420. Toast('敬请期待');
  421. // showToast('敬请期待');
  422. // uni.navigateTo({
  423. // // url: '/subpackages/pages/advancePay/index'
  424. // url:'/pages/advancePay/index'
  425. // })
  426. } else if (index == 8) {
  427. uni.navigateTo({
  428. url: '/pages/inspection_new/index'
  429. })
  430. } else if (index == 9) {
  431. // uni.navigateTo({
  432. // url: '/pages/education/index'
  433. // })
  434. }
  435. },
  436. // bencipaiban(time){
  437. // for(let i in this.list){
  438. // if(this.list[i].schedule_date==time){
  439. // return this.list[i].mode_id
  440. // }
  441. // }
  442. // }
  443. },
  444. }
  445. </script>
  446. <style>
  447. .dialysis {
  448. height: 100%;
  449. background: #FFFFFF;
  450. overflow-x: hidden;
  451. padding-bottom: 0;
  452. padding-bottom: constant(safe-area-inset-bottom);
  453. padding-bottom: env(safe-area-inset-bottom);
  454. }
  455. .bgLine {
  456. background: #F2F2F2;
  457. height: 24rpx;
  458. }
  459. .info {
  460. display: flex;
  461. flex-direction: column;
  462. background: #FFFFFF;
  463. padding: 28rpx 24rpx;
  464. }
  465. .infoRight {
  466. flex: 1;
  467. margin-left: 24rpx;
  468. }
  469. .dialysing {
  470. width: 100%;
  471. height: 270rpx;
  472. background-color: #0dccbcfa;
  473. border-radius: 10rpx;
  474. box-shadow: 0px 3px 14rpx -2px #01c8b8;
  475. }
  476. .dialysing .dia_cxt {
  477. width: 90%;
  478. height: 90%;
  479. margin: 20rpx auto;
  480. color: #FFFFFF;
  481. }
  482. .name {
  483. font-size: 32rpx;
  484. color: #000000;
  485. font-weight: bold;
  486. margin-right: 22rpx;
  487. }
  488. .infoImg {
  489. width: 122rpx;
  490. height: 122rpx;
  491. background: #FFFFFF;
  492. border-radius: 50%;
  493. }
  494. .estimate {
  495. border: 1px solid #01BD5D;
  496. border-radius: 10rpx;
  497. padding: 14rpx 18rpx;
  498. font-size: 28rpx;
  499. color: #01BD5D;
  500. display: inline-block;
  501. }
  502. .infoTitle {
  503. font-size: 26rpx;
  504. /* font-weight: bold; */
  505. color: #737373;
  506. margin: 20rpx 0 10rpx;
  507. }
  508. .nextInfo {
  509. display: flex;
  510. flex-wrap: wrap;
  511. font-size: 26rpx;
  512. color: rgba(49, 49, 49, 0.54);
  513. width: 100%;
  514. }
  515. .nextInfo>text:nth-of-type(odd) {
  516. width: 60%;
  517. }
  518. .nextInfo>text:nth-of-type(even) {
  519. width: 40%;
  520. }
  521. .appBox {
  522. display: flex;
  523. flex-wrap: nowrap;
  524. background: #FFFFFF;
  525. }
  526. .app {
  527. width: 22.1%;
  528. height: 250rpx;
  529. display: flex;
  530. flex-direction: column;
  531. align-items: center;
  532. font-size: 32rpx;
  533. color: #333333;
  534. }
  535. .app:nth-of-type(3) {
  536. border-right: 0;
  537. }
  538. .app:nth-of-type(6) {
  539. border-right: 0;
  540. }
  541. .app:nth-of-type(9) {
  542. border-right: 0;
  543. }
  544. .imgApp {
  545. width: 120rpx;
  546. height: 120rpx;
  547. border-radius: 40rpx;
  548. margin: 40rpx 0 20rpx;
  549. }
  550. .intro {
  551. font-size: 24rpx;
  552. white-space: nowrap;
  553. }
  554. .titleBox {
  555. width: 100%;
  556. height: 90rpx;
  557. background: #FFFFFF;
  558. box-shadow: 0px 1px 0px 0px #E7E7E7;
  559. font-size: 36rpx;
  560. color: #000000;
  561. display: flex;
  562. align-items: center;
  563. padding: 0 24rpx;
  564. display: flex;
  565. justify-content: space-between;
  566. }
  567. .titleBox_l {
  568. height: 90rpx;
  569. background: #FFFFFF;
  570. box-shadow: 0px 1px 0px 0px #E7E7E7;
  571. font-size: 36rpx;
  572. color: #000000;
  573. display: flex;
  574. align-items: center;
  575. /* padding: 0 24rpx; */
  576. }
  577. .titleBox .week_sel {
  578. text-align: right;
  579. }
  580. .line {
  581. width: 6rpx;
  582. height: 40rpx;
  583. background: #00C692;
  584. border-radius: 4rpx;
  585. margin-right: 20rpx;
  586. }
  587. .scheduling {
  588. display: flex;
  589. border-top: 1px solid #E7E7E7;
  590. padding-top: 28rpx;
  591. }
  592. .schedulingLeft {
  593. width: 50rpx;
  594. font-size: 26rpx;
  595. color: rgba(49, 49, 49, 0.54);
  596. text-align: center;
  597. background: #FFFFFF;
  598. }
  599. .classes {
  600. height: 100rpx;
  601. background: #FFFFFF;
  602. margin-bottom: 4rpx;
  603. display: flex;
  604. align-items: center;
  605. }
  606. .square {
  607. width: 114rpx;
  608. height: 100rpx;
  609. background: #F2F2F2;
  610. border-radius: 6rpx;
  611. text-align: center;
  612. margin-right: 4rpx;
  613. margin-bottom: 4rpx;
  614. display: flex;
  615. align-items: center;
  616. justify-content: space-around;
  617. flex-direction: column;
  618. }
  619. .scroll-view_H {
  620. display: -webkit-box;
  621. }
  622. .scrollBox {
  623. background: #FFFFFF;
  624. overflow: scroll;
  625. }
  626. .active {
  627. background: #00c4b3;
  628. font-size: 28rpx;
  629. color: #FFFFFF;
  630. text-align: center;
  631. }
  632. /deep/.uni-scroll-view::-webkit-scrollbar {
  633. /* 隐藏滚动条,但依旧具备可以滚动的功能 */
  634. display: none
  635. }
  636. </style>
  637. <style lang="scss" scoped>
  638. /deep/ .filter-wrapper {
  639. width: 190rpx !important;
  640. height: 70rpx !important;
  641. position: unset !important;
  642. .inner-wrapper {
  643. height: 70rpx !important;
  644. .mask {
  645. background-color: rgba(0, 0, 0, 0) !important;
  646. }
  647. .navs {
  648. height: 80rpx !important;
  649. border-bottom: none !important;
  650. padding: 0 25rpx;
  651. }
  652. .popupShow {
  653. background-color: #ececec !important;
  654. }
  655. }
  656. }
  657. </style>