服务时间

This commit is contained in:
shidongli 2023-10-25 16:01:03 +08:00
parent 6604488a24
commit 708af172b7
2 changed files with 284 additions and 82 deletions

View File

@ -0,0 +1,17 @@
import request from "../request.js"
// 时间表
export function getListByDoctor(doctorId) {
return request({
url: `/nurseApplet/schedule/plan/getListByDoctor?doctorId=${doctorId}`,
method: 'GET',
})
}
// 状态
export function updateStatus(data) {
return request({
url: `/nurseApplet/schedule/plan/updateStatus`,
method: 'post',
data
})
}

View File

@ -1,22 +1,29 @@
<template>
<view class="app">
<view class="content">
<span>2020-01-01今天</span>
<view class="content" v-if='tabslist.length>0'>
<view class="" v-if="timecurrent==0">
<span>{{tabslist[0].name}}&nbsp;&nbsp;{{tabslist[0].dates}}</span>
</view>
<view class="" v-else>
<span>{{tabslist[timecurrent].name}}&nbsp;&nbsp;{{tabslist[timecurrent].dates}}</span>
</view>
<tabs :list="tabslist" :current="timecurrent" @change="timechange" active-color="#18CBB3"
background="#18CBB3">
</tabs>
<view class="imageitem">
<image src="../../static/jiantou.png" mode=""></image>
<image src="../../static/jiantou.png" mode="" @tap="timecurrent++"></image>
</view>
</view>
<view class="time">
<view class="morningbutton">
<view @tap="tapSoonerorlater('morning')"
:class="Soonerorlater=='morning'?'morningbutton':'afternoonbutton'">
上午
</view>
<view class="afternoonbutton">
<view @tap="tapSoonerorlater('after')" :class="Soonerorlater=='after'?'morningbutton':'afternoonbutton'">
下午
</view>
<view class="morningbutton">
<view @tap="tapSoonerorlater('all')" :class="Soonerorlater=='all'?'morningbutton':'afternoonbutton'">
全天
</view>
@ -27,113 +34,234 @@
上午
</view>
<view class="bodyitem">
<view class="body">
<span class="spanitem">9:00~9:30</span>
<view class="spanitem">不可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
<view class="" v-for="(item ,index) in List[timecurrent].morningList">
<view @tap='taptimemorning(item,index)'
:class="timeindex==index && item.status==true?'morningbodytwo':'morningbody'">
<span class="spanitem">{{item.scheduleTimeSlot}}</span>
<view class="spanitem" v-if="item.status==false">不可预约</view>
<view class="spanitem" v-else>可预约</view>
</view>
</view>
</view>
</view>
<view class="morning after">
<view class="morningtime">
下午
</view>
<view class="bodyitem">
<view class="body">
<span class="spanitem">9:00~9:30</span>
<view class="spanitem">不可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
</view>
</view>
<view class="bodytwo">
<span class="spanitem">9:30~10:00</span>
<view class="spanitem">可预约
<view class="" v-for="(item ,index) in List[timecurrent].afternoonList">
<view @tap='taptimeafter(item,index)'
:class="timeindexafter==index&&item.status==true?'bodytwo':'body'">
<span class="spanitem">{{item.scheduleTimeSlot}}</span>
<view class="spanitem" v-if="item.status==false">不可预约</view>
<view class="spanitem" v-else>可预约</view>
</view>
</view>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import tabs from '@/components/utabs/u-tabs.vue'
import {
getListByDoctor,
updateStatus
} from '@/api/ServiceSchedule/ServiceSchedule.js'
export default {
components: {
tabs
},
data() {
return {
time: 0,
timecurrent: 0,
tabslist: [{
name: '周日 01-01',
orderStatus: '',
}, {
name: '周一 01-01',
orderStatus: '',
}, {
name: '周二 01-01',
orderStatus: '',
}, {
name: '周三 01-01',
orderStatus: '',
}, {
name: '周四 01-01',
orderStatus: '',
},
{
name: '周五 01-01',
orderStatus: 'EVALUATED',
}, {
name: '周六 01-01',
orderStatus: 'EVALUATED',
}
],
dates: '',
name: '',
}],
doctorId: '', //id
List: [{
morningList: {},
afternoonList: {},
}],
morningListdata: [],
status: '',
timeindex: null,
timeindexafter: null,
Soonerorlater: 'afternoonbutton',
qurey: {
schedulePlanDetailId: '',
status: "",
},
}
},
onLoad() {
},
onShow() {
this.doctorId = uni.getStorageSync('id')
// console.log(this.doctorId)
this.getListByDoctordata()
},
methods: {
//
tapSoonerorlater(item) {
this.Soonerorlater = item
console.log(this.Soonerorlater)
if (this.Soonerorlater == 'morning') {
this.statusmorning()
this.timeindexafter = null
this.timeindex = null
} else if (this.Soonerorlater == 'after') {
this.timeindexafter = null
this.timeindex = null
this.statusafter()
} else if (this.Soonerorlater == 'all') {
this.timeindexafter = null
this.timeindex = null
this.statusmorning()
this.statusafter()
}
},
//
taptimemorning(item, index) {
this.status = item.status
this.timeindex = index
if (item.status == true) {
this.qurey.status = "1"
} else {
this.qurey.status = "0"
}
this.qurey.schedulePlanDetailId = item.schedulePlanDetailId
console.log(this.qurey)
updateStatus(this.qurey).then(res => {
if (res.code == 500) {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
})
} else {
this.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1000'
})
this.updata()
}
})
},
//
statusmorning() {
this.List[this.timecurrent].morningList.forEach(e => {
if (e.status == true) {
e.status = false
} else {
e.status = true
}
})
},
//
statusafter() {
this.List[this.timecurrent].afternoonList.forEach(e => {
// console.log(e, '9999')
if (e.status == true) {
e.status = false
} else {
e.status = true
}
})
},
//
taptimeafter(item, index) {
this.timeindexafter = index
if (item.status == true) {
this.qurey.status = "1"
} else {
this.qurey.status = "0"
}
this.qurey.schedulePlanDetailId = item.schedulePlanDetailId
console.log(this.qurey)
updateStatus(this.qurey).then(res => {
if (res.code == 500) {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
})
} else {
this.$refs.uToast.show({
title: '修改成功',
type: 'success',
duration: '1000'
})
this.updata()
// this.getListByDoctordata()
}
})
this.status = item.status
console.log(item, index)
},
updata() {
getListByDoctor(this.doctorId).then(res => {
if (res.data) {
this.List = res.data
}
})
},
getListByDoctordata() {
this.tabslist = []
getListByDoctor(this.doctorId).then(res => {
if (res.data) {
res.data.forEach(e => {
// console.log(e)
this.tabslist.push({
dates: e.week,
name: e.scheduleDate,
})
})
console.log(this.tabslist)
this.List = res.data
}
})
},
timechange(index) {
// this.orderlist.serviceDate = this.orderlist.appointmentTimeList[index].date
this.timecurrent = index
this.timeindexafter = null
this.timeindex = null
// this.List={},
// this.updata()
this.Soonerorlater = null
},
}
}
@ -145,11 +273,12 @@
background: #F1F1F1;
position: relative;
overflow: hidden;
.time {
display: flex;
position: absolute;
right: 2%;
top: 13%;
position: absolute;
right: 2%;
top: 21%;
flex-wrap: wrap;
width: 400rpx;
@ -191,7 +320,7 @@
.morning {
width: 100%;
height: 261px;
height: 420rpx;
background: #FFFFFF;
border-radius: 0rpx 5rpx 5rpx 0rpx;
margin: 20rpx auto;
@ -257,6 +386,59 @@
.spanitem {
// width: 121px;
// height: 22px;
display: inline-block;
padding: 8rpx;
font-size: 28rpx;
font-family: SourceHanSansSC-Medium, SourceHanSansSC;
font-weight: 500;
color: #666666;
line-height: 38rpx;
}
}
.morningbodytwo {
background-color: #18CBB3;
// font-size: 36rpx;
// color: #26A888;
margin-bottom: 30rpx;
width: 200rpx;
height: 109rpx;
// background: #fff;
margin: 10rpx 30rpx 10rpx 22rpx;
.spanitem {
// width: 121px;
// height: 22px;
display: inline-block;
padding: 8rpx;
font-size: 28rpx;
font-family: SourceHanSansSC-Medium, SourceHanSansSC;
font-weight: 500;
color: #FFFFFF;
line-height: 38rpx;
}
}
.morningbody {
font-size: 36rpx;
color: #18CBB3;
margin-bottom: 30rpx;
width: 200rpx;
height: 109rpx;
background: #fff;
margin: 10rpx 30rpx 10rpx 22rpx;
// border-radius: 10rpx 10rpx 10rpx 10rpx;
// opacity: 1;
// margin: 30rpx;
border: 1rpx solid #E6E6E6;
.spanitem {
// width: 121px;
// height: 22px;
@ -272,6 +454,9 @@
}
.content {
background-color: #fff;
width: 100%;
@ -318,4 +503,4 @@
}
}
}
</style>
</style>