Cancel_Report
online
Sales_owner_job_type
button
javascript
取消
onClickJavaScript
false
//XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 start
{!REQUIRESCRIPT("/soap/ajax/51.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/51.0/apex.js")};
{!RequireScript("/resource/CommonUtilJs")};
var sql = "select id,Tender_information__r.subInfoType__c from Tender_Opportunity_Link__c where (Tender_information__r.subInfoType__c = '3-1:废标公告' OR Tender_information__r.subInfoType__c ='3-2:流标公告' OR Tender_information__r.TerminateApprovalStatus__c= '批准') and Opportunity__c ='" + '{!Opportunity.Id}'+ "'";
//20230427 lt 项目终止流程开发 add OR Tender_information__r.TerminateApprovalStatus__c= '批准'
var sqlResult = sforce.connection.query(sql);
// alert('测试+:'+sqlResult.size);
//XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 end
// jsの場合、翻訳された値がでるので、要注意
if ('{!Opportunity.StageName}' != '引合'
&& '{!Opportunity.StageName}' != '询价'
) {
alert("状态1:" + '{!Opportunity.StageName}' + "、不能做 取消 了!");
}
else if ('{!Opportunity.SAP_Send_OK__c}' == '1') {
alert("已经上传SAP、不能做 取消 了!");
}
else if ({!Opportunity.Cnt_Lost_cancel_report__c} - {!Opportunity.Cnt_Lost_cancel_Draft__c} > 0) {
alert("询价已经有 取消/失单报告 了!");
}
else if ('{!Opportunity.Job_category__c}' == '支援') {
alert("询价所有人是助理的,先请修改到销售担当!");
}
//XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 start
//else if({!NOT(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))}&& '{!Opportunity.subInfoType__c}' != '3-1:废标公告' &&'{!Opportunity.subInfoType__c}' != '3-2:流标公告'){
else if({!NOT(ISBLANK(Opportunity.Bidding_Project_Name_Bid__c))}&& sqlResult.size == 0){
alert("有招投标项目时只能做失单或部分失单报告!");
}
//XLIU-CG98L5 【委托】【评估】新需求-招标项目/询价对应流标、废标改善 end
else {
location.href = '/a1U/e?retURL=%2F{!URLENCODE(Opportunity.Id)}' +
'&RecordType=01210000000R4hH' +
'&CF00N10000004lbGT={!URLENCODE(Opportunity.Name)}' +
'&CF00N10000004lbGT_lkid={!URLENCODE(Opportunity.Id)}' +
'&CF00N10000006QShg={!URLENCODE(Opportunity.Sales_assistant_name__c)}' +
'&CF00N10000006QShg_lkid={!URLENCODE(Opportunity.Sales_assistant_ID__c)}' +
'&CF00N10000006QShq={!URLENCODE(Opportunity.Manager_name__c)}' +
'&CF00N10000006QShq_lkid={!URLENCODE(Opportunity.Sales_manager_departmentID__c)}' +
'&CF00N10000006QShb={!URLENCODE(Opportunity.Sales_owner_buchang__c)}' +
'&CF00N10000006QShb_lkid={!URLENCODE(Opportunity.Sales_owner_buchangID__c)}' +
'';
}