|
@@ -7,8 +7,8 @@ $(function(){
|
|
getSubMenu();
|
|
getSubMenu();
|
|
initScoreItem();
|
|
initScoreItem();
|
|
getRecordDetail();
|
|
getRecordDetail();
|
|
-});
|
|
|
|
|
|
|
|
|
|
+ let global_flawData = {}; //缺陷数据
|
|
function initMenu(data){
|
|
function initMenu(data){
|
|
//菜单数据填充
|
|
//菜单数据填充
|
|
$("#subMenuTmpl").tmpl(data).appendTo("#subMenu");
|
|
$("#subMenuTmpl").tmpl(data).appendTo("#subMenu");
|
|
@@ -27,8 +27,9 @@ function initMenu(data){
|
|
$(".sub-menu .active").removeClass('active');
|
|
$(".sub-menu .active").removeClass('active');
|
|
$(this).addClass("active");
|
|
$(this).addClass("active");
|
|
//显示对应内容
|
|
//显示对应内容
|
|
- $(".content-item").hide();
|
|
|
|
- $(".content-item[code="+$(this).attr("code")+"]").show();
|
|
|
|
|
|
+ const code=$(this).attr("code");
|
|
|
|
+ $(".content-item,.flaw-item").hide();
|
|
|
|
+ $(".content-item[code="+code+"],.flaw-item[code="+code+"]").show();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -54,6 +55,7 @@ function getRecordDetail(){
|
|
initPatientInfo(info);
|
|
initPatientInfo(info);
|
|
initContent(result.pageData,activeTab);
|
|
initContent(result.pageData,activeTab);
|
|
initScoreItem(msg);
|
|
initScoreItem(msg);
|
|
|
|
+ global_flawData=msg;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -65,12 +67,10 @@ function initPatientInfo(data){
|
|
//显示病例模块明细
|
|
//显示病例模块明细
|
|
function initContent(data){
|
|
function initContent(data){
|
|
const obj = JSON.parse(data);
|
|
const obj = JSON.parse(data);
|
|
- let i=0;
|
|
|
|
for(let k in obj){
|
|
for(let k in obj){
|
|
- $("#contentTmpl").tmpl({title:k,info:obj[k],code:i}).appendTo("#contentInfo");
|
|
|
|
- i++;
|
|
|
|
|
|
+ $("#contentTmpl").tmpl({title:k,info:obj[k]}).appendTo("#contentInfo");
|
|
}
|
|
}
|
|
- //console.log(obj)
|
|
|
|
|
|
+ console.log(obj)
|
|
}
|
|
}
|
|
|
|
|
|
//评分项数据填充
|
|
//评分项数据填充
|
|
@@ -79,16 +79,53 @@ function initScoreItem(data){
|
|
for(let k in data){
|
|
for(let k in data){
|
|
$("#flawTmpl").tmpl(data[k]).appendTo("#flaws .flaw-box");
|
|
$("#flawTmpl").tmpl(data[k]).appendTo("#flaws .flaw-box");
|
|
}
|
|
}
|
|
|
|
+
|
|
$(".flaw-item .oper a").click(function () {
|
|
$(".flaw-item .oper a").click(function () {
|
|
- $("#delModal").show();
|
|
|
|
|
|
+ const activeTab=$(".sub-menu .page.active").attr("code");
|
|
|
|
+ const i = $(".flaw-item[code="+activeTab+"]").index($(this).parents(".flaw-item"));
|
|
|
|
+ const code=$(this).attr("code");
|
|
|
|
+ const isEdit = $(this).is(".edit-flaw");
|
|
|
|
+ showModal(isEdit?'0':'1',code,i);
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+//删除评分项
|
|
function delScore(id){
|
|
function delScore(id){
|
|
- post(api.getRecordDetail,{'id':id}).then(function(res){
|
|
|
|
|
|
+ post(api.delScore,{'id':id}).then(function(res){
|
|
|
|
+ if(res.data.code==='0'){
|
|
|
|
+ const data = res.data.data;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+//修改评分项
|
|
|
|
+function editScore(){
|
|
|
|
+ const param={};
|
|
|
|
+ post(api.editScore,param).then(function(res){
|
|
if(res.data.code==='0'){
|
|
if(res.data.code==='0'){
|
|
const data = res.data.data;
|
|
const data = res.data.data;
|
|
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-}
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function showModal(flag,code,i){
|
|
|
|
+ $("#delModal .modal-body").html("");
|
|
|
|
+ $("#delModal").show();
|
|
|
|
+ $("#delModal .confirm").off("click");
|
|
|
|
+ const activeTab=$(".sub-menu .page.active").attr("code");
|
|
|
|
+ if(flag==='0'){ //修改
|
|
|
|
+ const info = global_flawData[activeTab][i];
|
|
|
|
+ $("#delModal .title").text("修改评分");
|
|
|
|
+ $("#editTmpl").tmpl(info).appendTo("#delModal .modal-body");
|
|
|
|
+ $("#delModal .confirm").click(function(){
|
|
|
|
+ editScore(code);
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ $("#delModal .title").text("删除评分");
|
|
|
|
+ $("#delModal .modal-body").html('<p>确定要删除该评分记录吗?</p>');
|
|
|
|
+ $("#delModal .confirm").click(function(){
|
|
|
|
+ delScore(code);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+});
|