|
@ -30,10 +30,16 @@
|
|
|
<li class="mb15 c-head">
|
|
|
<div><i class="other-icon"></i><span>自定义标签</span></div>
|
|
|
</li>
|
|
|
<li class="c-list-add">
|
|
|
<!-- <li class="c-list-add">
|
|
|
<div><span id='add-span'>添加标签</span><input maxlength="6" class="add-input" id='labelinput' type="input"/></div>
|
|
|
</li> -->
|
|
|
</ul>
|
|
|
<ul class="c-list msg-list" id='disease-box3'>
|
|
|
<li class="mb15 c-head">
|
|
|
<div><i class="disease-icon"></i><span>疾病类型</span></div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
<script src="../../../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
|
|
|
<script src="../../../js/app.js" type="text/javascript" charset="utf-8"></script>
|
|
@ -154,7 +160,6 @@
|
|
|
var disease=[];
|
|
|
var custom =[];
|
|
|
var diseaseName = [];
|
|
|
|
|
|
$("#disease-box2 .active-icon").each(function(){
|
|
|
var val = $(this).attr("data-code");
|
|
|
health.push(val);
|
|
@ -170,13 +175,14 @@
|
|
|
custom.push(val);
|
|
|
diseaseName.push($(this).attr("data-name"));
|
|
|
});
|
|
|
|
|
|
if(health.length<=0){
|
|
|
mui.toast("请选择患者健康情况!");
|
|
|
plus.nativeUI.closeWaiting();
|
|
|
$(".btntrue").removeClass('c-ccc');
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
|
|
|
// if(health.length<=0){
|
|
|
// mui.toast("请选择患者健康情况!");
|
|
|
// plus.nativeUI.closeWaiting();
|
|
|
// $(".btntrue").removeClass('c-ccc');
|
|
|
// return false;
|
|
|
// }
|
|
|
|
|
|
//保存服务类型
|
|
|
sendPost("doctor/sign/updateSignServerByCode",
|
|
@ -196,13 +202,14 @@
|
|
|
params.patient = patientCode;
|
|
|
sendPost("doctor/patient_label_info/patient_label_update",params,addPatientLabelErr,function(res){
|
|
|
if(res.status==200){
|
|
|
mui.toast('保存成功');
|
|
|
refreshHz();
|
|
|
setTimeout(function(){
|
|
|
$(".btntrue").removeClass('c-ccc');
|
|
|
plus.nativeUI.closeWaiting();
|
|
|
var xxWv = plus.webview.getWebviewById(viewId);
|
|
|
if(xxWv) {
|
|
|
if(viewId == 'huanzhexinxi.html'){
|
|
|
if(viewId == 'huanzhexinxi.html' || 'huanzhexinxi'){
|
|
|
mui.fire(xxWv, "setDiseaseTypes", {
|
|
|
names: diseaseName.join(","),
|
|
|
disease: disease.join(",")
|
|
@ -242,15 +249,45 @@
|
|
|
init();
|
|
|
})
|
|
|
|
|
|
|
|
|
//获取病人所有标签信息
|
|
|
// function getPatientAllLabels(){
|
|
|
// sendPost("/",
|
|
|
// {patient: patiCode}, null,
|
|
|
// function(res){
|
|
|
// console.log(res)
|
|
|
// if(res.status == 200){
|
|
|
// if(res.data){
|
|
|
// var str = ''
|
|
|
// res.data.map(function(v,i){
|
|
|
// str+=v.labelName;
|
|
|
// if(i+1 != res.data.length)str+=','
|
|
|
// })
|
|
|
// $('#diseases').html(str)
|
|
|
// }
|
|
|
|
|
|
// } else {
|
|
|
// mui.toast("获取标签情况失败");
|
|
|
// }
|
|
|
// },'POST','',true);
|
|
|
// }
|
|
|
var activeArr =[];//选中的标签
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function init(){
|
|
|
var docInfo = JSON.parse(plus.storage.getItem("docInfo"));
|
|
|
promise = getReqPromises([{url:"/doctor/patient_label/labels_by_type",data:{labelType:2}},
|
|
|
{url:"/doctor/patient_label/labels_by_type",data:{labelType:3}},
|
|
|
{url:"/doctor/patient_label/patient_teams",data:{patient:patientCode}}
|
|
|
{url:"/doctor/patient_label/labels_by_type",data:{labelType:4,teamCode:docInfo.adminTeamCode}},
|
|
|
{url:"/doctor/patient_label/patientAllLabels",data:{patient:patientCode}}, //获取选中的标签
|
|
|
])
|
|
|
return promise.then(function(datas){
|
|
|
var data0 = datas[0],
|
|
|
data1 = datas[1],
|
|
|
data2 = datas[2];
|
|
|
activeArr = datas[3].data
|
|
|
initData(2,data0);
|
|
|
initData(3,data1);
|
|
|
initData(4,data2);
|
|
@ -264,34 +301,19 @@
|
|
|
}
|
|
|
|
|
|
function initData(type,res){
|
|
|
if(type == 4){
|
|
|
teamCodes = [];
|
|
|
if(res.status==200){
|
|
|
var data = [], labelNames = [];
|
|
|
var tmp, i;
|
|
|
for(var j in res.data){
|
|
|
teamCodes.push(res.data[j].id);
|
|
|
tmp = res.data[j].labels;
|
|
|
if(tmp){
|
|
|
for(var k in tmp){
|
|
|
if(tmp[k].labelType==4){
|
|
|
if((i = labelNames.indexOf(tmp[k].labelName))==-1){
|
|
|
data.push(tmp[k]);
|
|
|
} else{
|
|
|
data[i].labelCode += "," + tmp[k].labelCode;
|
|
|
}
|
|
|
labelNames.push(tmp[k].labelName);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
teamCodes = teamCodes.join(",");
|
|
|
if(data.length>0)
|
|
|
appendLabel(data);
|
|
|
}else{
|
|
|
queryFailed(res);
|
|
|
}
|
|
|
} else
|
|
|
|
|
|
// if(type == 4){
|
|
|
// if(res.status==200){
|
|
|
// res.data = res.data.map(function(v){
|
|
|
// v.labelCode = v.label;
|
|
|
// return v
|
|
|
// })
|
|
|
// if(res.data.length>0)
|
|
|
// appendLabel(res.data);
|
|
|
// }else{
|
|
|
// queryFailed(res);
|
|
|
// }
|
|
|
// } else
|
|
|
querySuccess(res);
|
|
|
}
|
|
|
|
|
@ -378,13 +400,19 @@
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
var isExit=false;
|
|
|
activeArr.map(function(v){
|
|
|
if(v.label == data[j].labelCode)isExit =true;
|
|
|
})
|
|
|
if(isExit)disabled = "active-icon" //本来就有的默认高亮
|
|
|
labelhtml +='<li id="'+data[j].labelType+'-'+data[j].labelCode+'" data-code="'+data[j].labelCode+'" data-name="'+data[j].labelName+'" data-noselect="' + noselect + '" class="c-list-li '+disabled+'">'+
|
|
|
'<div><span >'+data[j].labelName+'</span></div>'+
|
|
|
'</li>'
|
|
|
}
|
|
|
if(data[0].labelType==4){
|
|
|
$(".c-list-add").before(labelhtml);
|
|
|
// $(".c-list-add").before(labelhtml);
|
|
|
$("#disease-box4").append(labelhtml);
|
|
|
}
|
|
|
if(data[0].labelType==3){
|
|
|
$("#disease-box3").append(labelhtml);
|