|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<title></title>
|
|
|
<script src="js/jquery-1.12.4.min.js" crossorigin="anonymous"></script>
|
|
|
<link rel="stylesheet" href="css/bootstrap.min.css" crossorigin="anonymous">
|
|
|
<script src="js/bootstrap.min.js" crossorigin="anonymous"></script>
|
|
|
<script src="js/bootstrap-datetimepicker.min.js"></script>
|
|
|
<!-- <script src="js/jquery.freezeheader.js"></script> -->
|
|
|
<script src="js/jquery.jqprint-0.3.js"></script>
|
|
|
<script src="js/jquery-migrate-1.2.1.min.js"></script>
|
|
|
<script type="text/javascript" src="js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
|
|
|
<link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css">
|
|
|
</head>
|
|
|
<body>
|
|
|
<script>
|
|
|
// let BaseUrl='http://10.50.120.166/YiJiYuYue/Laravel/public'
|
|
|
let BaseUrl='http://YiJiYuYue-Common'
|
|
|
let entrust_ids=[]; //选中的entrust_id
|
|
|
let today_date=''
|
|
|
let tomorrowDate=''
|
|
|
let MainInfo_ids=[];//选中的检查项目对应的mainid
|
|
|
let PrintInfo=null;//打印信息
|
|
|
let YuYueSuccessInfo='';//预约成功后返回的信息
|
|
|
let MainInfo_period_ids=[];//选中的检查项目对应的reservation_time
|
|
|
let MainInfo_date=[];//选中的检查项目对应的日期
|
|
|
//获取url参数
|
|
|
function getParameterByName(name, url) {
|
|
|
if (!url) url = decodeURIComponent(window.location.href)
|
|
|
name = name.replace(/[\[\]]/g, '\\$&')
|
|
|
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
|
|
|
results = regex.exec(url)
|
|
|
if (!results) return null
|
|
|
if (!results[2]) return ''
|
|
|
return decodeURIComponent(results[2].replace(/\+/g, ' '))
|
|
|
}
|
|
|
|
|
|
//格式化日期
|
|
|
function getdate(dateString) {
|
|
|
var date = new Date(dateString)
|
|
|
var year = date.getFullYear()
|
|
|
var month = ('0' + (date.getMonth() + 1)).slice(-2) // 月份从0开始,所以要加1
|
|
|
var day = ('0' + date.getDate()).slice(-2)
|
|
|
|
|
|
// 构建格式化后的日期字符串
|
|
|
return year + '-' + month + '-' + day
|
|
|
}
|
|
|
function GetStatus(a){
|
|
|
switch(a) {
|
|
|
case 0:
|
|
|
return "正在申请"
|
|
|
break;
|
|
|
case 1:
|
|
|
return "已预约"
|
|
|
break;
|
|
|
case 2:
|
|
|
return "已登记"
|
|
|
break;
|
|
|
case 3:
|
|
|
return "结束"
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取基本信息
|
|
|
function GetMainInfo() {
|
|
|
$('#yizhulist').html('');
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/getMainDetail', {
|
|
|
regnum: getParameterByName('regnum'),
|
|
|
entrustid: getParameterByName('entrustid'),
|
|
|
episodeid: getParameterByName('episodeid'),
|
|
|
appointment_type:getParameterByName('appointment_type')
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
console.log(data)
|
|
|
if (data.status) {
|
|
|
MainInfoList=data.data.info
|
|
|
MainInfoList.forEach(function(item,key){
|
|
|
let zhuangtai =GetStatus(item.maininfo.list_status)
|
|
|
let msg=item.msg==''?"":'<div style="color:#fff">不可预约:<span>'+item.msg+'</span></div>'
|
|
|
let yuyueshijian=item.maininfo.list_status==1?'<div>预约时间:<span>'+item.maininfo.reservation_date+' '+item.maininfo.period_begin_time.substring(0,5) +'-'+ item.maininfo.period_end_time.substring(0,5) +'</span></div>' :''
|
|
|
let bj_color=item.msg==''?"":"hongse_bg"
|
|
|
let kongfu=(item.iteminfo[0] && item.iteminfo[0].limosis==1)?'是':'否'
|
|
|
if(YuYueSuccessInfo && YuYueSuccessInfo.mainlistids.includes(item.maininfo.id+'')){
|
|
|
console.log(666666666);
|
|
|
bj_color="lanse_bg"
|
|
|
}
|
|
|
$('#yizhulist').append(
|
|
|
'<div class="yiyuInfo '+ bj_color+' "data-entrustid='+ item.maininfo.entrust_id +' data-id='+ key +' data-mainid='+ item.maininfo.id +' data-status='+ item.maininfo.list_status +' data-name='+ item.maininfo.entrust+ ' data-periodid='+ item.maininfo.reservation_time + ' data-yuyuedate='+ item.maininfo.reservation_date +'>' +
|
|
|
'<div>医嘱项:<span >'+item.maininfo.entrust +'</span></div>' +
|
|
|
'<div>当前状态:<span >'+zhuangtai+'</span></div>' +msg+
|
|
|
'<div>医生:<span >'+ item.maininfo.docotr+' </span> 是否空腹:<span >'+ kongfu+'</span></div>' +
|
|
|
yuyueshijian+
|
|
|
'</div>'
|
|
|
);
|
|
|
})
|
|
|
|
|
|
$('.b_name').html(MainInfoList[0].maininfo.user_name);
|
|
|
$('.b_id').html(MainInfoList[0].maininfo.reg_num);
|
|
|
$('.b_sex').html(function(){
|
|
|
if(MainInfoList[0].maininfo.user_sex==1){
|
|
|
return "男"
|
|
|
}
|
|
|
if(MainInfoList[0].maininfo.user_sex==2){
|
|
|
return "女"
|
|
|
}
|
|
|
});
|
|
|
$('.b_tel').html(MainInfoList[0].maininfo.user_phone);
|
|
|
// $('.b_yun').html(MainInfoList[0].maininfo.RISRPatDiag);
|
|
|
|
|
|
today_date=data.data.today_date
|
|
|
let add=1;
|
|
|
if(getParameterByName('dotype')==2 && YuYueSuccessInfo==''){//如果是改约,默认定位到预约的日期
|
|
|
console.log(data.data.info[0].maininfo.reservation_date);
|
|
|
today_date=data.data.info[0].maininfo.reservation_date
|
|
|
add=1;
|
|
|
}
|
|
|
var currentDate = new Date(today_date)
|
|
|
|
|
|
currentDate.setDate(currentDate.getDate() + add)
|
|
|
tomorrowDate = currentDate.toISOString().split('T')[0]
|
|
|
if(YuYueSuccessInfo==''){
|
|
|
$('.yiyuInfo:first').trigger('click');
|
|
|
}
|
|
|
|
|
|
|
|
|
} else {
|
|
|
MsgAlert(data.msg)
|
|
|
}
|
|
|
}, 'json')
|
|
|
}
|
|
|
|
|
|
//查询检查项目预约计划
|
|
|
function getPlanList(date) {
|
|
|
$('#loadingModal').modal('show');
|
|
|
//查询检查项目预约计划
|
|
|
$.post(BaseUrl+'/api/admin/GetEnablePlan', {
|
|
|
regnum: getParameterByName('regnum'),
|
|
|
entrustid: entrust_ids,
|
|
|
episodeid: getParameterByName('episodeid'),
|
|
|
appointment_type: getParameterByName('appointment_type'),
|
|
|
date: date
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
console.log(data)
|
|
|
if (data.status) {
|
|
|
if (data.data.appointment_date == $('#datetimepicker1 input').val()) {
|
|
|
$('#xingqi1').html(data.data.weekname);
|
|
|
$('#table1 tbody').html('')
|
|
|
if(data.data.plan_list.length>0){
|
|
|
//判断是否是预约成功后重新加载计划列表,自动选中成功后的日期
|
|
|
let zhuangtai="class='table_row '";
|
|
|
|
|
|
data.data.plan_list.forEach(function(v, i) {
|
|
|
if(YuYueSuccessInfo && YuYueSuccessInfo.planid==v.id){
|
|
|
zhuangtai="class='table_row row_selected'"
|
|
|
}else{
|
|
|
zhuangtai="class='table_row '"
|
|
|
}
|
|
|
if(getParameterByName('dotype')==2 && YuYueSuccessInfo=='' && v.date==MainInfo_date[0]) {//如果是改约,默认定位到预约的日期
|
|
|
if(MainInfo_period_ids[0]==v.period_id){
|
|
|
zhuangtai="class='table_row row_selected'"
|
|
|
}else{
|
|
|
zhuangtai="class='table_row '"
|
|
|
}
|
|
|
}
|
|
|
$('#table1 tbody').append('<tr data-resource='+v.department_resources_name+' data-timerange='+v.begin_time+'-'+v.end_time +' data-date='+v.date +' data-id=' + v.id + ' '+zhuangtai+'>\n' +
|
|
|
' <td>' + v.date + '</td>\n' +
|
|
|
' <td>' + v.weekname + '</td>\n' +
|
|
|
' <td>' + v.department_resources_name + '</td>\n' +
|
|
|
' <td>' + v.devices + '</td>\n' +
|
|
|
' <td>' + v.begin_time.substring(0,5) + '-' + v.end_time.substring(0,5) + '</td>\n' +
|
|
|
' <td class=\'usecount\' onclick=\'test('+v.id+')\'>' + v.used_count + '/' + v.count + '</td>\n' +
|
|
|
' </tr>')
|
|
|
})
|
|
|
// if(getParameterByName('dotype')==2 && YuYueSuccessInfo=='') {//如果是改约,默认定位到预约的日期
|
|
|
// console.log($('.row_selected').position())
|
|
|
// $('.table_k').animate({
|
|
|
// scrollTop: $('.row_selected').position().top-200
|
|
|
// }, 200); // 动画持续时间为1000毫秒
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
$('#table1 tbody').append('暂无可用计划')
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
if (data.data.appointment_date == $('#datetimepicker2 input').val()) {
|
|
|
$('#xingqi2').html(data.data.weekname);
|
|
|
$('#table2 tbody').html('')
|
|
|
if(data.data.plan_list.length>0){
|
|
|
//判断是否是预约成功后重新加载计划列表,自动选中成功后的日期
|
|
|
let zhuangtai="class='table_row '";
|
|
|
data.data.plan_list.forEach(function(v, i) {
|
|
|
if(YuYueSuccessInfo && YuYueSuccessInfo.planid==v.id){
|
|
|
zhuangtai="class='table_row row_selected'"
|
|
|
}else{
|
|
|
zhuangtai="class='table_row '"
|
|
|
}
|
|
|
if(getParameterByName('dotype')==2 && YuYueSuccessInfo=='' && v.date==MainInfo_date[0] ) {//如果是改约,默认定位到预约的日期
|
|
|
if(MainInfo_period_ids[0]==v.period_id){
|
|
|
zhuangtai="class='table_row row_selected'"
|
|
|
}else{
|
|
|
zhuangtai="class='table_row '"
|
|
|
}
|
|
|
}
|
|
|
$('#table2 tbody').append('<tr data-resource='+v.department_resources_name+' data-timerange='+v.begin_time+'-'+v.end_time +' data-date='+v.date +' data-id=' + v.id + ' '+zhuangtai+'>\n' +
|
|
|
' <td>' + v.date + '</td>\n' +
|
|
|
' <td>' + v.weekname + '</td>\n' +
|
|
|
' <td>' + v.department_resources_name + '</td>\n' +
|
|
|
' <td>' + v.devices + '</td>\n' +
|
|
|
' <td>' + v.begin_time.substring(0,5) + '-' + v.end_time.substring(0,5) + '</td>\n' +
|
|
|
' <td class=\'usecount\' onclick=\'test('+v.id+')\'>' + v.used_count + '/' + v.count + '</td>\n' +
|
|
|
' </tr>')
|
|
|
})
|
|
|
}else{
|
|
|
$('#table2 tbody').append('暂无可用计划')
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
//选中某一行
|
|
|
$('.table_row').off('click').on('click', function(event) {
|
|
|
if ($(this).hasClass('row_selected')) {
|
|
|
// 如果已经选中,则移除选中状态
|
|
|
$('.table_row').removeClass('row_selected')
|
|
|
selectedId = 0
|
|
|
$('#input_appointment_date').val('');
|
|
|
$('#input_appointment_timerange').val('');
|
|
|
$('#input_appointment_resource').val('');
|
|
|
} else {
|
|
|
$('.table_row').removeClass('row_selected')
|
|
|
$(this).addClass('row_selected')
|
|
|
selectedId = $(this).data('id')
|
|
|
$('#input_appointment_date').val($(this).data('date'));
|
|
|
$('#input_appointment_timerange').val($(this).data('timerange'));
|
|
|
$('#input_appointment_resource').val($(this).data('resource')) ;
|
|
|
IsDaiJian(getParameterByName('regnum'),selectedId);
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
MsgAlert(data.msg)
|
|
|
}
|
|
|
|
|
|
}, 'json')
|
|
|
|
|
|
|
|
|
}
|
|
|
//检查待预约时段是否有待检项目
|
|
|
function IsDaiJian(reg_num,planid){
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/CheckIsDaiJian', {
|
|
|
reg_num:reg_num,
|
|
|
planid: planid,
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
|
|
|
}else{
|
|
|
MsgAlert(data.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
let selectedId = 0
|
|
|
|
|
|
//开始预约
|
|
|
function start_yuyue() {
|
|
|
if (selectedId == 0) return false
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/PlanYuYue', {
|
|
|
mainlistid:MainInfo_ids,
|
|
|
planid: selectedId,
|
|
|
appointment_type:getParameterByName('appointment_type'),
|
|
|
dotype:getParameterByName('dotype'),//1预约2改约
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
YuYueSuccessInfo=data.data
|
|
|
MsgAlert("操作成功")
|
|
|
if($('#enable_print').is(':checked')){
|
|
|
PrintFunc();
|
|
|
}
|
|
|
getPlanList($('#datetimepicker1 input').val())
|
|
|
getPlanList($('#datetimepicker2 input').val())
|
|
|
GetMainInfo()
|
|
|
}else{
|
|
|
MsgAlert(data.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
$(function() {
|
|
|
|
|
|
console.log(getParameterByName('regnum'))
|
|
|
console.log(getParameterByName('entrustid'))
|
|
|
console.log(getParameterByName('episodeid'))
|
|
|
if(getParameterByName('dotype')==2){
|
|
|
$('#yuyue_button').html('修改预约时间');
|
|
|
$('#yuyue_button').css("background-color", "#e6a23c");
|
|
|
$('#yuyue_button').css("border", "0px");
|
|
|
}
|
|
|
|
|
|
$('#datetimepicker1').datetimepicker({
|
|
|
language: 'zh-CN',
|
|
|
weekStart: 1,
|
|
|
todayBtn: 1,
|
|
|
autoclose: 1,
|
|
|
todayHighlight: 1,
|
|
|
startView: 2,
|
|
|
minView: 2,
|
|
|
forceParse: 0
|
|
|
}
|
|
|
).on('changeDate', function(e) {
|
|
|
console.log(getdate(e.date))
|
|
|
getPlanList(getdate(e.date))
|
|
|
})
|
|
|
$('#datetimepicker2').datetimepicker({
|
|
|
language: 'zh-CN',
|
|
|
weekStart: 1,
|
|
|
todayBtn: 1,
|
|
|
autoclose: 1,
|
|
|
todayHighlight: 1,
|
|
|
startView: 2,
|
|
|
minView: 2,
|
|
|
forceParse: 0
|
|
|
}
|
|
|
).on('changeDate', function(e) {
|
|
|
console.log(getdate(e.date))
|
|
|
getPlanList(getdate(e.date))
|
|
|
})
|
|
|
GetMainInfo()
|
|
|
|
|
|
$('#yuyue_button').click(function() {
|
|
|
if (selectedId == 0) {
|
|
|
return false
|
|
|
}
|
|
|
start_yuyue()
|
|
|
})
|
|
|
|
|
|
$('.model_button').on('click',function(){
|
|
|
$('#tishi').modal('hide');
|
|
|
})
|
|
|
// var elementDistanceToBottom = $(window).height() - $('#table2_head').offset().top - $('#table2_head').outerHeight();
|
|
|
|
|
|
// console.log("元素到页面底部的距离为: " + elementDistanceToBottom + "px");
|
|
|
$('.table_k').css("height",400+'px');
|
|
|
|
|
|
//点击左侧的检查项目,调用接口查询可同时预约的项目
|
|
|
$("#yizhulist").on('click','.yiyuInfo:not(.yiyuInfo.hongse_bg)',function(){
|
|
|
//如果有预约状态的被选中则启用取消按钮,否则取消按钮关闭
|
|
|
if($(this).data('status')==1){
|
|
|
$('#quxiao_button').prop('disabled', false);
|
|
|
}else{
|
|
|
$('#quxiao_button').prop('disabled', true);
|
|
|
}
|
|
|
//如果点击的项目本身已经被选中,再次点击则取消
|
|
|
if( $(this).hasClass('lanse_bg')){
|
|
|
$(this).removeClass('lanse_bg');
|
|
|
insertInto_appointmenText()
|
|
|
return false;
|
|
|
}
|
|
|
//如果点击的项目还没被选中,则清空所有已经选中的
|
|
|
if(!$(this).hasClass('lanse_bg')){
|
|
|
$(".lanse_bg").removeClass('lanse_bg');
|
|
|
$(this).addClass('lanse_bg');
|
|
|
insertInto_appointmenText()
|
|
|
}
|
|
|
|
|
|
|
|
|
let first=$(this).data('id')
|
|
|
let items=[]
|
|
|
$('.yiyuInfo:not(.yiyuInfo.hongse_bg)').each(function(){
|
|
|
let isfirst=0
|
|
|
if($(this).data('id')==first){
|
|
|
isfirst=1
|
|
|
}
|
|
|
if($(this).data('status')==0){
|
|
|
items.push({name:$(this).data('name'),rowid:$(this).data('id'),first:isfirst})
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
if(items.length>1){
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/CheckEntrstItemGroup', {
|
|
|
items:items
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
data.data.group[0].forEach(function(v,i){
|
|
|
//遍历所有 不是红色的检查项目。匹配接口返回的可同时预约的项目 ,勾选
|
|
|
$('.yiyuInfo:not(.yiyuInfo.hongse_bg)').each(function(){
|
|
|
if($(this).data('id')==v.rowid){
|
|
|
$(this).addClass('lanse_bg');
|
|
|
}
|
|
|
})
|
|
|
|
|
|
})
|
|
|
insertInto_appointmenText()
|
|
|
|
|
|
|
|
|
}else{
|
|
|
MsgAlert(data.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
})
|
|
|
async function insertInto_appointmenText(){ //向检查项目输入框 填写内容
|
|
|
MainInfo_ids=[]
|
|
|
entrust_ids=[]
|
|
|
let input_itemname=""
|
|
|
$('.lanse_bg').each(function(){
|
|
|
input_itemname=input_itemname+" "+$(this).data('name')
|
|
|
entrust_ids.push($(this).data('entrustid'))
|
|
|
MainInfo_ids.push($(this).data('mainid'))
|
|
|
MainInfo_period_ids.push($(this).data('periodid'))
|
|
|
MainInfo_date.push($(this).data('yuyuedate'))
|
|
|
})
|
|
|
$('#input_appointment_item').val(input_itemname);
|
|
|
console.log(entrust_ids);
|
|
|
if($(".lanse_bg").length>0){
|
|
|
console.log(getParameterByName('dotype'))
|
|
|
if(getParameterByName('dotype')!=2){
|
|
|
await NearestEnablePlanDate();
|
|
|
}
|
|
|
|
|
|
//日历设置日期,支持查询计划
|
|
|
$('#datetimepicker1 input').val(today_date)
|
|
|
$('#datetimepicker2 input').val(tomorrowDate)
|
|
|
getPlanList(today_date)
|
|
|
getPlanList(tomorrowDate)
|
|
|
}else{
|
|
|
//清空
|
|
|
$('#datetimepicker1 input').val('')
|
|
|
$('#datetimepicker2 input').val('')
|
|
|
$('#table1 tbody').html('<tr><td>请先选择检查项目</td></tr>')
|
|
|
$('#table2 tbody').html('<tr><td>请先选择检查项目</td></tr>')
|
|
|
}
|
|
|
|
|
|
}
|
|
|
$('#dayin_button').on('click',function(){
|
|
|
PrintFunc();
|
|
|
})
|
|
|
|
|
|
$('#shuaxin_button').on('click',function(){
|
|
|
window.location.reload()
|
|
|
})
|
|
|
//点击下一页
|
|
|
$('#xiayiye_button').on('click',function(){
|
|
|
if($(".lanse_bg").length>0){
|
|
|
var cr = new Date($('#datetimepicker2 input').val())
|
|
|
cr.setDate(cr.getDate() + 1)
|
|
|
t1 = cr.toISOString().split('T')[0]
|
|
|
cr.setDate(cr.getDate() + 1)
|
|
|
t2 = cr.toISOString().split('T')[0]
|
|
|
//日历设置日期,支持查询计划
|
|
|
$('#datetimepicker1 input').val(t1)
|
|
|
$('#datetimepicker2 input').val(t2)
|
|
|
getPlanList(t1)
|
|
|
getPlanList(t2)
|
|
|
}
|
|
|
})
|
|
|
//点击上一页
|
|
|
$('#shangyiye_button').on('click',function(){
|
|
|
if($(".lanse_bg").length>0){
|
|
|
var cr = new Date($('#datetimepicker1 input').val())
|
|
|
cr.setDate(cr.getDate() - 1)
|
|
|
t2 = cr.toISOString().split('T')[0]
|
|
|
cr.setDate(cr.getDate() - 1)
|
|
|
t1 = cr.toISOString().split('T')[0]
|
|
|
//日历设置日期,支持查询计划
|
|
|
$('#datetimepicker1 input').val(t1)
|
|
|
$('#datetimepicker2 input').val(t2)
|
|
|
getPlanList(t1)
|
|
|
getPlanList(t2)
|
|
|
}
|
|
|
})
|
|
|
//点击取消
|
|
|
$('#quxiao_button').on('click',function(){
|
|
|
if (MainInfo_ids.length !== 1) {
|
|
|
MsgAlert("请勾选1条 预约中 的医嘱,进行取消")
|
|
|
return false
|
|
|
}
|
|
|
let result = confirm("你确定要取消此预约吗?");
|
|
|
|
|
|
if (result !== true) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/DoctorCancelYuYue', {
|
|
|
MainListId:MainInfo_ids[0],
|
|
|
reg_num: getParameterByName('regnum'),
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
MsgAlert("操作成功")
|
|
|
getPlanList($('#datetimepicker1 input').val())
|
|
|
getPlanList($('#datetimepicker2 input').val())
|
|
|
GetMainInfo()
|
|
|
}else{
|
|
|
MsgAlert(data.msg)
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
|
|
|
$('#tablelist').load("tablelist.html");
|
|
|
$('#allentrust_button').click(function(){
|
|
|
window.location.href="PersonEntrustList.html?reg_num="+getParameterByName('regnum')
|
|
|
})
|
|
|
})
|
|
|
|
|
|
function MsgAlert(msg){
|
|
|
$('#tishi .tishineirong').html(msg);
|
|
|
$('#tishi').modal('show');
|
|
|
}
|
|
|
//打印
|
|
|
function PrintFunc(){
|
|
|
PrintInfo=null
|
|
|
$("#shenqingdan").html('')
|
|
|
if($(".lanse_bg").length==0){
|
|
|
MsgAlert('请选择要打印的申请单');
|
|
|
return false;
|
|
|
}
|
|
|
let enids=''
|
|
|
$('.lanse_bg').each(function(){
|
|
|
enids=enids+$(this).data('entrustid')+','
|
|
|
})
|
|
|
//调用接口查询项目详情
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/getMainDetail', {
|
|
|
regnum: getParameterByName('regnum'),
|
|
|
entrustid: enids,
|
|
|
episodeid: getParameterByName('episodeid'),
|
|
|
appointment_type:getParameterByName('appointment_type')
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
let info=data.data.info
|
|
|
let enable=true
|
|
|
info.forEach(function(v,i){
|
|
|
if(v.maininfo.list_status!=1){
|
|
|
MsgAlert(v.maininfo.entrust+" 不可打印,请重新选择");
|
|
|
enable=false
|
|
|
}
|
|
|
})
|
|
|
if(enable){
|
|
|
PrintInfo=data.data.info
|
|
|
PrintInfo.forEach(function(v,i){
|
|
|
console.log(i)
|
|
|
$("#shenqingdan").append(
|
|
|
'<div style="height:100vh;">' +
|
|
|
'<div style="width: 100%;text-align: center;font-size: 14px;">深圳市南山区妇幼保健院</div>'+
|
|
|
'<div style="width: 100%;text-align: center;font-size: 18px;font-weight: bold;">检查申请单</div>'+
|
|
|
'<div style="width: 100%; border: 1px solid #ccc;padding: 20px;">'+
|
|
|
'<div>检查项目:'+v.maininfo.entrust+'</div>'+
|
|
|
'</div>'+
|
|
|
'</div>'
|
|
|
)
|
|
|
})
|
|
|
|
|
|
$("#shenqingdan").show();
|
|
|
$("#shenqingdan").jqprint();
|
|
|
$("#shenqingdan").hide();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
//获取最近可用日期
|
|
|
async function NearestEnablePlanDate(){
|
|
|
$('#loadingModal').modal('show');
|
|
|
|
|
|
await $.post(BaseUrl+'/api/admin/NearestEnablePlanDate', {
|
|
|
regnum: getParameterByName('regnum'),
|
|
|
entrustid: entrust_ids,
|
|
|
episodeid: getParameterByName('episodeid'),
|
|
|
appointment_type:getParameterByName('appointment_type')
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
if(data.data.list.length>0){
|
|
|
//today_date
|
|
|
// tomorrowDate
|
|
|
today_date=data.data.list[0];
|
|
|
if(data.data.list[1]!=undefined){
|
|
|
tomorrowDate=data.data.list[1]
|
|
|
}else{
|
|
|
var currentDate = new Date(today_date)
|
|
|
currentDate.setDate(currentDate.getDate() + 1)
|
|
|
tomorrowDate = currentDate.toISOString().split('T')[0]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<!-- 加载状态 -->
|
|
|
<div class="modal" id="loadingModal" tabindex="-1">
|
|
|
<div class="modal-dialog">
|
|
|
<div class="modal-content">
|
|
|
<div class="modal-body text-center">
|
|
|
<div class="spinner-border text-primary" role="status">
|
|
|
<span class="visually-hidden">Loading...</span>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 提示 -->
|
|
|
<div class="modal" id="tishi" tabindex="-1">
|
|
|
<div class="modal-dialog" style="margin-top: 20%;width: 300px">
|
|
|
<div class="modal-content">
|
|
|
<div class="modal-body text-center">
|
|
|
<div class="spinner-border text-primary" role="status">
|
|
|
<span class="visually-hidden tishineirong"></span>
|
|
|
</div>
|
|
|
<button type="button" class="btn btn-info model_button" style="width: 120px;margin-top: 12px;">确定</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="container-fluid">
|
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-md-2 ">
|
|
|
<div style="margin-top: 8px;"> 医嘱列表</div>
|
|
|
<div id="yizhulist"></div>
|
|
|
<!-- <div class="yiyuInfo">
|
|
|
<div>医嘱项:<span class="yizhu"></span></div>
|
|
|
<div>是否空腹:<span class="kongfu"></span></div>
|
|
|
<div>开单科室:<span class="keshi"></span></div>
|
|
|
<div>开单医生:<span class="yisheng"></span></div>
|
|
|
<div>开医嘱时间:<span class="time"></span></div>
|
|
|
<div>当前状态:<span class="zhuangtai"></span></div>
|
|
|
</div> -->
|
|
|
|
|
|
</div>
|
|
|
<div class="col-md-10">
|
|
|
<div class="b_info">姓名: <span class="b_name"></span> 登记号: <span class="b_id"></span> 性别: <span class="b_sex"></span>
|
|
|
年龄: <span class="b_age"></span> 电话: <span class="b_tel"></span>
|
|
|
<button type="button" id="allentrust_button" class="btn btn-sm btn-info" style="margin-left: 8px;">查看用户全部预约记录</button>
|
|
|
<!-- 孕周: <span class="b_yun"></span>-->
|
|
|
</div>
|
|
|
<div class="row" style="margin-top: 16px">
|
|
|
<div class="col-md-3">
|
|
|
<div class="input-group">
|
|
|
<span class="input-group-addon" >预约日期</span>
|
|
|
<input type="text" disabled class="form-control" id="input_appointment_date" aria-describedby="basic-addon1">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-3">
|
|
|
<div class="input-group">
|
|
|
<span class="input-group-addon" >预约时间段</span>
|
|
|
<input type="text" disabled class="form-control" id="input_appointment_timerange" aria-describedby="basic-addon1">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-3">
|
|
|
<div class="input-group">
|
|
|
<span class="input-group-addon" >资源</span>
|
|
|
<input type="text" disabled class="form-control" id="input_appointment_resource" aria-describedby="basic-addon1">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row" style="margin-top: 8px">
|
|
|
<div class="col-md-8">
|
|
|
<div class="input-group">
|
|
|
<span class="input-group-addon">检查项目</span>
|
|
|
<textarea name="" disabled id="input_appointment_item" cols="30" rows="3"
|
|
|
class="form-control"></textarea>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row" style="margin-top: 20px">
|
|
|
<div class="col-md-12">
|
|
|
<button type="button" id="yuyue_button" class="btn btn-info" style="width: 130px">预 约</button>
|
|
|
<button type="button" disabled id="quxiao_button" class="btn btn-danger" style="width: 130px;margin-left: 8px">取消预约</button>
|
|
|
<button type="button" id="shuaxin_button" class="btn btn-info" style="width: 130px;margin-left: 8px;">刷 新</button>
|
|
|
<button type="button" id="shangyiye_button" class="btn " style="width: 130px;margin-left: 8px;">上一页</button>
|
|
|
<button type="button" id="xiayiye_button" class="btn " style="width: 130px;margin-left: 8px;">下一页</button>
|
|
|
<button type="button" id="dayin_button" class="btn btn-info" style="width: 130px;margin-left: 8px;margin-right: 10px;">打印申请单</button>
|
|
|
<label><input type="checkbox" id="enable_print" name="enable_print" value="enable_print" checked> 预约完成后打印申请单</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
<hr>
|
|
|
<div class="row">
|
|
|
<div class="col-md-6">
|
|
|
<div class="row">
|
|
|
<div class="col-md-2" style="text-align: right; line-height: 36px">日期</div>
|
|
|
<div class="col-md-5">
|
|
|
<div class="form-group">
|
|
|
<div class='input-group date' id='datetimepicker1' data-date-format="yyyy-mm-dd"
|
|
|
data-link-format="yyyy-mm-dd">
|
|
|
<input type='text' class="form-control" />
|
|
|
<span class="input-group-addon">
|
|
|
<span class="glyphicon glyphicon-calendar"></span>
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-4" style="line-height: 36px" id="xingqi1"></div>
|
|
|
</div>
|
|
|
<div style="padding-right: 16px;">
|
|
|
<table id="table1_head" >
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>日期</th>
|
|
|
<th>星期</th>
|
|
|
<th>资源</th>
|
|
|
<th>服务组</th>
|
|
|
<th>时间段</th>
|
|
|
<th>已用/总数</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
</table>
|
|
|
</div>
|
|
|
<div class="table_k" style=" overflow-y: scroll;">
|
|
|
<table id="table1">
|
|
|
<tbody>
|
|
|
<tr><td>请先选择检查项目</td></tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<div class="col-md-6">
|
|
|
<div class="row">
|
|
|
<div class="col-md-2" style="text-align: right; line-height: 36px">日期</div>
|
|
|
<div class="col-md-5">
|
|
|
<div class="form-group">
|
|
|
<div class='input-group date' id='datetimepicker2' data-date-format="yyyy-mm-dd"
|
|
|
data-link-format="yyyy-mm-dd">
|
|
|
<input type='text' class="form-control" />
|
|
|
<span class="input-group-addon">
|
|
|
<span class="glyphicon glyphicon-calendar"></span>
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-4" style="line-height: 36px" id="xingqi2"></div>
|
|
|
</div>
|
|
|
<div style="padding-right: 16px;">
|
|
|
<table id="table2_head" >
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>日期</th>
|
|
|
<th>星期</th>
|
|
|
<th>资源</th>
|
|
|
<th>服务组</th>
|
|
|
<th>时间段</th>
|
|
|
<th>已用/总数</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
</table>
|
|
|
</div>
|
|
|
<div class="table_k" style=" overflow-y: scroll;">
|
|
|
<table id="table2" >
|
|
|
<tbody >
|
|
|
<tr><td>请先选择检查项目</td></tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
<div class="col-md-3" style="border-right: 1px solid #eee">
|
|
|
|
|
|
</div>
|
|
|
<div class="col-md-9">
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
<div id="shenqingdan">
|
|
|
<!-- <div>
|
|
|
<div style="width: 100%;text-align: center;font-size: 14px;">深圳市南山区妇幼保健院</div>
|
|
|
<div style="width: 100%;text-align: center;font-size: 18px;font-weight: bold;">检查申请单</div>
|
|
|
<div style="width: 100%; border: 1px solid #ccc;padding: 20px;">
|
|
|
<div>检查项目:腹部彩超</div>
|
|
|
</div>
|
|
|
</div> -->
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div id="tablelist">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<style>
|
|
|
|
|
|
table {
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
table, td, th {
|
|
|
border: 1px solid #ccc;
|
|
|
text-align: center;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
td ,th{
|
|
|
width: 100px ;
|
|
|
white-space: normal; /* 保留空白符序列,但是正常换行 */
|
|
|
word-break: break-all; /* 允许在单词内换行 */
|
|
|
}
|
|
|
tr th:first-child{
|
|
|
width: 70px ;
|
|
|
|
|
|
}
|
|
|
tr td:first-child{
|
|
|
width: 70px ;
|
|
|
|
|
|
}
|
|
|
tr th:nth-child(2){
|
|
|
width: 50px ;
|
|
|
|
|
|
}
|
|
|
tr td:nth-child(2){
|
|
|
width: 50px ;
|
|
|
|
|
|
}
|
|
|
tr th:nth-child(3){
|
|
|
width: 80px ;
|
|
|
|
|
|
}
|
|
|
tr td:nth-child(3){
|
|
|
width: 80px ;
|
|
|
|
|
|
}
|
|
|
tr th:nth-child(5){
|
|
|
width: 70px ;
|
|
|
|
|
|
}
|
|
|
tr td:nth-child(5){
|
|
|
width: 70px ;
|
|
|
|
|
|
}
|
|
|
tr th:nth-child(6){
|
|
|
width: 60px ;
|
|
|
|
|
|
}
|
|
|
tr td:nth-child(6){
|
|
|
width: 60px ;
|
|
|
|
|
|
}
|
|
|
|
|
|
tbody tr td {
|
|
|
padding: 8px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
th {
|
|
|
padding: 10px;
|
|
|
background-color: #eee;
|
|
|
}
|
|
|
|
|
|
.row_selected {
|
|
|
background-color: #79bbff;
|
|
|
}
|
|
|
.input-group-addon{
|
|
|
background-color: #ddd;
|
|
|
color: #666;
|
|
|
}
|
|
|
.yiyuInfo{
|
|
|
background-color: #fff;
|
|
|
border: 1px solid #31b0d5;
|
|
|
padding: 8px 18px;
|
|
|
margin-top: 8px;
|
|
|
|
|
|
}
|
|
|
.yiyuInfo:not(.yiyuInfo.hongse_bg):hover{
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
.yiyuInfo div{
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
.yiyuInfo div span{
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
.b_info span{
|
|
|
font-weight: 700;
|
|
|
color: #31b0d5;
|
|
|
}
|
|
|
.hongse_bg{
|
|
|
background-color: rgb(183, 169, 169);
|
|
|
}
|
|
|
.lanse_bg{
|
|
|
background-color: #31b0d5;
|
|
|
}
|
|
|
#yizhulist{
|
|
|
height:100vh;
|
|
|
overflow-y: auto;
|
|
|
}
|
|
|
.usecount{
|
|
|
color: #31b0d5;
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
</body>
|
|
|
</html>
|