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

140 lines
5.5 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%>
<%
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
String ProductId=CurPage.getParameter("ProductId");
if(sFlowUnid == null)sFlowUnid = "";
String ID = CurPage.getParameter("id");//担保单位ID
if(ID == null)ID = "";
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String taskno=CurPage.getParameter("TaskNo");
// CurPage.getCurComp().setAttribute("RightType","");
String RightType= CurPage.getAttribute("RightType");
String sTempletNo = "LBClaimsApplyTempInfo";//--模板号
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setHtmlEvent("CAUTION_MONEY", "onchange", "checkCautionMoney");
doTemp.setHtmlEvent("CHANNEL_CAUTION_MONEY", "onchange", "checkChannelCautionMoney");
if(null!=ishistory&&ishistory.equals("true")){
//数据归档,显示历史数据
// doTemp.setDataQueryClass("com.tenwa.flow.flowHistory.FlowDataInfoHistory");//如果是历史则新显示历史数据
}
%>
<%@ 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 = "1";//只读模式
}
//dwTemp.genHTMLObjectWindow(ID);
dwTemp.genHTMLObjectWindow(sFlowUnid);
CurPage.getCurComp().setAttribute("RightType", RightType);
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
{"false","","Button","返回","返回列表页面","goBack()","","","","btn_icon_return"}
};
//sButtonPosition = "south";
%>
<%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
var oldCautionMoney;
var oldChannelCautionMoney;
$(function(){
oldCautionMoney = getItemValue(0,0,"CAUTION_MONEY");
oldChannelCautionMoney = getItemValue(0,0,"CHANNEL_CAUTION_MONEY");
})
/*~[Describe=保存记录;InputParam=无;OutPutParam=无;]~*/
function saveRecord(){
var sFlowUnid = "<%=sFlowUnid%>";
var ContractId= getItemValue(0,getRow(0),'CONTRACT_ID');
var ClimApplyTime= getItemValue(0,getRow(0),'CLIMAPPLYTIME');
var param="ContractId="+ContractId+",FlowUnid="+sFlowUnid+",ClimApplyTime="+ClimApplyTime;
setItemValue(0,getRow(),"FlowUnid",sFlowUnid);//初始化流程编号
as_save("myiframe0");
}
/*~[Describe=返回列表页面;InputParam=无;OutPutParam=无;]~*/
function goBack(){
AsDialog.ClosePage();
}
//changeClaimTime()
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()%>");
}
function checkCautionMoney(){
var cautionMoney = getItemValue(0,0,"CAUTION_MONEY");
if(cautionMoney == ""){
cautionMoney = oldCautionMoney;
setItemValue(0,0,"CAUTION_MONEY",cautionMoney);
AsDebug.showMessage("提示","输入金额不能为空","","",true);
return;
}
if(Number(cautionMoney) < 0){
cautionMoney = oldCautionMoney;
setItemValue(0,0,"CAUTION_MONEY",cautionMoney);
AsDebug.showMessage("提示","输入金额不能小于0","","",true);
return;
}
var contractId = getItemValue(0,0,"CONTRACT_ID");
var result = AsControl.RunJsp("/Tenwa/Lease/Flow/Contract/ContractInsurance/GetCautionMoney.jsp","Type=customer&ContractId="+contractId);
if(Number(result) < Number(cautionMoney)){
cautionMoney = oldCautionMoney;
setItemValue(0,0,"CAUTION_MONEY",cautionMoney);
AsDebug.showMessage("提示","输入金额不能大于可抵扣金额","","",true);
return;
}else{
var climamount = getItemValue(0,0,"CLIMAMOUNT");
climamount = eval(climamount + "+" + oldCautionMoney + "-" + cautionMoney).toFixed(2);
setItemValue(0,0,"CLIMAMOUNT",climamount);
oldCautionMoney = cautionMoney;
}
}
function checkChannelCautionMoney(){
var channelCautionMoney = getItemValue(0,0,"CHANNEL_CAUTION_MONEY");
if(channelCautionMoney == ""){
channelCautionMoney = oldChannelCautionMoney;
setItemValue(0,0,"CHANNEL_CAUTION_MONEY",channelCautionMoney);
AsDebug.showMessage("提示","输入金额不能为空","","",true);
return;
}
if(Number(channelCautionMoney) < 0){
channelCautionMoney = oldChannelCautionMoney;
setItemValue(0,0,"CHANNEL_CAUTION_MONEY",channelCautionMoney);
AsDebug.showMessage("提示","输入金额不能小于0","","",true);
return;
}
var contractId = getItemValue(0,0,"CONTRACT_ID");
var result = AsControl.RunJsp("/Tenwa/Lease/Flow/Contract/ContractInsurance/GetCautionMoney.jsp","Type=channel&ContractId="+contractId);
if(Number(result) < Number(channelCautionMoney)){
channelCautionMoney = oldChannelCautionMoney;
setItemValue(0,0,"CHANNEL_CAUTION_MONEY",channelCautionMoney);
AsDebug.showMessage("提示","输入金额不能大于可抵扣金额","","",true);
return;
}else{
var climamount = getItemValue(0,0,"CLIMAMOUNT");
climamount = eval(climamount + "+" + oldChannelCautionMoney + "-" + channelCautionMoney).toFixed(2);
setItemValue(0,0,"CLIMAMOUNT",climamount);
oldChannelCautionMoney = channelCautionMoney;
}
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>