290 lines
8.8 KiB
JavaScript
290 lines
8.8 KiB
JavaScript
|
|
|
|
function WorkFlowPlatform_Toggle(id, visibled, focused)
|
|
{
|
|
var _ToggleCompoment = $("#Box_" + id);
|
|
var _ToggleVisibled = visibled;
|
|
if (_ToggleVisibled == null)
|
|
_ToggleVisibled = true;
|
|
if (_ToggleCompoment.length > 0)
|
|
{
|
|
var _ToggleMenu = $("#Item_" + id);
|
|
|
|
if (_ToggleVisibled)
|
|
{
|
|
_ToggleCompoment.css('display', 'block');
|
|
_ToggleCompoment.css('width', '100%');
|
|
_ToggleMenu.css('display', '');
|
|
if (focused)
|
|
_ToggleCompoment.get(0).scrollIntoView();
|
|
}
|
|
else
|
|
{
|
|
_ToggleCompoment.css('display', 'none');
|
|
_ToggleCompoment.css('width', 'auto');
|
|
_ToggleMenu.css('display', 'none');
|
|
}
|
|
var _ComponentContent = _ToggleCompoment.find(".ComponentContent");
|
|
_ComponentContent.css('display', 'block');
|
|
_ToggleCompoment.find(".ComponentToolBar").find("input:text").val("1");
|
|
}
|
|
}
|
|
|
|
function WorkFlowPlatform_Print()
|
|
{
|
|
window.print();
|
|
return false;
|
|
}
|
|
|
|
function WorkFlowPlatform_GetUrl(isTransact)
|
|
{
|
|
if (isTransact)
|
|
{
|
|
var _url = window.location.href;
|
|
_url = _url.substring(0, _url.lastIndexOf("/"));
|
|
return _url + "/Common/Default.aspx";
|
|
}
|
|
else
|
|
{
|
|
return "/WorkFlow/Transact/Common/Default.aspx";
|
|
}
|
|
}
|
|
|
|
function WorkFlowPlatform_Accept(evt, currElement)
|
|
{
|
|
var _Url = "?ProDef_ID=" + currElement.getAttribute("key");//.id.replace("Span_", "");
|
|
WorkFlowPlatform_Transact(null, _Url);
|
|
|
|
return false;
|
|
}
|
|
|
|
function WorkFlowPlatform_Receive(targetID)
|
|
{
|
|
var _this = $("#" + targetID);
|
|
if (_this.length > 0)
|
|
{
|
|
if (_this.val() == "")
|
|
{
|
|
RealEstate.Page.Alert("请输入待办业务受理编号,再快速收文。", false, 3);
|
|
return false;
|
|
}
|
|
if (!window.confirm("您确定将受理编号「" + _this.val() + "」的业务收取到您的在办任务列表中吗?"))
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function WorkFlowPlatform_Transact(evt, url, isTransact)
|
|
{
|
|
if (isTransact == null)
|
|
isTransact = true;
|
|
var _Url = url;
|
|
if (evt != null)
|
|
{
|
|
var _CurrEvent = evt || window.event;
|
|
var _EvtElement = (_CurrEvent.target) ? _CurrEvent.target : _CurrEvent.srcElement;
|
|
var _ClickTR = $(_EvtElement).parents("tr");
|
|
if (_ClickTR.length > 0)
|
|
{
|
|
_ClickTR.offsetParent().find("tr").removeClass("Selected");
|
|
_ClickTR.addClass("Selected");
|
|
}
|
|
}
|
|
|
|
var _Passport_Guid = top.document.documentElement.getAttribute("Passport_Guid");
|
|
if (_Passport_Guid != null)
|
|
_Url = _Url + "&Passport_Guid=" + _Passport_Guid;
|
|
//用于刷新和关闭
|
|
_Url += "&PopDialogPageName=F_R_GridPageEx1";
|
|
_Url += "&PopDialogName=WorkFlowWorkPlatform";
|
|
|
|
var _height = top.document.documentElement.clientHeight - 100;
|
|
if (_height < 400)
|
|
_height = 400;
|
|
var _Width = top.document.documentElement.clientWidth - 100;
|
|
if (_Width < 800)
|
|
_Width = 800;
|
|
else if (_Width > 1600)
|
|
_Width = 1600;
|
|
$(document).click();
|
|
_Url = WorkFlowPlatform_GetUrl(isTransact) + _Url;
|
|
var _Division = RealEstate.Page.GetRequestValue("Enabled_Division", _Url);
|
|
if (_Division != null)
|
|
{
|
|
_Division = $("#" + _Division + " option");
|
|
var _Count = 0;
|
|
var _HtmlText = "<div style='min-width:300px;width:100%; float:left;'><div style='padding-left:50px;'><ul class='ListItem Col2'>";
|
|
var _OutHtml = "<li style='padding:3px 0px;'><input type='radio' style='vertical-align:middle' {3} id='division_{1}' name='division' value='{0}' />" +
|
|
"<label for='division_{1}' style='vertical-align:middle;padding-left:5px;'>{2}</label></li>";
|
|
var _Checked = "checked='checked'";
|
|
_Division.each(function (index)
|
|
{
|
|
if (parseInt(this.value) > 0)
|
|
{
|
|
if ($(this).prop("disabled"))
|
|
{
|
|
|
|
}
|
|
else
|
|
{
|
|
_Count++;
|
|
_HtmlText += _OutHtml.format(this.value, index, $(this).html(), _Checked);
|
|
if (_Count > 0)
|
|
_Checked = "";
|
|
}
|
|
}
|
|
});
|
|
_HtmlText += "</ul></div></div>";
|
|
|
|
if (_Count == 0)
|
|
{
|
|
Dialog.Alert("您可能没有权限办理业务流程");
|
|
return false;
|
|
}
|
|
else if (_Count == 1)
|
|
{
|
|
Dialog.OpenPopDialog("WorkFlowWorkPlatform", _Url, _Width, _height, true, false);
|
|
return false;
|
|
}
|
|
var diag = new Dialog(false, "true", true);
|
|
diag.Config = {
|
|
id: "divisionBox",
|
|
width: 400,
|
|
height: 100,
|
|
frame: {
|
|
text: _HtmlText,
|
|
resize: "true",
|
|
onload: function ()
|
|
{
|
|
diag.Button.Yes.focus();
|
|
}
|
|
},
|
|
message:
|
|
{
|
|
title: "您可办理多个区域业务,请选择该业务所属区域!",
|
|
show: true //,
|
|
//icon: Dialog.Skin.FrameIcon_Title
|
|
},
|
|
button: {
|
|
show: true,
|
|
yes: {
|
|
show: true,
|
|
fn: function ()
|
|
{
|
|
var _temp = $(diag.getDialogBox(diag.id));
|
|
_temp = _temp.find("#pop-dialog-frame-divisionBox").get(0).contentWindow.document;
|
|
_temp = _temp.getElementsByName("division");
|
|
var _Result = -1;
|
|
for (i = 0; i < _temp.length; i++)
|
|
{
|
|
if (_temp[i].checked)
|
|
{
|
|
_Result = _temp[i].value;
|
|
break;
|
|
}
|
|
}
|
|
_Url += "&Division_Code=" + _Result;
|
|
Dialog.OpenPopDialog("WorkFlowWorkPlatform", _Url, _Width, _height, true, false);
|
|
diag.close(); diag.ready = true;
|
|
}
|
|
},
|
|
no: {
|
|
show: true,
|
|
fn: function ()
|
|
{
|
|
|
|
diag.close(); diag.ready = true;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
diag.show();
|
|
}
|
|
else
|
|
{
|
|
Dialog.OpenPopDialog("WorkFlowWorkPlatform", _Url, _Width, _height, true, false);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
function WorkFlowPlatform_MenuClick(evt)
|
|
{
|
|
var _CurrEvent = evt || window.event;
|
|
var _EvtElement = (_CurrEvent.target) ? _CurrEvent.target : _CurrEvent.srcElement;
|
|
var _Component = null;
|
|
if (_EvtElement.tagName != "LI")
|
|
return;
|
|
var _TargetIndex = parseInt(_EvtElement.getAttribute("index"));
|
|
var _targetObject = null;
|
|
|
|
$(".ComponentToolBar").each(function (i)
|
|
{
|
|
var _this = $(this);
|
|
if (_TargetIndex == i)
|
|
{
|
|
_this = _this.parent();
|
|
var _top = FixOffsetTop(_this.get(0).offsetTop);
|
|
if (_TargetIndex == 0)
|
|
_top = 0;
|
|
else
|
|
_top += 1;
|
|
_PrivateScrolling = true;
|
|
$("#Form_Middle").stop(true);
|
|
setTimeout(function ()
|
|
{
|
|
_PrivateScrolling = false;
|
|
$('ul.ComponentList > li').removeClass("ComponentSelected");
|
|
$('ul.ComponentList > li').eq(_TargetIndex).addClass("ComponentSelected");
|
|
}, 250);
|
|
$("#Form_Middle").animate({ scrollTop: _top }, 200);
|
|
return false;
|
|
}
|
|
});
|
|
return false;
|
|
}
|
|
|
|
var _PrivateScrolling = false;
|
|
|
|
function FixOffsetTop(value)
|
|
{
|
|
if (!!RealEstate.Browser.Chrome)
|
|
{
|
|
value = value - 53;
|
|
}
|
|
else if (!!RealEstate.Browser.FireFox)
|
|
{
|
|
value = value - 53;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
$(document).ready(function ()
|
|
{
|
|
$('ul.ComponentList > li').eq(0).addClass("ComponentSelected");
|
|
$("#Form_Middle").scroll(function ()
|
|
{
|
|
if (_PrivateScrolling)
|
|
{
|
|
return;
|
|
}
|
|
var len = $(".ComponentBox").length;
|
|
var _Msg = "";
|
|
var _Menu;
|
|
for (var i = 0; i < len - 1 ; i++)
|
|
{
|
|
_Menu = $('.ComponentBox').eq(i).get(0);
|
|
var _FixMenuTop = FixOffsetTop(_Menu.offsetTop + _Menu.offsetHeight);
|
|
if ($(this).scrollTop() <= _FixMenuTop)
|
|
{
|
|
|
|
if ($('ul.ComponentList > li').eq(i).hasClass("ComponentSelected") == false)
|
|
{
|
|
$('ul.ComponentList > li').removeClass("ComponentSelected");
|
|
$('ul.ComponentList > li').eq(i).addClass("ComponentSelected");
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
})
|
|
}); |