liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<apex:page controller="StatusPageController" showHeader="false" id="allPage" sidebar="false" action="{!init}" docType="html-5.0" 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)}"/>
 
    <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>
    <script>
        let SelectFieldParamList=[
                {
                    //原apex:inputField的id值,需要在页面上获取
                    inputFieldId : 'allPage:allForm:pageBlock:pageBlockSection:name1',
                    //查找字段所在对象
                    ObjectType : 'Inquiry_form__c',
                    //查找字段的api名称
                    QueryFieldApiName : 'Opp_Name_Search__c',
                    //查找字段的查找对象
                    SelectObj : 'Opportunity',
                    //搜索时使用的字段
                    SelectFld : 'Name',
                }
            ]
            resetOpenPage(SelectFieldParamList);
            function unblockUI(){ 
                j$("#sbArea").fadeOut(500, function(){ 
                    j$("#sbArea").remove(); 
                }); 
                resetOpenPage(SelectFieldParamList); 
            } 
    </script>
</apex:page>