|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<title></title>
|
|
|
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
|
|
|
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
|
|
|
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css"
|
|
|
integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
|
|
|
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"
|
|
|
integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd"
|
|
|
crossorigin="anonymous"></script>
|
|
|
<script src="js/bootstrap-datetimepicker.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://yijiyuyue'
|
|
|
//获取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
|
|
|
}
|
|
|
let MainInfo='';
|
|
|
//获取基本信息
|
|
|
function GetMainInfo() {
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/getMainDetail', {
|
|
|
regnum: getParameterByName('regnum'),
|
|
|
entrustid: getParameterByName('entrustid'),
|
|
|
episodeid: getParameterByName('episodeid')
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
console.log(data)
|
|
|
if (data.status) {
|
|
|
MainInfo=data.data.mainInfo
|
|
|
$('.yizhu').html(data.data.mainInfo.entrust);
|
|
|
$('.kongfu').html(function(){
|
|
|
if(data.data.itemInfo.limosis===1){
|
|
|
return "是"
|
|
|
}else{
|
|
|
return "否"
|
|
|
}
|
|
|
});
|
|
|
$('.keshi').html(data.data.mainInfo.reservation_department)
|
|
|
$('.yisheng').html(data.data.mainInfo.docotr)
|
|
|
$('.time').html(data.data.mainInfo.entrust_date+' '+data.data.mainInfo.entrust_time)
|
|
|
$('.zhuangtai').html(function(){
|
|
|
switch(data.data.mainInfo.list_status) {
|
|
|
case 0:
|
|
|
return "正在申请"
|
|
|
break;
|
|
|
case 1:
|
|
|
return "预约"
|
|
|
break;
|
|
|
case 2:
|
|
|
return "登记"
|
|
|
break;
|
|
|
case 3:
|
|
|
return "结束"
|
|
|
break;
|
|
|
case 4:
|
|
|
return "预约取消"
|
|
|
break;
|
|
|
case 5:
|
|
|
return ".取消登记"
|
|
|
break;
|
|
|
}
|
|
|
})
|
|
|
$('.b_name').html(data.data.mainInfo.user_name);
|
|
|
$('.b_id').html(data.data.mainInfo.reg_num);
|
|
|
$('.b_sex').html(function(){
|
|
|
if(data.data.mainInfo.user_sex==1){
|
|
|
return "男"
|
|
|
}
|
|
|
if(data.data.mainInfo.user_sex==2){
|
|
|
return "女"
|
|
|
}
|
|
|
});
|
|
|
$('.b_tel').html(data.data.mainInfo.user_phone);
|
|
|
$('.b_yun').html(data.data.mainInfo.RISRPatDiag);
|
|
|
$('#input_appointment_item').val(data.data.itemInfo.item_name);
|
|
|
|
|
|
var currentDate = new Date(data.data.today_date)
|
|
|
currentDate.setDate(currentDate.getDate() + 1)
|
|
|
var tomorrowDate = currentDate.toISOString().split('T')[0]
|
|
|
$('#datetimepicker1 input').val(data.data.today_date)
|
|
|
$('#datetimepicker2 input').val(tomorrowDate)
|
|
|
// $("table").first().attr("id", data.data.today_date);
|
|
|
// $("table:eq(1)").attr("id", tomorrowDate);
|
|
|
getPlanList(data.data.today_date)
|
|
|
getPlanList(tomorrowDate)
|
|
|
|
|
|
} else {
|
|
|
alert(data.msg)
|
|
|
}
|
|
|
}, 'json')
|
|
|
}
|
|
|
|
|
|
//查询检查项目预约计划
|
|
|
function getPlanList(date) {
|
|
|
$('#loadingModal').modal('show');
|
|
|
//查询检查项目预约计划
|
|
|
$.post(BaseUrl+'/api/admin/GetEnablePlan', {
|
|
|
regnum: getParameterByName('regnum'),
|
|
|
entrustid: getParameterByName('entrustid'),
|
|
|
episodeid: getParameterByName('episodeid'),
|
|
|
appointment_type: 1,
|
|
|
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('')
|
|
|
data.data.plan_list.forEach(function(v, i) {
|
|
|
$('#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 + ' class=\'table_row\'>\n' +
|
|
|
' <td>' + v.date + '</td>\n' +
|
|
|
' <td>' + v.weekname + '</td>\n' +
|
|
|
' <td>' + v.department_resources_name + '</td>\n' +
|
|
|
' <td>' + v.device_id + '</td>\n' +
|
|
|
' <td>' + v.begin_time + '-' + v.end_time + '</td>\n' +
|
|
|
' <td>' + v.used_count + '/' + v.count + '</td>\n' +
|
|
|
' </tr>')
|
|
|
})
|
|
|
|
|
|
}
|
|
|
if (data.data.appointment_date == $('#datetimepicker2 input').val()) {
|
|
|
$('#xingqi2').html(data.data.weekname);
|
|
|
$('#table2 tbody').html('')
|
|
|
data.data.plan_list.forEach(function(v, i) {
|
|
|
$('#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 + ' class=\'table_row\'>\n' +
|
|
|
' <td>' + v.date + '</td>\n' +
|
|
|
' <td>' + v.weekname + '</td>\n' +
|
|
|
' <td>' + v.department_resources_name + '</td>\n' +
|
|
|
' <td>' + v.device_id + '</td>\n' +
|
|
|
' <td>' + v.begin_time + '-' + v.end_time + '</td>\n' +
|
|
|
' <td>' + v.used_count + '/' + v.count + '</td>\n' +
|
|
|
' </tr>')
|
|
|
})
|
|
|
|
|
|
}
|
|
|
//选中某一行
|
|
|
$('.table_row').off('click').on('click', function() {
|
|
|
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')) ;
|
|
|
}
|
|
|
|
|
|
})
|
|
|
} else {
|
|
|
alert(data.msg)
|
|
|
}
|
|
|
}, 'json')
|
|
|
}
|
|
|
|
|
|
let selectedId = 0
|
|
|
|
|
|
//开始预约
|
|
|
function start_yuyue() {
|
|
|
if (selectedId == 0) return false
|
|
|
$('#loadingModal').modal('show');
|
|
|
$.post(BaseUrl+'/api/admin/PlanYuYue', {
|
|
|
mainlistid:MainInfo.id,
|
|
|
planid: selectedId,
|
|
|
appointment_type: 1,
|
|
|
dotype:getParameterByName('dotype'),//1预约2改约
|
|
|
|
|
|
}, function(data) {
|
|
|
$('#loadingModal').modal('hide');
|
|
|
if (data.status) {
|
|
|
$('#tishi .tishineirong').html('操作成功');
|
|
|
$('#tishi').modal('show');
|
|
|
getPlanList($('#datetimepicker1 input').val())
|
|
|
getPlanList($('#datetimepicker2 input').val())
|
|
|
}else{
|
|
|
alert(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
|
|
|
if (confirm("你确定要继续吗?")) {
|
|
|
start_yuyue()
|
|
|
}else{
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
$('.model_button').on('click',function(){
|
|
|
$('#tishi').modal('hide');
|
|
|
})
|
|
|
})
|
|
|
</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-3" style="border-right: 1px solid #eee">
|
|
|
<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-9">
|
|
|
<div class="b_info">姓名: <span class="b_name"></span> 患者id: <span class="b_id"></span> 性别: <span class="b_sex"></span>
|
|
|
年龄: <span class="b_age"></span> 电话: <span class="b_tel"></span> 孕周: <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>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<hr>
|
|
|
<div class="row">
|
|
|
<div class="col-md-6">
|
|
|
<div class="row">
|
|
|
<div class="col-md-1" style="text-align: right; line-height: 36px">日期</div>
|
|
|
<div class="col-md-4">
|
|
|
<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">33333</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<table id="table1">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>日期</th>
|
|
|
<th>星期</th>
|
|
|
<th>资源</th>
|
|
|
<th>服务组</th>
|
|
|
<th>时间段</th>
|
|
|
<th>剩余</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<!-- <tr>-->
|
|
|
<!-- <td>22</td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- </tr>-->
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
<div class="col-md-6">
|
|
|
<div class="row">
|
|
|
<div class="col-md-1" style="text-align: right; line-height: 36px">日期</div>
|
|
|
<div class="col-md-4">
|
|
|
<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">33333</div>
|
|
|
|
|
|
</div>
|
|
|
<table id="table2">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>日期</th>
|
|
|
<th>星期</th>
|
|
|
<th>资源</th>
|
|
|
<th>服务组</th>
|
|
|
<th>时间段</th>
|
|
|
<th>剩余</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<!-- <tr>-->
|
|
|
<!-- <td>22</td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- <td></td>-->
|
|
|
<!-- </tr>-->
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<style>
|
|
|
.table_select {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
table {
|
|
|
width: 100%;
|
|
|
|
|
|
}
|
|
|
|
|
|
table, td, th {
|
|
|
border: 1px solid #ccc;
|
|
|
text-align: center;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
|
|
|
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: #31b0d5;
|
|
|
padding: 18px;
|
|
|
|
|
|
}
|
|
|
.yiyuInfo div{
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
.yiyuInfo div span{
|
|
|
font-weight: 700;
|
|
|
}
|
|
|
.b_info span{
|
|
|
font-weight: 700;
|
|
|
color: #31b0d5;
|
|
|
}
|
|
|
</style>
|
|
|
</body>
|
|
|
</html>
|