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

160 lines
6.2 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 contentType="text/html; charset=GBK"%>
<%@page import="com.tenwa.reckon.util.TbBeanTools"%>
<%@page import="com.tenwa.reckon.bean.TabCalBean"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2017-06-12
Content:
History Log:
*/
String flowunid=CurPage.getParameter("flowunid");
String plannumber=CurPage.getParameter("plannumber");
String planCName=CurPage.getParameter("planCName");
String ishistory=CurPage.getParameter("IsHistory");
String nodeNo=CurPage.getParameter("NodeNo");
String calType=CurPage.getParameter("calType");
TabCalBean tcb=TbBeanTools.getTabInfo(calType);
String RightType=CurPage.getParameter("RightType");
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
isShowButton=false;
}else{
isShowButton=true;
}
ASObjectModel doTemp = new ASObjectModel("LCCalcReriodList");
doTemp.appendJboWhere(" and "+planCName+"='"+plannumber+"'");
if(null!=ishistory&&ishistory.equals("true")){
doTemp.setDataQueryClass("com.tenwa.lease.flow.flowarchive.calcarchive.CalcRentListArachiveShow");
}
doTemp.setJboClass(tcb.getPeriodTb());
CurPage.setAttribute("modelno","reriod");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "0"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow(flowunid);
System.out.println( dwTemp.getPageCount());
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","","Button","新增","新增","newRecord()","","","",""},
{"true","","Button","保存","保存","save()","","","",""},
{"true","","Button","删除","删除","deleteRecord()","","","",""},
{"true","","Button","导入","导入","importRent()","","","","btn_icon_set",""},
{"true","","Button","模板下载","模板下载","downloadTemplate()","","","","btn_icon_set",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function save(){
var pa=s_c_p[0]+1;
var count=getRowCount(0);
var start=parent.getItemValue(0,0,"start_date");
if(pa>1){
start=AsControl.RunJavaMethodTrans("com.tenwa.reckon.action.CalcAction","getUpperPlanDate","flowunid=<%=flowunid%>,planCValue=<%=plannumber%>,planCName=<%=planCName%>,calType=<%=calType%>,planlist="+getItemValue(0,0,"PLAN_list"));
}
for(var i=0;i<getRowCount(0);i++){
if(getItemValue(0,i,"PLAN_DATE")<start){
alert("第"+getItemValue(0,i,"PLAN_list")+"期日期不能小于上一期日期");
return;
}
start=getItemValue(0,i,"PLAN_DATE");
}
if(pa<s_p_c[0]){
var nextplandate=AsControl.RunJavaMethodTrans("com.tenwa.reckon.action.CalcAction","getNextPlanDate","flowunid=<%=flowunid%>,calType=<%=calType%>,planCValue=<%=plannumber%>,planCName=<%=planCName%>,planlist="+getItemValue(0,count-1,"PLAN_list"));
if(getItemValue(0,count-1,"plan_date")>nextplandate){
alert("第"+getItemValue(0,count-1,"plan_list")+"期日期不能大于下一期日期");
return;
}
}
if(pa==1){
if(count>0&&getItemValue(0,0,'plan_date')){
parent.setItemValue(0,0,"FIRST_PLAN_DATE",getItemValue(0,0,'plan_date'));
}
if(count>1&&getItemValue(0,1,'plan_date')){
parent.setItemValue(0,0,"SECOND_PLAN_DATE",getItemValue(0,1,'plan_date'));
}
}
as_save(0,'setIncomeNumber()');
}
function setIncomeNumber(){
var lastplanlist=AsControl.RunJavaMethodTrans("com.tenwa.reckon.action.CalcAction","getLastPlanList","flowunid=<%=flowunid%>,calType=<%=calType%>,planCValue=<%=plannumber%>,planCName=<%=planCName%>");
parent.setItemValue(0,getRow(),"INCOME_NUMBER",lastplanlist);
}
/*~[Describe=新增记录;InputParam=无;OutPutParam=无;]~*/
function newRecord(){
var a=HiddenChangedValues;
var pa=s_c_p[0]+1;
if(pa!=s_p_c[0]&&s_p_c[0]!=0){
alert("请在最后一页新增");
return ;
}
var count=1;
if(getRowCount(0)>0){
count=Number( getItemValue(0,getRowCount(0)-1,'plan_list'))+1;
}
as_add(0);
setItemValue(0,getRow(0),'flowunid','<%=flowunid%>');
setItemValue(0,getRow(0),'<%=planCName%>','<%=plannumber%>');
setItemValue(0,getRow(0),'plan_list',count+"");
}
function deleteRecord(){
//s_c_p[0]+1 当前页 s_p_c[0] 最后一页
if(s_c_p[0]+1<s_p_c[0]){
alert('请依次从最后一期开始删除!');
return;
}
//判断当前期次是否已回笼,并且是不是最后一期
var count=getRowCount(0);
var rentList = getItemValue(0,getRow(0),'PLAN_LIST');
var plan=getItemValue(0,count-1,'plan_list');
if(rentList !=plan){
alert('请依次从最后一期开始删除!');
return;
}
if(confirm('确实要删除吗?')){
deleteHiddenChanged(count-1);
as_delete(0);
}
}
function importRent(){
var importCondition={};//导入配置
importCondition["flowunid"]="<%=flowunid%>";
importCondition["plannumber"]="<%=plannumber%>";
importCondition["planCName"]="<%=planCName%>";
importCondition["calType"]="<%=calType%>";
importCondition["CLEAN_LEASE_MONEY"]=parent.getItemValue(0,0,"CLEAN_LEASE_MONEY");
importCondition["RENT_OR_RATE"]=parent.getItemValue(0,0,"RENT_OR_RATE");
importCondition["EQUIP_END_VALUE"]=parent.getItemValue(0,0,"EQUIP_END_VALUE");
//增加其他配置参数
var sparam=JSON.stringify(importCondition).replace(/,/g,"@");
AsDialog.PopView("/Accounting/LoanSimulation/reriod/uploadReriod.jsp","importparam="+sparam,
{width:"350px",height:"40px",title:"上传租金表"},function(ew){
var result=eval("("+ew+")");
parent.setItemValue(0,0,"INCOME_NUMBER",result["index"]);
parent.setItemValue(0,0,"FIRST_PLAN_DATE",result["firstplan"]);
parent.setItemValue(0,0,"SECOND_PLAN_DATE",result["second"]);
//parent.lsaseTerm();
reloadSelf();
});
}
function downloadTemplate(){
var templateId="bf1b960acfc94c3f9457ff801bb88628";
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>&sqlString=save@"+templateId, "downloadTemplate");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>