Browse Source

提交预约页面,预约确认选择就诊人交互

master
kuaileWu 1 year ago
parent
commit
5da1cb4367
  1. 210
      pages/prebook/prebook.vue

210
pages/prebook/prebook.vue

@ -10,25 +10,10 @@
<view class="members-box" v-if="needSelectMembers"> <view class="members-box" v-if="needSelectMembers">
<view class="desc">当前时段余号不足只能预约{{times.left_count}}</view> <view class="desc">当前时段余号不足只能预约{{times.left_count}}</view>
<view class="members"> <view class="members">
<view class="memmbers-item active"> <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_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'"> <img :src="cssUrl+'checkbox_true.svg'">
上官子涵 {{item.real_name}}
</view>
<view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
帅哥
</view>
<view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
发财哥
</view>
<view class="memmbers-item">
<img :src="cssUrl+'checkbox_false.svg'">
<img :src="cssUrl+'checkbox_true.svg'">
王富贵
</view> </view>
</view> </view>
</view> </view>
@ -80,7 +65,8 @@
hospital:false, hospital:false,
activeVisitors:[], activeVisitors:[],
nums:['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩'], nums:['①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩'],
times:false times:false,
chooseVisitorCount:0
} }
}, },
components:{ components:{
@ -113,81 +99,102 @@
this.getAvailabletRegistrationTime() this.getAvailabletRegistrationTime()
}, },
methods: { methods: {
chooseVisitor(key){
var visitor = this.activeVisitors[key]
var choose = visitor.choose ? false : true
var chooseCount = 0
for (var i = 0; i < this.activeVisitors.length; i++) {
if(this.activeVisitors[i].choose) ++chooseCount
}
if(this.times.left_count <= chooseCount && choose){
this.$pop.modelShow('最多预约'+this.times.left_count+'人')
return
}
visitor.choose = choose
this.$set(this.activeVisitors, key, visitor)
},
tips(){ tips(){
uni.showToast({ uni.showToast({
title:"成功预约8人", title:"成功预约"+this.chooseVisitorCount+"人",
mask:true, mask:true,
image:this.cssUrl+'gou.svg', image:this.cssUrl+'gou.svg',
times:false times:false,
success() {
uni.navigateTo({
url:"/pages/prebook_list/prebook_list"
})
}
}) })
}, },
getAvailabletRegistrationTime(refresh = true, chooseDay = '') { getAvailabletRegistrationTime(refresh = true, chooseDay = '') {
this.$http.req('client/doctor/visit_hospital/days/'+this.hospitalId).then(data=>{ this.$http.req('client/doctor/visit_hospital/days/'+this.hospitalId).then(data=>{
if(data == -1) return if(data == -1) return
data.days = [ // data.days = [
{ // {
date: "2024-04-17", type: 2, type_text: "上午出诊", weekday: "周一", // date: "2024-04-17", type: 2, type_text: "", weekday: "",
am: [ // am: [
{ // {
"start": "12:00", // "start": "12:00",
"end": "12:30", // "end": "12:30",
"bed_count": 0 // "bed_count": 0
}, // },
{ // {
"start": "13:00", // "start": "13:00",
"end": "14:30", // "end": "14:30",
"bed_count": 2 // "bed_count": 2
} // }
], // ],
pm: [] // pm: []
}, // },
{ // {
date: "2024-04-18", type: 5, type_text: "未开放预约", weekday: "周二", am: [], pm: [] // date: "2024-04-18", type: 5, type_text: "", weekday: "", am: [], pm: []
}, // },
{ // {
date: "2024-04-19", type: 3, type_text: "全天出诊", weekday: "周三", am: [ // date: "2024-04-19", type: 3, type_text: "", weekday: "", am: [
{ // {
"start": "12:00", // "start": "12:00",
"end": "12:30", // "end": "12:30",
"bed_count": 0 // "bed_count": 0
}, // },
{ // {
"start": "13:00", // "start": "13:00",
"end": "14:30", // "end": "14:30",
"bed_count": 2 // "bed_count": 2
} // }
], pm: [ // ], pm: [
{ // {
"start": "12:00", // "start": "12:00",
"end": "12:30", // "end": "12:30",
"bed_count": 0 // "bed_count": 0
}, // },
{ // {
"start": "13:00", // "start": "13:00",
"end": "14:30", // "end": "14:30",
"bed_count": 8 // "bed_count": 8
} // }
] // ]
}, // },
{ // {
date: "2024-04-20", type: 4, type_text: "下午出诊", weekday: "周四", am: [], pm: [ // date: "2024-04-20", type: 4, type_text: "", weekday: "", am: [], pm: [
{ // {
"start": "12:00", // "start": "12:00",
"end": "12:30", // "end": "12:30",
"bed_count": 0 // "bed_count": 0
}, // },
{ // {
"start": "13:00", // "start": "13:00",
"end": "14:30", // "end": "14:30",
"bed_count": 1 // "bed_count": 1
} // }
] // ]
}, // },
{ // {
date: "2024-04-21", type: 1, type_text: "全天休息", weekday: "周五", am: [], pm: [] // date: "2024-04-21", type: 1, type_text: "", weekday: "", am: [], pm: []
}, // },
] // ]
// if(!refresh){ // if(!refresh){
// // data.days[3].pm[1].bed_count=0 // // data.days[3].pm[1].bed_count=0
// // data.days[3].type=1 // // data.days[3].type=1
@ -227,6 +234,37 @@
closeConfirm() { closeConfirm() {
this.$refs.sliderbox.closeConfirm() this.$refs.sliderbox.closeConfirm()
}, },
appoint() {
var param = new Object()
param.visit_hospital_id = this.hospitalId
param.start_time = this.times.start_time
param.end_time = this.times.end_time
param.date = this.times.date
var uids = new Array()
for (var i = 0; i < this.activeVisitors.length; i++) {
var visitor = this.activeVisitors[i]
if(!this.needSelectMembers){
uids.push(visitor.id)
continue
}
if(!visitor.choose) continue
uids.push(visitor.id)
}
if(uids.length <= 0){
this.$pop.modelShow('请选择预约就诊人')
return
}
this.chooseVisitorCount = uids.length
param.user_ids = JSON.stringify(uids)
param.handler_type = 1
this.$http.req('client/user/appoint/', param).then(data=>{
if(data == -1) return
this.tips()
});
},
appointCheck(times, chooseDay=''){ appointCheck(times, chooseDay=''){
var param = new Object() var param = new Object()
param.start_time = times.start param.start_time = times.start
@ -253,9 +291,7 @@
this.appointCheck(times, times.key) this.appointCheck(times, times.key)
}, },
submitConfim(){ submitConfim(){
uni.navigateTo({ this.appoint()
url:"/pages/index/index"
})
} }
} }
} }

Loading…
Cancel
Save