<?xml version="1.0" encoding="UTF-8"?>
|
<WebLink xmlns="http://soap.sforce.com/2006/04/metadata">
|
<fullName>RentalApplyDiscountApproval</fullName>
|
<availability>online</availability>
|
<displayType>button</displayType>
|
<linkType>javascript</linkType>
|
<masterLabel>备品减价申请</masterLabel>
|
<openType>onClickJavaScript</openType>
|
<protected>false</protected>
|
<url>{!RequireScript("/soap/ajax/51.0/connection.js")}
|
{!RequireScript("/resource/CommonUtilJs")}
|
|
var foo = function() {
|
|
var power = '{!$Profile.Id}';
|
// 2B2_备品中心检测&仓库管理 00e10000000xnoY
|
if(power!='00e10000000xnoY'){
|
//alert('对不起,您没有权限提交此申请!');
|
//return;
|
}
|
|
var status = '{!Repair_Quotation__c.Rental_Apply_Discount_Status__c}';
|
if (status=='审批中') {
|
alert("审批提交成功,当前正在审批请勿再提交!");
|
return;
|
}
|
if (status=='批准') {
|
alert("审批已批准,请勿再提交!");
|
return;
|
}
|
if (status=='草案中' || status=='' || status == '驳回') {
|
if ({!Repair_Quotation__c.Loaner_repair_sys__c}) {
|
var q = new sforce.SObject("Repair_Quotation__c");
|
q.Id = "{!Repair_Quotation__c.Id}";
|
q.Rental_Apply_Discount_Status__c = "已提交";
|
var result = sforce.connection.update([q]);
|
var messages = getConnectDMLErrorMessages(result);
|
if (messages.length > 0) {
|
alert("提交失败" + messages.join("\n"));
|
return;
|
}
|
} else {
|
alert("请先填写备品减价金额!");
|
return;
|
}
|
}
|
|
|
location.reload();
|
}
|
foo();</url>
|
</WebLink>
|