You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

146 lines
3.3 KiB

<template>
<view class='waiting-method-page'>
<view class="h-name over PfScSemibold">
{{hospital_depart_name}}
</view>
<user-card v-for="(item, key) in active_visitors" :dataitem="item" @clickEvent="changeType" :index="key"></user-card>
<view class="pagebt"></view>
<view class="submit">
<view class="bot primary btn btn2 submitbtn PfScMedium" hover-class="hover" @click="submitWaitType">
确认候诊方式
</view>
</view>
</view>
</template>
<script>
import userCard from '@/components/userCard.vue';
export default {
data() {
return {
cssUrl:this.cssUrl,
depart_id:0,
active_visitors:[],
hospital_depart_name:'',
submitting:false,
}
},
components:{
userCard
},
onLoad(option) {
// 来自 确认报道页面选中的就诊人
var active_visitors = JSON.parse(uni.getStorageSync('active_visitors'));
this.active_visitors = active_visitors;
var depart_info = uni.getStorageSync('depart');
if(depart_info) {
depart_info = JSON.parse(depart_info)
this.hospital_depart_name = depart_info.hospital_name + ' ' + depart_info.depart_name
}
this.getVisitors()
this.depart_id = uni.getStorageSync('depart_id')
if(!this.depart_id) {
this.$pop.modelShow('请先选择要预约的医院科室', '/pages/index/index')
return
}
},
methods: {
getVisitors() {
this.$http.req('api/user/get_visitors', {}, 'POST').then(data=>{
this.visitUsers = data;
this.visitUsers = [...this.visitUsers]
this.popMsgs = []
for (var i = 0; i < this.visitUsers.length; i++) {
this.visitUsers[i].select = false
}
});
},
changeType(info) {
// 存储每一项的候诊方式
this.active_visitors[info.key].type = info.type;
this.active_visitors[info.key].bed_desc = info.bed_desc ? info.bed_desc: '';
},
submitWaitType(){
if(this.submitting) return;
this.submitting = true;
setTimeout(() => {
this.submitting = false;
}, 3000);
var params = [];
this.active_visitors.forEach(visitor => {
params.push({
visitor_id: visitor.id,
visit_id: visitor.visit_id ? visitor.visit_id: 0,
wait_type: visitor.type,
bed_desc: visitor.bed_desc || ""
});
});
var obj = new Object();
obj.depart_id = this.depart_id;
obj.checkin_list = JSON.stringify(params);
this.$http.req('api/user/checkin', obj, 'POST').then(data => {
// 成功后跳转到就诊记录页面
if(data == -1) return
this.$nav.navToPath('/pages/prebook_list/prebook_list')
}).catch(err => {
this.$pop.msg('提交失败,请重试');
});
}
}
}
</script>
<style lang="scss" scoped>
.waiting-method-page{
overflow: hidden;
.h-name{
padding: 36rpx 24rpx;
box-sizing: border-box;
width: 100%;
height: 116rpx;
margin-bottom: 20rpx;
background: white;
align-items: center;
font-size: 32rpx;
color: #000000;
}
.title-wrap{
width: 100%;
height: 100rpx;
}
.pagebt{
height: 20vh;
width: 100%;
}
.submit{
position: fixed;
width: 100%;
top: 82.41%;
.submitbtn{
width: 666rpx;
margin: 0 auto;
}
.tip{
text-align: center;
font-size: 28rpx;
color: #B3B4BC;
margin-top: 33rpx;
}
}
}
</style>