<!doctype html>
|
<html class="no-js">
|
<head>
|
<meta charset="utf-8">
|
<title>自定义组添加</title>
|
[#include "/business/pages/include/static.html" /]
|
|
<script type="text/javascript">
|
$(document).ready(function() {
|
$.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
|
document.getElementById("myform").target = window.top.openDialog("0","操作",
|
{},
|
{"width":40,"height":40,"noclose":true},
|
[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
|
|
|
return true;
|
}});
|
|
$("#name").formValidator({empty: false,onFocus: "分组名称不能为空"}).inputValidator({min: 1,onError: "分组名称不能为空"});
|
$("#userid").formValidator({empty: false,onFocus: "主要负责人不能为空"}).inputValidator({min: 1,onError: "主要负责人不能为空"});
|
|
});
|
|
|
</script>
|
</head>
|
|
<body class="personnel_allocation_body">
|
<form id="myform" action="" method="post">
|
<input type="hidden" name="customer_id" value='${RequestParameters.customer_id}'>
|
<table class="edit_layout">
|
<tr id="groupname"><th><label>分组名称:</label></th><td><input type="text" name="name" id="name" value="${group.GROUP_NAME}" class="general"/></td></tr>
|
</table>
|
<table class="pab_con">
|
[#if users?? && users?size > 0]
|
[#list users as role]
|
<tr><th style="width:15%;">${role.name}</th><td>
|
[#if role.dataList?? && role.dataList?size > 0]
|
[#list role.dataList as user]
|
<div class="pabitem"><input class="pos" type="checkbox" name="users" value="${role.id}_${user.ID}" [#if user.check == 1]checked[/#if]/><span>${user.ZSXM}</span></div>
|
[/#list]
|
[/#if]
|
</td></tr>
|
[/#list]
|
[/#if]
|
</table>
|
<table class="edit_layout">
|
|
<tr>
|
<th ><label>主负责人:</label></th>
|
<td >
|
<input class="general maintitle" type="text" id="main" name="main" style="width:170px;" [#if main.username??]value="${main.username}"[#else]value="从人员中选择主要负责人" [/#if]readonly/>
|
<input type="hidden" id="userid" name="userid" style="width:170px;" value="${main.userid}" />
|
|
<div id="useridTip" style="display:inline-block;"></div>
|
</td>
|
</tr>
|
<tr>
|
<th ><label>人员:</label></th>
|
<td>
|
<div class="user" >
|
[#if groupuser?? && groupuser?size > 0]
|
[#list groupuser as user]
|
<p style="float:left;margin-left:20px;margin-top:8px;"><input type="radio" class="ropos" name="mainuser" id="${user.userid}" value="${user.userid}" [#if user.IS_MASTER == 1]checked[/#if] /><span class="${user.userid}">${user.username}</span></p>
|
[/#list]
|
[/#if]
|
</div>
|
</td>
|
</tr>
|
</table>
|
</form>
|
</body>
|
<script type="text/javascript">
|
$(function() {
|
|
$('input.pos').live('click', function() {
|
if($(this).is(":checked")){
|
var id = $(this).val();
|
var text = $(this).next("span").text();
|
var selectid = $("#"+id).val();
|
if($.util.isEmpty(selectid)){
|
var html = "";
|
html+='<p style="float:left;margin-left:20px;margin-top:8px;"><input type="radio" class="ropos" name="mainuser" id= "'+ id +'" value="'+ id +'"/><span class="'+ id +'">'+ text +'</span></p> ';
|
$(".user").append(html);
|
var $user = $(":radio.ropos");
|
if($user.length == 1){
|
$user.attr("checked",true);
|
$('#main').val($user.next("span").text());
|
$('#userid').val($user.val());
|
}
|
}else{
|
$(this).attr("checked",false);
|
popupTips("此人已经选择");
|
|
}
|
|
}else{
|
var checkid = $(this).val();
|
var $temp = $('span.'+checkid).parent();
|
var userId = $('#userid').val();
|
if(!$.util.isEmpty(userId) && userId == checkid) {
|
$('#userid').val("");
|
$('#main').val("");
|
}
|
|
$temp.remove();
|
}
|
|
|
});
|
$('input.ropos').live('click', function() {
|
var id = $(this).val();
|
var text = $(this).next("span").text();
|
$('#main').val(text);
|
$('#userid').val(id);
|
});
|
|
|
})
|
function radioAddClick() {
|
$('input.ropos').live('click', function() {
|
var id = $(this).val();
|
var text = $(this).next("span").text();
|
$('#main').val(text);
|
$('#userid').val(id);
|
});
|
}
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
var length = $(":checkbox:checked").length;
|
if(length == 0) {
|
popupTips("请选择人员");
|
} else {
|
$("#myform").submit();
|
}
|
}
|
}
|
</script>
|
</html>
|