| | |
| | | <apex:page controller="ChangeDealerApprovalController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="变更报价提交对象申请"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="/soap/ajax/29.0/connection.js"/> |
| | | <apex:includeScript value="/soap/ajax/29.0/apex.js"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.connection20)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.apex20)}"/> |
| | | |
| | | <script type="text/javascript"> |
| | | window.onload = function initCheckValue() { |
| | | resetDealer(); |
| | | } |
| | | window.onload = function initCheckValue() { |
| | | resetDealer(); |
| | | } |
| | | |
| | | 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"; |
| | | } |
| | | } |
| | | 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; |
| | | } |
| | | if (etTarget == target && obj == dealer) { |
| | | alert('报价提交对象没有变更!'); |
| | | return false; |
| | | } |
| | | } else { |
| | | if (etTarget == '医院') { |
| | | alert('报价提交对象没有变更!'); |
| | | return false; |
| | | } |
| | | } |
| | | if (confirm('一旦提交此记录,您将不能再编辑或调回,请确认是否继续?')) { |
| | | submitApproval(); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | 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; |
| | | } |
| | | 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.opener.closeWin(1); |
| | | } else { |
| | | var errMsg = '{!submitErrorMsg}'; |
| | | if (errMsg == 'false') { |
| | | if (!confirm("已经提交待审批,是否关闭?")) { |
| | | return false; |
| | | } |
| | | window.opener.closeWin(2); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | function closedWin(isClosed) { |
| | | |
| | | if (isClosed == 1) { |
| | | if (!confirm("请确认是否取消修改?")) { |
| | | return false; |
| | | } |
| | | window.opener.closeWin(1); |
| | | } else { |
| | | var errMsg = '{!submitErrorMsg}'; |
| | | if (errMsg == 'false') { |
| | | if (!confirm("已经提交待审批,是否关闭?")) { |
| | | return false; |
| | | } |
| | | 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__c}"/> |
| | | <apex:actionFunction name="submitApproval" action="{!submitApproval}" rerender="allForm" oncomplete="closedWin();"/> |
| | | <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"> |
| | | <apex:inputHidden id="etTarget" value="{!estimate.Estimate_Target__c}"/> |
| | | <apex:inputHidden id="dealer" value="{!estimate.Dealer__c}"/> |
| | | <apex:actionFunction name="submitApproval" action="{!submitApproval}" rerender="allForm" oncomplete="closedWin();"/> |
| | | <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> |
| | | <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> |
| | | <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;"/> |
| | | </td> |
| | | <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;"/> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </apex:pageBlock> |
| | | </apex:form> |
| | | </apex:form> |
| | | </apex:page> |