服务时间状态

This commit is contained in:
shidongli 2023-10-26 13:51:55 +08:00
parent f4d49a9708
commit 587ce8f0f0

View File

@ -37,7 +37,7 @@
<view class="" v-for="(item ,index) in List[timecurrent].morningList"> <view class="" v-for="(item ,index) in List[timecurrent].morningList">
<view @tap='taptimemorning(item,index)' <view @tap='taptimemorning(item,index)'
:class="timeindex==index && item.status==true?'morningbodytwo':'morningbody'"> :class="item.status==true?'morningbodytwo':'morningbody'">
<span class="spanitem">{{item.scheduleTimeSlot}}</span> <span class="spanitem">{{item.scheduleTimeSlot}}</span>
<view class="spanitem" v-if="item.status==false">不可预约</view> <view class="spanitem" v-if="item.status==false">不可预约</view>
<view class="spanitem" v-else>可预约</view> <view class="spanitem" v-else>可预约</view>
@ -53,7 +53,7 @@
<view class="bodyitem"> <view class="bodyitem">
<view class="" v-for="(item ,index) in List[timecurrent].afternoonList"> <view class="" v-for="(item ,index) in List[timecurrent].afternoonList">
<view @tap='taptimeafter(item,index)' <view @tap='taptimeafter(item,index)'
:class="timeindexafter==index&&item.status==true?'bodytwo':'body'"> :class="item.status==true?'bodytwo':'body'">
<span class="spanitem">{{item.scheduleTimeSlot}}</span> <span class="spanitem">{{item.scheduleTimeSlot}}</span>
<view class="spanitem" v-if="item.status==false">不可预约</view> <view class="spanitem" v-if="item.status==false">不可预约</view>
<view class="spanitem" v-else>可预约</view> <view class="spanitem" v-else>可预约</view>
@ -97,7 +97,7 @@
timeindexafter: null, timeindexafter: null,
Soonerorlater: 'afternoonbutton', Soonerorlater: 'afternoonbutton',
qurey: { qurey: {
schedulePlanDetailId: '', schedulePlanDetailIds: [],
status: "", status: "",
}, },
@ -112,29 +112,150 @@
this.getListByDoctordata() this.getListByDoctordata()
}, },
methods: { methods: {
// //
tapSoonerorlater(item) { tapSoonerorlater(item) {
this.Soonerorlater = item this.Soonerorlater = item
console.log(this.Soonerorlater) console.log(item)
if (this.Soonerorlater == 'morning') { if (this.Soonerorlater == 'morning') {
this.statusmorning()
this.timeindexafter = null this.timeindexafter = null
this.timeindex = null this.timeindex = null
this.morningdata()
} else if (this.Soonerorlater == 'after') { } else if (this.Soonerorlater == 'after') {
this.timeindexafter = null this.timeindexafter = null
this.timeindex = null this.timeindex = null
this.statusafter() this.afterdata()
} else if (this.Soonerorlater == 'all') { } else if (this.Soonerorlater == 'all') {
this.timeindexafter = null this.timeindexafter = null
this.timeindex = null this.timeindex = null
this.statusmorning() this.alldata()
this.statusafter()
} }
}, },
//
morningdata(){
this.qurey={
schedulePlanDetailIds:[],
status:'1',
}
getListByDoctor(this.doctorId).then(res => {
if (res.data) {
res.data[this.timecurrent].morningList.forEach(e=>{
this.qurey.schedulePlanDetailIds.push(e.schedulePlanDetailId)
})
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()
}
})
}
})
},
//
afterdata(){
this.qurey={
schedulePlanDetailIds:[],
status:'1',
},
getListByDoctor(this.doctorId).then(res => {
if (res.data) {
console.log(res.data[this.timecurrent].afternoonList)
// var schedulePlanDetailId
res.data[this.timecurrent].afternoonList.forEach(e=>{
this.qurey.schedulePlanDetailIds.push(e.schedulePlanDetailId)
})
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()
}
})
}
})
},
//
alldata(){
getListByDoctor(this.doctorId).then(res => {
this.qurey={
schedulePlanDetailIds:[],
status:'1',
}
if (res.data) {
console.log(res.data[this.timecurrent].afternoonList)
// var schedulePlanDetailId
res.data[this.timecurrent].afternoonList.forEach(e=>{
this.qurey.schedulePlanDetailIds.push(e.schedulePlanDetailId)
})
res.data[this.timecurrent].morningList.forEach(e=>{
this.qurey.schedulePlanDetailIds.push(e.schedulePlanDetailId)
})
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()
}
})
}
})
},
// //
taptimemorning(item, index) { taptimemorning(item, index) {
this.qurey={
schedulePlanDetailIds:[],
status:'1',
}
this.status = item.status this.status = item.status
this.timeindex = index this.timeindex = index
if (item.status == true) { if (item.status == true) {
@ -144,7 +265,9 @@
this.qurey.status = "0" this.qurey.status = "0"
} }
this.qurey.schedulePlanDetailId = item.schedulePlanDetailId
this.qurey.schedulePlanDetailIds.push(item.schedulePlanDetailId)
console.log(this.qurey) console.log(this.qurey)
updateStatus(this.qurey).then(res => { updateStatus(this.qurey).then(res => {
if (res.code == 500) { if (res.code == 500) {
@ -165,37 +288,14 @@
}) })
}, },
//
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) { taptimeafter(item, index) {
this.timeindexafter = index this.timeindexafter = index
this.qurey={
schedulePlanDetailIds:[],
status:''
}
if (item.status == true) { if (item.status == true) {
this.qurey.status = "1" this.qurey.status = "1"
@ -203,7 +303,8 @@
this.qurey.status = "0" this.qurey.status = "0"
} }
this.qurey.schedulePlanDetailId = item.schedulePlanDetailId
this.qurey.schedulePlanDetailIds.push(item.schedulePlanDetailId)
console.log(this.qurey) console.log(this.qurey)
updateStatus(this.qurey).then(res => { updateStatus(this.qurey).then(res => {
if (res.code == 500) { if (res.code == 500) {
@ -226,8 +327,6 @@
}) })
this.status = item.status this.status = item.status
console.log(item, index)
}, },
updata() { updata() {
getListByDoctor(this.doctorId).then(res => { getListByDoctor(this.doctorId).then(res => {
@ -254,13 +353,9 @@
}, },
timechange(index) { timechange(index) {
this.timecurrent = index this.timecurrent = index
this.timeindexafter = null this.timeindexafter = null
this.timeindex = null this.timeindex = null
// this.List={},
// this.updata()
this.Soonerorlater = null this.Soonerorlater = null
}, },
} }