diff --git a/pages/ServiceSchedule/ServiceSchedule.vue b/pages/ServiceSchedule/ServiceSchedule.vue index 7c15603..caf27c1 100644 --- a/pages/ServiceSchedule/ServiceSchedule.vue +++ b/pages/ServiceSchedule/ServiceSchedule.vue @@ -37,7 +37,7 @@ + :class="item.status==true?'morningbodytwo':'morningbody'"> {{item.scheduleTimeSlot}} 不可预约 可预约 @@ -53,7 +53,7 @@ + :class="item.status==true?'bodytwo':'body'"> {{item.scheduleTimeSlot}} 不可预约 可预约 @@ -97,7 +97,7 @@ timeindexafter: null, Soonerorlater: 'afternoonbutton', qurey: { - schedulePlanDetailId: '', + schedulePlanDetailIds: [], status: "", }, @@ -112,29 +112,150 @@ this.getListByDoctordata() }, methods: { - //切换上下午 + //切换上下午全天 tapSoonerorlater(item) { this.Soonerorlater = item - console.log(this.Soonerorlater) + console.log(item) if (this.Soonerorlater == 'morning') { - this.statusmorning() this.timeindexafter = null this.timeindex = null + this.morningdata() } else if (this.Soonerorlater == 'after') { this.timeindexafter = null this.timeindex = null - this.statusafter() - + this.afterdata() + } else if (this.Soonerorlater == 'all') { this.timeindexafter = null this.timeindex = null - this.statusmorning() - this.statusafter() + this.alldata() } }, + // 修改上午全部状态 + 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) { + this.qurey={ + schedulePlanDetailIds:[], + status:'1', + + } this.status = item.status this.timeindex = index if (item.status == true) { @@ -144,7 +265,9 @@ this.qurey.status = "0" } - this.qurey.schedulePlanDetailId = item.schedulePlanDetailId + + + this.qurey.schedulePlanDetailIds.push(item.schedulePlanDetailId) console.log(this.qurey) updateStatus(this.qurey).then(res => { 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) { this.timeindexafter = index + this.qurey={ + schedulePlanDetailIds:[], + status:'' + + } if (item.status == true) { this.qurey.status = "1" @@ -203,7 +303,8 @@ this.qurey.status = "0" } - this.qurey.schedulePlanDetailId = item.schedulePlanDetailId + + this.qurey.schedulePlanDetailIds.push(item.schedulePlanDetailId) console.log(this.qurey) updateStatus(this.qurey).then(res => { if (res.code == 500) { @@ -226,8 +327,6 @@ }) this.status = item.status - console.log(item, index) - }, updata() { getListByDoctor(this.doctorId).then(res => { @@ -254,13 +353,9 @@ }, timechange(index) { - this.timecurrent = index this.timeindexafter = null this.timeindex = null - // this.List={}, - // this.updata() - this.Soonerorlater = null }, }