123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713 |
- <template>
- <view class="dialysis">
- <view class="info">
- <!-- <img class="infoImg" src="../../static/images/avatar.png" alt=""> -->
- <view class="infoRight">
-
- <view class="infoTitle">
- 上次透析时间:<span>{{ sctx.schedule_date ? formatDate(sctx.schedule_date, 'yyyy-MM-dd') : '' }}</span><span>
- <text v-if="sctx.schedule_type == 1">上午</text>
- <text v-if="sctx.schedule_type == 2">下午</text>
- <text v-if="sctx.schedule_type == 3">晚上</text>
- <!-- <text v-else>暂无</text> -->
- </span> </view>
- <view class="infoTitle">
- 下次透析时间:<span>{{ patientSchedule.schedule_date ? formatDate(patientSchedule.schedule_date, 'yyyy-MM-dd') : '' }}</span><span>
- <text v-if="patientSchedule.schedule_type == 1">上午</text>
- <text v-if="patientSchedule.schedule_type == 2">下午</text>
- <text v-if="patientSchedule.schedule_type == 3">晚上</text>
- <!-- <text v-else>暂无</text> -->
- 床位:{{patientSchedule.Number ? patientSchedule.Number : ' '}}
- </span>
- </view>
-
- </view>
- <view class="dialysing">
- <view class="dia_cxt">
- <p v-if='order.created_time > 0 && nowTime<xiaji_time'>{{'正在透析中...'}}</p>
- <p v-if='modeid < 1 && order.created_time <= 0'>{{'暂无排班信息'}}</p>
- <p v-if='modeid > 0 && order.created_time <= 0'>{{'今天已有排班'}} 床位:{{bedname}}</p>
- <p v-if="nowTime>xiaji_time && order.created_time > 0">{{'已下机'}}</p>
- <view style="margin-top: 40rpx;line-height: 50rpx;" v-if='order.created_time > 0 && nowTime<xiaji_time'>
- <p style="text-align: right;font-size: 28rpx;max-width: 570rpx;">
- 上机时间:{{formatDate(sahngji_time,'yyyy-MM-dd hh:mm:ss' )}} 床位:{{bedname}}</p>
- <p style="text-align: right;font-size: 28rpx;max-width: 570rpx;">
- 预计下机时间:{{ estimate(order.created_time, 'hh:mm') }}</p>
- </view>
-
- </view>
-
- </view>
- </view>
-
- <view class="appBox">
- <view class="app" @click="toPage(1)">
- <img class="imgApp" src="../../static/images/app1new.png" alt="">
- <view class="intro">透析签到</view>
- </view>
- <view class="app" @click="toPage(4)">
- <img class="imgApp" src="../../static/images/app3new.png" alt="">
- <view class="intro">体征记录</view>
- </view>
- <view class="app" @click="toPage(2)">
- <img class="imgApp" src="../../static/images/app2new.png" alt="">
- <!-- <img class="imgApp" src="../../subPackages/static/images/app2new.png" alt="" /> -->
- <view class="intro">透析记录</view>
- </view>
- <view class="app" @click="toPage(6)">
- <img class="imgApp" src="../../static/images/app4new.png" alt="">
- <!-- <img class="imgApp" src="../../subPackages/static/images/app4new.png" alt=""> -->
- <view class="intro">预交金查询</view>
- </view>
- <view class="app" @click="toPage(8)">
- <img class="imgApp" src="../../static/images/app5new.png" alt="">
- <view class="intro">检查报告</view>
- </view>
- </view>
- <van-toast id="van-toast" />
- <!-- <view class="bgLine"></view> -->
- <view class="titleBox">
- <view class="titleBox_l">
- <view class="line"></view>
- 我的排班
- </view>
-
- <view class="week_sel">
- <ren-dropdown-filter :filterData='filterData' :defaultIndex='defaultIndex' @ed='ed' @onSelected='onSelectedop'>
- </ren-dropdown-filter>
- </view>
- </view>
- <view class="scheduling">
- <view class="schedulingLeft">
- <view class="classes"></view>
- <view class="classes">上午</view>
- <view class="classes">下午</view>
- <view class="classes">晚上</view>
- </view>
- <scroll-view class="scrollBox" scroll-x="true" :scroll-left="scrollLeft">
- <view class="scroll-view_H">
- <view class="square" v-for="item in mon" style="font-size: 26rpx;">
- <view v-if="item.schedule_week == 1">周一</view>
- <view v-if="item.schedule_week == 2">周二</view>
- <view v-if="item.schedule_week == 3">周三</view>
- <view v-if="item.schedule_week == 4">周四</view>
- <view v-if="item.schedule_week == 5">周五</view>
- <view v-if="item.schedule_week == 6">周六</view>
- <view v-if="item.schedule_week == 7">周日</view>
- <view>{{ formatDate(item.schedule_date, "dd") }}</view>
- </view>
- </view>
- <!-- :key="index + 222" :key="index + 000" :key="index + 111"-->
- <view class="scroll-view_H">
- <view :class="item.mode_id != '' ? 'square active' : 'square'" v-for="(item,index) in mon"
- >
- <text v-if="item.mode_id">
- {{ getModeId(item.mode_id) }}
- </text>
- </view>
- </view>
- <view class="scroll-view_H">
- <view :class="item.mode_id != '' ? 'square active' : 'square'" v-for="(item,index) in aft"
- ><text v-if="item.mode_id">{{ getModeId(item.mode_id) }}</text></view>
- </view>
- <view class="scroll-view_H">
- <view :class="item.mode_id != '' ? 'square active' : 'square'" v-for="(item,index) in eve"
- ><text v-if="item.mode_id">{{ getModeId(item.mode_id) }}</text></view>
- </view>
- </scroll-view>
- </view>
- </view>
- </template>
-
- <script>
- import Toast from '@/wxcomponents/vant/toast/toast';
- import RenDropdownFilter from '@/components/ren-dropdown-filter/ren-dropdown-filter.vue'
- import {
- getSchedule
- } from '@/api/api.js';
- import {formatDate} from "@/utils/formatDate.js"
- import moment from 'moment'
- export default {
- components: {
- RenDropdownFilter
- },
- data() {
- return {
- sel_index:'本周',
- value1: 0,
- value2: 'a',
- filterData: [
- [{
- text: '本周',
- value: 0
- }, {
- text: '下周',
- value: 1
- }]
- ],
- defaultIndex: [0],
- patient_id: 0,
- schedule: [],
- mon: [{
- schedule_week: 1,
- mode_id: 1
- }, {
- schedule_week: 2,
- mode_id: ""
- }, {
- schedule_week: 3
- }, {
- schedule_week: 4
- }, {
- schedule_week: 5
- }, {
- schedule_week: 6
- }, {
- schedule_week: 7
- }],
- aft: [{
- schedule_week: 1,
- mode_id: 1
- }, {
- schedule_week: 2
- }, {
- schedule_week: 3
- }, {
- schedule_week: 4
- }, {
- schedule_week: 5
- }, {
- schedule_week: 6
- }, {
- schedule_week: 7
- }],
- eve: [{
- schedule_week: 1,
- mode_id: 1
- }, {
- schedule_week: 2
- }, {
- schedule_week: 3
- }, {
- schedule_week: 4,
- mode_id: 3
- }, {
- schedule_week: 5
- }, {
- schedule_week: 6
- }, {
- schedule_week: 7
- }],
- scrollLeft: 0,
- patientSchedule: {},
- order: {},
- patient: {},
- prescription: {},
- sahngji_time:'',
- nowTime:0,
- xiaji_time:0,
- sctx:'',
- list:[],
- modeid:0,
- bedid:0,
- bedname:'',
- // zhuoyi:'',
- // zhuomo:'',
- }
- },
- onLoad() {
- this.patient = this.$store.state.data.userInfo
- this.patient_id = this.$store.state.data.userInfo.id
- this.getSchedule(this.patient_id)
-
- },
- methods: {
-
- async getSchedule(patient_id) {
- let params = {
- patient_id: patient_id
- }
- let res = await getSchedule(params, true)
- this.order = res.data.data.order
- this.patientSchedule = res.data.data.patientSchedule
- this.prescription = res.data.data.prescription
- this.sahngji_time = res.data.data.order.created_time
- this.devicenumber = res.data.data.devicenumber
- // this.xiaji_time = res.data.data.order.updated_time
- var list =res.data.data.list
- // this.list = list
- this.estimate2(this.sahngji_time)
- let now =new Date()
- // var now = new Date().setHours(0,0,0,0);
- this.nowTime =Math.round(now.getTime()/1000);
- let now2 = new Date().setHours(0,0,0,0);
- let ling_time = Math.round(now2/1000)
- // this.ling_time = ling_time
- console.log(res)
- console.log('1111',ling_time,this.xiaji_time);
-
- let mon = []
- let aft = []
- let eve = []
- let shangci = []
- res.data.data.array.map(item => {
-
- if (item.schedule_type == 1) {
- mon.push(item)
- // console.log(mon,'mon')
- } else if (item.schedule_type == 2) {
- aft.push(item)
- } else if (item.schedule_type == 3) {
- eve.push(item)
- }
- })
- res.data.data.list.map(item => {
- mon.map(it => {
- if (item.schedule_date == it.schedule_date && item.schedule_type == it
- .schedule_type) {
- it.mode_id = item.mode_id
- it.name = item.name
- it.schedule_date = item.schedule_date
- it.schedule_type = item.schedule_type
- // it.schedule_week = item.schedule_week
- }
- })
- aft.map(it => {
- if (item.schedule_date == it.schedule_date && item.schedule_type == it
- .schedule_type) {
- it.mode_id = item.mode_id
- it.name = item.name
- it.schedule_date = item.schedule_date
- it.schedule_type = item.schedule_type
- it.schedule_week = item.schedule_week
- }
- })
- eve.map(it => {
- if (item.schedule_date == it.schedule_date && item.schedule_type == it
- .schedule_type) {
- it.mode_id = item.mode_id
- it.name = item.name
- it.schedule_date = item.schedule_date
- it.schedule_type = item.schedule_type
- it.schedule_week = item.schedule_week
- }
- })
- // console.log(item.schedule_date,'asddfg');
- if(item.schedule_date<ling_time){
- shangci.push(item)
- // // console.log(shangci,'asddfg');
- }
- if(item.schedule_date==ling_time){
- // console.log('bbbb',item);
- this.modeid=item.mode_id
- this.bedid = item.bed_id
- // this.sahngji_time = item.schedule_date
- }
- })
-
- this.sctx=shangci[shangci.length-1]
-
- console.log(shangci,'this.sel_index')
- if(this.sel_index == '本周'){
- // console.log('vvvvvv',mon.slice(7,14));
- let mon_test = mon.slice(7,14)
- let aft_test = aft.slice(7,14)
- let eve_test = eve.slice(7,14)
- this.mon = mon_test
- this.aft = aft_test
- this.eve = eve_test
- // console.log('zzzzz',this.mon);
- }
- if(this.sel_index == '下周'){
- let mon_test = mon.slice(14,21)
- let aft_test = aft.slice(14,21)
- let eve_test = eve.slice(14,21)
- this.mon = mon_test
- this.aft = aft_test
- this.eve = eve_test
- // console.log('ggggg',this.mon);
- }
- this.scrollLeft = 427
- res.data.data.devicenumber.map(itemdev =>{
- if(itemdev.id== this.bedid){
- this.bedname=itemdev.number
- }
- })
- },
- ed(res) {
- // console.log('weqrqwt',res)
- },
- onSelectedop(val){
- // console.log(val,'val')
- let arr = val[0]
- this.sel_index = arr[0].text
- // console.log(this.sel_index,'this.sel_index')
- this.getSchedule(this.patient_id)
- },
-
- formatDate(value, fmt) {
- return formatDate(new Date(value * 1000), fmt)
- },
- getModeId(id) {
- let name = ''
- if (id == 1) {
- name = "HD"
- } else if (id == 2) {
- name = "HDF"
- } else if (id == 3) {
- name = "HD+HP"
- } else if (id == 4) {
- name = "HP"
- } else if (id == 5) {
- name = "HF"
- } else if (id == 6) {
- name = "SCUF"
- } else if (id == 7) {
- name = "IUF"
- } else if (id == 8) {
- name = "HFHD"
- } else if (id == 9) {
- name = "HFHD+HP"
- } else if (id == 10) {
- name = "PHF"
- } else if (id == 11) {
- name = "HFR"
- } else if (id == 12) {
- name = "HDF+HP"
- } else if (id == 13) {
- name = "CRRT"
- } else if (id == 14) {
- name = "腹水回输"
- } else if (id == 15) {
- name = "HD前置换"
- } else if (id == 16) {
- name = "HD后置换"
- } else if (id == 17) {
- name = "HDF前置换"
- } else if (id == 18) {
- name = "HDF后置换"
- } else if (id == 19) {
- name = "IUF+HD"
- } else if (id == 22) {
- name = "血浆胆红素吸附+HDF"
- } else if (id == 23) {
- name = "血浆胆红素吸附"
- }
- return name
- },
- estimate(time) {
- let mydate = new Date(time * 1000);
- mydate.setHours(mydate.getHours() + this.prescription.dialysis_duration_hour);
- mydate.setMinutes(mydate.getMinutes() + this.prescription.dialysis_duration_minute)
- this.xiaji_time = new Date(mydate).getTime()/1000
- // console.log('hhhhhh',new Date(mydate).getTime()/1000);
- return formatDate(new Date(mydate), "hh:mm")
- },
- estimate2(time) {
- let mydate = new Date(time * 1000);
- mydate.setHours(mydate.getHours() + this.prescription.dialysis_duration_hour);
- mydate.setMinutes(mydate.getMinutes() + this.prescription.dialysis_duration_minute)
- this.xiaji_time = new Date(mydate).getTime()/1000
- console.log('hhhhhh',new Date(mydate).getTime()/1000);
- // return formatDate(new Date(mydate), "hh:mm")
- },
- toPage(index) {
- if (index == 1) {
- uni.navigateTo({
- url: '/pages/code/index'
- })
- } else if (index == 2) {
- // showToast('敬请期待');
- Toast('敬请期待');
- // uni.navigateTo({
- // url: '/subPackages/pages/dialysisRecord/index'
- // })
- } else if (index == 3) {
- uni.navigateTo({
- url: '/pages/advice/index'
- })
- } else if (index == 4) {
- uni.navigateTo({
- url: '/subpackagesA/pages/PhysicalSigns/index'
- })
- } else if (index == 6) {
- Toast('敬请期待');
- // showToast('敬请期待');
- // uni.navigateTo({
- // // url: '/subpackages/pages/advancePay/index'
- // url:'/pages/advancePay/index'
- // })
- } else if (index == 8) {
- uni.navigateTo({
- url: '/pages/inspection_new/index'
- })
- } else if (index == 9) {
- // uni.navigateTo({
- // url: '/pages/education/index'
- // })
- }
- },
-
-
- // bencipaiban(time){
- // for(let i in this.list){
- // if(this.list[i].schedule_date==time){
- // return this.list[i].mode_id
- // }
- // }
- // }
- },
- }
- </script>
-
- <style>
- .dialysis {
- height: 100%;
- background: #FFFFFF;
- overflow-x: hidden;
- padding-bottom: 0;
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
- }
-
- .bgLine {
- background: #F2F2F2;
- height: 24rpx;
- }
-
- .info {
- display: flex;
- flex-direction: column;
- background: #FFFFFF;
- padding: 28rpx 24rpx;
- }
-
- .infoRight {
- flex: 1;
- margin-left: 24rpx;
- }
-
- .dialysing {
- width: 100%;
- height: 270rpx;
- background-color: #0dccbcfa;
- border-radius: 10rpx;
- box-shadow: 0px 3px 14rpx -2px #01c8b8;
- }
-
- .dialysing .dia_cxt {
- width: 90%;
- height: 90%;
- margin: 20rpx auto;
- color: #FFFFFF;
- }
-
- .name {
- font-size: 32rpx;
- color: #000000;
- font-weight: bold;
- margin-right: 22rpx;
- }
-
- .infoImg {
- width: 122rpx;
- height: 122rpx;
- background: #FFFFFF;
- border-radius: 50%;
- }
-
- .estimate {
- border: 1px solid #01BD5D;
- border-radius: 10rpx;
- padding: 14rpx 18rpx;
- font-size: 28rpx;
- color: #01BD5D;
- display: inline-block;
- }
-
- .infoTitle {
- font-size: 26rpx;
- /* font-weight: bold; */
- color: #737373;
- margin: 20rpx 0 10rpx;
- }
-
- .nextInfo {
- display: flex;
- flex-wrap: wrap;
- font-size: 26rpx;
- color: rgba(49, 49, 49, 0.54);
- width: 100%;
- }
-
- .nextInfo>text:nth-of-type(odd) {
- width: 60%;
- }
-
- .nextInfo>text:nth-of-type(even) {
- width: 40%;
- }
-
- .appBox {
- display: flex;
- flex-wrap: nowrap;
- background: #FFFFFF;
- }
-
- .app {
- width: 22.1%;
- height: 250rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
-
- font-size: 32rpx;
- color: #333333;
- }
-
- .app:nth-of-type(3) {
- border-right: 0;
- }
-
- .app:nth-of-type(6) {
- border-right: 0;
- }
-
- .app:nth-of-type(9) {
- border-right: 0;
- }
-
- .imgApp {
- width: 120rpx;
- height: 120rpx;
- border-radius: 40rpx;
- margin: 40rpx 0 20rpx;
- }
-
- .intro {
- font-size: 24rpx;
- white-space: nowrap;
- }
-
- .titleBox {
- width: 100%;
- height: 90rpx;
- background: #FFFFFF;
- box-shadow: 0px 1px 0px 0px #E7E7E7;
- font-size: 36rpx;
- color: #000000;
- display: flex;
- align-items: center;
- padding: 0 24rpx;
- display: flex;
- justify-content: space-between;
- }
-
- .titleBox_l {
- height: 90rpx;
- background: #FFFFFF;
- box-shadow: 0px 1px 0px 0px #E7E7E7;
- font-size: 36rpx;
- color: #000000;
- display: flex;
- align-items: center;
- /* padding: 0 24rpx; */
- }
-
- .titleBox .week_sel {
- text-align: right;
- }
-
- .line {
- width: 6rpx;
- height: 40rpx;
- background: #00C692;
- border-radius: 4rpx;
- margin-right: 20rpx;
- }
-
- .scheduling {
- display: flex;
- border-top: 1px solid #E7E7E7;
- padding-top: 28rpx;
- }
-
- .schedulingLeft {
- width: 50rpx;
- font-size: 26rpx;
- color: rgba(49, 49, 49, 0.54);
- text-align: center;
- background: #FFFFFF;
- }
-
- .classes {
- height: 100rpx;
- background: #FFFFFF;
- margin-bottom: 4rpx;
- display: flex;
- align-items: center;
- }
-
- .square {
- width: 114rpx;
- height: 100rpx;
- background: #F2F2F2;
- border-radius: 6rpx;
- text-align: center;
- margin-right: 4rpx;
- margin-bottom: 4rpx;
- display: flex;
- align-items: center;
- justify-content: space-around;
- flex-direction: column;
- }
-
- .scroll-view_H {
- display: -webkit-box;
- }
-
- .scrollBox {
- background: #FFFFFF;
- overflow: scroll;
- }
-
- .active {
- background: #00c4b3;
- font-size: 28rpx;
- color: #FFFFFF;
- text-align: center;
- }
-
- /deep/.uni-scroll-view::-webkit-scrollbar {
- /* 隐藏滚动条,但依旧具备可以滚动的功能 */
- display: none
- }
- </style>
-
- <style lang="scss" scoped>
- /deep/ .filter-wrapper {
- width: 190rpx !important;
- height: 70rpx !important;
- position: unset !important;
-
- .inner-wrapper {
- height: 70rpx !important;
-
- .mask {
- background-color: rgba(0, 0, 0, 0) !important;
- }
-
- .navs {
- height: 80rpx !important;
- border-bottom: none !important;
- padding: 0 25rpx;
- }
-
- .popupShow {
- background-color: #ececec !important;
- }
-
- }
- }
- </style>
|