<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title>等级协议</title>
|
[#include "/business/pages/include/static.html" /]
|
</head>
|
|
<body >
|
<input type="hidden" id="type" name="type" value=""/>
|
<div class="fs_main clearfix" style="margin-top:10px;">
|
<div class="fs_main fs_edit nopadding" style="border:1px solid #dadbdf ;" >
|
<div class="deal_switch">
|
<div class="dls_btn" id="dlsBtn">
|
<a class="basicinfo focus"><span>人员</span></a>
|
<a id="group" class="basicinfo"><span>角色</span></a>
|
<a id="zdygroup" class="basicinfo"><span>自定义分组</span></a>
|
</div>
|
</div>
|
<div class="deal_switch_wrap">
|
<div class="deal_switch_con iframecon" style="display:block;" >
|
<table id="selExecutors" class="pab_con">
|
[#if groupList??&&groupList?size>0]
|
[#list groupList as group]
|
<tr><th>${group.name}</th><td>
|
[#assign userList=group.dataList]
|
[#if userList??&&userList?size>0]
|
[#list userList as user]
|
<div class="pabitem" style="margin-right:15px;">
|
<input name="checkbox" value="${user.USER_ID}" class="pos" type="checkbox" /><span>${user.USER_NAME}</span>
|
</div>
|
[/#list]
|
[/#if]
|
</td></tr>
|
[/#list]
|
[/#if]
|
</table>
|
<table class="edit_layout2">
|
<input type="hidden" name="alluserid" id="alluserid" >
|
<input type="hidden" name="allusername" id="allusername" >
|
<tr>
|
<th ><label>主负责人:</label></th>
|
<td>
|
<select style="width: 140px;height:26px;" id="user" >
|
</select>
|
</td>
|
</tr>
|
</table>
|
|
</div>
|
<div class="deal_switch_con iframecon" style="display:none;" >
|
|
</div>
|
<div class="deal_switch_con iframecon" style="display:none;" >
|
|
</div>
|
</div>
|
</div>
|
</div>
|
<script type="text/javascript">
|
var customer_id='${RequestParameters.customer_id}';
|
var serivceListId='${RequestParameters.serivceListId}';
|
var shownum=$("#shownum").val();
|
|
function loadGroup() {
|
$("#type").val(3);
|
$.post("${base}/business/pages/question/selectZdyGroup.html",{"customer_id":customer_id},function(data){
|
$('div.deal_switch_con').eq(2).html(data);
|
});
|
}
|
|
$(function() {
|
|
$("#dlsBtn>a").click(function() {
|
var index = $("#dlsBtn>a").index(this);
|
$("#dlsBtn>a").removeClass("focus");
|
$(this).addClass("focus");
|
var $dom = $("div.deal_switch_con:eq("+index+")");
|
$("#type").val(index+1);
|
if($.util.isEmpty($.trim($dom.html()))) {
|
if(index == 0) {
|
$('div.deal_switch_con').eq(0).show();
|
} else if(index == 1) {
|
$.get("${base}/business/pages/question/selectGroup.html",{"customer_id":customer_id,"serivceListId":serivceListId},function(data){
|
$('div.deal_switch_con').eq(1).html(data);
|
});
|
} else if(index == 2) {
|
loadGroup();
|
}
|
}
|
$("div.deal_switch_con").hide();
|
$dom.show();
|
})
|
|
$('.pos').click(function() {
|
if($(this).is(":checked")){
|
var id = $(this).val();
|
if(!$("select option[value="+id+"]").length>0){
|
var text = $(this).next("span").text();
|
var html = "";
|
$("#user").append("<option value='"+id+"'>"+text+"</option>");
|
radioAddClick();
|
}else{
|
$(this).attr("checked",false);
|
popupTips("此人已经选择");
|
}
|
|
}else{
|
var checkid = $(this).val();
|
var $temp = $('span.'+checkid).parent();
|
|
$("#user option[value='"+checkid+"']").remove();
|
$temp.remove();
|
}
|
|
|
});
|
|
|
$('div.deal_switch_con').hide();
|
$('div.deal_switch_con').eq(0).show();
|
$("#type").val(1);
|
|
})
|
function radioAddClick() {
|
$('input.ropos').click( function() {
|
var id = $(this).val();
|
var text = $(this).next("span").text();
|
$('#name').val(text);
|
$('#userid').val(id);
|
});
|
}
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
var typelx = $("#type").val();
|
var alluserid1 = "";
|
var allusername1 = "";
|
if(typelx == 1){
|
var checkUser = $(":checkbox:checked");
|
if(checkUser.length==0) {
|
popupTips("请选择人员");
|
return;
|
}
|
var checkmain = $("#user").val();
|
if($.util.isEmpty(checkmain)) {
|
popupTips("请选择主要负责人");
|
return;
|
}
|
var $users = $(":checkbox:checked");
|
var alluserid = "";
|
var allusername = "";
|
if($users.length>0) {
|
$users.each(function() {
|
if($(this).val() == checkmain){
|
alluserid += $(this).val()+"-1,";
|
allusername += $(this).next("span").text()+"(主负责人),";
|
}else{
|
alluserid += $(this).val()+",";
|
allusername += $(this).next("span").text()+",";
|
}
|
});
|
}
|
alluserid1 = alluserid.substring(0,alluserid.length-1)+"&"+allusername.substring(0,allusername.length-1);
|
allusername1 = allusername.substring(0,allusername.length-1);
|
}
|
if(typelx == 2){
|
var checkUser = $(":radio.pos:checked");
|
if(checkUser.length!=1) {
|
popupTips("请选择人员");
|
return;
|
}
|
alluserid1 = checkUser.val()+"&"+checkUser.next("span").text();
|
allusername1 = checkUser.next("span").text();
|
|
}
|
if(typelx == 3){
|
var checkUser = $(":radio.zdypos:checked");
|
if(checkUser.length!=1) {
|
popupTips("请选择人员");
|
return;
|
}
|
var alluser=new Array();
|
alluser = checkUser.val().split("&");
|
alluserid1 = alluser[0]+"&"+alluser[1];
|
allusername1 = alluser[1];
|
|
}
|
window.top.document.getElementById('dialogIframepersonList').contentWindow.selectUser(typelx,alluserid1,allusername1);
|
window.top.hideDialog("dealer");
|
|
|
}
|
}
|
|
//添加分组
|
function addGroup() {
|
window.top.openDialog("zdyadd","添加分组",
|
{},
|
{"width":70,"height":70},
|
[{btnId:"btnSure", btnName:"提交", btnStyle:"bluebtn"}],
|
"${base}/business/pages/question/addzdyGroupUser.html?customer_id="+customer_id);
|
}
|
//修改分组
|
function edit(id) {
|
window.top.openDialog("zdyadd","修改分组",
|
{},
|
{"width":70,"height":70},
|
[{btnId:"btnSure", btnName:"提交", btnStyle:"bluebtn"}],
|
"${base}/business/pages/question/addzdyGroupUser.html?customer_id="+customer_id+"&groupId="+id);
|
}
|
|
//删除分组
|
function del(id) {
|
var msg;
|
msg = "确定要删除该分组吗?";
|
window.top.confirmInfo('信息确认', msg, function(){
|
$.post("delzdyGroupUser.html", {'id':id},function(data,textStatus){
|
if(data=="1"){
|
window.top.popupTips("操作成功");
|
loadGroup();
|
} else {
|
window.top.popupTips("操作失败");
|
}
|
});
|
});
|
}
|
|
|
|
</script>
|
</body>
|
</html>
|