|
@ -35,6 +35,41 @@ $(function(){
|
|
return getReviewResultName(status)
|
|
return getReviewResultName(status)
|
|
})
|
|
})
|
|
|
|
|
|
|
|
template.helper('setRestTime',function(minDate,sDate){
|
|
|
|
var now = getNowDate();
|
|
|
|
var createDate = sDate.split(' ');
|
|
|
|
var diff = getDays(createDate[0],now);
|
|
|
|
if(diff<minDate){
|
|
|
|
return '<span style="color:#17b3ec">'+(minDate-diff)+'天</span>'
|
|
|
|
}else{
|
|
|
|
return '<span style="color:#ff4c4c">已用完</span>'
|
|
|
|
}
|
|
|
|
})
|
|
|
|
//相隔几天
|
|
|
|
function getDays(sDate,eDate){
|
|
|
|
var oDate1;
|
|
|
|
var oDate2;
|
|
|
|
var iDays;
|
|
|
|
oDate1= sDate.split("-");
|
|
|
|
oDate2= eDate.split("-");
|
|
|
|
var strDateS = new Date(oDate1[0], oDate1[1]-1, oDate1[2]);
|
|
|
|
var strDateE = new Date(oDate2[0], oDate2[1]-1, oDate2[2]);
|
|
|
|
iDays = parseInt(Math.abs(strDateE - strDateS ) / 1000 / 60 / 60 /24)
|
|
|
|
return iDays ;
|
|
|
|
}
|
|
|
|
//现在时间
|
|
|
|
function getNowDate() {
|
|
|
|
var date = new Date();
|
|
|
|
var year = date.getFullYear();
|
|
|
|
var month = date.getMonth() + 1;
|
|
|
|
var day = date.getDate();
|
|
|
|
var hour = date.getHours();
|
|
|
|
var minute = date.getMinutes();
|
|
|
|
var second = date.getSeconds();
|
|
|
|
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
prescriptionDetailApis.getContinuedPrescriptionAsDoctor({
|
|
prescriptionDetailApis.getContinuedPrescriptionAsDoctor({
|
|
data: {
|
|
data: {
|
|
code: prescriptionCode, // 续方CODE
|
|
code: prescriptionCode, // 续方CODE
|
|
@ -42,48 +77,69 @@ $(function(){
|
|
}
|
|
}
|
|
}).then(function(res) {
|
|
}).then(function(res) {
|
|
if(res.status == 200) {
|
|
if(res.status == 200) {
|
|
var data = res.data;
|
|
|
|
var prescription = data.prescription;
|
|
|
|
var diagnosis = data.diagnosis;
|
|
|
|
strOriginalData = data;
|
|
|
|
|
|
var detailData = res.data;
|
|
|
|
var prescription = detailData.prescription;
|
|
|
|
var diagnosis = detailData.diagnosis;
|
|
|
|
var patient = detailData.patient;
|
|
|
|
strOriginalData = detailData;
|
|
jwHospital = prescription.jwHospital;
|
|
jwHospital = prescription.jwHospital;
|
|
jwDoctorCode = prescription.jwDoctorCode;
|
|
jwDoctorCode = prescription.jwDoctorCode;
|
|
var diagnosisNames = _.pluck(diagnosis,'name').join('、')
|
|
var diagnosisNames = _.pluck(diagnosis,'name').join('、')
|
|
|
|
|
|
if(isLeader) {
|
|
|
|
getDataPromises().then(function(responses) {
|
|
|
|
var deptRes = responses[0],
|
|
|
|
feeRes = responses[1],
|
|
|
|
authRes = responses[2],
|
|
|
|
reasonRes = responses[3];
|
|
|
|
|
|
|
|
$main.html(template('detailTmpl',$.extend({}, data , {
|
|
|
|
diagnosisNames: diagnosisNames,
|
|
|
|
depts: deptRes.data,
|
|
|
|
feeRes: feeRes.data,
|
|
|
|
isAuthentication: authRes.data.type == 4,
|
|
|
|
isLeader: isLeader,
|
|
|
|
reasonTypes: reasonRes.data
|
|
|
|
})))
|
|
|
|
|
|
|
|
bindEvents()
|
|
|
|
}).catch(function(e) {
|
|
|
|
showErrorMsg('初始化失败')
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
$main.html(template('detailTmpl',$.extend({}, data , {
|
|
|
|
diagnosisNames: diagnosisNames,
|
|
|
|
isLeader: isLeader
|
|
|
|
})))
|
|
|
|
|
|
|
|
bindEvents()
|
|
|
|
}
|
|
|
|
|
|
prescriptionDetailApis.getPrescription({
|
|
|
|
data: {
|
|
|
|
code: prescriptionCode,
|
|
|
|
patient: patient.code
|
|
|
|
}
|
|
|
|
}).then(function(res) {
|
|
|
|
|
|
|
|
if(res.status == 200) {
|
|
|
|
|
|
|
|
if(isLeader) {
|
|
|
|
getDataPromises().then(function(responses) {
|
|
|
|
var deptRes = responses[0],
|
|
|
|
feeRes = responses[1],
|
|
|
|
authRes = responses[2],
|
|
|
|
reasonRes = responses[3];
|
|
|
|
|
|
|
|
$main.html(template('detailTmpl',$.extend({}, detailData , {
|
|
|
|
primary: res.data,
|
|
|
|
diagnosisNames: diagnosisNames,
|
|
|
|
depts: deptRes.data,
|
|
|
|
feeRes: feeRes.data,
|
|
|
|
isAuthentication: authRes.data.type == 4,
|
|
|
|
isLeader: isLeader,
|
|
|
|
reasonTypes: reasonRes.data
|
|
|
|
})))
|
|
|
|
|
|
|
|
bindEvents()
|
|
|
|
}).catch(function(e) {
|
|
|
|
showErrorMsg('初始化失败')
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
$main.html(template('detailTmpl',$.extend({}, detailData , {
|
|
|
|
primary: res.data,
|
|
|
|
diagnosisNames: diagnosisNames,
|
|
|
|
isLeader: isLeader
|
|
|
|
})))
|
|
|
|
|
|
|
|
bindEvents()
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
showErrorMsg(res.msg)
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch(function(e){
|
|
|
|
console && console.error(e)
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
} else {
|
|
} else {
|
|
showErrorMsg(res.msg)
|
|
showErrorMsg(res.msg)
|
|
}
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}).catch(function(e){
|
|
|
|
console && console.error(e)
|
|
|
|
})
|
|
|
|
|
|
function bindEvents() {
|
|
function bindEvents() {
|
|
$('#auditResultSel').on('change',function() {
|
|
$('#auditResultSel').on('change',function() {
|