215 lines
8.0 KiB
Plaintext

<%@page import="com.sun.org.apache.xalan.internal.xsltc.compiler.sym"%>
<%@page import="com.tenwa.reckon.product.ASObjectWindowCalc"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2017-07-10
Content: 示例详情页面
History Log:
*/
String userId= CurUser.getUserID();
String userName = CurUser.getUserName();
String sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
String sPhaseNo=CurPage.getParameter("PhaseNo");//阶段号
String FlowNo=CurPage.getParameter("FlowNo");//流程名称
String projectNo=CurPage.getParameter("ProjectNo");//项目编号
String sPrevUrl = CurPage.getParameter("PrevUrl");
String operationType = CurPage.getParameter("operationType");//获取产品类型
if(sPrevUrl == null) sPrevUrl = "";
String compClientID = CurPage.getParameter("CompClientID");
String rightType = CurPage.getParameter("RightType");
String sTempletNo = "BusinessProjectTempInfo";//--模板号--
String custype = CurPage.getParameter("CustomerType");
String customertype = CurPage.getParameter("customertype");
String channel = CurPage.getParameter("channel");
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
doTemp.setHtmlEvent("inputTel","onChange","checkTel");
//租赁形式set只读
if((null!=sPhaseNo&&sPhaseNo.equals("0010")) && ("BusinessApplyFlow".equals(FlowNo) ||"BusinessChangeFlow".equals(FlowNo))){
doTemp.setReadOnly("LEAS_FORM", true);
doTemp.setReadOnly("PROJECT_SOURCE", false);
};
if("ReadOnly".equals(rightType)){
doTemp.setReadOnly("INPUTNAME", true);
doTemp.setReadOnly("INPUTTEL", true);
doTemp.setReadOnly("ZC_PROJECT_NUMBER", true);
doTemp.setReadOnly("ZC_CONTRACT_NUMBER", true);
};
//如果是北汽的产品,业务申请号可编辑
if(!"ReadOnly".equals(rightType)&&sPhaseNo.equals("0010")&&"BAIC_MOTOR".equals(operationType)&&"BusinessApplyFlow".equals(FlowNo)){
doTemp.setReadOnly("PROJECT_NO", false);
}else{
doTemp.setReadOnly("PROJECT_NO", true);
};
String userll=null;
userll="/Tenwa/Lease/Flow/Project/BusinessApplication/CustomerInfo.jsp?CompClientID=";
if("01".equals(custype)||"01".equals(customertype)){
userll="/Tenwa/Customer/Lessee/Person/CustomerCompanyTempInfo.jsp?CompClientID=";
};
if("ZC".equals(channel)){
doTemp.setVisible("ZC_PROJECT_NUMBER",true);
doTemp.setRequired("ZC_PROJECT_NUMBER",true);
doTemp.setVisible("ZC_CONTRACT_NUMBER",true);
doTemp.setRequired("ZC_CONTRACT_NUMBER",true);
};
ASObjectWindowCalc dwTemp = new ASObjectWindowCalc(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
dwTemp.setGroupHidden("0020");
dwTemp.genHTMLObjectWindow(CurPage.getParameter("FlowUnid"));
dwTemp.replaceColumn("customer_info", "<iframe type='iframe' id='frame_list' name=\"frame_list\" width=\"100%\" height=\"500px\" frameborder=\"0\" src=\""+sWebRootPath+userll+compClientID+"&sPhaseNo="+sPhaseNo+"\"></iframe>", CurPage.getObjectWindowOutput());
String sButtons[][] = {
{"ReadOnly".equals(rightType)?"false":"true","","Button","保存","保存","save()","","","","btn_icon_saveNew",""},
{"true","","Button","资料清单","资料清单","openFileList()","","","","btn_icon_saveNew",""},
{"true","","Button","产品信息","产品信息","product()","","","","btn_icon_saveNew",""}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
$(function() {
//去除项目审批信息难看样式
$("#PROJECT_NO").parent().find(".info_span").remove();
$("#PRODUCT_NAME").parent().find(".info_span").remove();
$("#LEAS_FORM").parent().find(".info_span").remove();
$(".info_td_left").css("width","150px");
$(".info_mid_line").css("width","50%");
})
function save(){
if(!checkinputName()){
return;
}
if(!checkTel()){
return ;
}
if("ZC"=="<%=channel%>"){
if(!checkZcProjectNumber()){
return ;
}
if(!checkZcContractNumber()){
return ;
}
}
var leasfrom = getItemValue(0,getRow(),"LEAS_FORM");
var projectSource = getItemValue(0,getRow(),"PROJECT_SOURCE");
var inputName = getItemValue(0,getRow(),"inputName");
var inputTel = getItemValue(0,getRow(),"inputTel");
var zcProjectNumber = getItemValue(0,getRow(),"ZC_PROJECT_NUMBER");
var zcContractNumber = getItemValue(0,getRow(),"ZC_CONTRACT_NUMBER");
var customerType = "<%=custype%>";
var customerT = "<%=customertype%>";
var projectNo=getItemValue(0,getRow(),"PROJECT_NO");
if(projectNo.length<=0){
alert("请填写业务申请编号!!!");
return;
}
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","checkProjectNo","projectNo="+projectNo+",id="+getItemValue(0,getRow(),"ID"));
if("error"==sReturnInfo&&"BusinessApplyFlow"=="<%=FlowNo%>"){
alert("业务申请编号已被占用,请重新填写!!!");
return;
}
var operationType="<%=operationType%>";
if(customerType=="01"||customerT=="01"){//法人
//as_save("myiframe0","frame_list.window.saveCompany();");
// if("BAIC_MOTOR"==operationType){
var sReturn = RunJavaMethodTrans("com.tenwa.lease.flow.project.businessapply.CustomerInfoCheck","changFlowKey","projectNo="+projectNo+",flowunid=<%=sFlowUnid%>");
if("false"==sReturn){
return "申请编号保存错误!!!";
}
// }
frame_list.window.saveCompany(inputName,inputTel,projectNo);
//as_save(0);
}
if(customerType=="03"||customerT=="03"){//自然人
frame_list.window.saveRecord(leasfrom,projectSource,inputName,inputTel,projectNo,operationType,zcProjectNumber,zcContractNumber);
//as_save("myiframe0","frame_list.window.as_save(0);");
}
}
function checkTel(){//校验手机号格式和不为空校验
var mobile = getItemValue(0,getRow(0),"inputTel");
if(mobile==""){
setErrorTips("inputTel","手机号不能为空!");
return false;
}
if(CheckPhoneCode(mobile)){
setErrorTips("inputTel","");
return true;
}else{
setErrorTips("inputTel","报单人电话格式不正确!");
return false;
}
}
function checkinputName(){
var inputName = getItemValue(0,getRow(0),"inputName");
if(inputName==""){
setErrorTips("inputName","报单人不能为空!");
return false;
}else{
setErrorTips("inputName","");
return true;
}
}
function checkZcProjectNumber(){
var zcProjectNumber = getItemValue(0,getRow(0),"ZC_PROJECT_NUMBER");
if(zcProjectNumber==""){
setErrorTips("ZC_PROJECT_NUMBER","中车申请号不能为空!");
return false;
}else{
setErrorTips("ZC_PROJECT_NUMBER","");
return true;
}
}
function checkZcContractNumber(){
var zcContractNumber = getItemValue(0,getRow(0),"ZC_CONTRACT_NUMBER");
if(zcContractNumber==""){
setErrorTips("ZC_CONTRACT_NUMBER","中车合同号不能为空!");
return false;
}else{
setErrorTips("ZC_CONTRACT_NUMBER","");
return true;
}
}
function openFileList(){
let url = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestUrl","");
let params = getRequestParam();
if(params!=null){
AsControl.postICMS(url,params);
}
}
function getRequestParam(){
let appInfo = RunJavaMethod("com.ample.icms.util.GetInfoUtil", "getAppInfoByFlowUnidRJM", "flowUnid=<%=sFlowUnid%>");
let index = appInfo.indexOf("@");
if(index==-1){
alert(appInfo);
return;
}
let appCode = appInfo.substr(0,index);
let appName = appInfo.substr(index+1,appInfo.length);
if(appCode=='0000'){
alert(appName);
return;
}
let code = 'ECM0002';
if(("<%=FlowNo%>"=="BusinessApplyFlow"||"<%=FlowNo%>"=="BusinessChangeFlow")&&"<%=sPhaseNo%>"=="0010"){
code = 'ECM0001';
}
let busiNo="<%=projectNo%>";
if(busiNo==null||busiNo==""||busiNo=="null"){
busiNo = RunJavaMethod("com.ample.icms.util.GetInfoUtil", "getProjectNoByFlowUnidRJM", "flowUnid=<%=sFlowUnid%>");
}
let identity = $("#frame_list")[0].contentWindow.getIdentity();
let customerName = $("#frame_list")[0].contentWindow.getCustomerName();
let param = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestParam","appCode="+appCode+",appName="+appName+",code="+code+",busiNo="+busiNo+",userCode=<%=userId%>"+",userName=<%=userName%>"+",identity="+identity+",customerName="+customerName);
return param;
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>