|
@ -22,24 +22,23 @@ |
|
|
</view> |
|
|
</view> |
|
|
<view class="tip height40">请确保预约就诊前在门诊先挂号</view> |
|
|
<view class="tip height40">请确保预约就诊前在门诊先挂号</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="list-wrapper2" v-if="type == 2"> |
|
|
<view class="list-wrapper2" v-if="type == 2"> |
|
|
<view class="item block" v-for="(item,key) in visitUsers"> |
|
|
<view class="item block" v-for="(item,key) in visitUsers"> |
|
|
<view class="top flex"> |
|
|
<view class="top flex"> |
|
|
<view class="PfScSemibold">{{item.name}}</view> |
|
|
<view class="PfScSemibold">{{item.real_name}}</view> |
|
|
<view>身份证尾号:{{item.id_no}}</view> |
|
|
<view>身份证尾号:{{item.id_no}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="bt"> |
|
|
<view class="bt"> |
|
|
<view class="bt-item flex"> |
|
|
<view class="bt-item flex" v-for="(item2,key2) in item.hospital_info"> |
|
|
<view class="left flex"><view class="over3">广安门中医医院西单门诊部</view><view class="status2">10周未看病</view></view> |
|
|
<view class="left flex"> |
|
|
<view class="more right" v-if="res">剩余<text>2</text>次</view> |
|
|
<view class="over3">{{item2.hospital_name}} {{item2.hospital_dept}}</view> |
|
|
<view class="owe right" v-else>超<text>10</text>次</view> |
|
|
<view class="status2" v-if="!item2.hospital_state">停诊</view> |
|
|
</view> |
|
|
<view class="status2" v-else-if="item2.is_expire">{{item2.expire_day}}未看病</view> |
|
|
|
|
|
</view> |
|
|
<view class="bt-item flex"> |
|
|
|
|
|
<view class="left flex"><view class="over3">顺天德中医医院</view><view class="status2">停诊</view></view> |
|
|
<view class="more right" v-if="item2.times>=0">剩余<text>{{item2.times}}</text>次</view> |
|
|
<view class="more right" v-if="res">剩余<text>20</text>次</view> |
|
|
<view class="owe right" v-else>超<text>{{-item2.times}}</text>次</view> |
|
|
<view class="owe right" v-else>超<text>10</text>次</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -49,6 +48,7 @@ |
|
|
ref="popcom" |
|
|
ref="popcom" |
|
|
:content="popContent" |
|
|
:content="popContent" |
|
|
:title="popTitle" |
|
|
:title="popTitle" |
|
|
|
|
|
:index="popIndex" |
|
|
:showCancel='popShowCancel' |
|
|
:showCancel='popShowCancel' |
|
|
@confirm="popConfirm" |
|
|
@confirm="popConfirm" |
|
|
@cancel="popCancel" |
|
|
@cancel="popCancel" |
|
@ -71,17 +71,26 @@ |
|
|
visitUsers:false, |
|
|
visitUsers:false, |
|
|
selectCount:0, |
|
|
selectCount:0, |
|
|
hospitalId:false, |
|
|
hospitalId:false, |
|
|
activeVisitors:[] |
|
|
activeVisitors:[], |
|
|
|
|
|
popMsgs:[], |
|
|
|
|
|
popIndex:0 |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components:{ |
|
|
components:{ |
|
|
pop |
|
|
pop |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
if(option.type) this.type = option.type |
|
|
if(option.type) { |
|
|
|
|
|
this.type = option.type |
|
|
|
|
|
}else{ |
|
|
|
|
|
var type = uni.getStorageSync('visitor_type') |
|
|
|
|
|
if(type) this.type = type |
|
|
|
|
|
} |
|
|
|
|
|
uni.setStorageSync('visitor_type', this.type) |
|
|
|
|
|
|
|
|
this.getVisitors() |
|
|
this.getVisitors() |
|
|
this.hospitalId = uni.getStorageSync('hospital_id') |
|
|
this.hospitalId = uni.getStorageSync('hospital_id') |
|
|
if(!this.hospitalId) { |
|
|
if(!this.hospitalId && this.type == 1) { |
|
|
this.$pop.modelShow('请先选择要预约的医院', '/pages/index/index') |
|
|
this.$pop.modelShow('请先选择要预约的医院', '/pages/index/index') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
@ -103,22 +112,103 @@ |
|
|
param.limit = 10000 |
|
|
param.limit = 10000 |
|
|
this.$http.req('client/user/visit_user/', param, 'GET').then(data=>{ |
|
|
this.$http.req('client/user/visit_user/', param, 'GET').then(data=>{ |
|
|
if(data == -1) return |
|
|
if(data == -1) return |
|
|
|
|
|
var server_time = data.server_time |
|
|
this.visitUsers = data.data |
|
|
this.visitUsers = data.data |
|
|
|
|
|
this.popMsgs = [] |
|
|
for (var i = 0; i < this.visitUsers.length; i++) { |
|
|
for (var i = 0; i < this.visitUsers.length; i++) { |
|
|
this.visitUsers[i].select = false |
|
|
this.visitUsers[i].select = false |
|
|
|
|
|
// this.visitUsers[i].hospital_info = [ |
|
|
|
|
|
// { |
|
|
|
|
|
// "times": -1, |
|
|
|
|
|
// "hospital_name": "测试医院", |
|
|
|
|
|
// "hospital_dept": "呼吸科", |
|
|
|
|
|
// "hospital_state": true, |
|
|
|
|
|
// "is_expire":true, |
|
|
|
|
|
// "last_visit_time": "2021-01-12 13:16:26" |
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
// { |
|
|
|
|
|
// "times": 10, |
|
|
|
|
|
// "hospital_name": "测试医院", |
|
|
|
|
|
// "hospital_dept": "呼吸科", |
|
|
|
|
|
// "hospital_state": true, |
|
|
|
|
|
// "is_expire":true, |
|
|
|
|
|
// "last_visit_time": "2021-01-12 13:16:26" |
|
|
|
|
|
// } |
|
|
|
|
|
// ] |
|
|
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
|
var dateService = new Date(server_time.replaceAll('-', "/")); |
|
|
|
|
|
var timestampService = Math.floor(dateService)/1000; |
|
|
|
|
|
var hospitalInfo = this.visitUsers[i].hospital_info |
|
|
|
|
|
for (var j = 0; j < hospitalInfo.length; j++) { |
|
|
|
|
|
var datestr = new Date(hospitalInfo[j].last_visit_time.replaceAll('-', "/")); |
|
|
|
|
|
var timestamp = Math.floor(datestr)/1000; |
|
|
|
|
|
var visitTimeDayTotal = Math.floor((timestampService-timestamp)/3600/24) |
|
|
|
|
|
if(visitTimeDayTotal>0 && visitTimeDayTotal < 7) hospitalInfo[j].expire_day = visitTimeDayTotal+'天' |
|
|
|
|
|
if(visitTimeDayTotal>=7) hospitalInfo[j].expire_day = Math.floor(visitTimeDayTotal/7)+'周' |
|
|
|
|
|
if(visitTimeDayTotal>=365) hospitalInfo[j].expire_day = Math.floor(visitTimeDayTotal/365)+'年' |
|
|
|
|
|
if(!hospitalInfo[j].expire_day) { |
|
|
|
|
|
var visitTimeMinute = Math.floor((timestampService-timestamp)/60) |
|
|
|
|
|
if(visitTimeMinute <= 0) hospitalInfo[j].expire_day = (timestampService-timestamp)+'秒' |
|
|
|
|
|
if(visitTimeMinute >= 1 && visitTimeMinute<60) hospitalInfo[j].expire_day = Math.floor((timestampService-timestamp)/60)+'分' |
|
|
|
|
|
if(visitTimeMinute>=60) hospitalInfo[j].expire_day = Math.floor((visitTimeMinute)/60)+'小时' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!hospitalInfo[j].hospital_state) continue |
|
|
|
|
|
|
|
|
|
|
|
var popobj = new Object() |
|
|
|
|
|
popobj.popShowCancel = false |
|
|
|
|
|
if(hospitalInfo[j].is_expire){ |
|
|
|
|
|
popobj.popContent = this.visitUsers[i].real_name+'已<span style="color:red;">'+hospitalInfo[j].expire_day+'</span>没有来'+hospitalInfo[j].hospital_name+hospitalInfo[j].hospital_dept+'针灸。如还需要,请尽快安排' |
|
|
|
|
|
popobj.popTitle = "提醒" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(hospitalInfo[j].times < 0){ |
|
|
|
|
|
popobj.popContent = this.visitUsers[i].real_name+'在'+hospitalInfo[j].hospital_name+hospitalInfo[j].hospital_dept+'须补挂号啦,请挂号缴费后告知医生' |
|
|
|
|
|
popobj.popTitle = "挂号提醒" |
|
|
|
|
|
} |
|
|
|
|
|
this.popMsgs.push(popobj) |
|
|
|
|
|
} |
|
|
|
|
|
}catch(et){ |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.popMsgs.length > 0 && !uni.getStorageSync('has_noticed')){ |
|
|
|
|
|
this.popIndex = 0 |
|
|
|
|
|
var popinfo = this.popMsgs[this.popIndex] |
|
|
|
|
|
this.popContent = popinfo.popContent |
|
|
|
|
|
this.popTitle = popinfo.popTitle |
|
|
|
|
|
this.popIndex = popinfo.popIndex |
|
|
|
|
|
this.popShowCancel = popinfo.popShowCancel |
|
|
|
|
|
this.showPopCom() |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
showPopCom() { |
|
|
showPopCom() { |
|
|
this.$refs.popcom.open() |
|
|
this.$refs.popcom.open() |
|
|
}, |
|
|
}, |
|
|
popConfirm(e){ |
|
|
closePopCom() { |
|
|
|
|
|
this.$refs.popcom.close() |
|
|
|
|
|
}, |
|
|
|
|
|
popConfirm(e, index){ |
|
|
|
|
|
if(this.popMsgs.length > 0 && index<(this.popMsgs.length-1)){ |
|
|
|
|
|
this.popIndex = index+1 |
|
|
|
|
|
var popinfo = this.popMsgs[this.popIndex] |
|
|
|
|
|
this.popContent = popinfo.popContent |
|
|
|
|
|
this.popTitle = popinfo.popTitle |
|
|
|
|
|
this.popShowCancel = popinfo.popShowCancel |
|
|
|
|
|
this.showPopCom() |
|
|
|
|
|
}else{ |
|
|
|
|
|
uni.setStorageSync('has_noticed', 1) |
|
|
|
|
|
this.closePopCom() |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
popCancel(e){ |
|
|
popCancel(e){ |
|
|
}, |
|
|
}, |
|
|
addVisitor(){ |
|
|
addVisitor(){ |
|
|
uni.navigateTo({ |
|
|
uni.navigateTo({ |
|
|
url:"/pages/modify_visitor/modify_visitor" |
|
|
url:"/pages/modify_visitor/modify_visitor?type="+this.type |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
toPrebook(){ |
|
|
toPrebook(){ |
|
@ -126,7 +216,7 @@ |
|
|
this.$pop.modelShow('请选择就诊人') |
|
|
this.$pop.modelShow('请选择就诊人') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.activeVisitors = [] |
|
|
this.activeVisitors = [] |
|
|
for (var i = 0; i < this.visitUsers.length; i++) { |
|
|
for (var i = 0; i < this.visitUsers.length; i++) { |
|
|
if(this.visitUsers[i].select) this.activeVisitors.push(this.visitUsers[i]) |
|
|
if(this.visitUsers[i].select) this.activeVisitors.push(this.visitUsers[i]) |
|
|