高章伟
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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<apex:page Controller="ConsumableAccountController" showHeader="true" tabStyle="ConsumableAccount__tab" sidebar="true" id="allPage" action="{!init}" title="客户">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<script>
function refreshPageSizeJs() {
    refreshPageSize();
}
function searchAccpJs() {
    changelistView();
}
//排序
function SortLimitedJs(key) {
    blockme();
    accsort(key);
}
</script>
<style>
tr.dataRow {
        background-color:white;
    }
    td.dataRowCFDA {
        background-color:red;
    }
    td.columus {
        background-color:white;
        text-align: right;
    }
    tr.dataRow:hover {
        background-color: #e3f3ff;
    }
</style>
    <apex:form id="allForm">
    <apex:actionFunction name="refreshPageSize" action="{!refreshPageSize}" status="fetchStatus" reRender="searchdetails" />
    <apex:actionFunction name="changelistView" action="{!changelistView}" status="fetchStatus" reRender="searchdetails" />
    <apex:actionFunction name="accsort" action="{!accsort}" rerender="searchdetails" onComplete="unblockUI();">
        <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
    </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <div class="controls">
                <img src="/customer/img/s.gif" alt="客户" class="pageTitleIcon" title="客户"/>
                <apex:selectList value="{! filterName }" size="1" styleClass="title" onchange="searchAccpJs();return false;">
                    <apex:selectOptions value="{! listViewOptions }"/>
                </apex:selectList>
            </div>
            <apex:pageBlock id="searchdetails">
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                 </apex:outputPanel>
                <table class="list" border="0" cellpadding="0" cellspacing="0">
                    <tr class="headerRow">
                        <th title="{!$ObjectType.Account.fields.Name.label}"><a href="#" onclick="SortLimitedJs('0');return false;">{!$ObjectType.Account.fields.Name.label}</a>{!sortOrder[0]}</th>
                        <th title="{!$ObjectType.Account.fields.State_Master__c.label}"><a href="#" onclick="SortLimitedJs('1');return false;">{!$ObjectType.Account.fields.State_Master__c.label}</a>{!sortOrder[1]}</th>
                        <th title="{!$ObjectType.Account.fields.Salesdepartment_HP__c.label}"><a href="#" onclick="SortLimitedJs('2');return false;">{!$ObjectType.Account.fields.Salesdepartment_HP__c.label}</a>{!sortOrder[2]}</th>
                        <th title="{!$ObjectType.Account.fields.CreatedDate.label}"><a href="#" onclick="SortLimitedJs('3');return false;">{!$ObjectType.Account.fields.CreatedDate.label}</a>{!sortOrder[3]}</th>
                        <th title="{!$ObjectType.Account.fields.Is_Active__c.label}"><a href="#" onclick="SortLimitedJs('4');return false;">{!$ObjectType.Account.fields.Is_Active__c.label}</a>{!sortOrder[4]}</th>
                        <th title="客户记录类型"><a href="#" onclick="SortLimitedJs('5');return false;">客户记录类型</a>{!sortOrder[5]}</th>
                        <th title="{!$ObjectType.Account.fields.Grade__c.label}"><a href="#" onclick="SortLimitedJs('6');return false;">{!$ObjectType.Account.fields.Grade__c.label}</a>{!sortOrder[6]}</th>
                        <th title="{!$ObjectType.Account.fields.OCM_Category__c.label}"><a href="#" onclick="SortLimitedJs('7');return false;">{!$ObjectType.Account.fields.OCM_Category__c.label}</a>{!sortOrder[7]}</th>
                        <th title="{!$ObjectType.Account.fields.City_Master__c.label}"><a href="#" onclick="SortLimitedJs('8');return false;">{!$ObjectType.Account.fields.City_Master__c.label}</a>{!sortOrder[8]}</th>
                        <th title="{!$ObjectType.Account.fields.Town__c.label}"><a href="#" onclick="SortLimitedJs('9');return false;">{!$ObjectType.Account.fields.Town__c.label}</a>{!sortOrder[9]}</th>
                        <th title="{!$ObjectType.Account.fields.Phone.label}"><a href="#" onclick="SortLimitedJs('10');return false;">{!$ObjectType.Account.fields.Phone.label}</a>{!sortOrder[10]}</th>
                    </tr>
                <apex:repeat value="{!pageRecords}" var="records" id="theRepeat">
                    <tr class="dataRow">
                        <td class="dataCell"><apex:outputLink value="/ConsumableAccountInfo?AccId={!records.Id}" target="_self"><apex:outputField value="{!records.Name}"/></apex:outputLink></td>
                        <td class="dataCell"><apex:outputField value="{!records.State_Master__c}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.Salesdepartment_HP__c}"/></td>
                        <!--<td class="dataCell"><apex:outputField value="{!records.CreatedDate}"/></td>-->
                        <td class="dataCell">
                            <apex:outputText value="{0, date, yyyy/MM/dd}">
                                <apex:param value="{!records.CreatedDate}" />
                            </apex:outputText>
                        </td>
                        <td class="dataCell"><apex:outputField value="{!records.Is_Active__c}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.RecordType.Name}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.Grade__c}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.OCM_Category__c}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.City_Master__c}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.Town__c}"/></td>
                        <td class="dataCell"><apex:outputField value="{!records.Phone}"/></td>
                    </tr>
                </apex:repeat>
                </table>
                <table style="width: 100%">
                     <tr>
                        <td>
                            <!-- Page X of Y -->
                            <!-- PageNumber:当前页面所在位置,ResultSize:记录总条数,PageSize:每页记录条数 -->
                            <apex:outputText value="{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,
                             (setCon.pageNumber * size))} 共 {!noOfRecords} 个" />
                             <!--<apex:outputPanel >
                                <apex:actionStatus id="fetchStatus" >
                                    <apex:facet name="start" >
                                      <img src="/img/loading.gif" />
                                    </apex:facet>
                                </apex:actionStatus>
                            </apex:outputPanel>-->
                        </td>
                        <td align="center">
                            <div class="paginator line1">
                            <span class="prevNextLinks">
                            <span class="prevNext">
                            <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.first}" oncomplete="refreshPageSizeJs();" title="首页" >
                            <img src="/s.gif" title="首页" alt="首页" class="{!if((setCon.hasPrevious),'first','firstoff')}"/>
                            </apex:commandLink>
                            </span>
                            <span class="prevNext">
                            <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection"  action="{!setCon.previous}" oncomplete="refreshPageSizeJs();"  title="上一页">
                            <img src="/s.gif" title="上一页" alt="上一页" class="{!if((setCon.hasPrevious),'prev','prevoff')}"/>上一页
                            </apex:commandLink>
                            </span>
                            <span class="prevNext">
                            <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.next}" oncomplete="refreshPageSizeJs();" title="下一页">下一页
                            <img src="/s.gif" title="下一页" alt="下一页" class="{!if((setCon.hasNext),'next','nextoff')}"/>
                            </apex:commandLink>
                            </span>
                            <span class="prevNext">
                            <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.last}"  oncomplete="refreshPageSizeJs();" title="尾页">
                            <img src="/s.gif" title="尾页" alt="尾页" class="{!if((setCon.hasNext),'last','lastoff')}"/>
                            </apex:commandLink>
                            </span>
                            </span>
                            </div>
                         </td>
                         <td align="right" width="20%">
                        </td>
                    </tr>
                </table>
           </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
</apex:page>