222 lines
8.0 KiB
Plaintext
222 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 sFlowUnid = CurPage.getParameter("FlowUnid");//流程编号
|
||
String sPhaseNo=CurPage.getParameter("PhaseNo");//阶段号
|
||
String FlowNo=CurPage.getParameter("FlowNo");//流程名称
|
||
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";//--模板号--
|
||
BizObject bo=JBOFactory.createBizObjectQuery("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT", "flow_unid=:flowunid").setParameter("flowunid",sFlowUnid).getSingleResult(false);
|
||
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",""},
|
||
{"ReadOnly".equals(rightType)?"false":"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 = getRequestUrl();
|
||
let params = getRequestParam();
|
||
post(url,params);
|
||
}
|
||
function getRequestUrl(){
|
||
let url = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestUrl","");
|
||
return url;
|
||
}
|
||
function getRequestParam(){
|
||
let appCode = 'BQCW-000010';
|
||
let appName = '业务申请';
|
||
let code = 'ECM0002';
|
||
if(("<%=sPhaseNo%>"=="0010") && ("<%=FlowNo%>"=="BusinessApplyFlow" || "<%=FlowNo%>" == "BusinessChangeFlow")){
|
||
code = 'ECM0001';
|
||
}
|
||
let busiNo = '<%=sFlowUnid%>';
|
||
let param = RunJavaMethod("com.ample.icms.query.ImageQuery","getRequestParam","appCode="+appCode+",appName="+appName+",code="+code+",busiNo="+busiNo);
|
||
return param;
|
||
}
|
||
/**
|
||
* 考虑防止一些浏览器的弹窗被阻止,不用ajax,而是用form表单提交的方式
|
||
* @param URL
|
||
* @param PARAMS
|
||
*/
|
||
function post(URL, param) {
|
||
let temp_form = document.createElement("form");
|
||
temp_form.action = URL;
|
||
temp_form.target = "_blank";
|
||
temp_form.method = "post";
|
||
temp_form.style.display = "none";
|
||
|
||
let opt = document.createElement("textarea");
|
||
opt.name = 'data';
|
||
opt.value = param;
|
||
temp_form.appendChild(opt);
|
||
|
||
document.body.appendChild(temp_form);
|
||
temp_form.submit();
|
||
}
|
||
function product(){
|
||
RunJavaMethod("com.tenwa.util.test","product","");
|
||
}
|
||
|
||
</script>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%> |