按钮重复点击处理

This commit is contained in:
yjf 2021-11-04 18:05:42 +08:00
parent 237871e9ae
commit 02f8d84f42

View File

@ -286,13 +286,8 @@
}
function createContractByTemplate() {
var d = popupShade();
setTimeout(function () {
var checkbox = $("#filetemplatemodel").html() || "";
if (checkbox == "") {
alert("请选择合同模板下面的分类,或分类下面没有模板");
return false;
}
let click = $('a[title="生成合同"]').attr('onclick');
$('a[title="生成合同"]').removeAttr('onclick');
var tempids = "";
$('input[name="fileTemplate"]:checked').each(function () {
if (tempids.length > 0) {
@ -302,14 +297,14 @@
});
if (tempids.length <= 0) {
alert("请勾选合同模板!");
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
if ("BContractChangeApply" != "<%=CurPage.getParameter("ApplyType")%>") {
var contractNomessage = RunJavaMethodTrans("com.tenwa.app.baseFileTemplate.handle.FileTemplateUtil", "CheckContractNo", "contractId=" + "<%=sContractId%>" + ",contractNo=" + "<%=CurPage.getParameter("ContractNo")%>");
if ("error" == contractNomessage) {
alert("合同编号重复,请联系后台人员处理!");
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
}
@ -318,19 +313,19 @@
if ("01" == "<%=customertype%>") {
if (message.indexOf("请先删除后再生成") > 0) {
alert("合同已生成,无法再次生成!");
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
}
alert(message);
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
//检查扣款卡信息是否签约
var sReturnInfo = RunJavaMethodTrans("com.tenwa.lease.flow.contract.check.ContractInfoCheck", "ProjectSignStatus", "projectid=<%=projectId%>");
if ("success" != sReturnInfo) {
alert(sReturnInfo);
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
var param = {};
@ -367,7 +362,6 @@
if (sReturn0.length > 2) {
alert(sReturn0);
d.close().remove();
} else {
var pdfPath = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction", "wordToPdf", "FlowUnid=<%=flowunid%>,flagType=word");
<%-- if("01"=="<%=customertype%>"||"1"=="<%=CurPage.getParameter("isNetCar")%>"||"BAIC_MOTOR"=="<%=CurPage.getParameter("operationType")%>"||"ZYC"=="<%=CurPage.getParameter("operationType")%>"||"KHSQ"=="<%=CurPage.getParameter("operationType")%>"||"KJZL"=="<%=CurPage.getParameter("operationType")%>"){ --%>
@ -378,7 +372,7 @@
if ("error" == OwmMessage) {
RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction", "companyUpdateDocContractStatus", "FlowUnid=<%=flowunid%>" + ",ProjectId=<%=projectId%>");
alert("生成失败1");
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
} else {
@ -407,15 +401,14 @@
if ("success" != falg) {
RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction", "companyUpdateDocContractStatus", "FlowUnid=<%=flowunid%>" + ",ProjectId=<%=projectId%>");
alert("生成失败!!!");
d.close().remove();
$('a[title="生成合同"]').attr('onclick', click);
return;
}
}
alert("生成成功");
d.close().remove();
}
reloadSelf();
}, '200');
}
function downloadFile(id){
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");