Prechádzať zdrojové kódy

无体征设备、无体征记录屏蔽tab页体征记录按钮

linehang 7 rokov pred
rodič
commit
5b44fff022

+ 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>