<!doctype html>
|
<html>
|
<head>
|
[#include "/business/wechat/include/title.html" /]
|
[#include "/business/wechat/include/wheader.html" /]
|
</head>
|
|
<body>
|
<header class="kltit"><div class="present"><a href="javascript:saveLinkKnow();">确定</a></div><a href="javascript:history.go(-1);" ><span></span></a>添加关联知识</header>
|
<div class="search-bg">
|
<div class="search-box">
|
<input type="text" placeholder="请输入知识标题" id="title" >
|
<a href="javascript:query();"><span></span></a>
|
</div>
|
</div>
|
|
<div id="main"></div>
|
</body>
|
<script type="text/javascript">
|
function query() {
|
var title = $.util.encode($.trim($("#title").val()));
|
var param = {"title":title,"knowIds":"${knowIds}"};
|
$.post("${base}/ewyw/ewKnowledge/ewLinkKnowData.html",param,function(data,textStatus) {
|
$("#main").html(data);
|
});
|
}
|
|
|
$(function() {
|
query();
|
})
|
|
function saveLinkKnow(){
|
var checkedBox = $(".item-foucs");
|
if(checkedBox.length==0) {
|
popupTips("请选择关联知识");
|
return;
|
}
|
|
var knowsArray = new Array();
|
checkedBox.each(function() {
|
knowsArray.push($(this).find(".know").val());
|
});
|
var knows = knowsArray.join(",");
|
$.post("${base}/ewyw/ewKnowledge/saveLinkKnow.html",{"knows":knows,"beforeKnows":"${knowIds}"},function(data,textStatus) {
|
if(data=="1") {
|
popupTips("关联成功");
|
if('${type}' == 1){
|
window.location.href = "${base}/ewyw/ewKnowledge/ewAddKnowledge.html";
|
}else if('${type}' == 2){
|
window.location.href = "${base}/ewyw/ewKnowledge/ewEditKnowledge.html?id=${id}&type=${type}";
|
}else{
|
window.location.href = "${base}/ewyw/ewKnowledge/ewEditShKnowledge.html?id=${id}&type=${type}";
|
}
|
} else {
|
popupTips("关联失败");
|
}
|
})
|
}
|
|
</script>
|
</html>
|