高章伟
2022-03-18 4bfe21c4b5ddc089ae5a95f4b10f6cff148b690d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<apex:page controller="StatusPageController" showHeader="false" id="allPage" sidebar="false" action="{!init}" docType="html-5.0">
<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"/>
    <head>
        <title>不需要的理由</title>
    </head>
    <script type="text/javascript">
        function save(){
            var chance = j$(escapeVfId('allPage:allForm:pageBlock:pageBlockSection:chance')).value();
            var name1 = j$(escapeVfId('allPage:allForm:pageBlock:pageBlockSection:name1')).value();
            if (((chance.trim() == '' || chance.trim() == null) && (name1.trim() == null || name1.trim() == '')) || chance == null) {
                alert('不需要理由不能为空');
                return;
            }
            if (chance.trim() == '' || chance.trim() == null) {
                alert('不需要理由不能为空');
                return;
            }
            if ((chance == '已经有询价') && (name1.trim() == null || name1.trim() == "")) {
                alert('已有询价名称不能为空');
                return;
            }else{
                blockme();
                allSave();
            }
        }
        function check(){
            window.opener.location.href = "/{!Inquiryform.id}";
            window.close();
        }
    </script>
    <apex:form id="allForm">
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                </apex:outputPanel>
        <apex:actionfunction action="{!save}" name="allSave" onComplete="check();unblockUI();"></apex:actionfunction>
        <apex:pageBlock id="pageBlock">
            <apex:pageBlockSection id="pageBlockSection" >
                    <apex:inputField id="chance" value="{!Inquiryform.Reasons_options__c}" style="width: 155px"/>
                    <br />
                    <apex:inputField id="name1" value="{!Inquiryform.Opp_Name_Search__c}" style="width: 150px"/>
            </apex:pageBlockSection>
            <apex:pageblockbuttons location="bottom">
                <apex:commandbutton onclick="save();return false;" value="保存"></apex:commandbutton>
            </apex:pageblockbuttons>
        </apex:pageBlock>
    </apex:form>
</apex:page>