增加clickone

master
e 2020-02-27 11:00:26 +08:00
parent f4e0aa7002
commit f4f3cdc88f
1 changed files with 101 additions and 0 deletions

View File

@ -34,6 +34,107 @@ try {
} }
/*
自定义url的弹出
obj:要填充的控件,可以为多个以逗号分隔
name:列表中对应的字段,可以为多个以逗号分隔与obj要对应
url弹出页面的Url
*/
function popClickone(obj,name,url) {
$.dialog.setting.zIndex = getzIndex(true);
var names = name;
var objs = obj;
if(typeof(windowapi) == 'undefined'){
$.dialog({
content: "url:"+url,
zIndex: getzIndex(),
lock : true,
title:"选择",
width:700,
height: 400,
cache:false,
ok: function(){
iframe = this.iframe.contentWindow;
var selected = iframe.getSelectRows();
if (selected == '' || selected == null ){
alert("请选择Z");
return false;
}else {
for(var i1=0;i1<names.length;i1++){
var str = "";
$.each( selected, function(i, n){
if (i==0)
str+= n[names[i1]];
else{
str+= ",";
str+=n[names[i1]];
}
});
if($("#"+objs[i1]).length>=1){
$("#"+objs[i1]).val("");
$("#"+objs[i1]).val(str);
}else{
$("input[name='"+objs[i1]+"']").val("");
$("input[name='"+objs[i1]+"']").val(str);
}
}
return true;
}
},
cancelVal: '关闭',
cancel: true /*为true等价于function(){}*/
});
}else{
$.dialog({
content: "url:"+url,
zIndex: getzIndex(),
lock : true,
title:"选择",
width:700,
height: 400,
parent:windowapi,
cache:false,
ok: function(){
iframe = this.iframe.contentWindow;
var selected = iframe.getSelectRows();
console.log("11111111111111"+selected);
if (selected == '' || selected == null ){
alert("请选择数据Z");
return false;
}else {
console.log(selected);
for(var i1=0;i1<1;i1++){
var str = "";
$.each( selected, function(i, n){
if (i==0)
str+= n[names];
else{
str+= ",";
str+=n[names];
}
});
$("#"+objs).val("");
$("#"+objs).val(str);
$("[name='"+objs+"']").val("");
$("[name='"+objs+"']").val(str);
}
return true;
}
},
cancelVal: '关闭',
cancel: true /*为true等价于function(){}*/
});
}
}
/** /**
* 设置 window的 zIndex * 设置 window的 zIndex
* @param flag true: 不增量(因为 tip提示经常使用 zIndex, 所以如果是 tip的话 ,则不增量) * @param flag true: 不增量(因为 tip提示经常使用 zIndex, 所以如果是 tip的话 ,则不增量)