Browse Source

长处方续方咨询中随访相关功能代码提交

raolu 7 years ago
parent
commit
8953c77aea

+ 192 - 0
css/followup.css

@ -0,0 +1,192 @@
.mt40{
    margin-top: 40px;
}
.mt60{
    margin-top: 60px;
}
.h34{
    height: 34px;
}
.lh34{
    line-height: 34px;
}
.form-control[type=text][readonly]{
    background-color: #f5f5fa;
}
.form-control[data-val=date][readonly]{
    background-color: #fff;
}
.c-arrow{
    position: absolute;
    font-size: 20px;
    top: 50%;
    right: 10px;
    margin-top: -10px;
    z-index: 3;
    color: #666;
}
.input-sm{
    height: 34px;
}
.chosen-container-single .chosen-single{
    border: 1px solid #e5e6e7;
}
.chosen-container-single .chosen-single span{
    margin-right: 15px;
}
.chosen-container-single .chosen-single div{
    width: 20px;
}
.chosen-container-single .chosen-single div b{
    background: none;
    background: url(../img/angle-down.png) no-repeat;
    background-size: 12px 12px;
    background-position-y: center;
}
.chosen-disabled{
    opacity: 1 !important;
}
.chosen-disabled.chosen-container-single .chosen-single{
    background-color: #f5f5fa;
}
.btn-blue{
    background-color: #12b7f5;
    color: #fff;
}
.required {
    position: relative;
}
.required:before {
    content: "*";
    position: absolute;
    color: #f00;
    font-size: 14px;
    height: 12px;
    line-height: 12px;
    vertical-align: middle;
    left: -8px;
    top: 50%;
    margin-top: -5px;
}
#question_form{
    /*width: 80%;
    margin: 20px auto;*/
    margin: 20px 30px;
}
.width-100{
    width: 100%;
}
.c-f12{
    font-size: 12px;
}
.c-909090{
    color: #909090;
}
.w100{
    width: 100px !important;
}
.w60{
    width: 60px !important;
}
.form-inline .form-group{
    margin-bottom: 10px;
}
@media (max-width: 768px){
    .form-inline .form-group{
        margin-bottom: 10px;
        display: inline-block;
        vertical-align: middle;
    }
    .form-inline .form-control{
        display: inline-block;
        width: auto;
        vertical-align: middle;
    }
    .form-inline .input-group{
        display: inline-table;
        vertical-align: middle;
    }
}
/*.multi-input-group .chosen-container{
    width: 200px !important;
}*/
.popover.bottom>.arrow{
    top: -13px;
}
.modal-header{
    padding: 10px 15px;
}
.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column{
    text-align: center;
}
.ui-jqgrid .ui-jqgrid-hdiv{
    width: 400px;
    background-color: #f5f5fa;
    border-bottom: 1px solid #ddd;
}
.ui-th-column, .ui-jqgrid .ui-jqgrid-htable th.ui-th-column{
    height: 40px;
    border-right: 1px solid #ddd;
}
.ui-jqgrid .ui-jqgrid-htable thead th div{
    font-weight: normal;
    color: #999;
}
.ui-jqgrid tr.jqgrow td{
    height: 40px;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}
.q-note{
    background-color: #fafaeb;
    padding: 10px;
    color: #666;
}
.c-bold{
    font-weight: bold;
}
textarea{
    border-color: #e5e6e7;
}
.table>tbody>tr>td, 
.table>tbody>tr>th, 
.table>tfoot>tr>td, 
.table>tfoot>tr>th, 
.table>thead>tr>td, 
.table>thead>tr>th{
    border-top: none;
    border-bottom: none;
}
.link-blue,
.link-blue:hover,
.link-blue:active,
.link-blue:focus{
    text-decoration: underline;
    color: #12b7f5;
}
.link-red,
.link-red:hover,
.link-red:active,
.link-red:focus{
    text-decoration: underline;
    color: #f96565;
}
.status-tag{
    background-color: #12b7f5;
    color: #fff;
    padding: 3px 10px;
    border-radius: 3px;
}
#prescritionInfo td{
    background-color: #f5f5fa;
}
.modal-body{
    padding: 20px;
}
.modal-dialog{
    margin: 40px;
}
.frequency-select,
.unit-select{
    padding-right: 25px;
}

+ 9 - 0
css/index-layer.css

@ -0,0 +1,9 @@
body .layui-layer.layer-ext-moon .layui-layer-title{
    height: 40px;
    background-color: #fff;
    border-top-right-radius: 2px;
    border-top-left-radius: 2px;
    line-height: 40px;
    color: #333;
    font-weight: 600;
}

+ 418 - 0
css/plugins/datetimepicker/bootstrap-datetimepicker.css

@ -0,0 +1,418 @@
/*!
 * Datetimepicker for Bootstrap
 *
 * Copyright 2012 Stefan Petre
 * Improvements by Andrew Rowls
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 */
.datetimepicker {
	padding: 4px;
	margin-top: 1px;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	direction: ltr;
}
.datetimepicker-inline {
	width: 220px;
}
.datetimepicker.datetimepicker-rtl {
	direction: rtl;
}
.datetimepicker.datetimepicker-rtl table tr td span {
	float: right;
}
.datetimepicker-dropdown, .datetimepicker-dropdown-left {
	top: 0;
	left: 0;
}
[class*=" datetimepicker-dropdown"]:before {
	content: '';
	display: inline-block;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-bottom: 7px solid #cccccc;
	border-bottom-color: rgba(0, 0, 0, 0.2);
	position: absolute;
}
[class*=" datetimepicker-dropdown"]:after {
	content: '';
	display: inline-block;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-bottom: 6px solid #ffffff;
	position: absolute;
}
[class*=" datetimepicker-dropdown-top"]:before {
	content: '';
	display: inline-block;
	border-left: 7px solid transparent;
	border-right: 7px solid transparent;
	border-top: 7px solid #cccccc;
	border-top-color: rgba(0, 0, 0, 0.2);
	border-bottom: 0;
}
[class*=" datetimepicker-dropdown-top"]:after {
	content: '';
	display: inline-block;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid #ffffff;
	border-bottom: 0;
}
.datetimepicker-dropdown-bottom-left:before {
	top: -7px;
	right: 6px;
}
.datetimepicker-dropdown-bottom-left:after {
	top: -6px;
	right: 7px;
}
.datetimepicker-dropdown-bottom-right:before {
	top: -7px;
	left: 6px;
}
.datetimepicker-dropdown-bottom-right:after {
	top: -6px;
	left: 7px;
}
.datetimepicker-dropdown-top-left:before {
	bottom: -7px;
	right: 6px;
}
.datetimepicker-dropdown-top-left:after {
	bottom: -6px;
	right: 7px;
}
.datetimepicker-dropdown-top-right:before {
	bottom: -7px;
	left: 6px;
}
.datetimepicker-dropdown-top-right:after {
	bottom: -6px;
	left: 7px;
}
.datetimepicker > div {
	display: none;
}
.datetimepicker.minutes div.datetimepicker-minutes {
	display: block;
}
.datetimepicker.hours div.datetimepicker-hours {
	display: block;
}
.datetimepicker.days div.datetimepicker-days {
	display: block;
}
.datetimepicker.months div.datetimepicker-months {
	display: block;
}
.datetimepicker.years div.datetimepicker-years {
	display: block;
}
.datetimepicker table {
	margin: 0;
}
.datetimepicker  td,
.datetimepicker th {
	text-align: center;
	width: 20px;
	height: 20px;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	border: none;
}
.table-striped .datetimepicker table tr td,
.table-striped .datetimepicker table tr th {
	background-color: transparent;
}
.datetimepicker table tr td.minute:hover {
	background: #eeeeee;
	cursor: pointer;
}
.datetimepicker table tr td.hour:hover {
	background: #eeeeee;
	cursor: pointer;
}
.datetimepicker table tr td.day:hover {
	background: #eeeeee;
	cursor: pointer;
}
.datetimepicker table tr td.old,
.datetimepicker table tr td.new {
	color: #999999;
}
.datetimepicker table tr td.disabled,
.datetimepicker table tr td.disabled:hover {
	background: none;
	color: #999999;
	cursor: default;
}
.datetimepicker table tr td.today,
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today.disabled:hover {
	background-color: #fde19a;
	background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
	background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
	background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
	background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
	background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
	background-repeat: repeat-x;
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
	border-color: #fdf59a #fdf59a #fbed50;
	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
	filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today:hover:hover,
.datetimepicker table tr td.today.disabled:hover,
.datetimepicker table tr td.today.disabled:hover:hover,
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today:hover.disabled,
.datetimepicker table tr td.today.disabled.disabled,
.datetimepicker table tr td.today.disabled:hover.disabled,
.datetimepicker table tr td.today[disabled],
.datetimepicker table tr td.today:hover[disabled],
.datetimepicker table tr td.today.disabled[disabled],
.datetimepicker table tr td.today.disabled:hover[disabled] {
	background-color: #fdf59a;
}
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active {
	background-color: #fbf069;
}
.datetimepicker table tr td.active,
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active.disabled:hover {
	background-color: #006dcc;
	background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
	background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
	background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
	background-image: -o-linear-gradient(top, #0088cc, #0044cc);
	background-image: linear-gradient(to bottom, #0088cc, #0044cc);
	background-repeat: repeat-x;
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
	border-color: #0044cc #0044cc #002a80;
	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
	filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
	color: #ffffff;
	text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active:hover:hover,
.datetimepicker table tr td.active.disabled:hover,
.datetimepicker table tr td.active.disabled:hover:hover,
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active:hover.disabled,
.datetimepicker table tr td.active.disabled.disabled,
.datetimepicker table tr td.active.disabled:hover.disabled,
.datetimepicker table tr td.active[disabled],
.datetimepicker table tr td.active:hover[disabled],
.datetimepicker table tr td.active.disabled[disabled],
.datetimepicker table tr td.active.disabled:hover[disabled] {
	background-color: #0044cc;
}
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active {
	background-color: #003399;
}
.datetimepicker table tr td span {
	display: block;
	width: 23%;
	height: 54px;
	line-height: 54px;
	float: left;
	margin: 1%;
	cursor: pointer;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
}
.datetimepicker .datetimepicker-hours span {
	height: 26px;
	line-height: 26px;
}
.datetimepicker .datetimepicker-hours table tr td span.hour_am,
.datetimepicker .datetimepicker-hours table tr td span.hour_pm {
	width: 14.6%;
}
.datetimepicker .datetimepicker-hours fieldset legend,
.datetimepicker .datetimepicker-minutes fieldset legend {
	margin-bottom: inherit;
	line-height: 30px;
}
.datetimepicker .datetimepicker-minutes span {
	height: 26px;
	line-height: 26px;
}
.datetimepicker table tr td span:hover {
	background: #eeeeee;
}
.datetimepicker table tr td span.disabled,
.datetimepicker table tr td span.disabled:hover {
	background: none;
	color: #999999;
	cursor: default;
}
.datetimepicker table tr td span.active,
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active.disabled:hover {
	background-color: #006dcc;
	background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
	background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
	background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
	background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
	background-image: -o-linear-gradient(top, #0088cc, #0044cc);
	background-image: linear-gradient(to bottom, #0088cc, #0044cc);
	background-repeat: repeat-x;
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
	border-color: #0044cc #0044cc #002a80;
	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
	filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
	color: #ffffff;
	text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active:hover:hover,
.datetimepicker table tr td span.active.disabled:hover,
.datetimepicker table tr td span.active.disabled:hover:hover,
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active:hover.disabled,
.datetimepicker table tr td span.active.disabled.disabled,
.datetimepicker table tr td span.active.disabled:hover.disabled,
.datetimepicker table tr td span.active[disabled],
.datetimepicker table tr td span.active:hover[disabled],
.datetimepicker table tr td span.active.disabled[disabled],
.datetimepicker table tr td span.active.disabled:hover[disabled] {
	background-color: #0044cc;
}
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active {
	background-color: #003399;
}
.datetimepicker table tr td span.old {
	color: #999999;
}
.datetimepicker th.switch {
	width: 145px;
}
.datetimepicker th span.glyphicon {
	pointer-events: none;
}
.datetimepicker thead tr:first-child th,
.datetimepicker tfoot th {
	cursor: pointer;
}
.datetimepicker thead tr:first-child th:hover,
.datetimepicker tfoot th:hover {
	background: #eeeeee;
}
.input-append.date .add-on i,
.input-prepend.date .add-on i,
.input-group.date .input-group-addon span {
	cursor: pointer;
	width: 14px;
	height: 14px;
}

File diff suppressed because it is too large
+ 9 - 0
css/plugins/datetimepicker/bootstrap-datetimepicker.min.css


+ 784 - 0
css/plugins/jqgrid/ui.jqgrid.css

@ -0,0 +1,784 @@
.ui-jqgrid {
	position: relative
}

.ui-jqgrid .ui-jqgrid-view {
	position: relative;
	left: 0;
	top: 0;
	padding: .0em;
	font-size: 11px
}

.ui-jqgrid .ui-jqgrid-titlebar {
	padding: .3em .2em .2em .3em;
	position: relative;
	border-left: 0 none;
	border-right: 0 none;
	border-top: 0 none
}

.ui-jqgrid .ui-jqgrid-title {
	float: left;
	margin: .1em 0 .2em
}

.ui-jqgrid .ui-jqgrid-titlebar-close {
	position: absolute;
	top: 50%;
	width: 19px;
	margin: -10px 0 0 0;
	padding: 1px;
	height: 18px
}

.ui-jqgrid .ui-jqgrid-titlebar-close span {
	display: block;
	margin: 1px
}

.ui-jqgrid .ui-jqgrid-titlebar-close:hover {
	padding: 0
}

.ui-jqgrid .ui-jqgrid-hdiv {
	position: relative;
	margin: 0;
	padding: 0;
	overflow-x: hidden;
	border-left: 0 none !important;
	border-top: 0 none !important;
	border-right: 0 none !important
}

.ui-jqgrid .ui-jqgrid-hbox {
	float: left;
	padding-right: 20px
}

.ui-jqgrid .ui-jqgrid-htable {
	table-layout: fixed;
	margin: 0
}

.ui-jqgrid .ui-jqgrid-htable th {
	height: 22px;
	padding: 0 2px 0 2px
}

.ui-jqgrid .ui-jqgrid-htable th div {
	overflow: hidden;
	position: relative;
	height: 17px
}

.ui-th-column,.ui-jqgrid .ui-jqgrid-htable th.ui-th-column {
	overflow: hidden;
	white-space: nowrap;
	text-align: center;
	border-top: 0 none;
	border-bottom: 0 none
}

.ui-th-ltr,.ui-jqgrid .ui-jqgrid-htable th.ui-th-ltr {
	border-left: 0 none
}

.ui-th-rtl,.ui-jqgrid .ui-jqgrid-htable th.ui-th-rtl {
	border-right: 0 none
}

.ui-first-th-ltr {
	border-right: 1px solid
}

.ui-first-th-rtl {
	border-left: 1px solid
}

.ui-jqgrid .ui-th-div-ie {
	white-space: nowrap;
	zoom: 1;
	height: 17px
}

.ui-jqgrid .ui-jqgrid-resize {
	height: 20px !important;
	position: relative;
	cursor: e-resize;
	display: inline;
	overflow: hidden
}

.ui-jqgrid .ui-grid-ico-sort {
	overflow: hidden;
	position: absolute;
	display: inline;
	cursor: pointer !important
}

.ui-jqgrid .ui-icon-asc {
	margin-top: -3px;
	height: 12px
}

.ui-jqgrid .ui-icon-desc {
	margin-top: 3px;
	height: 12px
}

.ui-jqgrid .ui-i-asc {
	margin-top: 0;
	height: 16px
}

.ui-jqgrid .ui-i-desc {
	margin-top: 0;
	margin-left: 13px;
	height: 16px
}

.ui-jqgrid .ui-jqgrid-sortable {
	cursor: pointer
}

.ui-jqgrid tr.ui-search-toolbar th {
	border-top-width: 1px !important;
	border-top-color: inherit !important;
	border-top-style: ridge !important
}

tr.ui-search-toolbar input {
	margin: 1px 0 0 0
}

tr.ui-search-toolbar select {
	margin: 1px 0 0 0
}

.ui-jqgrid .ui-jqgrid-bdiv {
	position: relative;
	margin: 0;
	padding: 0;
	overflow: auto;
	text-align: left
}

.ui-jqgrid .ui-jqgrid-btable {
	table-layout: fixed;
	margin: 0;
	outline-style: none
}

.ui-jqgrid tr.jqgrow {
	outline-style: none
}

.ui-jqgrid tr.jqgroup {
	outline-style: none
}

.ui-jqgrid tr.jqgrow td {
	font-weight: normal;
	overflow: hidden;
	white-space: pre;
	height: 22px;
	padding: 0 2px 0 2px;
	border-bottom-width: 1px;
	border-bottom-color: inherit;
	border-bottom-style: solid
}

.ui-jqgrid tr.jqgfirstrow td {
	padding: 0 2px 0 2px;
	border-right-width: 1px;
	border-right-style: solid
}

.ui-jqgrid tr.jqgroup td {
	font-weight: normal;
	overflow: hidden;
	white-space: pre;
	height: 22px;
	padding: 0 2px 0 2px;
	border-bottom-width: 1px;
	border-bottom-color: inherit;
	border-bottom-style: solid
}

.ui-jqgrid tr.jqfoot td {
	font-weight: bold;
	overflow: hidden;
	white-space: pre;
	height: 22px;
	padding: 0 2px 0 2px;
	border-bottom-width: 1px;
	border-bottom-color: inherit;
	border-bottom-style: solid
}

.ui-jqgrid tr.ui-row-ltr td {
	text-align: left;
	border-right-width: 1px;
	border-right-color: inherit;
	border-right-style: solid
}

.ui-jqgrid tr.ui-row-rtl td {
	text-align: right;
	border-left-width: 1px;
	border-left-color: inherit;
	border-left-style: solid
}

.ui-jqgrid td.jqgrid-rownum {
	padding: 0 2px 0 2px;
	margin: 0;
	border: 0 none
}

.ui-jqgrid .ui-jqgrid-resize-mark {
	width: 2px;
	left: 0;
	background-color: #777;
	cursor: e-resize;
	cursor: col-resize;
	position: absolute;
	top: 0;
	height: 100px;
	overflow: hidden;
	display: none;
	border: 0 none;
	z-index: 99999
}

.ui-jqgrid .ui-jqgrid-sdiv {
	position: relative;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-left: 0 none !important;
	border-top: 0 none !important;
	border-right: 0 none !important
}

.ui-jqgrid .ui-jqgrid-ftable {
	table-layout: fixed;
	margin-bottom: 0
}

.ui-jqgrid tr.footrow td {
	font-weight: bold;
	overflow: hidden;
	white-space: nowrap;
	height: 21px;
	padding: 0 2px 0 2px;
	border-top-width: 1px;
	border-top-color: inherit;
	border-top-style: solid
}

.ui-jqgrid tr.footrow-ltr td {
	text-align: left;
	border-right-width: 1px;
	border-right-color: inherit;
	border-right-style: solid
}

.ui-jqgrid tr.footrow-rtl td {
	text-align: right;
	border-left-width: 1px;
	border-left-color: inherit;
	border-left-style: solid
}

.ui-jqgrid .ui-jqgrid-pager {
	border-left: 0 none !important;
	border-right: 0 none !important;
	border-bottom: 0 none !important;
	margin: 0 !important;
	padding: 0 !important;
	position: relative;
	height: 25px;
	white-space: nowrap;
	overflow: hidden;
	font-size: 11px
}

.ui-jqgrid .ui-pager-control {
	position: relative
}

.ui-jqgrid .ui-pg-table {
	position: relative;
	padding-bottom: 2px;
	width: auto;
	margin: 0
}

.ui-jqgrid .ui-pg-table td {
	font-weight: normal;
	vertical-align: middle;
	padding: 1px
}

.ui-jqgrid .ui-pg-button {
	height: 19px !important
}

.ui-jqgrid .ui-pg-button span {
	display: block;
	margin: 1px;
	float: left
}

.ui-jqgrid .ui-pg-button:hover {
	padding: 0
}

.ui-jqgrid .ui-state-disabled:hover {
	padding: 1px
}

.ui-jqgrid .ui-pg-input {
	height: 13px;
	font-size: .8em;
	margin: 0
}

.ui-jqgrid .ui-pg-selbox {
	font-size: .8em;
	line-height: 18px;
	display: block;
	height: 18px;
	margin: 0
}

.ui-jqgrid .ui-separator {
	height: 18px;
	border-left: 1px solid #ccc;
	border-right: 1px solid #ccc;
	margin: 1px;
	float: right
}

.ui-jqgrid .ui-paging-info {
	font-weight: normal;
	height: 19px;
	margin-top: 3px;
	margin-right: 4px
}

.ui-jqgrid .ui-jqgrid-pager .ui-pg-div {
	padding: 1px 0;
	float: left;
	position: relative
}

.ui-jqgrid .ui-jqgrid-pager .ui-pg-button {
	cursor: pointer
}

.ui-jqgrid .ui-jqgrid-pager .ui-pg-div span.ui-icon {
	float: left;
	margin: 0 2px
}

.ui-jqgrid td input,.ui-jqgrid td select .ui-jqgrid td textarea {
	margin: 0
}

.ui-jqgrid td textarea {
	width: auto;
	height: auto
}

.ui-jqgrid .ui-jqgrid-toppager {
	border-left: 0 none !important;
	border-right: 0 none !important;
	border-top: 0 none !important;
	margin: 0 !important;
	padding: 0 !important;
	position: relative;
	height: 25px !important;
	white-space: nowrap;
	overflow: hidden
}

.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div {
	padding: 1px 0;
	float: left;
	position: relative
}

.ui-jqgrid .ui-jqgrid-toppager .ui-pg-button {
	cursor: pointer
}

.ui-jqgrid .ui-jqgrid-toppager .ui-pg-div span.ui-icon {
	float: left;
	margin: 0 2px
}

.ui-jqgrid .ui-jqgrid-btable .ui-sgcollapsed span {
	display: block
}

.ui-jqgrid .ui-subgrid {
	margin: 0;
	padding: 0;
	width: 100%
}

.ui-jqgrid .ui-subgrid table {
	table-layout: fixed
}

.ui-jqgrid .ui-subgrid tr.ui-subtblcell td {
	height: 18px;
	border-right-width: 1px;
	border-right-color: inherit;
	border-right-style: solid;
	border-bottom-width: 1px;
	border-bottom-color: inherit;
	border-bottom-style: solid
}

.ui-jqgrid .ui-subgrid td.subgrid-data {
	border-top: 0 none !important
}

.ui-jqgrid .ui-subgrid td.subgrid-cell {
	border-width: 0 0 1px 0
}

.ui-jqgrid .ui-th-subgrid {
	height: 20px
}

.ui-jqgrid .loading {
	position: absolute;
	top: 45%;
	left: 45%;
	width: auto;
	z-index: 101;
	padding: 6px;
	margin: 5px;
	text-align: center;
	font-weight: bold;
	display: none;
	border-width: 2px !important;
	font-size: 11px
}

.ui-jqgrid .jqgrid-overlay {
	display: none;
	z-index: 100
}

* html .jqgrid-overlay {
	width: expression(this.parentNode.offsetWidth + 'px');
	height: expression(this.parentNode.offsetHeight + 'px')
}

* .jqgrid-overlay iframe {
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1;
	width: expression(this.parentNode.offsetWidth + 'px');
	height: expression(this.parentNode.offsetHeight + 'px')
}

.ui-jqgrid .ui-userdata {
	border-left: 0 none;
	border-right: 0 none;
	height: 21px;
	overflow: hidden
}

.ui-jqdialog {
	display: none;
	width: 300px;
	position: absolute;
	padding: .2em;
	font-size: 11px;
	overflow: visible
}

.ui-jqdialog .ui-jqdialog-titlebar {
	padding: .3em .2em;
	position: relative
}

.ui-jqdialog .ui-jqdialog-title {
	margin: .1em 0 .2em
}

.ui-jqdialog .ui-jqdialog-titlebar-close {
	position: absolute;
	top: 50%;
	width: 19px;
	margin: -10px 0 0 0;
	padding: 1px;
	height: 18px
}

.ui-jqdialog .ui-jqdialog-titlebar-close span {
	display: block;
	margin: 1px
}

.ui-jqdialog .ui-jqdialog-titlebar-close:hover,.ui-jqdialog .ui-jqdialog-titlebar-close:focus
	{
	padding: 0
}

.ui-jqdialog-content,.ui-jqdialog .ui-jqdialog-content {
	border: 0;
	padding: .3em .2em;
	background: 0;
	height: auto
}

.ui-jqdialog .ui-jqconfirm {
	padding: .4em 1em;
	border-width: 3px;
	position: absolute;
	bottom: 10px;
	right: 10px;
	overflow: visible;
	display: none;
	height: 80px;
	width: 220px;
	text-align: center
}

.ui-jqdialog-content .FormGrid {
	margin: 0
}

.ui-jqdialog-content .EditTable {
	width: 100%;
	margin-bottom: 0
}

.ui-jqdialog-content .DelTable {
	width: 100%;
	margin-bottom: 0
}

.EditTable td input,.EditTable td select,.EditTable td textarea {
	margin: 0
}

.EditTable td textarea {
	width: auto;
	height: auto
}

.ui-jqdialog-content td.EditButton {
	text-align: right;
	border-top: 0 none;
	border-left: 0 none;
	border-right: 0 none;
	padding-bottom: 5px;
	padding-top: 5px
}

.ui-jqdialog-content td.navButton {
	text-align: center;
	border-left: 0 none;
	border-top: 0 none;
	border-right: 0 none;
	padding-bottom: 5px;
	padding-top: 5px
}

.ui-jqdialog-content input.FormElement {
	padding: .3em
}

.ui-jqdialog-content .data-line {
	padding-top: .1em;
	border: 0 none
}

.ui-jqdialog-content .CaptionTD {
	vertical-align: middle;
	border: 0 none;
	padding: 2px;
	white-space: nowrap
}

.ui-jqdialog-content .DataTD {
	padding: 2px;
	border: 0 none;
	vertical-align: top
}

.ui-jqdialog-content .form-view-data {
	white-space: pre
}

.fm-button {
	display: inline-block;
	margin: 0 4px 0 0;
	padding: .4em .5em;
	text-decoration: none !important;
	cursor: pointer;
	position: relative;
	text-align: center;
	zoom: 1
}

.fm-button-icon-left {
	padding-left: 1.9em
}

.fm-button-icon-right {
	padding-right: 1.9em
}

.fm-button-icon-left .ui-icon {
	right: auto;
	left: .2em;
	margin-left: 0;
	position: absolute;
	top: 50%;
	margin-top: -8px
}

.fm-button-icon-right .ui-icon {
	left: auto;
	right: .2em;
	margin-left: 0;
	position: absolute;
	top: 50%;
	margin-top: -8px
}

#nData,#pData {
	float: left;
	margin: 3px;
	padding: 0;
	width: 15px
}

.ui-jqgrid .selected-row,div.ui-jqgrid .selected-row td {
	font-style: normal;
	border-left: 0 none
}

.ui-inline-del.ui-state-hover span,.ui-inline-edit.ui-state-hover span,.ui-inline-save.ui-state-hover span,.ui-inline-cancel.ui-state-hover span
	{
	margin: -1px
}

.ui-jqgrid .tree-wrap {
	float: left;
	position: relative;
	height: 18px;
	white-space: nowrap;
	overflow: hidden
}

.ui-jqgrid .tree-minus {
	position: absolute;
	height: 18px;
	width: 18px;
	overflow: hidden
}

.ui-jqgrid .tree-plus {
	position: absolute;
	height: 18px;
	width: 18px;
	overflow: hidden
}

.ui-jqgrid .tree-leaf {
	position: absolute;
	height: 18px;
	width: 18px;
	overflow: hidden
}

.ui-jqgrid .treeclick {
	cursor: pointer
}

* iframe.jqm {
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1;
	width: expression(this.parentNode.offsetWidth + 'px');
	height: expression(this.parentNode.offsetHeight + 'px')
}

.ui-jqgrid-dnd tr td {
	border-right-width: 1px;
	border-right-color: inherit;
	border-right-style: solid;
	height: 20px
}

.ui-jqgrid .ui-jqgrid-title-rtl {
	float: right;
	margin: .1em 0 .2em
}

.ui-jqgrid .ui-jqgrid-hbox-rtl {
	float: right;
	padding-left: 20px
}

.ui-jqgrid .ui-jqgrid-resize-ltr {
	float: right;
	margin: -2px -2px -2px 0
}

.ui-jqgrid .ui-jqgrid-resize-rtl {
	float: left;
	margin: -2px 0 -1px -3px
}

.ui-jqgrid .ui-sort-rtl {
	left: 0
}

.ui-jqgrid .tree-wrap-ltr {
	float: left
}

.ui-jqgrid .tree-wrap-rtl {
	float: right
}

.ui-jqgrid .ui-ellipsis {
	text-overflow: ellipsis
}
.ui-search-menu {
    padding: 2px 5px;
    position: absolute;
}
.ui-jqgrid .ui-search-table {
    border: 0 none;
    height: 20px;
    padding: 0;
    width: 100%;
}
.ui-jqgrid .ui-search-table .ui-search-oper {
    width: 20px;
}
a.g-menu-item, a.soptclass, a.clearsearchclass {
    cursor: pointer;
}
.ui-jqgrid .ui-search-table .ui-search-input > input, .ui-jqgrid .ui-search-table .ui-search-input > select {
    -moz-box-sizing: border-box;
    display: block;
}
.ui-jqgrid .ui-jqgrid-view input, .ui-jqgrid .ui-jqgrid-view select, .ui-jqgrid .ui-jqgrid-view textarea, .ui-jqgrid .ui-jqgrid-view button {
    font-size: 11px;
}

+ 1 - 0
css/style.css

@ -5692,6 +5692,7 @@ input[type="checkbox"], input[type="radio"] {
    padding: 0;
    cursor: pointer;
    position: relative;
    margin: 4px;
}
.icon-checkbox[type=radio]:before{
    content: '';

BIN
img/angle-down.png


+ 2 - 0
index.html

@ -20,9 +20,11 @@
    <link rel="shortcut icon" href="favicon.ico">
    <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="js/plugins/layer/skin/layer.css"/>
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/index-layer.css"/>
</head>
<body class="fixed-sidebar full-height-layout white-bg" style="overflow:hidden">

+ 6 - 3
js/api-service.js

@ -11,26 +11,28 @@
        server = "http://www.xmtyw.cn/wlyy/"
        imserver = "http://27.155.101.77:3000/api/v2";
        socketUrl = "http://27.155.101.77:3000";
        loginUrl = "login.html";
        loginUrl = "/PC-prescription/login.html";
        imgServer = "http://www.xmtyw.cn/";
		if(isInner){
			server = "http://10.95.22.10:8011/wlyy/"
			imserver = "http://10.95.22.138:3000/api/v2";
			socketUrl = "http://10.95.22.138:3000";
			loginUrl = "login.html";
			loginUrl = "/PC-prescription/login.html";
			imgServer = "http://10.95.22.140:23001/";
		}
    } else { // 测试环境配置
        server = "http://172.19.103.88:9092/wlyy/"
        imserver = "http://172.19.103.88:3000/api/v2";
        socketUrl = "http://172.19.103.88:3000";
        
//      server = "http://192.168.131.133:8080/";
//      server = "http://192.168.131.127:8060/"; //逸祥
//      server = "http://192.168.131.24:8080/"; //仕杰
//      imserver = "http://192.168.131.24:3000/api/v2"
//      socketUrl = "http://192.168.131.24:3000";
        loginUrl = "login.html";
        loginUrl = "/PC-prescription/login.html";
        imgServer = "http://172.19.103.54/";
    }
@ -245,6 +247,7 @@
        imHttpGet: imHttpGet,
        imHttpPost: imHttpPost,
        getImgUrl: getImgUrl,
        failCodeHandle: failCodeHandle,
        loginIm: function(data){
            return imHttpPost('/users/login', data);
        },

+ 345 - 0
js/buz/followup/drugs.js

@ -0,0 +1,345 @@
var request = getRequest(), 
    fv_id = request.fv_id,
    pro_id = request.pro_id,
    title = request.title,
    fv_class = request.fv_class,
    patiCode = request.patiCode;

var docInfo = window.localStorage.getItem('docInfo');
if(docInfo){
    docInfo = JSON.parse(docInfo);
}

$(function(){
    initPage();
    bindEvents();
})

function initPage(){
    var params = {
        id: fv_id
    };
    followupAPI.getFollowupDrugs(params).then(function(res){
        if(res.status == 200){
            var data = res.data.DRUG_LIST,
                regular = res.data.DRUG_COMPLIANCE_CODE,
                hasInsulin=[],
                noInsulin=[];
            if(data.length>0){
                for(var i=0;i<data.length;i++){
                    var unitInfo = _.findWhere(measure_unit_dict, {key: data[i].unit}),
                        frequency = _.findWhere(recipe_frequency_dict, {key: data[i].frequency});
                        
                    data[i].unitName = unitInfo.name;
                    data[i].frequencyName = frequency.name;
                    if(data[i].drugsGroup == 'insulin'){//胰岛素药品
                        hasInsulin.push(data[i])
                    }else{
                        noInsulin.push(data[i])
                    }
                }
            }
            var hasInsulinLen = hasInsulin.length,
                noInsulinLen = noInsulin.length,
                noInsulinEmptyList = new Array(6 - noInsulinLen), //非胰岛素药品最多只能增加6种
                hasInsulinEmptyList = new Array(3 - hasInsulinLen); //胰岛素药品最多只能增加3种
            var html1 = template("drug_tmp", {dataList: noInsulin, emptyList: noInsulinEmptyList}),
                html2 = template("drug_tmp", {dataList: hasInsulin, emptyList: hasInsulinEmptyList});
                
            $("#table1 tbody").append(html1);
            $("#table2 tbody").append(html2);
            
            initDrugNameSuggestInput();
            initUnitInput();
            initFreqSuggestInput();
        }else{
            showErrorMsg(res.msg);
        }
    })
}

function bindEvents(){
    $(".link-red").on("click", function(){
        layer.confirm('您确定要清空用药信息吗?', {
            btn: ['是的','取消'], //按钮
            shade: false //不显示遮罩
        }, function(){
            //清空数据
            clearDrugsInfo();
        });
    });
    
    $("#getPrescription").on("click", function(){
        //弹出层是加载在top上的,目前项目的top层是index.html页面层。所以路径需要相对index.html页面
        top.layer.open({
            type: 2,
            type: 2,
            title: '<img src="img/shezi_tankuang_icon.png" class="mr10">用药记录',
            shadeClose: true,
            area: ['700px', '500px'],
            content: '/PC-prescription/page/followup/followup-prescriptions.html'+location.search
        });
    });
    
    $("#submitBtn").on("click", function(){
        //保存
        var complianceCode = $("[name=DRUG_COMPLIANCE_CODE]").val(),
            $trs1 = $("#table1 tbody tr"),
            $trs2 = $("#table2 tbody tr"),
            drugs = [];
        for(var i=0; i<6; i++){
            var $tr = $($trs1[i]),
                $drug = $tr.find(".j-drugName"),
                $dose = $tr.find(".dose"),
                $unit = $tr.find(".unit-select"),
                $freq = $tr.find(".frequency-select");
                
            var obj = {},
                drugsGroup = 'normal',
                drugsCode = $drug.attr("data-id"),
                drugsName = $drug.val(),
                frequency = $freq.attr("data-id"),
                unit = $unit.attr("data-id"),
                dose = $dose.val();
            if(drugsCode && drugsName && dose && unit && frequency){
                obj = {
                    drugsGroup : 'normal',
                    drugsCode : drugsCode,
                    drugsName : drugsName,
                    frequency : frequency,
                    unit : unit,
                    dose : dose
                };
                drugs.push(obj);
            }else if(drugsCode || drugsName || dose || unit || frequency){
                //如果药品信息中填写了部分,则需要将未填写的内容补全
                showWarningMsg("请补全未填写完成的药品信息");
                return false;
            }
        }
        for(var j=0; j<3; j++){
            var $tr = $($trs2[j]),
                $drug = $tr.find(".j-drugName"),
                $dose = $tr.find(".dose"),
                $unit = $tr.find(".unit-select"),
                $freq = $tr.find(".frequency-select");
                
            var obj = {},
                drugsGroup = 'insulin',
                drugsCode = $drug.attr("data-id"),
                drugsName = $drug.val(),
                frequency = $freq.attr("data-id"),
                unit = $unit.attr("data-id"),
                dose = $dose.val();
            if(drugsCode && drugsName && dose && unit && frequency){
                obj = {
                    drugsGroup : 'normal',
                    drugsCode : drugsCode,
                    drugsName : drugsName,
                    frequency : frequency,
                    unit : unit,
                    dose : dose
                };
                drugs.push(obj);
            }else if(drugsCode || drugsName || dose || unit || frequency){
                //如果药品信息中填写了部分,则需要将未填写的内容补全
                showWarningMsg("请补全未填写完成的药品信息");
                return false;
            }
        }
        
        
        if(complianceCode == "undefined"){
            complianceCode = "";
        }
        var followupProjectData = {'DRUG_COMPLIANCE_CODE': complianceCode};
        console.log(followupProjectData);
        var projectData = {
            id: fv_id,
            followupProject: pro_id,
            followupProjectData: JSON.stringify(followupProjectData)
        },
        drugData = {
            id: fv_id,
            drugsData: JSON.stringify(drugs)
        };
        Promise.all([
            followupAPI.saveFollowupProjectData(projectData),
            followupAPI.saveFollowupDrugs(drugData)
        ]).then(function(ress){
            if(ress[0].status == 200 && ress[1].status == 200){
                top.goFollowupNextQuestionaire();
            }else if(ress[0].status != 200){
                showErrorMsg(ress[0].msg);
            }else if(ress[1].status != 200){
                showErrorMsg(ress[1].msg);
            }
        })
    })
}

function initDrugNameSuggestInput() {
    $("input.j-drugName").bsSuggest({
        url: APIService.server+'doctor/prescriptionInfo/findDictByName?name=',
        getDataMethod:'url',
        idField: "drugCode",
        keyField: "drugName",
        effectiveFields: ['drugName','drugFormat'],
        effectiveFieldsAlias:{drugName: "药品名称",drugFormat:"规格"},
        ignorecase: true,
        fnProcessData: function(res) {
            return {
                value: res.data
            }
        }
    }).on('onSetSelectValue', function (e, v) {
        var rowData = v.json;
        rowData = JSON.parse(rowData);
        var $tr = $(this).closest("tr"),
            $unit = $tr.find(".unit-select");
        $unit.val(rowData.physicDoseUnitName);
        $unit.attr("data-id", rowData.physicDoseUnit);
    })
}

function initFreqSuggestInput(){
    $("input.frequency-select").bsSuggest({
        data: {value: recipe_frequency_dict},
        idField: "key",
        keyField: "name",
        getDataMethod:'data',
        effectiveFields: ['name'],
        ignorecase: true
    })
}

function initUnitInput(){
    $("input.unit-select").bsSuggest({
        data: {value: measure_unit_dict},
        idField: "key",
        keyField: "name",
        getDataMethod:'data',
        effectiveFields: ['name'],
        ignorecase: true
    })
}

//清空药品信息
function clearDrugsInfo(){
    var $trs = $("tbody tr");
    
    for(var i=0; i<9; i++){
        var $tr = $($trs[i]),
            $inputs = $tr.find("input"),
            len = $inputs.length;
        for(var j=0; j<len; j++){
            var $input = $($inputs[j]);
            $input.val("");
            $input.attr("data-id", "");
        }
    }
}

function fillDrugsInfo(){
    //从缓存中获取选中的药品信息
    var drugsData = window.sessionStorage.getItem("chooseDrugs");
    if(drugsData){
        drugsData = JSON.parse(drugsData);
        var len = drugsData.length;
        
        if(len == 0){
            return false;
        }
        //先将药品分类
        var insulinList = [],
            normalList = [];
        for(var i=0; i<len; i++){
            var obj = drugsData[i];
            if(obj.subjectClass.substr(0,2)=='010' && obj.name.indexOf('胰岛素')>0){
                //胰岛素药品
                insulinList.push(obj);
            }else{
                normalList.push(obj)
            }
        }
        //如果表格中药品名称没有填写的均可以被覆盖,如果已填写的药品与处方中的药品名称一致,设定为相同药品
        
        var $trs1 = $("#table1 tbody tr"),
            $trs2 = $("#table2 tbody tr"),
            len1 = normalList.length,
            len2 = insulinList.length;
        
        if(len1 > 0){
            //填充普通药品
            var index1 = 0;
            for(var i1=0; i1<6; i1++){
                var $tr = $($trs1[i1]),
                    $drugName = $tr.find(".j-drugName"),
                    $unit = $tr.find(".unit-select"),
                    $frequency = $tr.find(".frequency-select");
                if($drugName.val() == ''){
                    if(index1 < len1){
                        var obj1 = normalList[index1];
                        $drugName.val(obj1.drugName);
                        $drugName.attr("data-id", obj1.drugCode);
                        $tr.find(".dose").val(obj1.physicDose);
                        $unit.val(obj1.physicDoseUnitName);
                        $unit.attr("data-id", obj1.physicDoseUnit);
                        index1 ++;
                    }else{
                        break;
                    }
                }else{
                    var name = $drugName.val();
                    //如果已经填写了内容,则判断药品名称是否一样
                    for(var j1=0; j1<len1; j1++){
                        var obj1 = normalList[j1];
                        if(name == obj1.drugName){
                            //从列表中删除这个对象
                            normalList.splice(j1, 1);
                            len1 --;
                            break;
                        }
                    }
                }
            }
        }
        
        if(len2 >0){
            //填充胰岛素药品
            var index2 = 0;
            for(var i2=0; i2<6; i2++){
                var $tr = $($trs2[i2]),
                    $drugName = $tr.find(".j-drugName"),
                    $unit = $tr.find(".unit-select"),
                    $frequency = $tr.find(".frequency-select");
                if($drugName.val() == ''){
                    if(index2 < len2){
                        var obj2 = insulinList[index2];
                        $drugName.val(obj2.drugName);
                        $drugName.attr("data-id", obj2.drugCode);
                        $tr.find(".dose").val(obj2.physicDose);
                        $unit.val(obj2.physicDoseUnitName);
                        $unit.attr("data-id", obj2.physicDoseUnit);
                        index2 ++;
                    }else{
                        break;
                    }
                }else{
                    var name = $drugName.val();
                    //如果已经填写了内容,则判断药品名称是否一样
                    for(var j2=0; j2<len2; j2++){
                        var obj2 = normalList[j2];
                        if(name == obj2.drugName){
                            //从列表中删除这个对象
                            insulinList.splice(j2, 1);
                            len2 --;
                            break;
                        }
                    }
                }
            }
        }
    }
}
top.fillChooseDrugs = fillDrugsInfo;

+ 47 - 0
js/buz/followup/followup-prescription.js

@ -0,0 +1,47 @@
var request = getRequest(), 
    fv_id = request.fv_id,
    pro_id = request.pro_id,
    title = request.title,
    fv_class = request.fv_class,
    patiCode = request.patiCode;
    
$(function(){
    var options = $.extend(followupAPI.getPrescriptionListTableAjaxObj, {
        queryParams: queryParams,
        queryParamsType: "limit",
        pagination: true,
        paginationLoop: true,
        sidePagination: 'server',
        pageNumber: 1,
        pageSize: 5,
        responseHandler: function (res) {
            return {
                rows: res.data.list,
                total: res.data.total
            }
        },
        columns: [{
            field: '',
            title:'',
            formatter: function(val, row, index){
                var html = template('prescription_tmp', row);
                return html;
            }
        }],
        onClickRow: function(row, $el){
            document.location.href = "../../jw-prescription-info.html?code="+row.code+"&patient="+patiCode+'&fv_id='+fv_id;
        }
    })
    $("#prescritionInfo").bootstrapTable(options);
    
});

function queryParams(params) {
    return {
        diagnosisCode: fv_class=='1,2' ? 3 : fv_class,
        patient: patiCode,
        page: params.offset/params.limit,
        size: params.limit,
        isRenewal: 2
    };
}

+ 123 - 0
js/buz/followup/followup-register.js

@ -0,0 +1,123 @@
(function($){
    var request = getRequest(),
        fd_class = request.fd_class, //随访类型,与续方类型一致
        patiCode = request.patiCode,
        fv_id = request.fv_id,
        fv_status,
        fv_type;

    var docInfo = window.localStorage.getItem('docInfo'),
        level;
    if(docInfo){
        docInfo = JSON.parse(docInfo);
        level = docInfo.level;
    }
     
    //随访类型
    var followupClass = {"1": "高血压", "2": "糖尿病", "3": "高血压, 糖尿病"},
        //随访方式, 对应医生的level
        followupType = {"1": {"key": 13, "value": "专科医生随访"},
                        "2": {"key": 22, "value": "家庭(全科)"},
                        "3": {"key": 10, "value": "健管师随访"}
                    };
    
    $(function(){
        bindEvents();
        if(fv_id){
            followupAPI.getFollowup({id: fv_id}).then(function(res){
                if(res.status == 200){
                    var data = res.data;
                    fv_status = data.status; //随访状态 1-已完成,2-未开始,3-进行中
                    fv_class = data.followupClass;
                    fv_type = data.followupType;
                    
                    $("#doneDate").val(data.followupDate.substr(0, 16));
                    $("#followupType").val(data.followupTypeName);
                    $("#followupClass").val(data.followupClassName);
                    $("#nextDate").val(data.followupNextDate.substr(0, 16));
                    $("#followupStatus").val(data.followupManagerStatusName)
                    
                    if(fv_status != 2){
                        $("#followupStatus").attr("disabled", true);
                    }else{
                        initDatePicker();
                    }
                    getDict(); //获得随访状态下拉框数据
                }else{
                    showErrorMsg(res.msg)
                }
            });
            return;
        }
        
        getDict(); //获得随访状态下拉框数据
        initDatePicker();
        
        var date = new Date();
        $("#doneDate").val(date.format("yyyy-MM-dd HH:mm"));
        $("#followupClass").val(followupClass[fd_class]);
        $("#followupType").val(followupType[level]['value']);
        fv_type = followupType[level]['key'];
    });
    
    function initDatePicker(){
        $(".form_datetime").datetimepicker({
            format: 'yyyy-mm-dd hh:ii',
            language: 'zh-CN',
            weekStart: 1,
            todayBtn:  1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0
        });
        
    }
    
    //获得随访状态下拉框数据
    function getDict(){
        followupAPI.getDictByDictName().then(function(res){
            if(res.status == 200){
                var html = "";
                for(i=0; i<res.list.length; i++){
                    var item = res.list[i];
                    html += '<option value="'+ item.code +'">'+ item.value + '</option>';
                }
                $("#followupStatus").empty().append(html);
                $(".my_select_box").chosen({
                    disable_search: true,
//                  inherit_select_classes: true, //将设定的样式添加到插件的控件中
                    disable_search_threshold: 10,
                    width: "100%"
                });
            }else{
                showErrorMsg(res.msg);
            }
        });
    }
    
    function bindEvents(){
        $("#startFU").on("click", function(){
            if(fv_status != 2){
                
            }else{
                var params = {
                    id: fv_id,
                    date: $("#doneDate").val(),
                    followupType : fv_type,
                    followupClass : fv_class,
                    followupManagerStatus : $("#followupStatus").val(),
                    plandate:$("#nextDate").val()
                }
                followupAPI.startFollowup(params).then(function(res){
                    if(res.status == 200){
                        
                    }else{
                        showErrorMsg(res.msg);
                    }
                });
            }
        });
    }
})(jQuery)


+ 0 - 0
js/buz/followup/followup-settings.js


+ 68 - 0
js/buz/followup/followup-tabs.js

@ -0,0 +1,68 @@
var request = getRequest();
var selectedTab = 0;

//初始tab的链接
var links = [{
    url: 'followup-register.html'+location.search,
    name: '随访登记',
    class: 'active'
},{
    url: 'questionaires.html'+location.search+'&pro_id=1&title=症状',
    name: '症状',
    class: ''
},{
    url: 'questionaires.html'+location.search+'&pro_id=2&title=体征',
    name: '体征',
    class: '',
},{
    url: 'questionaires.html'+location.search+'&pro_id=3&title=实验室检查',
    name: '实验室检查',
    class: ''
},{
    url: 'questionaires.html'+location.search+'&pro_id=4&title=生活方式指导',
    name: '生活方式指导',
    class: ''
},{
    url: 'questionaires.html'+location.search+'&pro_id=5&title=评价',
    name: '评价',
    class: ''
},{
    url: 'drugs.html'+location.search+'&pro_id=6&title=用药情况',
    name: '用药情况',
    class: ''
},{
    url: 'questionaires.html'+location.search+'&pro_id=7&title=控制目标',
    name: '控制目标',
    class: ''
},{
    url: 'questionaires.html'+location.search+'&pro_id=8&title=健康教育',
    name: '健康教育',
    class: ''
},{
    url: 'questionaires.html'+location.search+'&pro_id=9&title=转诊',
    name: '转诊',
    class: ''
}];

$(function(){
    
    var html = template("fv_tab_tmp", {list: links});
    $("#fv_tabs").empty().append(html);
//  parent.document.getElementById('fv_main').src = links[0].url;
    
    $("#fv_tabs").on('click', 'a', function(){
        var $this = $(this),
            $li = $this.parent();
        $li.siblings().removeClass("active");
        $li.addClass("active");
        selectedTab = $this.data('index');
//      reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx);
        var url = links[selectedTab].url;
        parent.document.getElementById('fv_main').src = url;
    })
})

top.goFollowupNextQuestionaire = function(){
    selectedTab ++;
    $("#fv_tabs a").eq(selectedTab).trigger('click');
}

+ 98 - 0
js/buz/followup/measure_unit_dict.js

@ -0,0 +1,98 @@
var measure_unit_dict = [{
    "key": "175",
    "name": "板"
}, {
    "key": "179",
    "name": "盒"
}, {
    "key": "183",
    "name": "瓶"
}, {
    "key": "197",
    "name": "万IU"
}, {
    "key": "199",
    "name": "10mg"
}, {
    "key": "200",
    "name": "KU"
}, {
    "key": "201",
    "name": "g"
}, {
    "key": "202",
    "name": "kg"
}, {
    "key": "203",
    "name": "mg"
}, {
    "key": "204",
    "name": "ml"
}, {
    "key": "205",
    "name": "μg"
}, {
    "key": "206",
    "name": "包"
}, {
    "key": "207",
    "name": "袋"
}, {
    "key": "208",
    "name": "滴"
}, {
    "key": "209",
    "name": "对"
}, {
    "key": "210",
    "name": "付"
}, {
    "key": "211",
    "name": "个"
}, {
    "key": "212",
    "name": "剂"
}, {
    "key": "213",
    "name": "粒"
}, {
    "key": "214",
    "name": "枚"
}, {
    "key": "215",
    "name": "喷"
}, {
    "key": "216",
    "name": "片"
}, {
    "key": "217",
    "name": "套"
}, {
    "key": "218",
    "name": "贴"
}, {
    "key": "219",
    "name": "丸"
}, {
    "key": "220",
    "name": "雾化溶液"
}, {
    "key": "221",
    "name": "吸"
}, {
    "key": "222",
    "name": "掀"
}, {
    "key": "223",
    "name": "张"
}, {
    "key": "224",
    "name": "支"
}, {
    "key": "225",
    "name": "万单位"
}, {
    "key": "233",
    "name": "本"
}
]

+ 485 - 0
js/buz/followup/questionaires.js

@ -0,0 +1,485 @@
var request = getRequest(),
    fv_id = request.fv_id,
    pro_id = request.pro_id,
    title = request.title,
    fv_class = request.fv_class,
    patiCode = request.patiCode;

var docInfo = window.localStorage.getItem('docInfo');
if(docInfo){
    docInfo = JSON.parse(docInfo);
}

var requiredFields=[];

var project_data = gTemplate[pro_id]; //获得模板中的数据显示
    
$(function(){
    if(pro_id == 9){
        $("#submitBtn").text("保存");
    }
    getProjectData();
    bindEvents();
});

function getProjectData(){
    var params = {
        id: fv_id,
        followupProject: pro_id
    }
    followupAPI.getFollowupProjectData(params).then(function(res){
        if(res.status == 200){
            if(pro_id == 5){
                if(fv_class == 1){//高血压
                    project_data = _.pick(project_data, 'HYP_FOLLOWUP_TYPE_CODE', 'HYP_COMPLICATION_DETAIL');
                }else if(fv_class == 2){//糖尿病
                    project_data = _.pick(project_data, 'DIA_FOLLOWUP_TYPE_CODE', 'DIA_COMPLICATION_DETAIL');
                }
            }
            
            for(key in project_data){
                project_data[key].value = res.data?res.data[key]:'';
                if(project_data[key].type==4 || project_data[key].type==3) {
                    if(project_data[key].value){
                        project_data[key].valueLength = project_data[key].value.length;
                    }
                }
                if(project_data[key].type==5){
                    var isRequired = project_data[key].required;
                    for(var i = 0; i<project_data[key].items.length; i++){
                        var it = project_data[key].items[i];
                        it.value = res.data ? res.data[it.name]:'';
                        
                        if(isRequired){
                            var isEmpty = it.value == "" ? true : false;
                            requiredFields.push({
                                name: it.name,
                                type: it.type,
                                textType: it.textType
                            });
                        }
                    }
                }else{
                    //非并联控件的field的required的处理
                    if(project_data[key].required){
                        var isEmpty = project_data[key].value == "" ? true : false;
                        requiredFields.push({
                            name: key,
                            type: project_data[key].type,
                            textType: project_data[key].textType
                        });
                    }
                }
            }
            
            var html = template("item", {
                data:project_data,
                followupClass:fv_class, 
                pro_id: pro_id,
                title: decodeURI(title)
            });
            
            $("#question_form .form-info").append(html);
            
            if(pro_id == 7){//控制目标
                $("input[name=CONTROL_CONSTITUTOR]").val(docInfo.name);
            }
            
            $(".q-note-"+pro_id).removeClass("hidden");
            
            initChosen();
            initDatePicker();
            initPopover();
            checkBtnEnable();
        }else{
            showErrorMsg(res.msg);
        }
    });
}

function initChosen(){
    $(".my_select_box").chosen({
        disable_search: true,
        inherit_select_classes: true, //将设定的样式添加到插件的控件中
        disable_search_threshold: 10,
        no_results_text: "",
        width: "100%"
    });
}

function initDatePicker(){
    $(".date").datepicker({
        format: 'yyyy-mm-dd',
        language: 'zh-CN',
        autoclose: true,
        todayHighlight: 1,
        todayBtn: true,
    });
}

function initPopover(){
    var $inputs = $("input"),
        len = $inputs.length;
    for(i=0; i<len; i++){
        var $item = $($inputs[i]),
            name = $item.attr("name");
        
        switch(name){
            case "BP_U": //血压
            case "BP_D": //血压
            case "CONTROL_BP_U": //目标血压
            case "CONTROL_BP_D": //目标血压
                $item.popover({
                    content: '<a onclick="getHistory(\''+name+'\', this)">从居民血压记录中获取</a>',
                    html: true,
                    placement: 'bottom',
                    trigger: 'focus',
                    delay: {hide: 300}
                });
                break;
            case "BS_FPG": //空腹血糖
            case "NO_BS_FPG": //餐后血糖
            case "RANDOM_BLOOD_SUGAR": //随机血糖
            case "CONTROL_BS_FPG":
            case "CONTROL_NO_BS_FPG":
                $item.popover({
                    content: '<a onclick="getHistory(\''+name+'\', this)">从居民血糖记录中获取</a>',
                    html: true,
                    placement: 'bottom',
                    trigger: 'focus',
                    delay: {hide: 300}
                });
                break;
            case "HEIGHT":
            case "WEIGHT":
                $item.popover({
                    content: '<a onclick="getHistory(\''+name+'\', this)">从居民身高体重记录中获取</a>',
                    html: true,
                    placement: 'bottom',
                    trigger: 'focus',
                    delay: {hide: 300}
                });
                break;
            default:
                break;
        }
    }
}

//获得历史记录 type: BP - 血压,
function getHistory(type, el){
    console.log(type);
    var colObj = {},
        reqType = 0,
        tableId = "",
        modalTitle = "";
    switch(type){
        case "BP_U": //血压
        case "BP_D": //血压
        case "CONTROL_BP_U": //目标血压
        case "CONTROL_BP_D":
            reqType = 2;
            tableId = "bp_table";
            modalTitle = "血压记录";
            colObj = {
                colNames: ["记录时间", "血压", "操作"],
                colModel: [
                    {name: 'time', index: 'time', width: '150', align: 'center'},
                    {name: '', index: '', width: '150',  align: 'center',
                    formatter: function(val, op, row){
                        return row.sys + ' / ' + row.dia+ ' mmHg';
                    }},
                    {name: '', index: '', width: '100', align: 'center', 
                    formatter: function(val, op, row){
                        return '<a onclick="fillHistoryData(\''+type+'\', '+ row.sys +', '+ row.dia +')">填入随访记录</a>';
                    }}
                ]
            };
            break;
        case 'HEIGHT':
        case 'WEIGHT':
            reqType = 3;
            tableId = "weight_table";
            modalTitle = "身高体重记录";
            colObj = {
                colNames: ["记录时间", "身高", "体重", "操作"],
                colModel: [
                    {name: 'time', index: 'time', width: '150', align: 'center'},
                    {name: 'height', index: 'height', width: '100',  align: 'center',
                    formatter: function(val, op, row){
                        return val + ' cm';
                    }},
                    {name: 'weight', index: 'weight', width: '100',  align: 'center',
                    formatter: function(val, op, row){
                        return val + ' Kg';
                    }},
                    {name: '', index: '', width: '100', align: 'center', 
                    formatter: function(val, op, row){
                        return '<a onclick="fillHistoryData(\''+type+'\','+row.height+','+row.weight+')">填入随访记录</a>';;
                    }}
                ]
            };
            break;
        case "BS_FPG": //空腹血糖
        case "NO_BS_FPG": //餐后血糖
        case "RANDOM_BLOOD_SUGAR": //随机血糖
        case "CONTROL_BS_FPG":
        case "CONTROL_NO_BS_FPG":
            reqType = 1;
            tableId = "bs_table";
            modalTitle = "血糖记录";
            colObj = {
                colNames: ["记录时间", "血糖", "操作"],
                colModel: [
                    {name: 'time', index: 'time', width: '150', align: 'center'},
                    {name: 'gi', index: 'gi', width: '150',  align: 'center',
                    formatter: function(val, op, row){
                        return row.gi + ' mmol/L';
                    }},
                    {name: '', index: '', width: '100', align: 'center', 
                    formatter: function(val, op, row){
                        return '<a onclick="fillHistoryData(\''+type+'\', '+ row.gi +')">填入随访记录</a>';
                    }}
                ]
            };
            break;
    }
    
    colObj.ajaxGridOptions = {
        data: {
            patient:patiCode, 
            type: reqType, 
            page:0, 
            pagesize: 10
        }
    };
    
    $("#modal-title").text(modalTitle);
    if($("#"+tableId).length == 0){
        var html = '<table id="'+tableId+'"></table>';
        $("#myModal .modal-body").empty().append(html);
        fillHistoryTable(colObj, true, tableId);
    }else{
        fillHistoryTable(colObj, false, tableId);
    }
}

//填充血压历史记录数据
function fillHistoryTable(colObj, isInit, tableId){
    console.log(colObj);
    var option = {
        height: '400px',
        rowNum: 10,
        rowList : [ 10, 20, 30 ],
        jsonReader: {
            root: 'data'
        },
        viewrecords: true,
        hidegrid: false
    };
    $.extend(true, option, followupAPI.getHistoryTableObj);
    $.extend(true, option, colObj);
    if(isInit){
        $("#"+tableId).jqGrid(option);
    }else{
        $("#"+tableId).clearGridData();
        $("#"+tableId).jqGrid('setGridParam', colObj);
        $("#"+tableId).trigger("reloadGrid");
    }
    
    $("#myModal").modal('toggle');
}

//将选中的历史信息填写到随访记录中
function fillHistoryData(type, val1, val2){
    switch(type){
        case 'BP_D':
        case 'BP_U':
            $("input[name=BP_D]").val(val1);
            $("input[name=BP_U]").val(val2);
            break;
        case 'HEIGHT':
        case 'WEIGHT':
            $("#HEIGHT").val(val1);
            $("#WEIGHT").val(val2);
            var w = parseFloat(val2),
                h = parseFloat(val1);
            var BMI = w/(h/100 * h/100);
            if(!isNaN(BMI)){
                $("input[name=BMI]").val(BMI.toFixed(2));
            }
            break;
        case 'CONTROL_BP_D':
        case 'CONTROL_BP_U':
            $("input[name=CONTROL_BP_D]").val(val1);
            $("input[name=CONTROL_BP_U]").val(val2);
            break;
        default:
            $("input[name="+type+"]").val(val1);
            break;
    }
    checkBtnEnable();
    $("#myModal").modal('toggle');
}

//判断按钮是否可执行
function checkBtnEnable(){
    //先判断是否存在必填项目,如果没有必填项目,则至少需要填写一个
    var disabled = true;
    if(requiredFields.length == 0){
        var $inputs = $("input"),
            input_len = $inputs.length,
            $textarea = $("textarea"),
            textarea_len = $textarea.length,
            $select = $("select"),
            select_len = $select.length;
        for(var i=0; i<input_len; i++){
            var $item = $($inputs[i]),
                textType = $item.attr("type"),
                value = $item.val();
            if(textType == "radio"){
                if($item.prop("checked")){
                    disabled = false;
                    break;
                }
            }else if(textType == "checkbox"){
                if($item.prop("checked")){
                    disabled = false;
                    break;
                }
            }else{
                if(value.length > 0){
                    disabled = false;
                    break;
                }
            }
        }
    }else{
        for(var i=0; i<requiredFields.length; i++){
            var item = requiredFields[i],
                value; //目前只有下拉框、输入框、textarea
            if(item.type == 4){
                value = $("textarea[name="+item.name+"]").val();
                if(value.length > 0){
                    disabled = false;
                }else{
                    disabled = true;
                    break;
                }
            }else if(item.type == 2){ //radio
                value = $("input[name="+item.name+"]").val();
                if(value.length > 0){
                    disabled = false;
                }else{
                    disabled = true;
                    break;
                }
            }else if(item.type == 1){
                if(item.textType == 'select'){
                    value = $("select[name="+item.name+"]").val();
                    if(value != "undefined"){
                        disabled = false;
                    }else{
                        disabled = true;
                        break;
                    }
                }else{
                    value = $("input[name="+item.name+"]").val();
                    if(value.length > 0){
                        disabled = false;
                    }else{
                        disabled = true;
                        break;
                    }
                }
            }
            
        }
    }
    if(disabled){
        $("#submitBtn").addClass("disabled");
    }else{
        $("#submitBtn").removeClass("disabled");
    }
}

function submitForm(){
    if($("#submitBtn").hasClass("disabled")){
        return false;
    }
    if(pro_id == 3) { // 实验室检查,空腹血糖、餐后血糖、随机血糖、三项需必填一项
        var bsValue = $('input[name="BS_FPG"]').val() 
                        || $('input[name="NO_BS_FPG"]').val() 
                        || $('input[name="RANDOM_BLOOD_SUGAR"]').val()
        if(!bsValue) {
            showWarningMsg("血糖必填一项");
            return false;
        }
    }
    var data = {};
    $("#question_form").serializeArray().map(function(x){
        data[x.name]=x.value;
    });
    if(pro_id == 7){
        data.CONTROL_CONSTITUTOR_DOCTORCODE = docInfo.code;
    }
    var params = {
        id: fv_id,
        followupProject:pro_id,
        followupProjectData: JSON.stringify(data)
    };
    followupAPI.saveFollowupProjectData(params).then(function(res){
//      var projectName = ['症状', '体征', '实验室检查', '生活方式指导', '评价', '用药情况', '控制目标', '健康教育', '转诊'];
        if(res.status == 200){
//          var title = projectName[pro_id];
//          pro_id ++;
            if(pro_id > 9){
                //保存成功后不做任何操作。
            }else{
                //控制tab页面,跳转选中下一个tab
                top.goFollowupNextQuestionaire();
            }
        }else{
            showErrorMsg(res.msg);
        }
    });
    return false;
}

function bindEvents(){
    //监听表单数据信息变化
    $("#question_form").on("change", "input", function(){
        checkBtnEnable();
        
        var name = $(this).attr("name");
        
        //计算BMI值 体质指数(BMI)=体重(kg)÷身高^2(m)
        switch(name){
            case "WEIGHT":
            case "WEIGHT_EXP":
            case "HEIGHT":
                var w = parseFloat($("input[name=WEIGHT]").val()),
                    ex_w = parseFloat($("input[name=WEIGHT_EXP]").val()),
                    h = parseFloat($("input[name=HEIGHT]").val());
                var BMI = w/(h/100 * h/100),
                    EX_BMI = ex_w/(h/100 * h/100);
                if(!isNaN(BMI)){
                    $("input[name=BMI]").val(BMI.toFixed(2));
                }
                if(!isNaN(EX_BMI)){
                    $("input[name=BMI_EXP]").val(EX_BMI.toFixed(2));
                }
                break;
        }
    });
    
    //监听下拉框的变化
    $("#question_form").on("change", "select", function(){
        checkBtnEnable();
    });
    
    //监听输入框内容变化
    $("#question_form").on("keyup", "textarea", function(){
        checkBtnEnable();
    });
}

+ 165 - 0
js/buz/followup/recipe_frequency_dict.js

@ -0,0 +1,165 @@
var recipe_frequency_dict = [{
        "key": "1",
        "name": "q.d."
    }, {
        "key": "2",
        "name": "b.i.d."
    }, {
        "key": "3",
        "name": "t.i.d."
    }, {
        "key": "4",
        "name": "q.i.d."
    }, {
        "key": "5",
        "name": "q.n."
    }, {
        "key": "6",
        "name": "q.d(11pm)"
    }, {
        "key": "7",
        "name": "q.m"
    }, {
        "key": "8",
        "name": "s.t."
    }, {
        "key": "9",
        "name": "p.r.n."
    }, {
        "key": "10",
        "name": "q1/2h"
    }, {
        "key": "11",
        "name": "持续用"
    }, {
        "key": "12",
        "name": "q2h"
    }, {
        "key": "13",
        "name": "q3h"
    }, {
        "key": "14",
        "name": "q4h"
    }, {
        "key": "15",
        "name": "q6h"
    }, {
        "key": "16",
        "name": "q8h"
    }, {
        "key": "17",
        "name": "q12h"
    }, {
        "key": "18",
        "name": "q.o.d"
    }, {
        "key": "19",
        "name": "q2h×3次"
    }, {
        "key": "20",
        "name": "q3h×3次"
    }, {
        "key": "21",
        "name": "q3h×6次"
    }, {
        "key": "22",
        "name": "一天五次"
    }, {
        "key": "23",
        "name": "q72h"
    }, {
        "key": "24",
        "name": "早餐前"
    }, {
        "key": "25",
        "name": "午餐前"
    }, {
        "key": "26",
        "name": "晚餐前"
    }, {
        "key": "27",
        "name": "早餐后"
    }, {
        "key": "28",
        "name": "午餐后"
    }, {
        "key": "29",
        "name": "晚餐后"
    }, {
        "key": "30",
        "name": "q.d.(早餐)"
    }, {
        "key": "31",
        "name": "q.d.(午餐)"
    }, {
        "key": "32",
        "name": "q.d.(晚餐)"
    }, {
        "key": "33",
        "name": "q1"
    }, {
        "key": "34",
        "name": "q2"
    }, {
        "key": "35",
        "name": "q3"
    }, {
        "key": "36",
        "name": "q1/4h"
    }, {
        "key": "37",
        "name": "qh"
    }, {
        "key": "38",
        "name": "q.o.d(单日)"
    }, {
        "key": "39",
        "name": "q.o.d(双日)"
    }, {
        "key": "40",
        "name": "q.w.1"
    }, {
        "key": "41",
        "name": "2/周(1-4)"
    }, {
        "key": "42",
        "name": "2/周(2-5)"
    }, {
        "key": "43",
        "name": "2/周(3-6)"
    }, {
        "key": "44",
        "name": "3/周(1-3-5)"
    }, {
        "key": "45",
        "name": "3/周(2-4-6)"
    }, {
        "key": "46",
        "name": "q.w.2"
    }, {
        "key": "47",
        "name": "q.w.3"
    }, {
        "key": "48",
        "name": "q.w.4"
    }, {
        "key": "49",
        "name": "q.w.5"
    }, {
        "key": "50",
        "name": "q.w.6"
    }, {
        "key": "51",
        "name": "q.w.7"
    }, {
        "key": "52",
        "name": "S.0.S"
    }
//  {
//      "key": "53",
//      "name": "1/2周"
//  }, {
//      "key": "54",
//      "name": "2/周"
//  }
];

+ 730 - 0
js/buz/followup/template_gxy.js

@ -0,0 +1,730 @@
//随访项目数据
//--------------------随访模板------------------------
//-----type 1-文本输入,2-radio选择,3-checkbox, 4-textarea
//-----textType :string, number ,date (type == 1时,才区分)
var gTemplate = {
// - 症状
    "1":{
        "NO_SYMPTOM":{
            "label": "无症状",
            "type": 3,
            "width": ""
        },
        "HEADACHE":{
            "label": "头痛头晕",
            "type": 3
        },
        "NAUSEA":{
            "label": "恶心呕吐",
            "type": 3
        },
        "VERTIGO_TINNITUS":{
            "label": "眼花耳鸣",
            "type": 3
        },
        "DIFFICULTY_BREATHING":{
            "label": "呼吸困难",
            "type": 3
        },
        "PALPITATIONS":{
            "label": "心悸胸闷",
            "type": 3
        },
        "EPISTAXIS_BLEEDING":{
            "label": "鼻衄出血不止",
            "type": 3
        },
        "LIMBS_NUMB":{
            "label": "四肢发麻",
            "type": 3
        },
        "EXTREMITY_EDEMA":{
            "label": "下肢水肿",
            "type": 3
        },
        "POLYDIPSIA":{
            "label": "多饮",
            "type": 3
        },
        "MORE_FOOD":{
            "label": "多食",
            "type": 3
        },
        "MORE_URINE":{
            "label": "多尿",
            "type": 3
        },
        "BLURRED_VISION":{
            "label": "视力模糊",
            "type": 3
        },
        "INFECTION":{
            "label": "感染",
            "type": 3
        },
        "NUMB_HANDS":{
            "label": "四肢麻痹",
            "type": 3
        },
        "WEIGHT_LOSS":{
            "label": "体重下降",
            "type": 3
        },
        "HYPOG_REACT_CODE":{
            "label": "低血糖反应",
            "type": 2,
            "items": {
                "0": "无",
                "1": "偶尔",
                "2": "频繁"
            }
        },
        "SYMPTOM_OTHER":{
            "label": "其他",
            "type":4,
            "row": 1,
            "maxLength": 100,
            "width": "100%"
        }
    },
    //-体征
    "2":{
        "BP": {
            "label": "血压",
            "type": 5, //联动输入框
            "unit": "mmHg",
            "required": true,
            "separate": " / ",
            "items": [{
                "textType": "number",
                "type": 1,
                "name": "BP_D", //收缩压
                "width": "60px"
            },{
                "textType": "number",
                "type": 1,
                "name": "BP_U", //舒张压
                "width": "60px"
            }]
        },
        "HEIGHT":{
            "label":"身高",
            "type":1,
            "unit":"cm",
            "textType": "number",
            "width": "100px"
        },
        "WEIGHT":{
            "label":"体重",
            "type":1,
            "unit":"Kg",
            "textType": "number",
            "width": "100px"
        },
        "BMI":{
            "label":"体质指数",
            "type":1,
            "textType": "string",
            "readonly": "readonly",
            "width": "100px"
        },
        "WEIGHT_EXP":{
            "label":"期望体重",
            "type":1,
            "unit":"Kg",
            "textType": "number",
            "width": "100px"
        },
        "BMI_EXP":{
            "label":"期望体质指数",
            "type":1,
            "textType": "string",
            "readonly": "readonly",
            "width": "100px"
        },
        "HEART_RATE":{
            "label":"心率",
            "type":1,
            "unit":"次/分",
            "textType": "number",
            "width": "100px"
        },
        "POFDA_MARK":{
            "label":"足背动脉搏动",
            "type":1,
            "textType": "select",
            "options": [{
                "key": "1",
                "value": "未触及"
            },{
                "key": "2",
                "value": "触及"
            }],
            "width": "100px"
        },
        "OTHER_POSITIVE_SIGNS":{
            "label":"其他",
            "type":1,
            "textType": "string",
            "width": "180px"
        }
    },
    //-实验室检查
    "3":{
    	"EXAM_DATE":{
            "label":"检查日期",
            "type":1,
            "textType": "date"
        },
        "BS_FPG":{
            "label":"空腹血糖",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "NO_BS_FPG":{
            "label":"餐后血糖",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "RANDOM_BLOOD_SUGAR": {
        	"label":"随机血糖",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "GHB":{
            "label":"糖化血红蛋白",
            "type":1,
            "unit":"%",
            "textType": "number",
            "width": "80px"
        },
        "BLOOD_FAT_TRIGLYCERIDE":{
            "label":"甘油三酯",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "BLOOD_FAT_TC":{
            "label":"总胆固醇",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "BLOOD_FAT_LDLC":{
            "label":"低密度脂蛋白",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "RENAL_FUNCTION_CREATININE":{
        	"label":"血清肌酐",
            "type":1,
            "unit":"umol/L",
            "textType": "number",
            "width": "80px"
        },
        "RENAL_FUNCTION_BUN":{
        	"label":"血尿素氮",
            "type":1,
            "unit":"mmol/L",
            "textType": "number",
            "width": "80px"
        },
        "MICROALBUMINURIA":{
        	"label":"尿微量白蛋白",
            "type":1,
            "unit":"μg/min",
            "textType": "number",
            "width": "80px"
        }
    },
    //-生活方式指导
    "4":{
        "DAILY_SMOKING":{
            "label":"日吸烟量",
            "type":1,
            "unit":"支",
            "textType": "number",
            "width": "60px"
        },
        "SOMKING_EXP":{
            "label":"日吸烟量期望",
            "type":1,
            "unit":"支",
            "textType": "number",
            "width": "60px"
        },
        "DAILY_DRINKING":{
            "label":"日饮酒量",
            "type":1,
            "unit":"两",
            "textType": "number",
            "width": "60px"
        },
        "DRINK_EXP":{
            "label":"日饮酒量期望",
            "type":1,
            "unit":"两",
            "textType": "number",
            "width": "60px"
        },
        "EXERCISE_FREQ_CODE":{
            "label":"运动频率",
            "type":5,
            "required": true,
            "unit": "分钟/次",
            "separate": "",
            "items": [{
                "name": "EXERCISE_FREQ_CODE",
                "type": 1,
                "textType": "select",
                "width": "200px",
                "options":[{
                    "key": "1",
                    "value": "每周 <= 三次"
                },{
                    "key": "2",
                    "value": "每周 > 三次"
                },{
                    "key": "3",
                    "value": "极少运动"
                },{
                    "key": "4",
                    "value": "残疾、关节等原因不能运动"
                },{
                    "key": "99",
                    "value": "不详"
                }]
            },{
                "name": "EXERCISE_DURATION_MINS",
                "type": 1,
                "textType": "number",
                "width": "60px"
            }]
        },
        "EXERCISE_FREQ_CODE_EXP":{
            "label":"运动频率期望",
            "type":5,
            "required": true,
            "unit": "分钟/次",
            "separate": "",
            "items": [{
                "name": "EXERCISE_FREQ_CODE_EXP",
                "type": 1,
                "textType": "select",
                "width": "200px",
                "options":[{
                    "key": "1",
                    "value": "每周 <= 三次"
                },{
                    "key": "2",
                    "value": "每周 > 三次"
                },{
                    "key": "3",
                    "value": "极少运动"
                },{
                    "key": "4",
                    "value": "残疾、关节等原因不能运动"
                },{
                    "key": "99",
                    "value": "不详"
                }]
            },{
                "name": "EXERCISE_DURATION_MINS_EXP",
                "type": 1,
                "textType": "number",
                "width": "60px"
            }]
        },
        "SALT_TAKEN_LEVEL_CODE":{
            "label":"摄盐情况",
            "type":1,
            "required": true,
            "textType": "select",
            "width": "120px",
            "options":[{
                "key": "1",
                "value": "轻"
            },{
                "key": "2",
                "value": "中"
            },{
                "key": "3",
                "value": "重"
            }]
        },
        "SALT_TAKEN_LEVEL_EXP":{
            "label":"摄盐情况期望",
            "type":1,
            "textType": "select",
            "width": "120px",
            "options":[{
                "key": "1",
                "value": "轻"
            },{
                "key": "2",
                "value": "中"
            },{
                "key": "3",
                "value": "重"
            }]
        },
        "PSY_ADJUST_RESULT_CODE":{
            "label":"心理调整",
            "type":1,
            "textType": "select",
            "width": "120px",
            "options":[{
                "key": "1",
                "value": "理想"
            },{
                "key": "2",
                "value": "良好"
            },{
                "key": "3",
                "value": "一般"
            },{
                "key": "4",
                "value": "差"
            }]
        },
        "COMPLIANCE_RESULT_CODE":{
            "label":"遵医行为",
            "type":1,
            "textType": "select",
            "width": "120px",
            "options":[{
                "key": "1",
                "value": "理想"
            },{
                "key": "2",
                "value": "良好"
            },{
                "key": "3",
                "value": "一般"
            },{
                "key": "4",
                "value": "差"
            }]
        },
        "DAILY_STAPLE":{
            "label":"主食",
            "type":1,
            "unit":"克/天",
            "textType":"number",
            "width": "60px"
        }
    },
    // - 评价
    "5":{
        "HYP_FOLLOWUP_TYPE_CODE":{
            "label":"高血压随访分类",
            "required":true,
            "type":1,
            "textType": 'select',
            "width": "120px",
            "options":[{
                "key": "1",
                "value": "控制满意"
            },{
                "key": "2",
                "value": "控制不满意"
            },{
                "key": "3",
                "value": "不良反应"
            },{
                "key": "4",
                "value": "并发症"
            },{
                "key": "5",
                "value": "控制一般"
            }]
        },
        "HYP_COMPLICATION_DETAIL":{
            "label":"详情",
            "type":4,
            "row": 3,
            "maxLength": 100,
            "width": "100%",
        },
        "DIA_FOLLOWUP_TYPE_CODE":{
            "label":"糖尿病随访分类",
            "required":true,
            "type":1,
            "textType": 'select',
            "width": "120px",
            "options":[{
                "key": "1",
                "value": "控制满意"
            },{
                "key": "2",
                "value": "控制不满意"
            },{
                "key": "3",
                "value": "不良反应"
            },{
                "key": "4",
                "value": "并发症"
            },{
                "key": "5",
                "value": "控制一般"
            }]
        },
        "DIA_COMPLICATION_DETAIL":{
            "label":"详情",
            "type":4,
            "row": 3,
            "maxLength": 100,
            "width": "100%",
        }
    },
    // - 用药情况
    "6":{
        "DRUG_COMPLIANCE_CODE":{
            "label": "服药依从性",
            "type": 2,
            "items":{
                "1":"规律服药",
                "2": "间断服药",
                "3": "不服药"
            }
        },
        "DRUG_LIST":{
            "label":"用药记录",
            "type":"json"
        }
    },
    // - 控制目标
    "7":{
        "CONTROL_DATE":{
            "label":"控制日期",
            "type":1,
            "textType": "date"
        },
        "CONTROL_CONSTITUTOR":{
            "label":"制定者",
            "type":1,
            "textType": "string",
            "readonly":"readonly",
            "width": "120px"
        },
        "CONTROL_BP":{
            "label": "血压",
            "type": 5,
            "unit": "mmHg",
            "separate": " / ",
            "items":[{
                "name": "CONTROL_BP_U",
                "type": 1,
                "textType": "number",
                "width": "60px"
            },{
                "name": "CONTROL_BP_D",
                "type": 1,
                "textType": "number",
                "width": "60px"
            }]
        },
        
        "CONTROL_BS_FPG":{
            "label":"空腹血糖",
            "type":1,
            "unit": "mmol/L",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_NO_BS_FPG":{
            "label":"餐后血糖",
            "type":1,
            "unit": "mmol/L",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_GHB":{
            "label":"糖化血红蛋白",
            "type":1,
            "unit": "%",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_TRIGLYCERIDE":{
            "label":"甘油三酯",
            "type":1,
            "unit": "mmol/L",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_TOTAL_CHOLESTEROL":{
            "label":"总胆固醇",
            "type":1,
            "unit": "mmol/L",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_LDL":{
            "label":"低密度脂蛋白",
            "type":1,
            "unit": "mmol/L",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_WEIGHT":{
            "label":"体重",
            "type":1,
            "unit": "Kg",
            "textType": "number",
            "width": "60px"
        },
        "CONTROL_EXERCISE_FREQ_CODE":{
            "label":"运动频率",
            "type":5,
            "unit": "分钟/次",
            "items":[{
                "name": "CONTROL_EXERCISE_FREQ_CODE",
                "type": 1,
                "textType": "select",
                "width": "200px",
                "options":[{
                    "key": "1",
                    "value": "每周 <= 三次"
                },{
                    "key": "2",
                    "value": "每周 > 三次"
                },{
                    "key": "3",
                    "value": "极少运动"
                },{
                    "key": "4",
                    "value": "残疾、关节等原因不能运动"
                },{
                    "key": "99",
                    "value": "不详"
                }]
            },{
                "name": "CONTROL_EXERCISE_DURATION_MINS",
                "type": 1,
                "textType": "number",
                "width": "60px"
            }]
            
        },
    },
    //- 健康教育
    "8":{
        "ARCHIVE_TIME":{
            "label":"日期",
            "type":1,
            "textType": "date"
        },
        "ARCHIVE_OPERATOR_NAME":{
            "label":"记录者",
            "type":1,
            "textType": "string",
            "width": "100px"
        },
        "HEALTH_EDUCATE":{
            "label":"健康教育",
            "required":true,
            "type":1,
            "textType": "select",
            "width": "200px",
            "options":[{
                "key": 1,
                "value": "高血压健康教育"
            },{
                "key": 2,
                "value": "糖尿病健康教育"
            },{
                "key": 3,
                "value": "低盐饮食"
            },{
                "key": 4,
                "value": "自定义高血压健康教育"
            },{
                "key": 5,
                "value": "自定义糖尿病健康教育"
            },{
                "key": 6,
                "value": "高糖并存健康教育处方"
            }]
        },
        "EDUCATE_CONTENT":{
            "label":"教育内容",
            "type":4,
            "row": 8,
            "maxLength": 2000,
            "width": "100%",
        }
    },
    //- 转诊
    "9":{
        "DRUG_ADVERSE":{
            "label":"药物不良反应",
            "type": 5,
            "items": [{
                "name": "DRUG_ADVERSE_MARK",
                "type": 2,
                "textType": "radio",
                "options":{
                    "0": "无",
                    "1": "有"
                }
            },{
                "name": "ADR_REMARK",
                "type": 1,
                "textType": "text",
                "width": "200px",
                "maxLength": 200
            }]
        },
        "DISAGREE_TRANSFER":{
            "label":"患者拒绝转诊",
            "type":5,
            "items":[{
                "name": "DISAGREE_TRANSFER",
                "type": 2,
                "textType": "radio",
                "options":{
                    "0": "否",
                    "1": "是"
                }
            },{
                "name": "DISAGREE_TRANSFER_REASON",
                "type": 1,
                "textType": "text",
                "width": "200px",
                "maxLength": 200
            }]
        },
        "TRANSFER_RESON":{
            "label":"转诊原因",
            "type":4,
            "required": true,
            "row": 3,
            "maxLength": 200,
            "width": "100%"
        },
        "TRANSFER_ORG_DEPT":{
            "label":"转诊机构科室",
            "type":4,
            "required": true,
            "row": 3,
            "maxLength": 200,
            "width": "100%",
//          "link":{
//              "text": "从代预约记录获取",
//              "url": "dyy_history.html",
//              "type":"dyy"
//          }
        }
    }
}

+ 21 - 1
js/buz/jw-prescription-info.js

@ -1,14 +1,21 @@
var request = getRequest(),
    code = request.code,
    patient = request.patient;
    patient = request.patient,
    fv_id = request.fv_id; //记录从随访跳转过来的数据
  
var info; //保存处方信息
$(function(){
    if(fv_id){
        $("#fvBtn").show();
    }
    var params = {
        code: code,
        patient: patient
    }
    jwPrescriptionAPI.getJwPrescriptionInfo({data: params}).then(function(res){
        if(res.status == 200){
            info = res.data;
            var html = template('tmp', res.data);
            $("#main").empty().append(html);
        }else{
@ -19,4 +26,17 @@ $(function(){
    $("#backBtn").on('click', function(){
        history.go(-1);
    });
    
    $("#fvBtn").on('click', function(){
        //保存处方的药品信息
        var drugs = info.prescriptionInfo;
        window.sessionStorage.setItem("chooseDrugs", JSON.stringify(drugs));
        //触发填充药品信息
        top.fillChooseDrugs();
        //关闭当前的layer弹框
        setTimeout(function(){
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.layer.close(index);
        }, 300);
    })
});

+ 54 - 8
js/buz/prescription-tabs.js

@ -6,7 +6,9 @@ var request = getRequest(),
    consultCode,
    prescriptionCode = request.code || '',
    teamCode = request.teamCode || '',
    jwCode; //基卫那边存储的原处方的code
    jwCode, //基卫那边存储的原处方的code
    fv_id = '1136', //随访的id
    fv_class = 1; //随访的类别
var docInfo = window.localStorage.getItem("docInfo");
docInfo = JSON.parse(docInfo);
@ -43,6 +45,14 @@ var links = [{
    url: 'prescription-list.html?from=tab&teamCode='+teamCode+'&patient='+patiCode,
    name: '历史续方',
    class: ''
},{
    url: '',
    name: '问卷调查',
    class: ''
},{
    url: 'page/followup/followup-main.html?fv_id='+fv_id+'&patiCode='+patiCode+'&fv_class='+fv_class,
    name: '随访记录',
    class: ''
}];
$(function(){
@ -101,12 +111,28 @@ function initPage(){
    $("#tabs").on('click', 'a', function(){
        var $this = $(this),
            $li = $this.parent();
        fromTabIdx = $("#tabs li.active").index();  
        $li.siblings().removeClass("active");
        $li.addClass("active");
        tab = $this.data('index');
        reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx);
        var url = links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx;
        
        if($this.text() == "随访记录"){
            tab = $this.data('index');
            top.layer.open({
                type: 2,
                title: '随访记录',
                shadeClose: true,
        //      shade: false,
        //      maxmin: true, //开启最大化最小化按钮
                area: ['800px', '570px'],
                content: links[tab].url
            });
            return false;
        }else{
            fromTabIdx = $("#tabs li.active").index();  
            $li.siblings().removeClass("active");
            $li.addClass("active");
            tab = $this.data('index');
            reqLinkList.push(links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx);
            var url = links[tab].url+'&from=tab&fromTabIdx='+fromTabIdx;
        }
        
//      parent.document.getElementById('main').src = url;
    })
}
@ -137,10 +163,20 @@ function getPrescriptionInfo(){
        if(res.status == 200){
            prescriptionCode = res.data.code;
            jwCode = res.data.jwCode;
            var followup = res.data.followup;
            if(followup){
                followup = JSON.parse(followup);
                fv_id = followup.id;
                fv_class = followup.followupClass;
            }
            updateLinkInfo();
            if(res.data.status < 50){ //支付成功前不会有订单记录
                links[2].class="hidden";
            }
            if(!followup){
                links[7].class="hidden";
                links[8].class="hidden";
            }
            judgeDeviceFn();
        }else{
            showWarningMsg(res.msg);
@ -160,9 +196,11 @@ function getPrescriptionInfoByCode(){
            consultCode = res.data.prescription.consult;
            sessionId = patiCode + '_' + consultCode+'_8';
            updateLinkInfo();
            //如果不是该续方所在团队的团队长,则不可以显示咨询tab
            //如果不是该续方所在团队的团队长,则不可以显示咨询tab,也不显示随访tab
            if(res.data.prescription.doctor != docInfo.code){
                links[0].class="hidden";
                links[7].class="hidden";
                links[8].class="hidden";
            }
            if(res.data.prescription.status < 50){ //支付成功前不会有订单记录
                links[2].class="hidden";
@ -203,5 +241,13 @@ function updateLinkInfo(){
        url: 'prescription-list.html?from=tab&teamCode='+teamCode+'&patient='+patiCode,
        name: '历史续方',
        class: ''
    },{
        url: '',
        name: '问卷调查',
        class: ''
    },{
        url: 'page/followup/followup-main.html?fv_id='+fv_id+'&patiCode='+patiCode+'&fv_class='+fv_class,
        name: '随访记录',
        class: ''
    }];
}

+ 89 - 0
js/followup-api.js

@ -0,0 +1,89 @@

(function(){
    var apis = {
        getPatientInfo: function(data){
            return APIService.httpGet("/doctor/patient/info", {data: data});
        },
        getDictByDictName: function(){
            return APIService.httpGet("/common/getDictByDictName", {
                data: {
                    name: 'FOLLOWUP_MANAGER_STATUS'
                }
            })
        },
        //获取随访内容
        getFollowup: function(data){
            return APIService.httpGet("/doctor/followup/getFollowup", {data: data});
        },
        //开始随访计划
        startFollowup: function(data){
            return APIService.httpPost("/doctor/followup/startFollowup", {data: data});
        },
        //新增临时随访
        addFollowup: function(data){
            return APIService.httpPost("/doctor/followup/addFollowup", {data: data});
        },
        //获得随访个项目数据
        getFollowupProjectData: function(data){
            return APIService.httpGet("/doctor/followup/getFollowupProjectData", {data: data});
        },
        //获得历史记录的数据
        getHealthIndexHistory: function(data){
            return APIService.httpGet("/doctor/health_index/getHealthIndexHistory", {data: data});
        },
        //获得历史记录的表格参数
        getHistoryTableObj:{
            url: APIService.server+ '/doctor/health_index/getHealthIndexHistory',
            datatype: 'json',
            mtype: 'get',
            ajaxGridOptions:{
                beforeSend: function(request) {
                    request.setRequestHeader("userAgent", JSON.stringify(APIService.userAgent));
                },
                complete: function(xhr, ts) {
                    console.log(xhr);
                    console.log(ts);
                    APIService.failCodeHandle(xhr.responseJSON)
////                  resolve(res)
//                  return res;
                }
            }
        },
        //保存填写的表单数据
        saveFollowupProjectData: function(data){
            return APIService.httpPost("/doctor/followup/saveFollowupProjectData", {data: data});
        },
        //获取随访用药记录的数据
        getFollowupDrugs: function(data){
            return APIService.httpGet("doctor/followup/drugs/getFollowupDrugs", {data: data});
        },
        //获取处方记录
        getPrescriptionList: function(data){
            return APIService.httpGet("doctor/prescriptionInfo/getPrescriptionInfos", {data: data});
        },
        getPrescriptionListTableAjaxObj: { //表格数据获取时,使用的ajax请求配置
            method: 'get',
            url: APIService.server + 'doctor/prescriptionInfo/getRecipeMasterList', 
            contentType: "application/json",
            dataType: "json",
            ajaxOptions: {
                beforeSend: function(request) {
                    var userAgent = APIService.userAgent;
                    userAgent = JSON.stringify(userAgent);
                    request.setRequestHeader("userAgent", userAgent);
                }
            }
        },
        //获取用药频率
        getRateList:function() {
            return APIService.httpGet('doctor/prescriptionInfo/getRateList');
        },
        //保存随访用药情况
        saveFollowupDrugs: function(data){
            return APIService.httpPost('doctor/followup/drugs/saveFollowupDrugs', {data: data});
        }
        
    };

    window.followupAPI = apis;
})(jQuery)

+ 1967 - 0
js/plugins/datetimepicker/bootstrap-datetimepicker.js

@ -0,0 +1,1967 @@
/* =========================================================
 * bootstrap-datetimepicker.js
 * =========================================================
 * Copyright 2012 Stefan Petre
 *
 * Improvements by Andrew Rowls
 * Improvements by Sébastien Malot
 * Improvements by Yun Lai
 * Improvements by Kenneth Henderick
 * Improvements by CuGBabyBeaR
 * Improvements by Christian Vaas <auspex@auspex.eu>
 *
 * Project URL : http://www.malot.fr/bootstrap-datetimepicker
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================= */
(function(factory){
    if (typeof define === 'function' && define.amd)
      define(['jquery'], factory);
    else if (typeof exports === 'object')
      factory(require('jquery'));
    else
      factory(jQuery);
}(function($, undefined){
  // Add ECMA262-5 Array methods if not supported natively (IE8)
  if (!('indexOf' in Array.prototype)) {
    Array.prototype.indexOf = function (find, i) {
      if (i === undefined) i = 0;
      if (i < 0) i += this.length;
      if (i < 0) i = 0;
      for (var n = this.length; i < n; i++) {
        if (i in this && this[i] === find) {
          return i;
        }
      }
      return -1;
    }
  }
  // Add timezone abbreviation support for ie6+, Chrome, Firefox
  function timeZoneAbbreviation() {
    var abbreviation, date, formattedStr, i, len, matchedStrings, ref, str;
    date = (new Date()).toString();
    formattedStr = ((ref = date.split('(')[1]) != null ? ref.slice(0, -1) : 0) || date.split(' ');
    if (formattedStr instanceof Array) {
      matchedStrings = [];
      for (var i = 0, len = formattedStr.length; i < len; i++) {
        str = formattedStr[i];
        if ((abbreviation = (ref = str.match(/\b[A-Z]+\b/)) !== null) ? ref[0] : 0) {
          matchedStrings.push(abbreviation);
        }
      }
      formattedStr = matchedStrings.pop();
    }
    return formattedStr;
  }
  function UTCDate() {
    return new Date(Date.UTC.apply(Date, arguments));
  }
  // Picker object
  var Datetimepicker = function (element, options) {
    var that = this;
    this.element = $(element);
    // add container for single page application
    // when page switch the datetimepicker div will be removed also.
    this.container = options.container || 'body';
    this.language = options.language || this.element.data('date-language') || 'en';
    this.language = this.language in dates ? this.language : this.language.split('-')[0]; // fr-CA fallback to fr
    this.language = this.language in dates ? this.language : 'en';
    this.isRTL = dates[this.language].rtl || false;
    this.formatType = options.formatType || this.element.data('format-type') || 'standard';
    this.format = DPGlobal.parseFormat(options.format || this.element.data('date-format') || dates[this.language].format || DPGlobal.getDefaultFormat(this.formatType, 'input'), this.formatType);
    this.isInline = false;
    this.isVisible = false;
    this.isInput = this.element.is('input');
    this.fontAwesome = options.fontAwesome || this.element.data('font-awesome') || false;
    this.bootcssVer = options.bootcssVer || (this.isInput ? (this.element.is('.form-control') ? 3 : 2) : ( this.bootcssVer = this.element.is('.input-group') ? 3 : 2 ));
    this.component = this.element.is('.date') ? ( this.bootcssVer === 3 ? this.element.find('.input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-remove, .input-group-addon .glyphicon-calendar, .input-group-addon .fa-calendar, .input-group-addon .fa-clock-o').parent() : this.element.find('.add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar, .add-on .fa-calendar, .add-on .fa-clock-o').parent()) : false;
    this.componentReset = this.element.is('.date') ? ( this.bootcssVer === 3 ? this.element.find('.input-group-addon .glyphicon-remove, .input-group-addon .fa-times').parent():this.element.find('.add-on .icon-remove, .add-on .fa-times').parent()) : false;
    this.hasInput = this.component && this.element.find('input').length;
    if (this.component && this.component.length === 0) {
      this.component = false;
    }
    this.linkField = options.linkField || this.element.data('link-field') || false;
    this.linkFormat = DPGlobal.parseFormat(options.linkFormat || this.element.data('link-format') || DPGlobal.getDefaultFormat(this.formatType, 'link'), this.formatType);
    this.minuteStep = options.minuteStep || this.element.data('minute-step') || 5;
    this.pickerPosition = options.pickerPosition || this.element.data('picker-position') || 'bottom-right';
    this.showMeridian = options.showMeridian || this.element.data('show-meridian') || false;
    this.initialDate = options.initialDate || new Date();
    this.zIndex = options.zIndex || this.element.data('z-index') || undefined;
    this.title = typeof options.title === 'undefined' ? false : options.title;
    this.timezone = options.timezone || timeZoneAbbreviation();
    this.icons = {
      leftArrow: this.fontAwesome ? 'fa-arrow-left' : (this.bootcssVer === 3 ? 'glyphicon-arrow-left' : 'icon-arrow-left'),
      rightArrow: this.fontAwesome ? 'fa-arrow-right' : (this.bootcssVer === 3 ? 'glyphicon-arrow-right' : 'icon-arrow-right')
    }
    this.icontype = this.fontAwesome ? 'fa' : 'glyphicon';
    this._attachEvents();
    this.clickedOutside = function (e) {
        // Clicked outside the datetimepicker, hide it
        if ($(e.target).closest('.datetimepicker').length === 0) {
            that.hide();
        }
    }
    this.formatViewType = 'datetime';
    if ('formatViewType' in options) {
      this.formatViewType = options.formatViewType;
    } else if ('formatViewType' in this.element.data()) {
      this.formatViewType = this.element.data('formatViewType');
    }
    this.minView = 0;
    if ('minView' in options) {
      this.minView = options.minView;
    } else if ('minView' in this.element.data()) {
      this.minView = this.element.data('min-view');
    }
    this.minView = DPGlobal.convertViewMode(this.minView);
    this.maxView = DPGlobal.modes.length - 1;
    if ('maxView' in options) {
      this.maxView = options.maxView;
    } else if ('maxView' in this.element.data()) {
      this.maxView = this.element.data('max-view');
    }
    this.maxView = DPGlobal.convertViewMode(this.maxView);
    this.wheelViewModeNavigation = false;
    if ('wheelViewModeNavigation' in options) {
      this.wheelViewModeNavigation = options.wheelViewModeNavigation;
    } else if ('wheelViewModeNavigation' in this.element.data()) {
      this.wheelViewModeNavigation = this.element.data('view-mode-wheel-navigation');
    }
    this.wheelViewModeNavigationInverseDirection = false;
    if ('wheelViewModeNavigationInverseDirection' in options) {
      this.wheelViewModeNavigationInverseDirection = options.wheelViewModeNavigationInverseDirection;
    } else if ('wheelViewModeNavigationInverseDirection' in this.element.data()) {
      this.wheelViewModeNavigationInverseDirection = this.element.data('view-mode-wheel-navigation-inverse-dir');
    }
    this.wheelViewModeNavigationDelay = 100;
    if ('wheelViewModeNavigationDelay' in options) {
      this.wheelViewModeNavigationDelay = options.wheelViewModeNavigationDelay;
    } else if ('wheelViewModeNavigationDelay' in this.element.data()) {
      this.wheelViewModeNavigationDelay = this.element.data('view-mode-wheel-navigation-delay');
    }
    this.startViewMode = 2;
    if ('startView' in options) {
      this.startViewMode = options.startView;
    } else if ('startView' in this.element.data()) {
      this.startViewMode = this.element.data('start-view');
    }
    this.startViewMode = DPGlobal.convertViewMode(this.startViewMode);
    this.viewMode = this.startViewMode;
    this.viewSelect = this.minView;
    if ('viewSelect' in options) {
      this.viewSelect = options.viewSelect;
    } else if ('viewSelect' in this.element.data()) {
      this.viewSelect = this.element.data('view-select');
    }
    this.viewSelect = DPGlobal.convertViewMode(this.viewSelect);
    this.forceParse = true;
    if ('forceParse' in options) {
      this.forceParse = options.forceParse;
    } else if ('dateForceParse' in this.element.data()) {
      this.forceParse = this.element.data('date-force-parse');
    }
    var template = this.bootcssVer === 3 ? DPGlobal.templateV3 : DPGlobal.template;
    while (template.indexOf('{iconType}') !== -1) {
      template = template.replace('{iconType}', this.icontype);
    }
    while (template.indexOf('{leftArrow}') !== -1) {
      template = template.replace('{leftArrow}', this.icons.leftArrow);
    }
    while (template.indexOf('{rightArrow}') !== -1) {
      template = template.replace('{rightArrow}', this.icons.rightArrow);
    }
    this.picker = $(template)
      .appendTo(this.isInline ? this.element : this.container) // 'body')
      .on({
        click:     $.proxy(this.click, this),
        mousedown: $.proxy(this.mousedown, this)
      });
    if (this.wheelViewModeNavigation) {
      if ($.fn.mousewheel) {
        this.picker.on({mousewheel: $.proxy(this.mousewheel, this)});
      } else {
        console.log('Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option');
      }
    }
    if (this.isInline) {
      this.picker.addClass('datetimepicker-inline');
    } else {
      this.picker.addClass('datetimepicker-dropdown-' + this.pickerPosition + ' dropdown-menu');
    }
    if (this.isRTL) {
      this.picker.addClass('datetimepicker-rtl');
      var selector = this.bootcssVer === 3 ? '.prev span, .next span' : '.prev i, .next i';
      this.picker.find(selector).toggleClass(this.icons.leftArrow + ' ' + this.icons.rightArrow);
    }
    $(document).on('mousedown touchend', this.clickedOutside);
    this.autoclose = false;
    if ('autoclose' in options) {
      this.autoclose = options.autoclose;
    } else if ('dateAutoclose' in this.element.data()) {
      this.autoclose = this.element.data('date-autoclose');
    }
    this.keyboardNavigation = true;
    if ('keyboardNavigation' in options) {
      this.keyboardNavigation = options.keyboardNavigation;
    } else if ('dateKeyboardNavigation' in this.element.data()) {
      this.keyboardNavigation = this.element.data('date-keyboard-navigation');
    }
    this.todayBtn = (options.todayBtn || this.element.data('date-today-btn') || false);
    this.clearBtn = (options.clearBtn || this.element.data('date-clear-btn') || false);
    this.todayHighlight = (options.todayHighlight || this.element.data('date-today-highlight') || false);
    this.weekStart = 0;
    if (typeof options.weekStart !== 'undefined') {
      this.weekStart = options.weekStart;
    } else if (typeof this.element.data('date-weekstart') !== 'undefined') {
      this.weekStart = this.element.data('date-weekstart');
    } else if (typeof dates[this.language].weekStart !== 'undefined') {
      this.weekStart = dates[this.language].weekStart;
    }
    this.weekStart = this.weekStart % 7;
    this.weekEnd = ((this.weekStart + 6) % 7);
    this.onRenderDay = function (date) {
      var render = (options.onRenderDay || function () { return []; })(date);
      if (typeof render === 'string') {
        render = [render];
      }
      var res = ['day'];
      return res.concat((render ? render : []));
    };
    this.onRenderHour = function (date) {
      var render = (options.onRenderHour || function () { return []; })(date);
      var res = ['hour'];
      if (typeof render === 'string') {
        render = [render];
      }
      return res.concat((render ? render : []));
    };
    this.onRenderMinute = function (date) {
      var render = (options.onRenderMinute || function () { return []; })(date);
      var res = ['minute'];
      if (typeof render === 'string') {
        render = [render];
      }
      if (date < this.startDate || date > this.endDate) {
        res.push('disabled');
      } else if (Math.floor(this.date.getUTCMinutes() / this.minuteStep) === Math.floor(date.getUTCMinutes() / this.minuteStep)) {
        res.push('active');
      }
      return res.concat((render ? render : []));
    };
    this.onRenderYear = function (date) {
      var render = (options.onRenderYear || function () { return []; })(date);
      var res = ['year'];
      if (typeof render === 'string') {
        render = [render];
      }
      if (this.date.getUTCFullYear() === date.getUTCFullYear()) {
        res.push('active');
      }
      var currentYear = date.getUTCFullYear();
      var endYear = this.endDate.getUTCFullYear();
      if (date < this.startDate || currentYear > endYear) {
        res.push('disabled');
      }
      return res.concat((render ? render : []));
    }
    this.onRenderMonth = function (date) {
      var render = (options.onRenderMonth || function () { return []; })(date);
      var res = ['month'];
      if (typeof render === 'string') {
        render = [render];
      }
      return res.concat((render ? render : []));
    }
    this.startDate = new Date(-8639968443048000);
    this.endDate = new Date(8639968443048000);
    this.datesDisabled = [];
    this.daysOfWeekDisabled = [];
    this.setStartDate(options.startDate || this.element.data('date-startdate'));
    this.setEndDate(options.endDate || this.element.data('date-enddate'));
    this.setDatesDisabled(options.datesDisabled || this.element.data('date-dates-disabled'));
    this.setDaysOfWeekDisabled(options.daysOfWeekDisabled || this.element.data('date-days-of-week-disabled'));
    this.setMinutesDisabled(options.minutesDisabled || this.element.data('date-minute-disabled'));
    this.setHoursDisabled(options.hoursDisabled || this.element.data('date-hour-disabled'));
    this.fillDow();
    this.fillMonths();
    this.update();
    this.showMode();
    if (this.isInline) {
      this.show();
    }
  };
  Datetimepicker.prototype = {
    constructor: Datetimepicker,
    _events:       [],
    _attachEvents: function () {
      this._detachEvents();
      if (this.isInput) { // single input
        this._events = [
          [this.element, {
            focus:   $.proxy(this.show, this),
            keyup:   $.proxy(this.update, this),
            keydown: $.proxy(this.keydown, this)
          }]
        ];
      }
      else if (this.component && this.hasInput) { // component: input + button
        this._events = [
          // For components that are not readonly, allow keyboard nav
          [this.element.find('input'), {
            focus:   $.proxy(this.show, this),
            keyup:   $.proxy(this.update, this),
            keydown: $.proxy(this.keydown, this)
          }],
          [this.component, {
            click: $.proxy(this.show, this)
          }]
        ];
        if (this.componentReset) {
          this._events.push([
            this.componentReset,
            {click: $.proxy(this.reset, this)}
          ]);
        }
      }
      else if (this.element.is('div')) {  // inline datetimepicker
        this.isInline = true;
      }
      else {
        this._events = [
          [this.element, {
            click: $.proxy(this.show, this)
          }]
        ];
      }
      for (var i = 0, el, ev; i < this._events.length; i++) {
        el = this._events[i][0];
        ev = this._events[i][1];
        el.on(ev);
      }
    },
    _detachEvents: function () {
      for (var i = 0, el, ev; i < this._events.length; i++) {
        el = this._events[i][0];
        ev = this._events[i][1];
        el.off(ev);
      }
      this._events = [];
    },
    show: function (e) {
      this.picker.show();
      this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
      if (this.forceParse) {
        this.update();
      }
      this.place();
      $(window).on('resize', $.proxy(this.place, this));
      if (e) {
        e.stopPropagation();
        e.preventDefault();
      }
      this.isVisible = true;
      this.element.trigger({
        type: 'show',
        date: this.date
      });
    },
    hide: function () {
      if (!this.isVisible) return;
      if (this.isInline) return;
      this.picker.hide();
      $(window).off('resize', this.place);
      this.viewMode = this.startViewMode;
      this.showMode();
      if (!this.isInput) {
        $(document).off('mousedown', this.hide);
      }
      if (
        this.forceParse &&
          (
            this.isInput && this.element.val() ||
              this.hasInput && this.element.find('input').val()
            )
        )
        this.setValue();
      this.isVisible = false;
      this.element.trigger({
        type: 'hide',
        date: this.date
      });
    },
    remove: function () {
      this._detachEvents();
      $(document).off('mousedown', this.clickedOutside);
      this.picker.remove();
      delete this.picker;
      delete this.element.data().datetimepicker;
    },
    getDate: function () {
      var d = this.getUTCDate();
      if (d === null) {
        return null;
      }
      return new Date(d.getTime() + (d.getTimezoneOffset() * 60000));
    },
    getUTCDate: function () {
      return this.date;
    },
    getInitialDate: function () {
      return this.initialDate
    },
    setInitialDate: function (initialDate) {
      this.initialDate = initialDate;
    },
    setDate: function (d) {
      this.setUTCDate(new Date(d.getTime() - (d.getTimezoneOffset() * 60000)));
    },
    setUTCDate: function (d) {
      if (d >= this.startDate && d <= this.endDate) {
        this.date = d;
        this.setValue();
        this.viewDate = this.date;
        this.fill();
      } else {
        this.element.trigger({
          type:      'outOfRange',
          date:      d,
          startDate: this.startDate,
          endDate:   this.endDate
        });
      }
    },
    setFormat: function (format) {
      this.format = DPGlobal.parseFormat(format, this.formatType);
      var element;
      if (this.isInput) {
        element = this.element;
      } else if (this.component) {
        element = this.element.find('input');
      }
      if (element && element.val()) {
        this.setValue();
      }
    },
    setValue: function () {
      var formatted = this.getFormattedDate();
      if (!this.isInput) {
        if (this.component) {
          this.element.find('input').val(formatted);
        }
        this.element.data('date', formatted);
      } else {
        this.element.val(formatted);
      }
      if (this.linkField) {
        $('#' + this.linkField).val(this.getFormattedDate(this.linkFormat));
      }
    },
    getFormattedDate: function (format) {
      format = format || this.format;
      return DPGlobal.formatDate(this.date, format, this.language, this.formatType, this.timezone);
    },
    setStartDate: function (startDate) {
      this.startDate = startDate || this.startDate;
      if (this.startDate.valueOf() !== 8639968443048000) {
        this.startDate = DPGlobal.parseDate(this.startDate, this.format, this.language, this.formatType, this.timezone);
      }
      this.update();
      this.updateNavArrows();
    },
    setEndDate: function (endDate) {
      this.endDate = endDate || this.endDate;
      if (this.endDate.valueOf() !== 8639968443048000) {
        this.endDate = DPGlobal.parseDate(this.endDate, this.format, this.language, this.formatType, this.timezone);
      }
      this.update();
      this.updateNavArrows();
    },
    setDatesDisabled: function (datesDisabled) {
      this.datesDisabled = datesDisabled || [];
      if (!$.isArray(this.datesDisabled)) {
        this.datesDisabled = this.datesDisabled.split(/,\s*/);
      }
      var mThis = this;
      this.datesDisabled = $.map(this.datesDisabled, function (d) {
        return DPGlobal.parseDate(d, mThis.format, mThis.language, mThis.formatType, mThis.timezone).toDateString();
      });
      this.update();
      this.updateNavArrows();
    },
    setTitle: function (selector, value) {
      return this.picker.find(selector)
        .find('th:eq(1)')
        .text(this.title === false ? value : this.title);
    },
    setDaysOfWeekDisabled: function (daysOfWeekDisabled) {
      this.daysOfWeekDisabled = daysOfWeekDisabled || [];
      if (!$.isArray(this.daysOfWeekDisabled)) {
        this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/);
      }
      this.daysOfWeekDisabled = $.map(this.daysOfWeekDisabled, function (d) {
        return parseInt(d, 10);
      });
      this.update();
      this.updateNavArrows();
    },
    setMinutesDisabled: function (minutesDisabled) {
      this.minutesDisabled = minutesDisabled || [];
      if (!$.isArray(this.minutesDisabled)) {
        this.minutesDisabled = this.minutesDisabled.split(/,\s*/);
      }
      this.minutesDisabled = $.map(this.minutesDisabled, function (d) {
        return parseInt(d, 10);
      });
      this.update();
      this.updateNavArrows();
    },
    setHoursDisabled: function (hoursDisabled) {
      this.hoursDisabled = hoursDisabled || [];
      if (!$.isArray(this.hoursDisabled)) {
        this.hoursDisabled = this.hoursDisabled.split(/,\s*/);
      }
      this.hoursDisabled = $.map(this.hoursDisabled, function (d) {
        return parseInt(d, 10);
      });
      this.update();
      this.updateNavArrows();
    },
    place: function () {
      if (this.isInline) return;
      if (!this.zIndex) {
        var index_highest = 0;
        $('div').each(function () {
          var index_current = parseInt($(this).css('zIndex'), 10);
          if (index_current > index_highest) {
            index_highest = index_current;
          }
        });
        this.zIndex = index_highest + 10;
      }
      var offset, top, left, containerOffset;
      if (this.container instanceof $) {
        containerOffset = this.container.offset();
      } else {
        containerOffset = $(this.container).offset();
      }
      if (this.component) {
        offset = this.component.offset();
        left = offset.left;
        if (this.pickerPosition === 'bottom-left' || this.pickerPosition === 'top-left') {
          left += this.component.outerWidth() - this.picker.outerWidth();
        }
      } else {
        offset = this.element.offset();
        left = offset.left;
        if (this.pickerPosition === 'bottom-left' || this.pickerPosition === 'top-left') {
          left += this.element.outerWidth() - this.picker.outerWidth();
        }
      }
      var bodyWidth = document.body.clientWidth || window.innerWidth;
      if (left + 220 > bodyWidth) {
        left = bodyWidth - 220;
      }
      if (this.pickerPosition === 'top-left' || this.pickerPosition === 'top-right') {
        top = offset.top - this.picker.outerHeight();
      } else {
        top = offset.top + this.height;
      }
      top = top - containerOffset.top;
      left = left - containerOffset.left;
      this.picker.css({
        top:    top,
        left:   left,
        zIndex: this.zIndex
      });
    },
    hour_minute: "^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]",
    update: function () {
      var date, fromArgs = false;
      if (arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) {
        date = arguments[0];
        fromArgs = true;
      } else {
        date = (this.isInput ? this.element.val() : this.element.find('input').val()) || this.element.data('date') || this.initialDate;
        if (typeof date === 'string') {
          date = date.replace(/^\s+|\s+$/g,'');
        }
      }
      if (!date) {
        date = new Date();
        fromArgs = false;
      }
      if (typeof date === "string") {
        if (new RegExp(this.hour_minute).test(date) || new RegExp(this.hour_minute + ":[0-5][0-9]").test(date)) {
          date = this.getDate()
        }
      }
      this.date = DPGlobal.parseDate(date, this.format, this.language, this.formatType, this.timezone);
      if (fromArgs) this.setValue();
      if (this.date < this.startDate) {
        this.viewDate = new Date(this.startDate);
      } else if (this.date > this.endDate) {
        this.viewDate = new Date(this.endDate);
      } else {
        this.viewDate = new Date(this.date);
      }
      this.fill();
    },
    fillDow: function () {
      var dowCnt = this.weekStart,
        html = '<tr>';
      while (dowCnt < this.weekStart + 7) {
        html += '<th class="dow">' + dates[this.language].daysMin[(dowCnt++) % 7] + '</th>';
      }
      html += '</tr>';
      this.picker.find('.datetimepicker-days thead').append(html);
    },
    fillMonths: function () {
      var html = '';
      var d = new Date(this.viewDate);
      for (var i = 0; i < 12; i++) {
        d.setUTCMonth(i);
        var classes = this.onRenderMonth(d);
        html += '<span class="' + classes.join(' ') + '">' + dates[this.language].monthsShort[i] + '</span>';
      }
      this.picker.find('.datetimepicker-months td').html(html);
    },
    fill: function () {
      if (!this.date || !this.viewDate) {
        return;
      }
      var d = new Date(this.viewDate),
        year = d.getUTCFullYear(),
        month = d.getUTCMonth(),
        dayMonth = d.getUTCDate(),
        hours = d.getUTCHours(),
        startYear = this.startDate.getUTCFullYear(),
        startMonth = this.startDate.getUTCMonth(),
        endYear = this.endDate.getUTCFullYear(),
        endMonth = this.endDate.getUTCMonth() + 1,
        currentDate = (new UTCDate(this.date.getUTCFullYear(), this.date.getUTCMonth(), this.date.getUTCDate())).valueOf(),
        today = new Date();
      this.setTitle('.datetimepicker-days', dates[this.language].months[month] + ' ' + year)
      if (this.formatViewType === 'time') {
        var formatted = this.getFormattedDate();
        this.setTitle('.datetimepicker-hours', formatted);
        this.setTitle('.datetimepicker-minutes', formatted);
      } else {
        this.setTitle('.datetimepicker-hours', dayMonth + ' ' + dates[this.language].months[month] + ' ' + year);
        this.setTitle('.datetimepicker-minutes', dayMonth + ' ' + dates[this.language].months[month] + ' ' + year);
      }
      this.picker.find('tfoot th.today')
        .text(dates[this.language].today || dates['en'].today)
        .toggle(this.todayBtn !== false);
      this.picker.find('tfoot th.clear')
        .text(dates[this.language].clear || dates['en'].clear)
        .toggle(this.clearBtn !== false);
      this.updateNavArrows();
      this.fillMonths();
      var prevMonth = UTCDate(year, month - 1, 28, 0, 0, 0, 0),
        day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth());
      prevMonth.setUTCDate(day);
      prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.weekStart + 7) % 7);
      var nextMonth = new Date(prevMonth);
      nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
      nextMonth = nextMonth.valueOf();
      var html = [];
      var classes;
      while (prevMonth.valueOf() < nextMonth) {
        if (prevMonth.getUTCDay() === this.weekStart) {
          html.push('<tr>');
        }
        classes = this.onRenderDay(prevMonth);
        if (prevMonth.getUTCFullYear() < year || (prevMonth.getUTCFullYear() === year && prevMonth.getUTCMonth() < month)) {
          classes.push('old');
        } else if (prevMonth.getUTCFullYear() > year || (prevMonth.getUTCFullYear() === year && prevMonth.getUTCMonth() > month)) {
          classes.push('new');
        }
        // Compare internal UTC date with local today, not UTC today
        if (this.todayHighlight &&
          prevMonth.getUTCFullYear() === today.getFullYear() &&
          prevMonth.getUTCMonth() === today.getMonth() &&
          prevMonth.getUTCDate() === today.getDate()) {
          classes.push('today');
        }
        if (prevMonth.valueOf() === currentDate) {
          classes.push('active');
        }
        if ((prevMonth.valueOf() + 86400000) <= this.startDate || prevMonth.valueOf() > this.endDate ||
          $.inArray(prevMonth.getUTCDay(), this.daysOfWeekDisabled) !== -1 ||
          $.inArray(prevMonth.toDateString(), this.datesDisabled) !== -1) {
          classes.push('disabled');
        }
        html.push('<td class="' + classes.join(' ') + '">' + prevMonth.getUTCDate() + '</td>');
        if (prevMonth.getUTCDay() === this.weekEnd) {
          html.push('</tr>');
        }
        prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
      }
      this.picker.find('.datetimepicker-days tbody').empty().append(html.join(''));
      html = [];
      var txt = '', meridian = '', meridianOld = '';
      var hoursDisabled = this.hoursDisabled || [];
      d = new Date(this.viewDate)
      for (var i = 0; i < 24; i++) {
        d.setUTCHours(i);
        classes = this.onRenderHour(d);
        if (hoursDisabled.indexOf(i) !== -1) {
          classes.push('disabled');
        }
        var actual = UTCDate(year, month, dayMonth, i);
        // We want the previous hour for the startDate
        if ((actual.valueOf() + 3600000) <= this.startDate || actual.valueOf() > this.endDate) {
          classes.push('disabled');
        } else if (hours === i) {
          classes.push('active');
        }
        if (this.showMeridian && dates[this.language].meridiem.length === 2) {
          meridian = (i < 12 ? dates[this.language].meridiem[0] : dates[this.language].meridiem[1]);
          if (meridian !== meridianOld) {
            if (meridianOld !== '') {
              html.push('</fieldset>');
            }
            html.push('<fieldset class="hour"><legend>' + meridian.toUpperCase() + '</legend>');
          }
          meridianOld = meridian;
          txt = (i % 12 ? i % 12 : 12);
          if (i < 12) {
            classes.push('hour_am');
          } else {
            classes.push('hour_pm');
          }
          html.push('<span class="' + classes.join(' ') + '">' + txt + '</span>');
          if (i === 23) {
            html.push('</fieldset>');
          }
        } else {
          txt = i + ':00';
          html.push('<span class="' + classes.join(' ') + '">' + txt + '</span>');
        }
      }
      this.picker.find('.datetimepicker-hours td').html(html.join(''));
      html = [];
      txt = '';
      meridian = '';
      meridianOld = '';
      var minutesDisabled = this.minutesDisabled || [];
      d = new Date(this.viewDate);
      for (var i = 0; i < 60; i += this.minuteStep) {
        if (minutesDisabled.indexOf(i) !== -1) continue;
        d.setUTCMinutes(i);
        d.setUTCSeconds(0);
        classes = this.onRenderMinute(d);
        if (this.showMeridian && dates[this.language].meridiem.length === 2) {
          meridian = (hours < 12 ? dates[this.language].meridiem[0] : dates[this.language].meridiem[1]);
          if (meridian !== meridianOld) {
            if (meridianOld !== '') {
              html.push('</fieldset>');
            }
            html.push('<fieldset class="minute"><legend>' + meridian.toUpperCase() + '</legend>');
          }
          meridianOld = meridian;
          txt = (hours % 12 ? hours % 12 : 12);
          html.push('<span class="' + classes.join(' ') + '">' + txt + ':' + (i < 10 ? '0' + i : i) + '</span>');
          if (i === 59) {
            html.push('</fieldset>');
          }
        } else {
          txt = i + ':00';
          html.push('<span class="' + classes.join(' ') + '">' + hours + ':' + (i < 10 ? '0' + i : i) + '</span>');
        }
      }
      this.picker.find('.datetimepicker-minutes td').html(html.join(''));
      var currentYear = this.date.getUTCFullYear();
      var months = this.setTitle('.datetimepicker-months', year)
        .end()
        .find('.month').removeClass('active');
      if (currentYear === year) {
        // getUTCMonths() returns 0 based, and we need to select the next one
        // To cater bootstrap 2 we don't need to select the next one
        months.eq(this.date.getUTCMonth()).addClass('active');
      }
      if (year < startYear || year > endYear) {
        months.addClass('disabled');
      }
      if (year === startYear) {
        months.slice(0, startMonth).addClass('disabled');
      }
      if (year === endYear) {
        months.slice(endMonth).addClass('disabled');
      }
      html = '';
      year = parseInt(year / 10, 10) * 10;
      var yearCont = this.setTitle('.datetimepicker-years', year + '-' + (year + 9))
        .end()
        .find('td');
      year -= 1;
      d = new Date(this.viewDate);
      for (var i = -1; i < 11; i++) {
        d.setUTCFullYear(year);
        classes = this.onRenderYear(d);
        if (i === -1 || i === 10) {
          classes.push(old);
        }
        html += '<span class="' + classes.join(' ') + '">' + year + '</span>';
        year += 1;
      }
      yearCont.html(html);
      this.place();
    },
    updateNavArrows: function () {
      var d = new Date(this.viewDate),
        year = d.getUTCFullYear(),
        month = d.getUTCMonth(),
        day = d.getUTCDate(),
        hour = d.getUTCHours();
      switch (this.viewMode) {
        case 0:
          if (year <= this.startDate.getUTCFullYear()
            && month <= this.startDate.getUTCMonth()
            && day <= this.startDate.getUTCDate()
            && hour <= this.startDate.getUTCHours()) {
            this.picker.find('.prev').css({visibility: 'hidden'});
          } else {
            this.picker.find('.prev').css({visibility: 'visible'});
          }
          if (year >= this.endDate.getUTCFullYear()
            && month >= this.endDate.getUTCMonth()
            && day >= this.endDate.getUTCDate()
            && hour >= this.endDate.getUTCHours()) {
            this.picker.find('.next').css({visibility: 'hidden'});
          } else {
            this.picker.find('.next').css({visibility: 'visible'});
          }
          break;
        case 1:
          if (year <= this.startDate.getUTCFullYear()
            && month <= this.startDate.getUTCMonth()
            && day <= this.startDate.getUTCDate()) {
            this.picker.find('.prev').css({visibility: 'hidden'});
          } else {
            this.picker.find('.prev').css({visibility: 'visible'});
          }
          if (year >= this.endDate.getUTCFullYear()
            && month >= this.endDate.getUTCMonth()
            && day >= this.endDate.getUTCDate()) {
            this.picker.find('.next').css({visibility: 'hidden'});
          } else {
            this.picker.find('.next').css({visibility: 'visible'});
          }
          break;
        case 2:
          if (year <= this.startDate.getUTCFullYear()
            && month <= this.startDate.getUTCMonth()) {
            this.picker.find('.prev').css({visibility: 'hidden'});
          } else {
            this.picker.find('.prev').css({visibility: 'visible'});
          }
          if (year >= this.endDate.getUTCFullYear()
            && month >= this.endDate.getUTCMonth()) {
            this.picker.find('.next').css({visibility: 'hidden'});
          } else {
            this.picker.find('.next').css({visibility: 'visible'});
          }
          break;
        case 3:
        case 4:
          if (year <= this.startDate.getUTCFullYear()) {
            this.picker.find('.prev').css({visibility: 'hidden'});
          } else {
            this.picker.find('.prev').css({visibility: 'visible'});
          }
          if (year >= this.endDate.getUTCFullYear()) {
            this.picker.find('.next').css({visibility: 'hidden'});
          } else {
            this.picker.find('.next').css({visibility: 'visible'});
          }
          break;
      }
    },
    mousewheel: function (e) {
      e.preventDefault();
      e.stopPropagation();
      if (this.wheelPause) {
        return;
      }
      this.wheelPause = true;
      var originalEvent = e.originalEvent;
      var delta = originalEvent.wheelDelta;
      var mode = delta > 0 ? 1 : (delta === 0) ? 0 : -1;
      if (this.wheelViewModeNavigationInverseDirection) {
        mode = -mode;
      }
      this.showMode(mode);
      setTimeout($.proxy(function () {
        this.wheelPause = false
      }, this), this.wheelViewModeNavigationDelay);
    },
    click: function (e) {
      e.stopPropagation();
      e.preventDefault();
      var target = $(e.target).closest('span, td, th, legend');
      if (target.is('.' + this.icontype)) {
        target = $(target).parent().closest('span, td, th, legend');
      }
      if (target.length === 1) {
        if (target.is('.disabled')) {
          this.element.trigger({
            type:      'outOfRange',
            date:      this.viewDate,
            startDate: this.startDate,
            endDate:   this.endDate
          });
          return;
        }
        switch (target[0].nodeName.toLowerCase()) {
          case 'th':
            switch (target[0].className) {
              case 'switch':
                this.showMode(1);
                break;
              case 'prev':
              case 'next':
                var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1);
                switch (this.viewMode) {
                  case 0:
                    this.viewDate = this.moveHour(this.viewDate, dir);
                    break;
                  case 1:
                    this.viewDate = this.moveDate(this.viewDate, dir);
                    break;
                  case 2:
                    this.viewDate = this.moveMonth(this.viewDate, dir);
                    break;
                  case 3:
                  case 4:
                    this.viewDate = this.moveYear(this.viewDate, dir);
                    break;
                }
                this.fill();
                this.element.trigger({
                  type:      target[0].className + ':' + this.convertViewModeText(this.viewMode),
                  date:      this.viewDate,
                  startDate: this.startDate,
                  endDate:   this.endDate
                });
                break;
              case 'clear':
                this.reset();
                if (this.autoclose) {
                  this.hide();
                }
                break;
              case 'today':
                var date = new Date();
                date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0);
                // Respect startDate and endDate.
                if (date < this.startDate) date = this.startDate;
                else if (date > this.endDate) date = this.endDate;
                this.viewMode = this.startViewMode;
                this.showMode(0);
                this._setDate(date);
                this.fill();
                if (this.autoclose) {
                  this.hide();
                }
                break;
            }
            break;
          case 'span':
            if (!target.is('.disabled')) {
              var year = this.viewDate.getUTCFullYear(),
                month = this.viewDate.getUTCMonth(),
                day = this.viewDate.getUTCDate(),
                hours = this.viewDate.getUTCHours(),
                minutes = this.viewDate.getUTCMinutes(),
                seconds = this.viewDate.getUTCSeconds();
              if (target.is('.month')) {
                this.viewDate.setUTCDate(1);
                month = target.parent().find('span').index(target);
                day = this.viewDate.getUTCDate();
                this.viewDate.setUTCMonth(month);
                this.element.trigger({
                  type: 'changeMonth',
                  date: this.viewDate
                });
                if (this.viewSelect >= 3) {
                  this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0));
                }
              } else if (target.is('.year')) {
                this.viewDate.setUTCDate(1);
                year = parseInt(target.text(), 10) || 0;
                this.viewDate.setUTCFullYear(year);
                this.element.trigger({
                  type: 'changeYear',
                  date: this.viewDate
                });
                if (this.viewSelect >= 4) {
                  this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0));
                }
              } else if (target.is('.hour')) {
                hours = parseInt(target.text(), 10) || 0;
                if (target.hasClass('hour_am') || target.hasClass('hour_pm')) {
                  if (hours === 12 && target.hasClass('hour_am')) {
                    hours = 0;
                  } else if (hours !== 12 && target.hasClass('hour_pm')) {
                    hours += 12;
                  }
                }
                this.viewDate.setUTCHours(hours);
                this.element.trigger({
                  type: 'changeHour',
                  date: this.viewDate
                });
                if (this.viewSelect >= 1) {
                  this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0));
                }
              } else if (target.is('.minute')) {
                minutes = parseInt(target.text().substr(target.text().indexOf(':') + 1), 10) || 0;
                this.viewDate.setUTCMinutes(minutes);
                this.element.trigger({
                  type: 'changeMinute',
                  date: this.viewDate
                });
                if (this.viewSelect >= 0) {
                  this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0));
                }
              }
              if (this.viewMode !== 0) {
                var oldViewMode = this.viewMode;
                this.showMode(-1);
                this.fill();
                if (oldViewMode === this.viewMode && this.autoclose) {
                  this.hide();
                }
              } else {
                this.fill();
                if (this.autoclose) {
                  this.hide();
                }
              }
            }
            break;
          case 'td':
            if (target.is('.day') && !target.is('.disabled')) {
              var day = parseInt(target.text(), 10) || 1;
              var year = this.viewDate.getUTCFullYear(),
                month = this.viewDate.getUTCMonth(),
                hours = this.viewDate.getUTCHours(),
                minutes = this.viewDate.getUTCMinutes(),
                seconds = this.viewDate.getUTCSeconds();
              if (target.is('.old')) {
                if (month === 0) {
                  month = 11;
                  year -= 1;
                } else {
                  month -= 1;
                }
              } else if (target.is('.new')) {
                if (month === 11) {
                  month = 0;
                  year += 1;
                } else {
                  month += 1;
                }
              }
              this.viewDate.setUTCFullYear(year);
              this.viewDate.setUTCMonth(month, day);
              this.element.trigger({
                type: 'changeDay',
                date: this.viewDate
              });
              if (this.viewSelect >= 2) {
                this._setDate(UTCDate(year, month, day, hours, minutes, seconds, 0));
              }
            }
            var oldViewMode = this.viewMode;
            this.showMode(-1);
            this.fill();
            if (oldViewMode === this.viewMode && this.autoclose) {
              this.hide();
            }
            break;
        }
      }
    },
    _setDate: function (date, which) {
      if (!which || which === 'date')
        this.date = date;
      if (!which || which === 'view')
        this.viewDate = date;
      this.fill();
      this.setValue();
      var element;
      if (this.isInput) {
        element = this.element;
      } else if (this.component) {
        element = this.element.find('input');
      }
      if (element) {
        element.change();
      }
      this.element.trigger({
        type: 'changeDate',
        date: this.getDate()
      });
      if(date === null)
        this.date = this.viewDate;
    },
    moveMinute: function (date, dir) {
      if (!dir) return date;
      var new_date = new Date(date.valueOf());
      //dir = dir > 0 ? 1 : -1;
      new_date.setUTCMinutes(new_date.getUTCMinutes() + (dir * this.minuteStep));
      return new_date;
    },
    moveHour: function (date, dir) {
      if (!dir) return date;
      var new_date = new Date(date.valueOf());
      //dir = dir > 0 ? 1 : -1;
      new_date.setUTCHours(new_date.getUTCHours() + dir);
      return new_date;
    },
    moveDate: function (date, dir) {
      if (!dir) return date;
      var new_date = new Date(date.valueOf());
      //dir = dir > 0 ? 1 : -1;
      new_date.setUTCDate(new_date.getUTCDate() + dir);
      return new_date;
    },
    moveMonth: function (date, dir) {
      if (!dir) return date;
      var new_date = new Date(date.valueOf()),
        day = new_date.getUTCDate(),
        month = new_date.getUTCMonth(),
        mag = Math.abs(dir),
        new_month, test;
      dir = dir > 0 ? 1 : -1;
      if (mag === 1) {
        test = dir === -1
          // If going back one month, make sure month is not current month
          // (eg, Mar 31 -> Feb 31 === Feb 28, not Mar 02)
          ? function () {
          return new_date.getUTCMonth() === month;
        }
          // If going forward one month, make sure month is as expected
          // (eg, Jan 31 -> Feb 31 === Feb 28, not Mar 02)
          : function () {
          return new_date.getUTCMonth() !== new_month;
        };
        new_month = month + dir;
        new_date.setUTCMonth(new_month);
        // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
        if (new_month < 0 || new_month > 11)
          new_month = (new_month + 12) % 12;
      } else {
        // For magnitudes >1, move one month at a time...
        for (var i = 0; i < mag; i++)
          // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
          new_date = this.moveMonth(new_date, dir);
        // ...then reset the day, keeping it in the new month
        new_month = new_date.getUTCMonth();
        new_date.setUTCDate(day);
        test = function () {
          return new_month !== new_date.getUTCMonth();
        };
      }
      // Common date-resetting loop -- if date is beyond end of month, make it
      // end of month
      while (test()) {
        new_date.setUTCDate(--day);
        new_date.setUTCMonth(new_month);
      }
      return new_date;
    },
    moveYear: function (date, dir) {
      return this.moveMonth(date, dir * 12);
    },
    dateWithinRange: function (date) {
      return date >= this.startDate && date <= this.endDate;
    },
    keydown: function (e) {
      if (this.picker.is(':not(:visible)')) {
        if (e.keyCode === 27) // allow escape to hide and re-show picker
          this.show();
        return;
      }
      var dateChanged = false,
        dir, newDate, newViewDate;
      switch (e.keyCode) {
        case 27: // escape
          this.hide();
          e.preventDefault();
          break;
        case 37: // left
        case 39: // right
          if (!this.keyboardNavigation) break;
          dir = e.keyCode === 37 ? -1 : 1;
          var viewMode = this.viewMode;
          if (e.ctrlKey) {
            viewMode += 2;
          } else if (e.shiftKey) {
            viewMode += 1;
          }
          if (viewMode === 4) {
            newDate = this.moveYear(this.date, dir);
            newViewDate = this.moveYear(this.viewDate, dir);
          } else if (viewMode === 3) {
            newDate = this.moveMonth(this.date, dir);
            newViewDate = this.moveMonth(this.viewDate, dir);
          } else if (viewMode === 2) {
            newDate = this.moveDate(this.date, dir);
            newViewDate = this.moveDate(this.viewDate, dir);
          } else if (viewMode === 1) {
            newDate = this.moveHour(this.date, dir);
            newViewDate = this.moveHour(this.viewDate, dir);
          } else if (viewMode === 0) {
            newDate = this.moveMinute(this.date, dir);
            newViewDate = this.moveMinute(this.viewDate, dir);
          }
          if (this.dateWithinRange(newDate)) {
            this.date = newDate;
            this.viewDate = newViewDate;
            this.setValue();
            this.update();
            e.preventDefault();
            dateChanged = true;
          }
          break;
        case 38: // up
        case 40: // down
          if (!this.keyboardNavigation) break;
          dir = e.keyCode === 38 ? -1 : 1;
          viewMode = this.viewMode;
          if (e.ctrlKey) {
            viewMode += 2;
          } else if (e.shiftKey) {
            viewMode += 1;
          }
          if (viewMode === 4) {
            newDate = this.moveYear(this.date, dir);
            newViewDate = this.moveYear(this.viewDate, dir);
          } else if (viewMode === 3) {
            newDate = this.moveMonth(this.date, dir);
            newViewDate = this.moveMonth(this.viewDate, dir);
          } else if (viewMode === 2) {
            newDate = this.moveDate(this.date, dir * 7);
            newViewDate = this.moveDate(this.viewDate, dir * 7);
          } else if (viewMode === 1) {
            if (this.showMeridian) {
              newDate = this.moveHour(this.date, dir * 6);
              newViewDate = this.moveHour(this.viewDate, dir * 6);
            } else {
              newDate = this.moveHour(this.date, dir * 4);
              newViewDate = this.moveHour(this.viewDate, dir * 4);
            }
          } else if (viewMode === 0) {
            newDate = this.moveMinute(this.date, dir * 4);
            newViewDate = this.moveMinute(this.viewDate, dir * 4);
          }
          if (this.dateWithinRange(newDate)) {
            this.date = newDate;
            this.viewDate = newViewDate;
            this.setValue();
            this.update();
            e.preventDefault();
            dateChanged = true;
          }
          break;
        case 13: // enter
          if (this.viewMode !== 0) {
            var oldViewMode = this.viewMode;
            this.showMode(-1);
            this.fill();
            if (oldViewMode === this.viewMode && this.autoclose) {
              this.hide();
            }
          } else {
            this.fill();
            if (this.autoclose) {
              this.hide();
            }
          }
          e.preventDefault();
          break;
        case 9: // tab
          this.hide();
          break;
      }
      if (dateChanged) {
        var element;
        if (this.isInput) {
          element = this.element;
        } else if (this.component) {
          element = this.element.find('input');
        }
        if (element) {
          element.change();
        }
        this.element.trigger({
          type: 'changeDate',
          date: this.getDate()
        });
      }
    },
    showMode: function (dir) {
      if (dir) {
        var newViewMode = Math.max(0, Math.min(DPGlobal.modes.length - 1, this.viewMode + dir));
        if (newViewMode >= this.minView && newViewMode <= this.maxView) {
          this.element.trigger({
            type:        'changeMode',
            date:        this.viewDate,
            oldViewMode: this.viewMode,
            newViewMode: newViewMode
          });
          this.viewMode = newViewMode;
        }
      }
      /*
       vitalets: fixing bug of very special conditions:
       jquery 1.7.1 + webkit + show inline datetimepicker in bootstrap popover.
       Method show() does not set display css correctly and datetimepicker is not shown.
       Changed to .css('display', 'block') solve the problem.
       See https://github.com/vitalets/x-editable/issues/37
       In jquery 1.7.2+ everything works fine.
       */
      //this.picker.find('>div').hide().filter('.datetimepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
      this.picker.find('>div').hide().filter('.datetimepicker-' + DPGlobal.modes[this.viewMode].clsName).css('display', 'block');
      this.updateNavArrows();
    },
    reset: function () {
      this._setDate(null, 'date');
    },
    convertViewModeText:  function (viewMode) {
      switch (viewMode) {
        case 4:
          return 'decade';
        case 3:
          return 'year';
        case 2:
          return 'month';
        case 1:
          return 'day';
        case 0:
          return 'hour';
      }
    }
  };
  var old = $.fn.datetimepicker;
  $.fn.datetimepicker = function (option) {
    var args = Array.apply(null, arguments);
    args.shift();
    var internal_return;
    this.each(function () {
      var $this = $(this),
        data = $this.data('datetimepicker'),
        options = typeof option === 'object' && option;
      if (!data) {
        $this.data('datetimepicker', (data = new Datetimepicker(this, $.extend({}, $.fn.datetimepicker.defaults, options))));
      }
      if (typeof option === 'string' && typeof data[option] === 'function') {
        internal_return = data[option].apply(data, args);
        if (internal_return !== undefined) {
          return false;
        }
      }
    });
    if (internal_return !== undefined)
      return internal_return;
    else
      return this;
  };
  $.fn.datetimepicker.defaults = {
  };
  $.fn.datetimepicker.Constructor = Datetimepicker;
  var dates = $.fn.datetimepicker.dates = {
    en: {
      days:        ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
      daysShort:   ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      daysMin:     ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
      months:      ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
      monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
      meridiem:    ['am', 'pm'],
      suffix:      ['st', 'nd', 'rd', 'th'],
      today:       'Today',
      clear:       'Clear'
    }
  };
  var DPGlobal = {
    modes:            [
      {
        clsName: 'minutes',
        navFnc:  'Hours',
        navStep: 1
      },
      {
        clsName: 'hours',
        navFnc:  'Date',
        navStep: 1
      },
      {
        clsName: 'days',
        navFnc:  'Month',
        navStep: 1
      },
      {
        clsName: 'months',
        navFnc:  'FullYear',
        navStep: 1
      },
      {
        clsName: 'years',
        navFnc:  'FullYear',
        navStep: 10
      }
    ],
    isLeapYear:       function (year) {
      return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
    },
    getDaysInMonth:   function (year, month) {
      return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
    },
    getDefaultFormat: function (type, field) {
      if (type === 'standard') {
        if (field === 'input')
          return 'yyyy-mm-dd hh:ii';
        else
          return 'yyyy-mm-dd hh:ii:ss';
      } else if (type === 'php') {
        if (field === 'input')
          return 'Y-m-d H:i';
        else
          return 'Y-m-d H:i:s';
      } else {
        throw new Error('Invalid format type.');
      }
    },
    validParts: function (type) {
      if (type === 'standard') {
        return /t|hh?|HH?|p|P|z|Z|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;
      } else if (type === 'php') {
        return /[dDjlNwzFmMnStyYaABgGhHis]/g;
      } else {
        throw new Error('Invalid format type.');
      }
    },
    nonpunctuation: /[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,
    parseFormat: function (format, type) {
      // IE treats \0 as a string end in inputs (truncating the value),
      // so it's a bad format delimiter, anyway
      var separators = format.replace(this.validParts(type), '\0').split('\0'),
        parts = format.match(this.validParts(type));
      if (!separators || !separators.length || !parts || parts.length === 0) {
        throw new Error('Invalid date format.');
      }
      return {separators: separators, parts: parts};
    },
    parseDate: function (date, format, language, type, timezone) {
      if (date instanceof Date) {
        var dateUTC = new Date(date.valueOf() - date.getTimezoneOffset() * 60000);
        dateUTC.setMilliseconds(0);
        return dateUTC;
      }
      if (/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(date)) {
        format = this.parseFormat('yyyy-mm-dd', type);
      }
      if (/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(date)) {
        format = this.parseFormat('yyyy-mm-dd hh:ii', type);
      }
      if (/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(date)) {
        format = this.parseFormat('yyyy-mm-dd hh:ii:ss', type);
      }
      if (/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(date)) {
        var part_re = /([-+]\d+)([dmwy])/,
          parts = date.match(/([-+]\d+)([dmwy])/g),
          part, dir;
        date = new Date();
        for (var i = 0; i < parts.length; i++) {
          part = part_re.exec(parts[i]);
          dir = parseInt(part[1]);
          switch (part[2]) {
            case 'd':
              date.setUTCDate(date.getUTCDate() + dir);
              break;
            case 'm':
              date = Datetimepicker.prototype.moveMonth.call(Datetimepicker.prototype, date, dir);
              break;
            case 'w':
              date.setUTCDate(date.getUTCDate() + dir * 7);
              break;
            case 'y':
              date = Datetimepicker.prototype.moveYear.call(Datetimepicker.prototype, date, dir);
              break;
          }
        }
        return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), 0);
      }
      var parts = date && date.toString().match(this.nonpunctuation) || [],
        date = new Date(0, 0, 0, 0, 0, 0, 0),
        parsed = {},
        setters_order = ['hh', 'h', 'ii', 'i', 'ss', 's', 'yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'D', 'DD', 'd', 'dd', 'H', 'HH', 'p', 'P', 'z', 'Z'],
        setters_map = {
          hh:   function (d, v) {
            return d.setUTCHours(v);
          },
          h:    function (d, v) {
            return d.setUTCHours(v);
          },
          HH:   function (d, v) {
            return d.setUTCHours(v === 12 ? 0 : v);
          },
          H:    function (d, v) {
            return d.setUTCHours(v === 12 ? 0 : v);
          },
          ii:   function (d, v) {
            return d.setUTCMinutes(v);
          },
          i:    function (d, v) {
            return d.setUTCMinutes(v);
          },
          ss:   function (d, v) {
            return d.setUTCSeconds(v);
          },
          s:    function (d, v) {
            return d.setUTCSeconds(v);
          },
          yyyy: function (d, v) {
            return d.setUTCFullYear(v);
          },
          yy:   function (d, v) {
            return d.setUTCFullYear(2000 + v);
          },
          m:    function (d, v) {
            v -= 1;
            while (v < 0) v += 12;
            v %= 12;
            d.setUTCMonth(v);
            while (d.getUTCMonth() !== v)
              if (isNaN(d.getUTCMonth()))
                return d;
              else
                d.setUTCDate(d.getUTCDate() - 1);
            return d;
          },
          d:    function (d, v) {
            return d.setUTCDate(v);
          },
          p:    function (d, v) {
            return d.setUTCHours(v === 1 ? d.getUTCHours() + 12 : d.getUTCHours());
          },
          z:    function () {
            return timezone
          }
        },
        val, filtered, part;
      setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m'];
      setters_map['dd'] = setters_map['d'];
      setters_map['P'] = setters_map['p'];
      setters_map['Z'] = setters_map['z'];
      date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds());
      if (parts.length === format.parts.length) {
        for (var i = 0, cnt = format.parts.length; i < cnt; i++) {
          val = parseInt(parts[i], 10);
          part = format.parts[i];
          if (isNaN(val)) {
            switch (part) {
              case 'MM':
                filtered = $(dates[language].months).filter(function () {
                  var m = this.slice(0, parts[i].length),
                    p = parts[i].slice(0, m.length);
                  return m === p;
                });
                val = $.inArray(filtered[0], dates[language].months) + 1;
                break;
              case 'M':
                filtered = $(dates[language].monthsShort).filter(function () {
                  var m = this.slice(0, parts[i].length),
                    p = parts[i].slice(0, m.length);
                  return m.toLowerCase() === p.toLowerCase();
                });
                val = $.inArray(filtered[0], dates[language].monthsShort) + 1;
                break;
              case 'p':
              case 'P':
                val = $.inArray(parts[i].toLowerCase(), dates[language].meridiem);
                break;
              case 'z':
              case 'Z':
                timezone;
                break;
            }
          }
          parsed[part] = val;
        }
        for (var i = 0, s; i < setters_order.length; i++) {
          s = setters_order[i];
          if (s in parsed && !isNaN(parsed[s]))
            setters_map[s](date, parsed[s])
        }
      }
      return date;
    },
    formatDate:       function (date, format, language, type, timezone) {
      if (date === null) {
        return '';
      }
      var val;
      if (type === 'standard') {
        val = {
          t:    date.getTime(),
          // year
          yy:   date.getUTCFullYear().toString().substring(2),
          yyyy: date.getUTCFullYear(),
          // month
          m:    date.getUTCMonth() + 1,
          M:    dates[language].monthsShort[date.getUTCMonth()],
          MM:   dates[language].months[date.getUTCMonth()],
          // day
          d:    date.getUTCDate(),
          D:    dates[language].daysShort[date.getUTCDay()],
          DD:   dates[language].days[date.getUTCDay()],
          p:    (dates[language].meridiem.length === 2 ? dates[language].meridiem[date.getUTCHours() < 12 ? 0 : 1] : ''),
          // hour
          h:    date.getUTCHours(),
          // minute
          i:    date.getUTCMinutes(),
          // second
          s:    date.getUTCSeconds(),
          // timezone
          z:    timezone
        };
        if (dates[language].meridiem.length === 2) {
          val.H = (val.h % 12 === 0 ? 12 : val.h % 12);
        }
        else {
          val.H = val.h;
        }
        val.HH = (val.H < 10 ? '0' : '') + val.H;
        val.P = val.p.toUpperCase();
        val.Z = val.z;
        val.hh = (val.h < 10 ? '0' : '') + val.h;
        val.ii = (val.i < 10 ? '0' : '') + val.i;
        val.ss = (val.s < 10 ? '0' : '') + val.s;
        val.dd = (val.d < 10 ? '0' : '') + val.d;
        val.mm = (val.m < 10 ? '0' : '') + val.m;
      } else if (type === 'php') {
        // php format
        val = {
          // year
          y: date.getUTCFullYear().toString().substring(2),
          Y: date.getUTCFullYear(),
          // month
          F: dates[language].months[date.getUTCMonth()],
          M: dates[language].monthsShort[date.getUTCMonth()],
          n: date.getUTCMonth() + 1,
          t: DPGlobal.getDaysInMonth(date.getUTCFullYear(), date.getUTCMonth()),
          // day
          j: date.getUTCDate(),
          l: dates[language].days[date.getUTCDay()],
          D: dates[language].daysShort[date.getUTCDay()],
          w: date.getUTCDay(), // 0 -> 6
          N: (date.getUTCDay() === 0 ? 7 : date.getUTCDay()),       // 1 -> 7
          S: (date.getUTCDate() % 10 <= dates[language].suffix.length ? dates[language].suffix[date.getUTCDate() % 10 - 1] : ''),
          // hour
          a: (dates[language].meridiem.length === 2 ? dates[language].meridiem[date.getUTCHours() < 12 ? 0 : 1] : ''),
          g: (date.getUTCHours() % 12 === 0 ? 12 : date.getUTCHours() % 12),
          G: date.getUTCHours(),
          // minute
          i: date.getUTCMinutes(),
          // second
          s: date.getUTCSeconds()
        };
        val.m = (val.n < 10 ? '0' : '') + val.n;
        val.d = (val.j < 10 ? '0' : '') + val.j;
        val.A = val.a.toString().toUpperCase();
        val.h = (val.g < 10 ? '0' : '') + val.g;
        val.H = (val.G < 10 ? '0' : '') + val.G;
        val.i = (val.i < 10 ? '0' : '') + val.i;
        val.s = (val.s < 10 ? '0' : '') + val.s;
      } else {
        throw new Error('Invalid format type.');
      }
      var date = [],
        seps = $.extend([], format.separators);
      for (var i = 0, cnt = format.parts.length; i < cnt; i++) {
        if (seps.length) {
          date.push(seps.shift());
        }
        date.push(val[format.parts[i]]);
      }
      if (seps.length) {
        date.push(seps.shift());
      }
      return date.join('');
    },
    convertViewMode:  function (viewMode) {
      switch (viewMode) {
        case 4:
        case 'decade':
          viewMode = 4;
          break;
        case 3:
        case 'year':
          viewMode = 3;
          break;
        case 2:
        case 'month':
          viewMode = 2;
          break;
        case 1:
        case 'day':
          viewMode = 1;
          break;
        case 0:
        case 'hour':
          viewMode = 0;
          break;
      }
      return viewMode;
    },
    headTemplate: '<thead>' +
                '<tr>' +
                '<th class="prev"><i class="{iconType} {leftArrow}"/></th>' +
                '<th colspan="5" class="switch"></th>' +
                '<th class="next"><i class="{iconType} {rightArrow}"/></th>' +
                '</tr>' +
      '</thead>',
    headTemplateV3: '<thead>' +
                '<tr>' +
                '<th class="prev"><span class="{iconType} {leftArrow}"></span> </th>' +
                '<th colspan="5" class="switch"></th>' +
                '<th class="next"><span class="{iconType} {rightArrow}"></span> </th>' +
                '</tr>' +
      '</thead>',
    contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>',
    footTemplate: '<tfoot>' + 
                    '<tr><th colspan="7" class="today"></th></tr>' +
                    '<tr><th colspan="7" class="clear"></th></tr>' +
                  '</tfoot>'
  };
  DPGlobal.template = '<div class="datetimepicker">' +
    '<div class="datetimepicker-minutes">' +
    '<table class=" table-condensed">' +
    DPGlobal.headTemplate +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-hours">' +
    '<table class=" table-condensed">' +
    DPGlobal.headTemplate +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-days">' +
    '<table class=" table-condensed">' +
    DPGlobal.headTemplate +
    '<tbody></tbody>' +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-months">' +
    '<table class="table-condensed">' +
    DPGlobal.headTemplate +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-years">' +
    '<table class="table-condensed">' +
    DPGlobal.headTemplate +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '</div>';
  DPGlobal.templateV3 = '<div class="datetimepicker">' +
    '<div class="datetimepicker-minutes">' +
    '<table class=" table-condensed">' +
    DPGlobal.headTemplateV3 +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-hours">' +
    '<table class=" table-condensed">' +
    DPGlobal.headTemplateV3 +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-days">' +
    '<table class=" table-condensed">' +
    DPGlobal.headTemplateV3 +
    '<tbody></tbody>' +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-months">' +
    '<table class="table-condensed">' +
    DPGlobal.headTemplateV3 +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '<div class="datetimepicker-years">' +
    '<table class="table-condensed">' +
    DPGlobal.headTemplateV3 +
    DPGlobal.contTemplate +
    DPGlobal.footTemplate +
    '</table>' +
    '</div>' +
    '</div>';
  $.fn.datetimepicker.DPGlobal = DPGlobal;
  /* DATETIMEPICKER NO CONFLICT
   * =================== */
  $.fn.datetimepicker.noConflict = function () {
    $.fn.datetimepicker = old;
    return this;
  };
  /* DATETIMEPICKER DATA-API
   * ================== */
  $(document).on(
    'focus.datetimepicker.data-api click.datetimepicker.data-api',
    '[data-provide="datetimepicker"]',
    function (e) {
      var $this = $(this);
      if ($this.data('datetimepicker')) return;
      e.preventDefault();
      // component click requires us to explicitly show it
      $this.datetimepicker('show');
    }
  );
  $(function () {
    $('[data-provide="datetimepicker-inline"]').datetimepicker();
  });
}));

File diff suppressed because it is too large
+ 1 - 0
js/plugins/datetimepicker/bootstrap-datetimepicker.min.js


+ 16 - 0
js/plugins/datetimepicker/bootstrap-datetimepicker.zh-CN.js

@ -0,0 +1,16 @@
/**
 * Simplified Chinese translation for bootstrap-datetimepicker
 * Yuan Cheung <advanimal@gmail.com>
 */
;(function($){
	$.fn.datetimepicker.dates['zh-CN'] = {
			days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
			daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
			daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
			months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
			monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
			today: "今天",
			suffix: [],
			meridiem: ["上午", "下午"]
	};
}(jQuery));

+ 6 - 6
js/plugins/layer/skin/moon/style.css

@ -79,12 +79,12 @@ body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin {
body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover {
	background: url(default.png) no-repeat -16px 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2 {
	background: url(default.png) 0 0;
}
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover {
	background: url(default.png) -48px 0;
}
/*body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2 {
	background: url(default.png) 1px -40px;
}*/
/*body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover {
	background: url(default.png) -48px 0;
}*/
body .layer-ext-moon .layui-layer-padding{padding-top: 24px;}
body .layer-ext-moon .layui-layer-btn {
	padding: 15px 0;

+ 1 - 0
jw-prescription-info.html

@ -27,6 +27,7 @@
    </div>
    <div class="c-tac mb20 mt20">
        <button id="fvBtn" type="button" class="btn btn-w-m btn-primary mlr20" style="display: none;">填入随访记录</button>
        <button id="backBtn" type="button" class="btn btn-w-m btn-danger mlr20">返回</button>
    </div>

+ 153 - 0
page/followup/drugs.html

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="renderer" content="webkit">
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <title>用药情况</title>
        <meta name="description" content="">
        <link rel="shortcut icon" href="../../favicon.ico">
        <link rel="stylesheet" type="text/css" href="../../css/font-awesome.min93e3.css"/>
        <link href="../../css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="../../css/plugins/chosen/chosen.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/plugins/toastr/toastr.min.css"/>
        <link rel="stylesheet" type="text/css" href="../../js/plugins/layer/skin/layer.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/followup.css"/>
    </head>
    <body>
        <form id="question_form" class="" onsubmit="return false;">
            <div class="clearfix form-info">
                <h1 class="text-center mb30" style="font-size: 20px;">6、用药情况</h1>
                <div class="form-group">
                    <label class="fl h34 lh34">服药依从性:</label>
                    <div class="input-group col-xs-6" style="width: 120px;">
                        <select name="DRUG_COMPLIANCE_CODE" class="my_select_box form-control" >
                            <option value="undefined">请选择</option>
                            <option value="1">规律服药</option>
                            <option value="2">间断服药</option>
                            <option value="3">不服药</option>
                        </select>
                    </div>
                </div>
            </div>
            <table class="table" id="table1">
                <thead>
                    <tr>
                        <th>药品名称</th>
                        <th>次剂量</th>
                        <th>单位</th>
                        <th>频次</th>
                    </tr>
                </thead>
                <tbody>
                    
                </tbody>
            </table>
            <table class="table" id="table2">
                <thead>
                    <tr>
                        <th>胰岛素药品名称</th>
                        <th>次剂量</th>
                        <th>单位</th>
                        <th>频次</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
        </form>
        <div class="mlr30 ui-grid">
            <div class="ui-col-1">
                <a class="link-blue" id="getPrescription">从居民用药记录中获取</a>
            </div>
            <div class="ui-col-1 text-right">
                <a class="link-red">清空用药信息</a>
            </div>
        </div>
        <div class="text-center mt40 mb30">
            <button type="submit" id="submitBtn" class="btn btn-blue">保存并下一步</a>
        </div>
        <script type="text/html" id="drug_tmp">
            {{each dataList as it}}
            <tr>
                <td>
                    <div class="input-group">
                        <input type="text" class="form-control j-drugName" data-id="{{it.drugsCode}}" value="{{it.drugsName}}" placeholder="请输入药品名称或拼音首码">
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </td>
                <td><input type="text" class="form-control dose" size="5" value="{{it.dose}}"></td>
                <td>
                    <div class="input-group" style="width: 110px;">
                        <input type="text" class="form-control unit-select" data-id="{{it.unit}}" value="{{it.unitName}}" placeholder="请选择">
                        <span><i class="fa fa-angle-down c-arrow"></i></span>
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="input-group" style="width: 110px;">
                        <input type="text" class="form-control frequency-select" data-id="{{it.frequency}}" value="{{it.frequencyName}}" placeholder="请选择">
                        <span><i class="fa fa-angle-down c-arrow"></i></span>
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </td>
            </tr>
            {{/each}}
            {{each emptyList as it}}
            <tr>
                <td>
                    <div class="input-group">
                        <input type="text" class="form-control j-drugName" placeholder="请输入药品名称或拼音首码">
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </td>
                <td><input type="text" class="form-control dose" size="5" value=""></td>
                <td>
                    <div class="input-group" style="width: 110px;">
                        <input type="text" class="form-control unit-select" placeholder="请选择">
                        <span><i class="fa fa-angle-down c-arrow"></i></span>
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="input-group" style="width: 110px;">
                        <input type="text" class="form-control frequency-select" placeholder="请选择">
                        <span><i class="fa fa-angle-down c-arrow"></i></span>
                        <div class="input-group-btn">
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </td>
            </tr>
            {{/each}}
        </script>
        <script src="../../js/jquery.min.js?v=2.1.4"></script>
        <script src="../../js/bootstrap.min.js?v=3.3.6"></script>
        <script src="../../js/plugins/toastr/toastr.min.js"></script>
        <script src="../../js/plugins/pace/pace.min.js"></script>
        <script src="../../js/plugins/chosen/chosen.jquery.js " type="text/javascript" charset="utf-8"></script>
        <script src="../../js/plugins/layer/layer.min.js"></script>
        <script src="../../js/plugins/suggest/bootstrap-suggest.min.js"></script>
        <script src="../../js/template.js"></script>
        <script src="../../js/util.js"></script>
        <script src="../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/api-service.js"></script>
        <script src="../../js/followup-api.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/buz/followup/template_gxy.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/buz/followup/measure_unit_dict.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/buz/followup/recipe_frequency_dict.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/buz/followup/drugs.js" type="text/javascript" charset="utf-8"></script>
    </body>
</html>

+ 27 - 0
page/followup/followup-main.html

@ -0,0 +1,27 @@
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>随访的框架主页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <script src="../../js/jquery.min.js?v=2.1.4"></script>
    <script src="../../js/plugins/pace/pace.min.js"></script>
    <script>
        var search = window.location.search;
        var url = 'followup-tabs.html'+search;
        window.onload = function(){
            document.getElementById("fv_tab").src = url;
            document.getElementById("fv_main").src = "followup-register.html"+search;
        }
        
    </script>
</head>
    <frameset cols="130, *" frameborder="NO" border="0" framespacing="0">
        <frame src="about:blank" noresize="noresize" id="fv_tab">
        <frame src="about:blank" name="view_frame2" id="fv_main" noresize="noresize">
    </frameset>
</html>

+ 66 - 0
page/followup/followup-prescriptions.html

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>居民用药记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../../css/plugins/toastr/toastr.min.css"/>
    <link href="../../css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/followup.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/index-layer.css"/>
</head>
<body>
    <div class="plr20 ptb20">
        <table id="prescritionInfo" data-mobile-responsive="true" data-show-header="false" cellspacing="10" border="0">
        </table>
    </div>
    
    <script type="text/html" id="prescription_tmp">
        <div class="ui-grid pl10 ui-grid-middle mb10">
            <div class="ui-col-0" style="width: 70px"><span class="status-tag">门诊</span></div>
            <div class="ui-col-1">{{hospitalName}}</div>
            <div class="ui-col-0 c-999" style="width: 120px;">{{createTime}}</div>
        </div>
        <div class="ui-grid ui-grid-middle pl10">
            <div class="ui-col-1">
                <span>临床诊断:</span>
                <span>
                    {{each prescriptionDt as dt index}}
                    {{if index == 0}}
                        {{dt.name}}
                    {{else}}
                        ,{{dt.name}}
                    {{/if}}
                    {{/each}}
                </span>
            </div>
            <div class="ui-col-0" style="width: 200px">
                <span>开方医生:</span>
                <span>{{doctorName}}</span>
            </div>
            <!--<div class="ui-col-0" style="width: 86px">
                <a class="link-blue">填入随访记录</a>
            </div>-->
        </div>
    </script>
    <script src="../../js/jquery.min.js?v=2.1.4"></script>
    <script src="../../js/bootstrap.min.js?v=3.3.6"></script>
    <script src="../../js/plugins/toastr/toastr.min.js"></script>
    <script src="../../js/plugins/pace/pace.min.js"></script>
    <script src="../../js/plugins/chosen/chosen.jquery.js " type="text/javascript" charset="utf-8"></script>
    <script src="../../js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="../../js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="../../js/template.js"></script>
    <script src="../../js/util.js"></script>
    <script src="../../js/api-service.js"></script>
    <script src="../../js/followup-api.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/buz/followup/followup-prescription.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

+ 79 - 0
page/followup/followup-register.html

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>随访登记</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" type="text/css" href="../../css/font-awesome.min93e3.css"/>
    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="../../css/plugins/toastr/toastr.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/plugins/datetimepicker/bootstrap-datetimepicker.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/plugins/chosen/chosen.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/followup.css"/>
    <style>
        form{
            width: 350px;
            margin: 0px auto;
        }
    </style>
</head>
<body>
    <div class="container">
    <form onsubmit="return false;" role="form" class="form-horizontal mt40">
        <div class="form-group">
            <label class="col-xs-3 control-label" for="doneDate"><span class="required"></span>完成时间</label>
            <div class="input-group col-xs-9 date ">
                <input type="text" class="form-control input-sm form_datetime" id="doneDate" data-val="date" readonly="readonly" placeholder="">
                <i class="fa fa-angle-down c-arrow"></i>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-3 control-label" for="followupType"><span class="required"></span>随访方式</label>
            <div class="input-group col-xs-9">
                <input type="text" class="form-control input-sm" readonly="readonly" id="followupType">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-3 control-label" for="followupClass"><span class="required"></span>随访类型</label>
            <div class="input-group col-xs-9">
                <input type="text" class="form-control input-sm" readonly="readonly" id="followupClass">
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-3 control-label" for="followupStatus">随访状态</label>
            <div class="input-group col-xs-9">
                <select id="followupStatus" class="form-control my_select_box" tabindex="-1"></select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-3 control-label" for="nextDate"><span class="required"></span>下次随访</label>
            <div class="input-group col-xs-9 date">
                <input type="text" class="form-control input-sm form_datetime" id="nextDate" data-val="date" readonly="readonly" placeholder="">
                <i class="fa fa-angle-down c-arrow"></i>
            </div>
        </div>
    </form>
    </div>
    <div class="mt60 text-center">
        <a class="btn btn-blue" id="startFU">登记随访结果</a>
    </div>
    <script src="../../js/jquery.min.js?v=2.1.4"></script>
    <script src="../../js/bootstrap.min.js?v=3.3.6"></script>
    <script src="../../js/plugins/toastr/toastr.min.js"></script>
    <script src="../../js/plugins/pace/pace.min.js"></script>
    <script src="../../js/plugins/datetimepicker/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/plugins/datetimepicker/bootstrap-datetimepicker.zh-CN.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/plugins/chosen/chosen.jquery.js " type="text/javascript" charset="utf-8"></script>
    <script src="../../js/template.js"></script>
    <script src="../../js/util.js"></script>
    <script src="../../js/api-service.js"></script>
    <script src="../../js/followup-api.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/buz/followup/followup-register.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>

+ 63 - 0
page/followup/followup-tabs.html

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>随访菜单页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <style>
        .nav-tabs{
            border-bottom: none;
            border-right: 1px solid #d7dce6;
            background-color: #f5f5fa;
            padding-bottom: 20px;
        }
        .nav-tabs>li{
            width: 100%;
            text-align: center;
            margin-top: 10px;
            position: relative;
            right: -1px;
        }
        .nav-tabs>li>a{
            border-radius: 0;
            margin: 0;
            color: #666;
        }
        .nav-tabs>li.active>a,
        .nav-tabs>li.active>a:focus,
        .nav-tabs>li.active>a:hover{
            color: #12b7f5;
            background-color: #fff;
            border: 1px solid #ddd;
            border-right-color: transparent;
            border-left-color: transparent;
        }
    </style>
</head>

<body class="gray-bg">
    <ul class="nav nav-tabs" id="fv_tabs">
    </ul>
    <script type="text/html" id="fv_tab_tmp">
    {{each list as it index}}
        <li class="{{it.class}}">
            <a href="{{it.url}}" target="view_frame2" data-index="{{index}}">{{it.name}}</a>
        </li>
    {{/each}}
    </script>
    <script src="../../js/jquery.min.js?v=2.1.4"></script>
    <script src="../../js/bootstrap.min.js?v=3.3.6"></script>
    <script src="../../js/plugins/toastr/toastr.min.js"></script>
    <script src="../../js/plugins/pace/pace.min.js"></script>
    <script src="../../js/template.js"></script>
    <script src="../../js/util.js"></script>
    <script src="../../js/api-service.js"></script>
    <script src="../../js/buz/followup/followup-tabs.js"></script>
</body>
</html>

+ 187 - 0
page/followup/questionaires.html

@ -0,0 +1,187 @@
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="renderer" content="webkit">
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <title>体征等信息</title>
        <meta name="description" content="">
        <link rel="shortcut icon" href="../../favicon.ico">
        <link rel="stylesheet" type="text/css" href="../../css/font-awesome.min93e3.css"/>
        <link href="../../css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="../../css/plugins/datapicker/datepicker3.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/plugins/chosen/chosen.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/plugins/toastr/toastr.min.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/plugins/jqgrid/ui.jqgridffe4.css"/>
        <link rel="stylesheet" type="text/css" href="../../css/followup.css"/>
    </head>
    <body>
        <form id="question_form" class="form-inline" onsubmit="return submitForm()">
            <div class="clearfix form-info">
            </div>
            <div class="q-note q-note-3 hidden">空腹、餐后或随机血糖至少需要填写一项</div>
            <div class="q-note q-note-9 hidden">
                <span class="c-bold">温馨提示1:</span>如需达到高血压健康规范管理要求【症状、血压、心率、生活方式指导(运动频率、摄盐情况)、服药依从性】需要登记,并且一年内至少登记4次随访,每次随访时间间隔不能超过3个月。
                <p class="mt10">
                    <span class="c-bold">温馨提示2:</span>如需达到糖尿病健康规范管理要求【症状、血糖、生活方式指导(运动频率)、服药依从性】需要登记,并且一年内至少登记4次随访,每次随访时间间隔不能超过3个月。
                </p>
            </div>
            <div class="text-center mt40">
                <button type="submit" id="submitBtn" class="btn btn-blue disabled">保存并下一步</a>
            </div>
        </form>
        <!-- 弹出模态框 start -->
        <div class="modal fade" tabindex="-1" role="dialog" id="myModal">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">
                    <img src="../../img/shezi_tankuang_icon.png" class="mr10">
                    <span id="modal-title"></span>
                </h4>
              </div>
              <div class="modal-body">
                
              </div>
            </div>
          </div>
        </div>
        <!-- 弹出模态框 end -->
        <script type="text/html" id="item">
            <h1 class="text-center mb30" style="font-size: 20px;">{{pro_id}}、{{title}}</h1>
            <!--type 1-文本输入,2-radio选择,3-checkbox, 4 - textarea-->
            {{each data as it key}}
            {{if it.type == 1}}
            <div class="form-group mr20">
                <label for="{{key}}">
                    {{if it.required == true}}
                    <i class="required"></i>
                    {{/if}}
                    {{it.label}}
                </label>
                {{if it.textType == 'string'}}
                <input type="text" name="{{key}}" id="{{key}}" value="{{it.value}}" {{if it.readonly}}readonly="{{it.readonly}}"{{/if}}class="form-control input-xs" style="width: {{it.width}};"/>
                {{/if}}
                {{if it.textType == 'number'}}
                <input type="number" name="{{key}}" id="{{key}}" value="{{it.value}}" step="0.01" class="form-control input-xs" style="width: {{it.width}};"/>
                {{/if}}
                {{if it.textType == 'date'}}
                <div class="input-group date" style="width:200px">
                    <input type="text" name="{{key}}" id="{{key}}" value="{{it.value}}" data-val="date" class="form-control input-xs form_datetime" style="width: {{it.width}};" readonly="readonly" />
                    <div class="input-group-addon">
                        <!--<span class="glyphicon glyphicon-th"></span>-->
                        <i class="fa fa-calendar"></i>
                    </div>
                </div>
                {{/if}}
                {{if it.textType == 'select'}}
                <div class="input-group" style="width: {{it.width}};">
                <select name="{{key}}" id="{{key}}" class="my_select_box">
                    <option value="undefined">请选择</option>
                    {{each it.options as op}}
                    <option value="{{op.key}}" {{if it.value == op.key}}selected{{/if}}>{{op.value}}</option>
                    {{/each}}
                </select>
                </div>
                {{/if}}
                {{if it.unit}}{{it.unit}}{{/if}}
            </div>
            {{/if}}
            {{if it.type == 5}} 
            <!-- 多级输入框组合 -->
            <div class="form-group mr20 multi-input-group">
                <label for="">
                    {{if it.required == true}}
                    <i class="required"></i>
                    {{/if}}
                    {{it.label}}
                </label>
                {{each it.items as op index}}
                {{if index>0}}{{it.separate}}{{/if}}
                {{if op.textType == 'select'}}
                <div class="input-group" style="width: {{op.width}};">
                    <select name="{{op.name}}" class="my_select_box" >
                        <option value="undefined">请选择</option>
                        {{each op.options as oop}}
                        <option value="{{oop.key}}" {{if op.value == oop.key}}selected{{/if}}>{{oop.value}}</option>
                        {{/each}}
                    </select>
                </div>
                {{else if op.textType == "radio"}}
                    {{each op.options as oop id}}
                    <label class="mr10">
                        <input type="radio" class="icon-checkbox" name="{{op.name}}" value="{{id}}" {{if op.value == id}}checked="checked"{{/if}}>
                        {{oop}}
                    </label>
                    {{/each}}
                {{else}}
                <input type="{{op.textType}}" value="{{op.value}}" name="{{op.name}}" step="0.01" maxlength="{{op.maxLength}}" class="form-control input-sm" style="width: {{op.width}};">
                {{/if}}
                {{/each}}
                {{if it.unit}}{{it.unit}}{{/if}}
            </div>
            {{/if}}
            {{if it.type == 2}}
            <div class="form-group fl">
                <label class="">
                    {{if it.required == true}}
                    <i class="required"></i>
                    {{/if}}
                    {{it.label}}{{if it.unit}}({{it.unit}}){{/if}}
                </label>
                <!--<div class="input-group">-->
                    {{each it.items as op id}}
                    <label class="mr10">
                        <input type="radio" class="icon-checkbox" name="{{key}}" value="{{id}}" {{if it.value == id}}checked="checked"{{/if}}>
                        {{op}}
                    </label>
                    {{/each}}
                <!--</div>-->
            </div>
            {{/if}} 
            {{if it.type == 3}}    
            <div class="form-group fl" style="width: 160px; margin-bottom: 10px;" has-hide="{{it.hide && it.hide.type}}">
                <input type="checkbox" class="icon-checkbox" name="{{key}}" {{if it.value}}checked="checked" value="{{it.value}}"{{else}}value="0"{{/if}}>
                <label>{{it.label}}</label>
            </div>
            {{/if}}
            {{if it.type == 4}}
            <div class="form-group fl" style="width: 100%;">
                <label class="col-xs-0 fl">
                    {{if it.required == true}}
                    <i class="required"></i>
                    {{/if}}
                    {{it.label}}
                    {{if it.unit}}({{it.unit}}){{/if}}
                </label>
                <div class="col-xs-10">
                    <textarea name="{{key}}" rows="{{it.row}}" cols="" maxlength="{{it.maxLength}}" style="width: {{it.width}};">{{it.value}}</textarea>
                    <p class="text-right c-f12 c-909090"><span class="other-count">{{it.valueLength||0}}</span>/{{it.maxLength}}</p>
                </div>
            </div>
            {{/if}}
            
            {{/each}}
        </script>
        <script src="../../js/jquery.min.js?v=2.1.4"></script>
        <script src="../../js/bootstrap.min.js?v=3.3.6"></script>
        <script src="../../js/plugins/toastr/toastr.min.js"></script>
        <script src="../../js/plugins/pace/pace.min.js"></script>
        <script src="../../js/plugins/datapicker/bootstrap-datepicker.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/plugins/chosen/chosen.jquery.js " type="text/javascript" charset="utf-8"></script>
        <script src="../../js/template.js"></script>
        <script src="../../js/util.js"></script>
        <!--<script src="../../js/content.min.js" type="text/javascript" charset="utf-8"></script>-->
        <script src="../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/plugins/jqgrid/jquery.jqGrid.minffe4.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/plugins/jqgrid/i18n/grid.locale-cnffe4.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/api-service.js"></script>
        <script src="../../js/followup-api.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/buz/followup/template_gxy.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/buz/followup/questionaires.js" type="text/javascript" charset="utf-8"></script>
    </body>
</html>