<apex:page controller="ChangeDealerApprovalController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="变更报价提交对象申请" lightningStylesheets="true">
|
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
|
<apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
|
<style type="text/css">
|
body .pbHeader .pbTitle{
|
width: 30%;
|
display: none;
|
|
}
|
body .pbHeader .pbButton, body .pbHeader .pbButtonb, .slds-vf-scope .pbHeader .pbButton, .slds-vf-scope .pbHeader .pbButtonb {
|
text-align: center;
|
}
|
</style>
|
<script type="text/javascript">
|
|
|
window.onload = function initCheckValue() {
|
resetDealer();
|
}
|
function unblockUI(){
|
|
j$("#sbArea").fadeOut(500, function(){
|
|
j$("#sbArea").remove();
|
|
});
|
|
resetOpenPage(SelectFieldParamList);
|
|
}
|
function resetDealer() {
|
var target = j$(escapeVfId('allPage:allForm:changedInput:estimateTarget')).val();
|
var obj = document.getElementById('allPage:allForm:changedInput:changedDealer');
|
var obj_lkwgt = document.getElementById('allPage:allForm:changedInput:changedDealer_lkwgt');
|
var lbObj = document.getElementById('changedLabel');
|
if (target == '医院') {
|
obj.style.display = "none";
|
obj_lkwgt.style.display = "none";
|
lbObj.style.display = "none";
|
} else {
|
obj.style.display = "block";
|
obj_lkwgt.style.display = "block";
|
lbObj.style.display = "block";
|
}
|
}
|
|
function requiredCheck() {
|
var target = j$(escapeVfId('allPage:allForm:changedInput:estimateTarget')).val();
|
var etTarget = j$(escapeVfId('allPage:allForm:etTarget')).val();
|
var dealer = j$(escapeVfId('allPage:allForm:dealer')).val();
|
|
if (target != '医院') {
|
var obj = j$(escapeVfId('allPage:allForm:changedInput:changedDealer')).val();
|
if (obj == null || obj == '') {
|
alert('请输入变更后经销商名');
|
return false;
|
}
|
console.log('etTarget='+etTarget);
|
console.log('etTarget='+target);
|
console.log('obj='+obj);
|
console.log('dealer='+dealer);
|
if (etTarget == target && obj == dealer) {
|
alert('报价提交对象没有变更!');
|
return false;
|
}
|
} else {
|
if (etTarget == '医院') {
|
alert('报价提交对象没有变更!');
|
return false;
|
}
|
}
|
if (confirm('一旦提交此记录,您将不能再编辑或调回,请确认是否继续?')) {
|
submitApproval();
|
} else {
|
return false;
|
}
|
}
|
|
function closedWin(isClosed) {
|
|
if (isClosed == 1) {
|
if (!confirm("请确认是否取消修改?")) {
|
return false;
|
}
|
window.close();
|
window.opener.closeWin(1);
|
} else {
|
var errMsg = '{!submitErrorMsg}';
|
if (errMsg == 'false') {
|
if (!confirm("已经提交待审批,是否关闭?")) {
|
|
return false;
|
}else{
|
window.close();
|
}
|
window.opener.closeWin(2);
|
} else {
|
return false;
|
}
|
}
|
}
|
</script>
|
|
<apex:form id="allForm">
|
<apex:inputHidden id="etTarget" value="{!estimate.Estimate_Target__c}"/>
|
<apex:inputHidden id="dealer" value="{!estimate.Dealer__r.name}"/>
|
<apex:inputHidden id="Changed_Dealer__c" value="{!estimate.Changed_Dealer__c}"/>
|
<apex:actionFunction name="submitApproval" action="{!submitApproval}" rerender="allForm" oncomplete="closedWin(2);"/>
|
<apex:pageBlock id="changedInput" title="" mode="edit" >
|
<apex:pageMessages id="submitErrorMsg"/>
|
<apex:pageBlockButtons >
|
<!-- 取引の開始 -->
|
<apex:commandButton value="提交待审批" onclick="requiredCheck(); return false;" disabled="{!ApprovalButDisabled}"/>
|
<!-- キャンセル -->
|
<apex:commandButton value="取消" onclick="closedWin(1); return false;" />
|
</apex:pageBlockButtons>
|
<div class="pbSubheader first tertiaryPalette">
|
<h3>报价提交对象变更</h3>
|
</div>
|
<table style="padding-top:10px" width="100%">
|
<tr style="height: 40px;">
|
<td width="5%"></td>
|
<td width="15%" style="text-align: right;">
|
<label>报价提交对象</label>
|
</td>
|
<td width="80%" style="text-align: left;">
|
<apex:selectList value="{!estimate.Changed_Estimate_Target__c}" multiselect="false" size="1" id="estimateTarget" onchange="resetDealer()" style="margin-left:15px;">
|
<apex:selectOptions value="{!etSelectOptions}" ></apex:selectOptions>
|
<!-- <apex:actionSupport event="onchange" onsubmit="" onbeforedomupdate="" action="{!depChange}" rerender="idCon">
|
<apex:param name="sltD" value="{!sltDep}"/>
|
</apex:actionSupport> -->
|
</apex:selectList>
|
</td>
|
</tr>
|
<tr>
|
<td width="5%"></td>
|
<td width="15%" style="text-align: right;">
|
<div id="changedLabel">经销商名</div>
|
</td>
|
<td width="80%" style="text-align: left;">
|
<apex:inputField value="{!estimate.Changed_Dealer__c}" id="changedDealer" style="margin-left:15px; width:220px;"/>
|
</td>
|
</tr>
|
</table>
|
</apex:pageBlock>
|
</apex:form>
|
<script type="text/javascript">
|
//查询参数列表
|
let SelectFieldParamList=[
|
//第一个输入框参数,eg:绑定的参数为{!estimate.Changed_Dealer__c}
|
{
|
//原apex:inputField的id值,需要在页面上获取
|
inputFieldId : 'allPage:allForm:changedInput:changedDealer',
|
//当前对象类型
|
ObjectType : 'Maintenance_Contract_Estimate__c',
|
//查询的当前对象的字段
|
QueryFieldApiName : 'Changed_Dealer__c',
|
//关联对象类型
|
SelectObj : 'Account',
|
//查询时匹对的字段
|
SelectFld : 'Name',
|
//当前输入框的值
|
value : '{!estimate.Changed_Dealer__c}',
|
},
|
|
]
|
resetOpenPage(SelectFieldParamList);
|
</script>
|
</apex:page>
|