gzw
2022-02-15 168114b11da83c5005cd608c1b23a66311717a0f
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
<apex:page Controller="SLAReportDetailsController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="信息更新">
    <script>
        function cancelJs() {
            window.opener=null;
            window.close();
        }
        
        function saveSLAInfoId(slaInfoId,index){
            var error = document.getElementById('allPage:allForm:allBlock:Editable:error').value;
            console.log('error='+error);
            if(error == 'false'){
                window.opener.document.getElementById('Page:mainForm:idDayEdit:idActivities:'+index+':EventCSLAInfoId').value = slaInfoId;
                window.close();
            }
        }
    </script>
    <apex:form id="allForm">
        <apex:actionFunction name="save" action="{!save}" rerender="allForm" oncomplete="saveSLAInfoId('{!slaInfoId}','{!index}');" ></apex:actionFunction>
        <apex:pageBlock id="allBlock" >
            <apex:outputPanel id="message" >
                <apex:pageMessages />
            </apex:outputPanel>
            <apex:pageBlock title="填写信息更新" id="Editable">
                <apex:pageBlockSection columns="1" id="accList" >
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问场所"></apex:outputLabel>
                        <apex:outputField id="Account_ID__c" value="{!slaInfo.Account_ID__c}"/> 
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
                <apex:inputHidden id="error" value="{!error}" />
                <apex:pageBlockSection columns="2" id="inList">
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="发放人"></apex:outputLabel>
                        <apex:inputField id="Distribution_Person__c" value="{!slaInfo.Distribution_Person__c}" required="true" /> 
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="发放方式"></apex:outputLabel>
                        <apex:inputField id="Distribution_Method__c" value="{!slaInfo.Distribution_Method__c}" required="true"  />
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问对象1"></apex:outputLabel>
                        <apex:outputField id="Visitor1__c" value="{!slaInfo.Visitor1__c}" /> 
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问对象1电话"></apex:outputLabel>
                        <apex:outputField id="Visitor1Phone" value="{!slaInfo.Visitor1__r.Phone}" /> 
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问对象2"></apex:outputLabel>
                        <apex:outputField id="Visitor2__c" value="{!slaInfo.Visitor2__c}" /> 
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问对象3"></apex:outputLabel>
                        <apex:outputField id="Visitor3__c" value="{!slaInfo.Visitor3__c}" /> 
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问对象4"></apex:outputLabel>
                        <apex:outputField id="Visitor4__c" value="{!slaInfo.Visitor4__c}" /> 
                    </apex:pageBlockSectionItem>
                    <apex:pageBlockSectionItem labelStyle="text-align:left;">
                        <apex:outputLabel value="访问对象5"></apex:outputLabel>
                        <apex:outputField id="Visitor5__c" value="{!slaInfo.Visitor5__c}" />
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
                <apex:commandButton onclick="save()" rerender="goOrNot,inList" value="保存" style="width: 150px;margin-left: 50px;"/>
                <apex:commandButton onClick="cancelJs()" value="取消" style="width: 150px;margin-left: 50px;"/>
            </apex:pageBlock> 
        </apex:pageBlock>
    </apex:form>    
</apex:page>