Explorar el Código

Merge branch 'master' of linehang/PC-prescription into master

raolu hace 7 años
padre
commit
132461d049
Se han modificado 4 ficheros con 48 adiciones y 5 borrados
  1. 4 0
      js/body-record-api.js
  2. 8 3
      js/buz/body-record.js
  3. 35 2
      js/buz/prescription-tabs.js
  4. 1 0
      prescription-tabs.html

+ 4 - 0
js/body-record-api.js

@ -1,6 +1,10 @@
(function() {
	var bodyRecordApis = {
		// 体征设备判断绑定
		getPatientDevice: function(data) {
			return APIService.httpGet('doctor/device/PatientDeviceList', data);
		},
		// 最后一条数据,用来推算时间
		getBodyRecoredLast: function(data) {
			return APIService.httpGet('doctor/health_index/last', data);

+ 8 - 3
js/buz/body-record.js

@ -108,6 +108,12 @@
			[6.1, 3.9]
		][index];
	};
	// 数据统计
	function totalStauts(zc, pg, pd) {
		$('.is-ok').html("正常:" + zc + "次");
	    $('.is-height').html("偏高:" + pg + "次");
    	$('.is-low').html("偏低:" + pd + "次");
	}
	// 获取最后一条数据
	var dataLast = {patient: patient};
	var lastXT = '',
@ -139,6 +145,7 @@
			toNormal = 0,
			toHigh = 0,
			toLow = 0;
		totalStauts(toNormal, toHigh, toLow);
		$('.danwei').html(tab == 0 ? '单位(mmol/L)' : '单位(mmHg)');
		var	dayNum = 0;
		switch(day) {
@ -209,9 +216,7 @@
	        			};
	        		}
	        	}
	        	$('.is-ok').html("正常:" + toNormal + "次");
	        	$('.is-height').html("偏高:" + toHigh + "次");
	        	$('.is-low').html("偏低:" + toLow + "次");
	        	totalStauts(toNormal, toHigh, toLow);
	        	// 绘制图
	        	myLineChart = new Chart(ctx).Line(dataCanvas, defaults);
	    	}else{

+ 35 - 2
js/buz/prescription-tabs.js

@ -57,6 +57,39 @@ $(function(){
    }
})
// 判断是否有体征设备
function judgeDeviceFn() {
	var recordDevice = {patient: patiCode, page: 1, pagesize: 1};
	bodyRecordApis.getPatientDevice({data: recordDevice}).then(function(res){
		if(res.status == 200){
			if(res.data.length == 0){
                //没有绑定设备
                links[3].class="hidden";
                initPage();
           } else {
           		judgeRecordFn()
           }
    	}else{
        	showWarningMsg(res.msg)
    	}
	})
}
// 判断是否有体征记录
function judgeRecordFn() {
	var recordData = {patient: patiCode};
	bodyRecordApis.getBodyRecoredLast({data: recordData}).then(function(res){
		if(res.status == 200){
			if(!res.data.xt || !res.data.xy) {
				links[3].class="hidden";
			}
			initPage();
    	}else{
        	showWarningMsg(res.msg)
    	}
	})
}
function initPage(){
    links[tab].class="active";
    var html = template('tab_tmp', {list: links});
@ -96,7 +129,7 @@ function getPrescriptionInfo(){
            if(res.data.status < 50){ //支付成功前不会有订单记录
                links[2].class="hidden";
            }
            initPage();
            judgeDeviceFn();
        }else{
            showWarningMsg(res.msg);
        }
@ -122,7 +155,7 @@ function getPrescriptionInfoByCode(){
            if(res.data.prescription.status < 50){ //支付成功前不会有订单记录
                links[2].class="hidden";
            }
            initPage();
            judgeDeviceFn
        }else{
            showWarningMsg(res.msg);
        }

+ 1 - 0
prescription-tabs.html

@ -52,6 +52,7 @@
    <script src="js/util.js"></script>
    <script src="js/api-service.js"></script>
    <script src="js/consulting-api.js"></script>
    <script src="js/body-record-api.js"></script>
    <script src="js/buz/prescription-tabs.js"></script>
</body>
</html>