1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- var d = dialog({
- contentType: 'load',
- skin: 'bk-popup'
- });
- var request = GetRequest();
- var code = request.code; //从链接中获得处方code
- $(function(){
- getDetail();
- bindEvents();
- });
- //获取续方详情信息
- function getDetail(){
- d.show();
- var url = "/patient/prescriptionInfo/getContinuedPrescription",
- params = {code: code};
-
- sendPost(url, params, 'json', 'get', queryFailed, function(res){
- if(res.status == 200){
- d.close();
- $("#dateTime").text(res.data.prescription.createTime);
- $("#docName").text(res.data.prescription.doctorName);
- $("#deptName").text(res.data.prescription.hospitalName);
- $("#caDoc").text(res.data.prescription.doctorName);
-
- var deseaseText = "";
- for(i=0; i<res.data.prescriptionDt.length; i++){
- var item = res.data.prescriptionDt[i];
- deseaseText += item.healthProblemName + ' ';
- }
- $("#deseaseDetail").text(deseaseText);
-
- //填充药品信息
- var html = template('rp_tmp', {list: res.data.prescriptionInfo});
- $("#rpList").empty().append(html);
-
- //获取CA认证的信息
- getCAInfo(res.data.prescription.doctor);
- }else{
- queryFailed(res);
- }
- });
- }
- //获取CA认证信息
- function getCAInfo(docCode){
- var url = '/patient/prescriptionInfo/doctor/isAuthentication',
- params = {doctorCode: docCode};
-
- sendPost(url, params, 'json', 'post', queryFailed, function(res){
- if(res.status == 200){
- //type:1、有证书,并有效;2、有证书,已过期;3、无证书,4
- if(res.data.type == 4){
- $("#caType").text('已认证');
- }else{
- $("#caType").text('未认证');
- }
- }else{
- queryFailed(res);
- }
- });
- }
- function bindEvents(){
- $("#xfRecord").on('click', function(){
- //跳转去续方记录页面
- var userAgent = window.localStorage.getItem(agentName),
- userInfo = JSON.parse(userAgent);
- window.location.href = "re-prescription_info.html?code="+code+"&toUser="+userInfo.uid;
- });
- }
- function queryFailed(res){
- d.close();
- if(res && res.msg) {
- dialog({
- contentType: 'tipsbox',
- skin: 'bk-popup',
- content: res.msg
- }).show();
- } else {
- dialog({
- contentType: 'tipsbox',
- skin: 'bk-popup',
- content: '加载失败'
- }).show();
- }
- }
|