369 lines
14 KiB
Plaintext
369 lines
14 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
<head>
|
|
<title></title>
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|
<script type="text/javascript">
|
|
function saveforinsertFun(dialog) {
|
|
var userid="";
|
|
var skillid="";
|
|
for(var i=0;i<$("#a_selectUsers option").length;i++){
|
|
userid+=$("#a_selectUsers").get(0).options[i].value+",";
|
|
}
|
|
for(var i=0;i<$("#a_selectSkill option").length;i++){
|
|
skillid+=$("#a_selectSkill").get(0).options[i].value+",";
|
|
}
|
|
$.post(ext.contextPath + "/process/taskprocedure/saveForInsert.do",{userid:userid,skillid:skillid},function(data){
|
|
if (data.res > 0) {
|
|
parent.$.messager.alert('提示','保存成功,','info');
|
|
}else if(data.res == 0){
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|
}else{
|
|
top.$.messager.alert('提示', data.res, 'info');
|
|
}
|
|
},'json');
|
|
$("#gotskill").empty();
|
|
}
|
|
|
|
function saveforcoverFun(dialog,grid) {
|
|
var userid="";
|
|
var skillid="";
|
|
for(var i=0;i<$("#a_selectUsers option").length;i++){
|
|
if(i==0)
|
|
{
|
|
userid=$("#a_selectUsers").get(0).options[i].value;
|
|
}
|
|
else
|
|
{
|
|
userid+=","+$("#a_selectUsers").get(0).options[i].value;
|
|
}
|
|
}
|
|
for(var i=0;i<$("#a_selectSkill option").length;i++){
|
|
skillid+=$("#a_selectSkill").get(0).options[i].value+",";
|
|
}
|
|
$.post(ext.contextPath + "/process/taskprocedure/saveForCover.do",{userid:userid,skillid:skillid},function(data){
|
|
if (data.res > 0) {
|
|
parent.$.messager.alert('提示','保存成功','info');
|
|
}else if(data.res == 0){
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|
}else{
|
|
top.$.messager.alert('提示', data.res, 'info');
|
|
}
|
|
},'json');
|
|
$("#gotskill").empty();
|
|
}
|
|
|
|
|
|
|
|
function doSearch(userid,type){
|
|
document.getElementById("prompt").style.visibility="hidden";
|
|
$.getJSON(ext.contextPath +"/process/taskprocedure/getMember.do?userid="+userid+"&type="+type+"",callback);
|
|
}
|
|
|
|
function doDisplaySkill(){
|
|
$.getJSON(ext.contextPath +"/process/taskprocedure/getSkillJson.do",callbackSkill);
|
|
}
|
|
|
|
function doSearchGotSkill(userid){
|
|
$.getJSON(ext.contextPath +"/process/taskprocedure/getGotSkillJson.do?userid="+userid+"",callbackGotSkill);
|
|
}
|
|
|
|
function callback(data){
|
|
$("#a_Users").empty();
|
|
if(data.rows.length > 0)
|
|
{
|
|
for(var i = 0;i<data.rows.length;i++){
|
|
var userid = data.rows[i].userid;
|
|
var username = data.rows[i].username;
|
|
|
|
$("#a_Users").append("<option value='"+userid+"'>"+username+"</option>");
|
|
}
|
|
}else{
|
|
document.getElementById("prompt").style.visibility="visible";//显示
|
|
}
|
|
}
|
|
|
|
function callbackSkill(data){
|
|
$("#a_Skill").empty();
|
|
if(data.rows.length > 0)
|
|
{
|
|
for(var i = 0;i<data.rows.length;i++){
|
|
var skillid = data.rows[i].id;
|
|
var skillname = data.rows[i].name;
|
|
|
|
$("#a_Skill").append("<option value='"+skillid+"'>"+skillname+"</option>");
|
|
}
|
|
}
|
|
}
|
|
|
|
function callbackGotSkill(data){
|
|
$("#gotskill").empty();
|
|
if(data.rows.length > 0)
|
|
{
|
|
for(var i = 0;i<data.rows.length;i++){
|
|
var skillid = data.rows[i].skillid;
|
|
var skillname = data.rows[i].skillname;
|
|
|
|
$("#gotskill").append("<option value='"+skillid+"'>"+skillname+"</option>");
|
|
}
|
|
}
|
|
}
|
|
|
|
function searchGotSkill(){
|
|
var selectid=$("#a_Users option:selected").val();
|
|
doSearchGotSkill(selectid);
|
|
}
|
|
|
|
function addToSelect(){
|
|
var selectid=$("#a_Users option:selected").val();
|
|
var selecttext=$("#a_Users option:selected").text()
|
|
for (var i = 0; i < $("#a_selectUsers option").length; i++) {
|
|
if($("#a_selectUsers").get(0).options[i].value==selectid){
|
|
return;
|
|
}
|
|
}
|
|
if(selectid=='undefined' ||selectid==null ||selectid==""){
|
|
return;
|
|
}
|
|
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
|
doSearchGotSkill(selectid);
|
|
}
|
|
|
|
function addToSelectSkill(){
|
|
var selectid=$("#a_Skill option:selected").val();
|
|
var selecttext=$("#a_Skill option:selected").text()
|
|
for (var i = 0; i < $("#a_selectSkill option").length; i++) {
|
|
if($("#a_selectSkill").get(0).options[i].value==selectid){
|
|
return;
|
|
}
|
|
}
|
|
if(selectid=='undefined' ||selectid==null ||selectid==""){
|
|
return;
|
|
}
|
|
$("#a_selectSkill").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
|
}
|
|
|
|
function removeFromSelect(){
|
|
var selOpt = $("#a_selectUsers option:selected");
|
|
selOpt.remove();
|
|
$("#gotskill").empty();
|
|
}
|
|
function removeFromSelectSkill(){
|
|
var selOpt = $("#a_selectSkill option:selected");
|
|
selOpt.remove();
|
|
|
|
}
|
|
|
|
function removeFromSelectAll(){
|
|
top.$.messager.confirm("提示","是否清除全部?",function(res){
|
|
if(res){
|
|
$("#a_selectUsers").empty();
|
|
$("#a_selectSkill").empty();
|
|
$("#gotskill").empty();
|
|
}
|
|
});
|
|
}
|
|
|
|
function addToSelectAll(){
|
|
for(var i=0;i<$("#a_Users option").length;i++){
|
|
var flag=0;
|
|
var selectid=$("#a_Users").get(0).options[i].value;
|
|
var selecttext=$("#a_Users").get(0).options[i].text;
|
|
for (var j = 0; j < $("#a_selectUsers option").length; j++) {
|
|
if($("#a_selectUsers").get(0).options[j].value==selectid){
|
|
flag=1;
|
|
}
|
|
}
|
|
if(flag==0) {
|
|
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
function addToSelectAllSkill(){
|
|
for(var i=0;i<$("#a_Skill option").length;i++){
|
|
var flag=0;
|
|
var selectid=$("#a_Skill").get(0).options[i].value;
|
|
var selecttext=$("#a_Skill").get(0).options[i].text;
|
|
for (var j = 0; j < $("#a_selectSkill option").length; j++) {
|
|
if($("#a_selectSkill").get(0).options[j].value==selectid){
|
|
flag=1;
|
|
}
|
|
}
|
|
if(flag==0) {
|
|
$("#a_selectSkill").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
function addToSelectMulti(){
|
|
for(var i=0;i<$("#a_Users option").length;i++){
|
|
if($("#a_Users").get(0).options[i].selected){
|
|
var flag=0;
|
|
var selectid=$("#a_Users").get(0).options[i].value;
|
|
var selecttext=$("#a_Users").get(0).options[i].text;
|
|
for (var j = 0; j < $("#a_selectUsers option").length; j++) {
|
|
if($("#a_selectUsers").get(0).options[j].value==selectid){
|
|
flag=1;
|
|
}
|
|
}
|
|
if(flag==0) {
|
|
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
|
}
|
|
doSearchGotSkill(selectid);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function addToSelectMultiSkill(){
|
|
for(var i=0;i<$("#a_Skill option").length;i++){
|
|
if($("#a_Skill").get(0).options[i].selected){
|
|
var flag=0;
|
|
var selectid=$("#a_Skill").get(0).options[i].value;
|
|
var selecttext=$("#a_Skill").get(0).options[i].text;
|
|
for (var j = 0; j < $("#a_selectSkill option").length; j++) {
|
|
if($("#a_selectSkill").get(0).options[j].value==selectid){
|
|
flag=1;
|
|
}
|
|
}
|
|
if(flag==0) {
|
|
$("#a_selectSkill").append("<option value='"+selectid+"'>"+selecttext+"</option>");
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function getUser(){
|
|
document.getElementById("prompt").style.visibility="hidden";
|
|
var username = $('#queryusername').val();
|
|
$.getJSON(ext.contextPath +"/user/queryUsers.do?queryusername="+encodeURI(encodeURI(username)), callback );
|
|
}
|
|
|
|
function selectOK() {
|
|
var useridname="";
|
|
for(var i=0;i<$("#a_selectUsers option").length;i++){
|
|
useridname+=$("#a_selectUsers").get(0).options[i].value+","+$("#a_selectUsers").get(0).options[i].text+";";
|
|
|
|
}
|
|
var retn=useridname;
|
|
return retn;
|
|
}
|
|
|
|
$(function() {
|
|
$('#unitTree').tree({
|
|
url : ext.contextPath + '/process/taskprocedure/getUnitJson.do?random=' + Math.random()+'&chiefid=${chiefid}',
|
|
parentField : 'pid',
|
|
onClick : function(node) {
|
|
if(node.pid != ''){
|
|
doSearch(node.id,node.attributes.type);
|
|
doDisplaySkill();
|
|
}
|
|
}
|
|
});
|
|
var recvid=parent.$('#'+'${param.iframeId}')[0].contentWindow.$("#"+'${param.recvid}').val();
|
|
$.getJSON(ext.contextPath +"/user/getRecvusersJson.do?recvid="+recvid, function(data){
|
|
$("#a_selectUsers").empty();
|
|
for(var i = 0;i<data.rows.length;i++){
|
|
var userid = data.rows[i].id;
|
|
var username = data.rows[i].caption;
|
|
$("#a_selectUsers").append("<option value='"+userid+"'>"+username+"</option>");
|
|
}
|
|
});
|
|
|
|
$.getJSON(ext.contextPath +"/process/taskprocedure/getSkillJson.do", function(datas){
|
|
$("#a_Skill").empty();
|
|
for(var i = 0;i<datas.rows.length;i++){
|
|
var skillid = datas.rows[i].id;
|
|
var skillname = datas.rows[i].procedurename;
|
|
$("#a_Skill").append("<option value='"+skillid+"'>"+skillname+"</option>");
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
</head>
|
|
<body style="margin:0px">
|
|
<input id="recvid" name="recvid" type="hidden" />
|
|
<div style="background-color:#f4f4f4;padding-top:2px;padding-bottom:2px;border-bottom:1px solid #e4e4e4;font-size:12px;">
|
|
<!-- <span style="padding:2px 5px 2px 5px">姓名</span>
|
|
<input id="queryusername" name="queryusername" class="easyui-searchbox" style="width: 180px;"
|
|
data-options="prompt:'请输入关键字',searcher:getUser" />-->
|
|
<span id="prompt" name="prompt" style="color:red;visibility:hidden;padding:2px 5px 2px 5px">无用户或者无权限</span>
|
|
</div>
|
|
<div style="float:left">
|
|
<table cellspacing="2" cellpadding="0" style="font-size:12px;">
|
|
<tr>
|
|
<td valign="top" style="border:1px solid #e4e4e4">
|
|
<div style="width: 150px;height: 370px;overflow:auto">
|
|
<ul id="unitTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
|
|
</div>
|
|
</td>
|
|
<td valign="top" style="border:1px solid #e4e4e4">
|
|
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
|
|
组员 (双击选择)
|
|
</div>
|
|
<select name="a_Users" id="a_Users" ondblclick="addToSelect()" onclick="searchGotSkill();"
|
|
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
|
|
</td>
|
|
<td valign="top" style="border:1px solid #e4e4e4">
|
|
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
|
|
已选 (双击移除)
|
|
</div>
|
|
<select name="a_selectUsers" id="a_selectUsers" ondblclick="removeFromSelect();"
|
|
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
|
|
</td>
|
|
</tr>
|
|
<tr><td></td>
|
|
<td><a id="btnCU" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-add',plain:true" onclick="addToSelectMulti();">选中</a>
|
|
<a id="btnCUA" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-world_add',plain:true" onclick="addToSelectAll();">全选</a></td>
|
|
</tr>
|
|
</table >
|
|
</div>
|
|
<div style="float:right">
|
|
<table cellspacing="2" cellpadding="0" style="font-size:12px;">
|
|
<tr>
|
|
<td><select name="gotskill" id="gotskill" style="border:none;width:120px; height:350px;" multiple="multiple" disabled=true></select></td>
|
|
<td valign="top" style="border:1px solid #e4e4e4">
|
|
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
|
|
已选 (双击移除)
|
|
</div>
|
|
<select name="a_selectSkill" id="a_selectSkill" ondblclick="removeFromSelectSkill();"
|
|
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
|
|
</td>
|
|
<td valign="top" style="border:1px solid #e4e4e4">
|
|
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
|
|
技能 (双击选择)
|
|
</div>
|
|
<select name="a_Skill" id="a_Skill" ondblclick="addToSelectSkill()"
|
|
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
|
|
|
|
|
|
</td>
|
|
</tr>
|
|
<tr><td></td>
|
|
<td><a id="btnCS" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-add',plain:true" onclick="addToSelectMultiSkill();">选中</a>
|
|
<a id="btnCSA" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-world_add',plain:true" onclick="addToSelectAllSkill();">全选</a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<div style="width:200; float:right">
|
|
<table>
|
|
<tr>
|
|
<td><a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-cd_add',plain:true" onclick="saveforinsertFun()">增量认定</a></td>
|
|
<td><a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-css_add',plain:true" onclick="saveforcoverFun()">覆盖认定</a></td>
|
|
<td><a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'ext-icon-cancel',plain:true" onclick="removeFromSelectAll()">初始化</a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |