2018-10-18 20:19:36 +08:00

118 lines
4.7 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
String id = CurPage.getParameter("ID");
String sTempletNo = CurPage.getParameter("TempletNo");//模板号
if(sTempletNo == null) sTempletNo = "LBContractInvoiceObjectListTemp";
String sInfoTempletNo = CurPage.getParameter("InfoTempletNo");//模板号
if(sInfoTempletNo == null) sInfoTempletNo = "LBContractInvoiceObjectInfoTemp";
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
if(sFlowUnid == null)sFlowUnid = "";
String RightType= CurPage.getParameter("RightType");
if(RightType == null) RightType = "";
String taskno=CurPage.getParameter("TaskNo");
if(taskno == null) taskno = "";
String ishistory=CurPage.getParameter("IsHistory");
if(ishistory == null) ishistory = "";
String nodeNo=CurPage.getParameter("NodeNo");
ASObjectModel doTemp = new ASObjectModel(sInfoTempletNo);
doTemp.setHtmlEvent("TAX_REG_TYPE", "onchange","changeRequired");
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";//
if((null!=RightType&&RightType.equals("ReadOnly"))||(null!=ishistory&&ishistory.equals("true"))){
dwTemp.ReadOnly = "-2";//只读模式
RightType = "ReadOnly";
}
dwTemp.genHTMLObjectWindow(id);
CurPage.getCurComp().setAttribute("RightType", RightType);
String sButtons[][] =null;
sButtons =new String[][] {
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
{"true","","Button","返回","返回列表","goBack()","","","","btn_icon_return"}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
window.onload=function(){
changeRequired();
}
function saveRecord(){
if(!validityCheck())return;
as_save("myiframe0");
}
function goBack(){
var sUrl = "/Tenwa/Lease/Flow/Comm/LBContractInvoiceInfo/LBContractInvoiceObjectList.jsp";
var sparam = 'FlowUnid='+'<%=sFlowUnid%>'+"&TempletNo="+"<%=sTempletNo%>&InfoTempletNo=<%=sInfoTempletNo%>&TaskNo=<%=taskno%>&NodeNo=<%=nodeNo%>&RightType=<%=RightType%>&IsHistory=<%=ishistory%>";//流程编号
AsControl.OpenView(sUrl,sparam,"_self","");
}
function changeRequired(){
var taxRegType =getItemValue(0,getRow(),'TAX_REG_TYPE');
if(typeof(taxRegType)!=undefined && taxRegType=='tax_payercategory1'){
setItemRequired(0, "TAX_REG_CODE", true);
setItemRequired(0, "TAX_BANK", true);
setItemRequired(0, "TAX_ACC", true);
setItemRequired(0, "INVOICE_ADD", true);
setItemRequired(0, "INVOICE_PHONE", true);
}else if(typeof(taxRegType)!=undefined && taxRegType=='tax_payercategory2'){
setItemRequired(0, "TAX_REG_CODE", false);
setItemRequired(0, "TAX_BANK", false);
setItemRequired(0, "TAX_ACC", false);
setItemRequired(0, "INVOICE_ADD", false);
setItemRequired(0, "INVOICE_PHONE", false);
}
}
function selectInvoiceObject(){
AsDialog.OpenSelector("selectInvoiceObject","FlowUnid,"+"<%=sFlowUnid%>","dialogWidth=" + parseInt(window.screen.width * 0.9) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"){
return;
}
sReturn = sReturn.split("@");
setItemValue(0,0,"INVOICE_OBJECT", sReturn[0]);
setItemValue(0,0,"TAX_REG_TYPE", sReturn[1]);
setItemValue(0,0,"TAX_REG_CODE", sReturn[2]);
setItemValue(0,0,"TAX_BANK", sReturn[3]);
setItemValue(0,0,"TAX_ACC", sReturn[4]);
setItemValue(0,0,"INVOICE_ADD", sReturn[5]);
setItemValue(0,0,"INVOICE_PHONE", sReturn[6]);
//添加是否是默认开票
if("yes"==sReturn[7]){
document.getElementById("IS_MAIN").selectedIndex = 1;
}else if("no"==sReturn[7]){
document.getElementById("IS_MAIN").selectedIndex = 2;
}
},"请选择开票对象");
}
function validityCheck(){
var taxAcc = getItemValue(0,getRow(),"TAX_ACC");//开票状态
var invoicePhone = getItemValue(0,getRow(),"INVOICE_PHONE");//开票电话
//验证手机号
if(typeof(invoicePhone) != undefined && invoicePhone != "" ){
if(!CheckPhoneCode(invoicePhone)){
alert("开票电话格式错误!");
return false;
}
}
//验证开户账号
if(typeof(taxAcc) != undefined && taxAcc != "" ){
var account = "";
for(var i = 0;i < taxAcc.length;i++){
if(taxAcc[i] != " "){
account += taxAcc[i];
}
}
var reg = /^[0-9]+$/;
if (!(reg.test(account))) {
alert("开户账号格式错误!");
return false;
}
}
return true;
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>