| | |
| | | {!RequireScript("/resource/CommonUtilJs")} |
| | | |
| | | var foo = function() { |
| | | var power = '{!$Profile.Id}'; |
| | | |
| | | var power = '{!$Profile.Id}'; |
| | | // 2B2_备品中心检测&仓库管理 00e10000000xnoY |
| | | if(power!='00e10000000xnoY'){ |
| | | //alert('对不起,您没有权限提交此申请!'); |
| | | //return; |
| | | } |
| | | |
| | | var status = '{!Repair_Quotation__c.Rental_Apply_Discount_Status__c}'; |
| | | if (status=='审批中') { |
| | |
| | | return; |
| | | } |
| | | if (status=='草案中' || status=='' || status == '驳回') { |
| | | if ('{!Repair_Quotation__c.Loaner_repair__c}' > 0) { |
| | | var qUpd = new sforce.SObject("Repair_Quotation__c"); |
| | | qUpd.Id = "{!Repair_Quotation__c.Id}"; |
| | | qUpd.Rental_Apply_Discount_Status__c = "已提交"; |
| | | var result = sforce.connection.update([qUpd]); |
| | | 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")); |
| | |
| | | alert("请先填写备品减价金额!"); |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | location.reload(); |
| | | } |
| | | foo();</url> |