2019-12-20 19:21:55 +08:00

266 lines
9.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="jbo.com.tenwa.lease.comm.LB_CONTRACT_INFO"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%@ page import="com.amarsoft.app.util.*" %>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info00;Describe=注释区;]~*/%>
<%
/*
Author:lzb 2017-05-5
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");//流程编号
BizObject flow=GetFlowAction.getFlowBussinessObject(sFlowUnid);
String product_id="";
if("true".equals(IsShowFormal)){
String contract_id = CurPage.getParameter("ContractId");//合同编号
BizObject bo=JBOFactory.getBizObjectManager(LB_CONTRACT_INFO.CLASS_NAME).createQuery("id=:id").setParameter("id", contract_id).getSingleResult(false);
product_id=bo.getAttribute("PRODUCT_ID").toString();
}else{
product_id=flow.getAttribute("productId").toString();
}
String sPhaseNo=CurPage.getParameter("PhaseNo");//阶段号
String FlowNo=CurPage.getParameter("FlowNo");//流程名称
String NodeNo=CurPage.getParameter("NodeNo");//流程名称
if(sFlowUnid == null) sFlowUnid="";
String productid = Sqlca.getString("select PRODUCT_ID from LB_CONTRACT_INFO_TEMP where flowunid = '"+sFlowUnid+"'");
String sTempletNo = "LBContractInfoTemp";//--模板号--
//传统合同审批流程中的合同基本信息页签带错模板如果产品编号正好为004是就会带错模板 ,所以注释了)
/* if("004".equals(productid)){
sTempletNo = "LBContractInfoTemp_Car";
} */
if(("0030".equals(sPhaseNo)&&("ContractApprovalFlow".equals(FlowNo)||"ContractChangeFlow".equals(FlowNo)))){
sTempletNo="LBContractInfoAtMakeTemp";
}
String orgid = CurUser.getOrgID();//当前用户部门id
String orgidname = CurUser.getOrgName();//当前用户部门
String userid = CurUser.getUserID();//用户id
String useridname = CurUser.getUserName();//用户姓名
String RightType=CurPage.getParameter("RightType");
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info03;Describe=定义数据对象;]~*/%>
<%
//String rentmethod=ProductParamUtil.getProductParameterValue(product_id,"PRD0313","starttimes");//起租方式
String rentmethod="N";//起租方式
String planinformation="SinglePlan";//方案类型
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setHtmlEvent("LEAS_FORM","onchange","changeLeaseForm");
if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataInfoHistory");//如果是历史则新显示历史数据
}
if(!("0030".equals(sPhaseNo)&&("ContractApprovalFlow".equals(FlowNo)||"ContractChangeFlow".equals(FlowNo)))){
CurPage.getCurComp().setAttribute("RightType", null);
}else{
doTemp.setColInnerBtEvent("PROJECT_ASSIST_NAME", "");
}
doTemp.setDefaultValue("FlowUnid", sFlowUnid);//赋值流程编号
if("TAssetsDisposalFeeFlow".equals(FlowNo)){
doTemp.setReadOnly("CONTRACT_NUMBER", true);
}
if("currentProduct".equals(product_id)){
doTemp.setReadOnly("LEAS_FORM", false);
}
%>
<%@ include file="/Tenwa/Lease/Flow/Comm/baseShowFormal.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";//只读模式
}
if(isShowForaml.equals("true")){
dwTemp.genHTMLObjectWindow(sContractId);
}else{
dwTemp.genHTMLObjectWindow(sFlowUnid);
}
CurPage.getCurComp().setAttribute("RightType", RightType);
%>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=true;CodeAreaID=Info04;Describe=定义按钮;]~*/%>
<%
String isAll="All";
if(("0030".equals(sPhaseNo)&&("ContractApprovalFlow".equals(FlowNo)||"ContractChangeFlow".equals(FlowNo)))&&!"true".equals(ishistory)){
isAll="";
}
String sButtons[][] =null;
// 原版的
sButtons= new String[][]{
{"true",isAll,"Button","保存","保存所有修改","saveRecord()","","","",""}
};
%>
<%/*~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">
//---------------------定义按钮事件------------------------------------
/*~[Describe=保存记录;InputParam=无;OutPutParam=无;]~*/
function saveRecord(){
as_save("myiframe0");
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info07;Describe=自定义函数;]~*/%>
<script type="text/javascript">
//选择项目经理
function selectManager(){
AsDialog.OpenSelector("SelectManager","orgid,<%=orgid%>","dialogWidth=" + parseInt(window.screen.width * 0.2) + "px dialogHeight=" + parseInt(window.screen.height * 0.3) + "px",function(sReturn){
if(!sReturn || sReturn == "_CANCEL_"){
return;
}
sReturn = sReturn.split("@");
setItemValue(0,getRow(),"PROJECT_MANAGE_NAME",sReturn[1]);
setItemValue(0,getRow(),"PROJECT_MANAGE",sReturn[0]);
},"请选项目经理");
}
//选择项目协办
function selectAssist(){
AsDialog.OpenSelector("SelectManager","orgid,<%=orgid%>","dialogWidth=" + parseInt(window.screen.width * 0.2) + "px dialogHeight=" + parseInt(window.screen.height * 0.3) + "px",function(sReturn){
if(!sReturn || sReturn == "_CANCEL_"){
return;
}
sReturn = sReturn.split("@");
setItemValue(0,getRow(),"PROJECT_ASSIST_NAME",sReturn[1]);
setItemValue(0,getRow(),"PROJECT_ASSIST",sReturn[0]);
},"请选项目协办");
}
</script>
<%/*~END~*/%>
<%/*~BEGIN~可编辑区~[Editable=false;CodeAreaID=Info08;Describe=页面装载时,进行初始化;]~*/%>
<script type="text/javascript">
//初始化数据
function init(){
//第三阶段业务合同号编辑
if('<%=sPhaseNo%>'=="0030"){
setItemReadOnly(0,0,"CONTRACT_NUMBER",false);
}
var num = RunJavaMethodSqlca("com.tenwa.lease.flow.project.projectapproval.BusinessTypeController","getNumber","");
if(num==1){
//字段隐藏,当系统中只有1个业务品种的时候该字段隐藏当系统中只有1个业务品种的时候该字段隐藏
hideItem(0,'product_Name');
hideItem(0,'product_id');
}else if(num>1){
showItem(0,"product_Name");
showItem(0,"product_id");
}
var ProjectDept=getItemValue(0, getRow(),"Project_Dept");//项目出单部门
var ProjectRegistrar=getItemValue(0, getRow(),"Project_Registrar");//经办人
var ProjectManage=getItemValue(0, getRow(),"Project_Manage");//项目经理
var ProjectAssist=getItemValue(0, getRow(),"Project_Assist");//项目协办
var RENT_METHOD=getItemValue(0, getRow(),"RENT_METHOD");//起租方式
if(typeof(ProjectDept) == "undefined" || ProjectDept.length == 0 ){
setItemValue(0,getRow(),"Project_Dept","<%=orgid%>");
setItemValue(0,getRow(),"Project_Dept_Name","<%=orgidname%>");
}
if(typeof(ProjectRegistrar) == "undefined" || ProjectRegistrar.length == 0 ){
setItemValue(0,0,"Project_Registrar","<%=userid%>");
setItemValue(0,0,"Project_Registrar_Name","<%=useridname%>");
}
if(typeof(ProjectManage) == "undefined" || ProjectManage.length == 0 ){
setItemValue(0,0,"Project_Manage","<%=userid%>");
setItemValue(0,0,"Project_Manage_Name","<%=useridname%>");
}
<%-- if(typeof(ProjectAssist) == "undefined" || ProjectAssist.length == 0 ){
setItemValue(0,0,"Project_Assist","<%=userid%>");
setItemValue(0,0,"Project_Assist_Name","<%=useridname%>");
} --%>
var rentmethod='<%=rentmethod%>';// 起租方式
var planinformation='<%=planinformation%>';//方案类型
if(rentmethod=='N'){
hideItem(0,"RENT_METHOD");
setItemValue(0,0,"RENT_METHOD","010");
}
if(planinformation!='SinglePlan'){
var sql="select itemno,itemname from code_library where codeno='rent_method' and itemno='020'";
initSelectOption(sql,"itemname","itemno","RENT_METHOD");
setItemValue(0,0,"RENT_METHOD","020");
}
if(typeof(RENT_METHOD) == "undefined" || RENT_METHOD.length == 0 ){
if(rentmethod=='Y'&&planinformation=='SinglePlan'){
var sql="select itemno,itemname from code_library where codeno='rent_method'";
initSelectOption(sql,"itemname","itemno","RENT_METHOD");
}else if(rentmethod=='Y'&&planinformation!='SinglePlan'){
var sql="select itemno,itemname from code_library where codeno='rent_method' and itemno='020'";
initSelectOption(sql,"itemname","itemno","RENT_METHOD");
setItemValue(0,0,"RENT_METHOD","020");
}
}
var LEASE_FORM=getItemValue(0,getRow(0),"LEAS_FORM");
var LEAS_FORM=getItemValue(0,getRow(0),"LEAS_FORM");
if(typeof(LEASE_FORM) == "undefined" || LEASE_FORM.length == 0){
changeLeaseForm();
}else if(LEAS_FORM=='01'){
setItemValue(0,0,"LEASE_FORM","01");
setItemReadOnly(0,0,"LEASE_FORM",true);
}else if(LEAS_FORM=='02'){
setItemValue(0,0,"LEASE_FORM","02");
setItemReadOnly(0,0,"LEASE_FORM",true);
}
}
function changeLeaseForm(){
var LEAS_FORM=getItemValue(0,getRow(0),"LEAS_FORM");
if(LEAS_FORM=='01'){
setItemValue(0,0,"LEASE_FORM","01");
setItemReadOnly(0,0,"LEASE_FORM",true);
}else if(LEAS_FORM=='02'){
setItemValue(0,0,"LEASE_FORM","02");
setItemReadOnly(0,0,"LEASE_FORM",true);
}else{
setItemValue(0,0,"LEASE_FORM",'');
setItemReadOnly(0,0,"LEASE_FORM",false);
}
}
init();
</script>
<%/*~END~*/%>
<%@ include file="/Frame/resources/include/include_end.jspf"%>