2018-06-03 22:26:41 +08:00

264 lines
7.2 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info00;Describe=注释区;]~*/%>
<%
/*
Author:zhgu 2017-05-11
Tester:
Content: 联合承租人列表详情页面
Input Param:
Output param:
History Log:
*/
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info01;Describe=定义页面属性;]~*/%>
<%
String PG_TITLE = "联合承租人列表详情"; // 浏览器窗口标题 <title> PG_TITLE </title>
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info02;Describe=定义变量,获取参数;]~*/%>
<%
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
String IsShowFormal=CurPage.getParameter("IsShowFormal");//流程编号
System.out.println(IsShowFormal+"---------------------");
if(sFlowUnid == null) sFlowUnid = "";
String sID = CurPage.getParameter("id");
if(sID == null) sID = "";
String sListTempletNo = CurPage.getParameter("ListTempletNo");//List页面模板号
if(sListTempletNo == null) sListTempletNo = "LBUnionLesseeListTemp";
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String taskno = CurPage.getParameter("TaskNo");
String RightType = CurPage.getParameter("RightType");
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info03;Describe=定义数据对象;]~*/%>
<%
String sTempletNo = "LBUnionLesseeInfoTemp";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataInfoHistory");//如果是历史则新显示历史数据
}
CurPage.getCurComp().setAttribute("RightType", null);
%>
<%@ include file="/Tenwa/Lease/Flow/Comm/baseShowInfoFormal.jspf"%>
<%
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "-2";//只读模式
}
dwTemp.genHTMLObjectWindow(sID+','+sFlowUnid);//得到的参数
CurPage.getCurComp().setAttribute("RightType",RightType);
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info04;Describe=定义按钮;]~*/%>
<%
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
{"true","","Button","返回","返回列表页面","goBack()","","","","btn_icon_return"},
};
sButtonPosition = "north";
%>
<%/*~END~*/%>
<%/*~BEGIN~不可编辑区~[Editable=false;CodeAreaID=Info05;Describe=主体页面;]~*/%>
<%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info06;Describe=定义按钮事件;]~*/%>
<script type="text/javascript">
var bIsInsert = false;
/*~[Describe=保存记录;InputParam=无;OutPutParam=无;]~*/
function saveRecord()
{
if(bIsInsert)
{
beforeInsert();
}
beforeUpdate();debugger;
var sCustomerId = getItemValue(0,getRow(0),"Customer_ID");
var sIsMain = getItemValue(0,getRow(0),"Is_Main");
var id = getItemValue(0,getRow(0),"id");
var customer_name=getItemValue(0,getRow(0),"customer_name");
var sparam="Customer_ID="+sCustomerId+",FlowUnid="+"<%=sFlowUnid%>"+",Is_Main="+sIsMain+",id="+id;
//新增时
if(id==""){
var sresult1=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "isexsit", sparam);
if(sresult1=="yes"){
alert("该承租人已存在!");
return;
}
if(sIsMain=='Y'){
var sresult2=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "isMain", sparam);
if(sresult2!="no"){
if(confirm("已存在主承租人\""+sresult2+"\",是否替换?")){
as_save("myiframe0");
return;
}
return;
}
}
as_save("myiframe0");
}
//修改时
if(id!=""){
var MainCustId=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "selectMainCustId", sparam);
var sresult3=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "ischange", sparam);
if(MainCustId==sCustomerId&&sresult3!='no'){
as_save("myiframe0");
return;
}
if(sresult3==id&&sIsMain=='Y'){
var sresult4=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "isMain", sparam);
if(sresult4!="no"){
if(confirm("已存在主承租人\""+sresult4+"\",是否替换?")){
as_save("myiframe0");
return;
}
return;
}
}
if(sresult3=="no"){
var sresult5=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "isexsit", sparam);
if(sresult5=="yes"){
alert("该承租人已存在!");
return;
}else if(sIsMain=='Y'){
var sresult6=RunJavaMethodTrans("com.tenwa.flow.comm.handler.SelectCustController", "isMain", sparam);
if(sresult6!="no"){
if(confirm("已存在主承租人\""+sresult6+"\",是否替换?")){
as_save("myiframe0");
return;
}
return;
}
}
}
as_save("myiframe0");
}
}
/*~[Describe=返回;InputParam=无;OutPutParam=无;]~*/
function goBack()//页面的返回
{
//要跳转的url
var sUrl = "/Tenwa/Lease/Flow/Comm/LBUnionLessee/LBUnionLesseeList.jsp";
//要传的参数
var sParam = "FlowUnid="+"<%=sFlowUnid%>"+"&TempletNo="+"<%=sListTempletNo%>";
var righttype ="<%=RightType%>";
if(righttype == "ReadOnly"){
sParam = sParam+"&RightType=<%=RightType%>";
}
sParam = sParam+"&IsHistory=<%=ishistory%>&TaskNo=<%=taskno%>&NodeNo=<%=nodeNo%>&IsShowFormal=<%=isShowForaml%>";
AsControl.OpenView(sUrl,sParam,"_self","");
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info07;Describe=自定义函数;]~*/%>
<script type="text/javascript">
<%/*~[Describe=执行插入操作前执行的代码;]~*/%>
function beforeInsert()
{
setItemValue(0,0,"InputUserID","<%=CurUser.getUserID()%>");
setItemValue(0,0,"InputOrgID","<%=CurUser.getOrgID()%>");
setItemValue(0,0,"InputTime","<%=StringFunction.getTodayNow()%>");
bIsInsert = false;
}
<%/*~[Describe=执行更新操作前执行的代码;]~*/%>
function beforeUpdate()
{
setItemValue(0,0,"UpdateUserID","<%=CurUser.getUserID()%>");
setItemValue(0,0,"UpdateOrgID","<%=CurUser.getOrgID()%>");
setItemValue(0,0,"UpdateTime","<%=StringFunction.getTodayNow()%>");
}
/*~[Describe=查询承租人名称;InputParam=无;OutPutParam=无;]~*/
function SelectCustomer()
{
AsDialog.OpenSelector("SelectCustomer","","dialogWidth=" + parseInt(window.screen.width * 0.4) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn || sReturn == "_CANCEL_"||sReturn == "_CLEAR_"||sReturn=="_NONE_")
{
return;
}
var results = sReturn.split("@");
setItemValue(0,0,"", results[0]);
setItemValue(0,getRow(),"Customer_ID",results[0]);
setItemValue(0,0,"Customer_Name", results[1]);
},"请选择承租人");
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info08;Describe=页面装载时,进行初始化;]~*/%>
<script type="text/javascript">
function initRow()
{
if (getRowCount(0) == 0) //如果没有找到对应记录,则新增一条,并设置字段默认值
{
setItemValue(0,0,"FlowUnid","<%=sFlowUnid%>");
bIsInsert = true;
}
}
initRow();
</script>
<%/*~END~*/%>
<%@ include file="/Frame/resources/include/include_end.jspf"%>