|
|
@ -2,18 +2,18 @@ |
|
|
|
<view class="page-prebook"> |
|
|
|
<view class="title flex"> |
|
|
|
<img :src="cssUrl+'ten.svg'"> |
|
|
|
{{depart.h_name}} {{depart.depart_name}} |
|
|
|
{{depart.hospital_name}} {{depart.depart_name}} |
|
|
|
</view> |
|
|
|
<book ref="book" @confirmSubmitEvent="showConfirm" :RegistrationTimeList="RegistrationTimeList" :visitorList="activeVisitors"/> |
|
|
|
<book ref="book" @confirmSubmitEvent="showConfirm" @getAvailabletRegistrationTime = "getAvailabletRegistrationTime" :visitorList="activeVisitors"/> |
|
|
|
<slider-box ref="sliderbox"> |
|
|
|
<view class="slider-title PfScMedium">预约信息确认</view> |
|
|
|
<view class="members-box" v-if="needSelectMembers"> |
|
|
|
<view class="desc">当前时段余号不足,只能预约{{times.remain_num}}人</view> |
|
|
|
<view class="desc">当前时段余号不足,只能预约{{times.remain}}人</view> |
|
|
|
<view class="members"> |
|
|
|
<view :class="'memmbers-item'+(item.choose?' active':'')" v-for="(item,key) in activeVisitors" @click="chooseVisitor(key)"> |
|
|
|
<img :src="cssUrl+'checkbox_false.svg'"> |
|
|
|
<img :src="cssUrl+'checkbox_true.svg'"> |
|
|
|
{{item.visitor_name}} |
|
|
|
{{item.name}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -21,21 +21,21 @@ |
|
|
|
<view class="left">就诊人:</view> |
|
|
|
<view class="right over2 over5"> |
|
|
|
<text v-for="(item,key) in activeVisitors"> |
|
|
|
<text v-if="key<=9">{{nums[key]}}</text><text v-else>n.</text>{{item.visitor_name}} |
|
|
|
<text v-if="key<=9">{{nums[key]}}</text><text v-else>n.</text>{{item.name}} |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="item" > |
|
|
|
<view class="left">医生姓名:</view> |
|
|
|
<view class="right">{{doctorInfo.doctor_info.name}}</view> |
|
|
|
<view class="right">{{doctorInfo.doctor_info.doctor_name}}</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="left">就诊医院:</view> |
|
|
|
<view class="right over2 over5">{{depart.h_name}} {{depart.depart_name}}</view> |
|
|
|
<view class="right over2 over5">{{depart.hospital_name}} {{depart.depart_name}}</view> |
|
|
|
</view> |
|
|
|
<view class="item"> |
|
|
|
<view class="left">看诊时间:</view> |
|
|
|
<view class="right orange">{{times.date}} {{times.time_desc}} {{times.start_time}}-{{times.end_time}}</view> |
|
|
|
<view class="right orange">{{times.date}} {{times.time_desc}} {{times.time_interval}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="btns-box flex"> |
|
|
@ -66,7 +66,7 @@ |
|
|
|
chooseVisitorCount:0, |
|
|
|
departId:false, |
|
|
|
depart:false, |
|
|
|
visit_nums_id:false |
|
|
|
visitor_ids:false, |
|
|
|
} |
|
|
|
}, |
|
|
|
components:{ |
|
|
@ -129,107 +129,56 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getAvailabletRegistrationTime(refresh = true, chooseDay = '') { |
|
|
|
this.$http.req('get_appoint_times',{depart_id:this.departId}, 'GET').then(data=>{ |
|
|
|
if(data == -1) return |
|
|
|
// data.days = [ |
|
|
|
// { |
|
|
|
// date: "2024-04-17", type: 2, type_text: "上午出诊", weekday: "周一", |
|
|
|
// am: [ |
|
|
|
// { |
|
|
|
// "start": "12:00", |
|
|
|
// "end": "12:30", |
|
|
|
// "bed_count": 0 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// "start": "13:00", |
|
|
|
// "end": "14:30", |
|
|
|
// "bed_count": 2 |
|
|
|
// } |
|
|
|
// ], |
|
|
|
// pm: [] |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// date: "2024-04-18", type: 5, type_text: "未开放预约", weekday: "周二", am: [], pm: [] |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// date: "2024-04-19", type: 3, type_text: "全天出诊", weekday: "周三", am: [ |
|
|
|
// { |
|
|
|
// "start": "12:00", |
|
|
|
// "end": "12:30", |
|
|
|
// "bed_count": 0 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// "start": "13:00", |
|
|
|
// "end": "14:30", |
|
|
|
// "bed_count": 2 |
|
|
|
// } |
|
|
|
// ], pm: [ |
|
|
|
// { |
|
|
|
// "start": "12:00", |
|
|
|
// "end": "12:30", |
|
|
|
// "bed_count": 0 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// "start": "13:00", |
|
|
|
// "end": "14:30", |
|
|
|
// "bed_count": 8 |
|
|
|
// } |
|
|
|
// ] |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// date: "2024-04-20", type: 4, type_text: "下午出诊", weekday: "周四", am: [], pm: [ |
|
|
|
// { |
|
|
|
// "start": "12:00", |
|
|
|
// "end": "12:30", |
|
|
|
// "bed_count": 0 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// "start": "13:00", |
|
|
|
// "end": "14:30", |
|
|
|
// "bed_count": 1 |
|
|
|
// } |
|
|
|
// ] |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// date: "2024-04-21", type: 1, type_text: "全天休息", weekday: "周五", am: [], pm: [] |
|
|
|
// }, |
|
|
|
// ] |
|
|
|
|
|
|
|
// if(!refresh){ |
|
|
|
// // data.days[3].pm[1].bed_count=0 |
|
|
|
// // data.days[3].type=1 |
|
|
|
// data.days = [ |
|
|
|
// { |
|
|
|
// date: "2024-04-17", type: 2, type_text: "上午出诊", weekday: "周一", |
|
|
|
// am: [ |
|
|
|
// { |
|
|
|
// "start": "12:00", |
|
|
|
// "end": "12:30", |
|
|
|
// "bed_count": 0 |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// "start": "13:00", |
|
|
|
// "end": "14:30", |
|
|
|
// "bed_count": 2 |
|
|
|
// } |
|
|
|
// ], |
|
|
|
// pm: [] |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// date: "2024-04-18", type: 5, type_text: "未开放预约", weekday: "周二", am: [], pm: [] |
|
|
|
// } |
|
|
|
// ] |
|
|
|
// } |
|
|
|
|
|
|
|
this.RegistrationTimeList = data |
|
|
|
if(this.RegistrationTimeList.length>0) { |
|
|
|
if(refresh || chooseDay>=this.RegistrationTimeList.length) { |
|
|
|
this.$refs.book.dataInit(this.RegistrationTimeList[0]) |
|
|
|
getAvailabletRegistrationTime(date) { |
|
|
|
const param = { |
|
|
|
depart_id:this.departId, |
|
|
|
date:date?date:'' |
|
|
|
} |
|
|
|
//仅测试 |
|
|
|
// const data1={"date2work":{"2024-09-25":{"date":"2024-09-25","week_desc":"周三","work_desc":"上午出诊"},"2024-09-26":{"date":"2024-09-26","week_desc":"周四","work_desc":"上午出诊"},"2024-09-27":{"date":"2024-09-27","week_desc":"周五","work_desc":"不出诊"},"2024-09-30":{"date":"2024-09-30","week_desc":"周一","work_desc":"下午出诊"},"2024-10-01":{"date":"2024-10-01","week_desc":"周二","work_desc":"全天出诊"},"2024-10-02":{"date":"2024-10-02","week_desc":"周三","work_desc":"上午出诊"},"2024-10-03":{"date":"2024-10-03","week_desc":"周四","work_desc":"上午出诊"}}, |
|
|
|
// "date2time":{ |
|
|
|
// "am":[ |
|
|
|
// "8:00-08:30","08:30-09:00","09:00-09:30","09:30-10:00","10:00-10:30","10:30-11:00","11:00-11:30","11:30-12:00" |
|
|
|
// ],"pm":[ |
|
|
|
// "13:00-13:30", |
|
|
|
// "13:30-14:00", |
|
|
|
// "14:00-14:30", |
|
|
|
// "14:30-15:00", |
|
|
|
// "15:00-15:30", |
|
|
|
// "15:30-16:00", |
|
|
|
// "14:00-14:30", |
|
|
|
// "14:30-15:00", |
|
|
|
// "15:00-15:30", |
|
|
|
// "15:30-16:00", |
|
|
|
// "16:00-16:30", |
|
|
|
// "16:30-17:00", |
|
|
|
// ]}, |
|
|
|
// "time2remain":{"8:00-08:30":1,"08:30-09:00":2,"09:00-09:30":20,"09:30-10:00":20,"10:00-10:30":20,"10:30-11:00":20,"11:00-11:30":20,"11:30-12:00":20}} |
|
|
|
this.$http.req('/user/get_appoint_times',param, 'POST').then(data=>{ |
|
|
|
let date2work = data.date2work |
|
|
|
// let date2work = data1.date2work;//后续可删除 |
|
|
|
let regxp = /^0/; |
|
|
|
for(let key in date2work){ |
|
|
|
let itemObj = date2work[key]; |
|
|
|
let month = itemObj.date.split('-')[1]; |
|
|
|
let day = itemObj.date.split('-')[2]; |
|
|
|
itemObj['day'] = day; |
|
|
|
if(regxp.test(month)){ |
|
|
|
itemObj['month'] = month.replace('0','') |
|
|
|
}else{ |
|
|
|
this.$refs.book.chooseDay(chooseDay, this.RegistrationTimeList[chooseDay]) |
|
|
|
itemObj['month'] = month |
|
|
|
} |
|
|
|
} |
|
|
|
// this.RegistrationTimeList = date2work |
|
|
|
// if(this.RegistrationTimeList.length>0) { |
|
|
|
// if(refresh) { |
|
|
|
// this.$refs.book.dataInit(data1['date2time'],data1['time2remain']) |
|
|
|
this.$refs.book.dataInit(data1,date) |
|
|
|
// this.$refs.book.dataInit(data['date2time'],data['time2remain'],date) |
|
|
|
// }else{ |
|
|
|
// this.$refs.book.chooseDay(chooseDay, this.RegistrationTimeList[chooseDay]) |
|
|
|
// } |
|
|
|
// } |
|
|
|
}); |
|
|
|
}, |
|
|
|
closeConfirm() { |
|
|
@ -238,7 +187,6 @@ |
|
|
|
appoint() { |
|
|
|
var param = new Object() |
|
|
|
param.depart_id = this.departId |
|
|
|
param.visit_nums_id = this.visit_nums_id |
|
|
|
var uids = new Array() |
|
|
|
for (var i = 0; i < this.activeVisitors.length; i++) { |
|
|
|
var visitor = this.activeVisitors[i] |
|
|
@ -255,45 +203,41 @@ |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if(uids.length > this.times.remain_num){ |
|
|
|
this.$pop.modelShow('当前时段余号不足,只能预约'+this.times.remain_num+'人') |
|
|
|
if(uids.length > this.times.remain){ |
|
|
|
this.$pop.modelShow('当前时段余号不足,只能预约'+this.times.remain+'人') |
|
|
|
return |
|
|
|
} |
|
|
|
param.visitor_ids = uids.join(',') |
|
|
|
|
|
|
|
param.visitor_ids = uids; |
|
|
|
param.time_interval = this.times.time_interval; |
|
|
|
param.date = this.times.date; |
|
|
|
this.chooseVisitorCount = uids.length |
|
|
|
this.$http.req('appoint', param).then(data=>{ |
|
|
|
this.$http.req('user/appoint', param,'POST').then(data=>{ |
|
|
|
if(data == -1) return |
|
|
|
this.tips() |
|
|
|
}); |
|
|
|
}, |
|
|
|
appointCheck(times, chooseDay='', visit_nums_id){ |
|
|
|
var param = new Object() |
|
|
|
param.depart_id = this.departId |
|
|
|
this.visit_nums_id = param.visit_nums_id = visit_nums_id |
|
|
|
|
|
|
|
var visitor_ids = new Array(); |
|
|
|
appointCheck(times){ |
|
|
|
var param = {...times} |
|
|
|
param.depart_id = this.departId; |
|
|
|
let visitor_ids = new Array(); |
|
|
|
for (var i = 0; i < this.activeVisitors.length; i++) { |
|
|
|
visitor_ids.push(this.activeVisitors[i].id) |
|
|
|
} |
|
|
|
param.visitor_ids = visitor_ids.join(',') |
|
|
|
|
|
|
|
this.times = param |
|
|
|
this.times.date = times.date.date |
|
|
|
this.times.start_time = times.start |
|
|
|
this.times.end_time = times.end |
|
|
|
this.times.time_desc = '下午' |
|
|
|
if(times.type == 1) this.times.time_desc = '上午' |
|
|
|
|
|
|
|
this.$http.req('check_appoint_nums', param).then(data=>{ |
|
|
|
if(data == -1) { |
|
|
|
this.getAvailabletRegistrationTime(false, chooseDay) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if(data.remain_num < this.activeVisitors.length){ |
|
|
|
param.visitor_ids = this.visitor_ids = visitor_ids; |
|
|
|
this.times = param; |
|
|
|
this.times.date = times.date; |
|
|
|
this.times.time_desc = '下午'; |
|
|
|
if(times.type == 1) this.times.time_desc = '上午'; |
|
|
|
this.$http.req('user/check_appoint_nums', param,'POST').then(data=>{ |
|
|
|
// if(data == -1) { |
|
|
|
// this.getAvailabletRegistrationTime(false, chooseDay) |
|
|
|
// return |
|
|
|
// } |
|
|
|
let remain = 1 |
|
|
|
if(remain < this.activeVisitors.length){ |
|
|
|
this.needSelectMembers = true |
|
|
|
this.$set(this.times, 'remain_num', data.remain_num) |
|
|
|
this.$set(this.times, 'remain', remain) |
|
|
|
this.$refs.sliderbox.showConfirm() |
|
|
|
}else{ |
|
|
|
this.$refs.sliderbox.showConfirm() |
|
|
@ -301,7 +245,7 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
showConfirm(times) { |
|
|
|
this.appointCheck(times, times.key, times.id) |
|
|
|
this.appointCheck(times) |
|
|
|
}, |
|
|
|
submitConfim(){ |
|
|
|
this.appoint() |
|
|
|