DESKTOP-0K9VGFE\hp
2022-03-11 6d766b0c8e9b31e7e03ffd344a94c2851aa9beb9
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<apex:page standardcontroller="Asset" extensions="SelectAssetExtension" showHeader="true" id="allPage">
 
<script>
var productCount={!productCount};
function checkAll() {
    
    if ( document.getElementById( 'checker').checked == true) {
        for ( var i = 0; i < productCount; i++) {
            outer = Math.floor(i / 1000);
            document.getElementById( 'allPage:allForm:allBlock:assetSection:assetListTable:'+ outer + ':assetTable:' + (i-(1000*outer)) + ':assetRowCheckbox').checked = true;
        }
    }
    else {
        for ( var i = 0; i < productCount; i++) {
            outer = Math.floor(i / 1000);
            document.getElementById( 'allPage:allForm:allBlock:assetSection:assetListTable:'+ outer + ':assetTable:' + (i-(1000*outer)) + ':assetRowCheckbox').checked = false;
        }
    }
}
function sortTableJs(sortNum) {
    sortTable(sortNum);
}
</script>
 
<apex:form id="allForm">
 
<apex:actionFunction name="sortTable" action="{!sortTable}" rerender="assetSection">
    <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
 
<apex:outputPanel id="allPanel">
    <apex:pageBlock title="保有设备选择" id="allBlock">
    
        <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="保存"/>
                <apex:commandButton action="{!cancel}" value="取消"/>
        </apex:pageBlockButtons>
            
        <apex:pageblocksection title="维修合同">
        
            <apex:outputField value="{!contract.Management_Code__c}" />
            <apex:outputField value="{!contract.Contract_Start_Date__c}" />
            <apex:outputField value="{!contract.Hospital__c}" />
            <apex:outputField value="{!contract.Contract_End_Date__c}" />
                    
        </apex:pageblocksection>
        
        <apex:pageblocksection columns="1" title="保有设备" id="assetSection">
            <apex:outputPanel layout="block" styleClass="container2">
                <table class="list" style="border-bottom-width: 0px; font-size:13px;" border="0" cellspacing="0" cellpadding="0">
                    <tr class="headerRow" height="30px" style="text-align: left;">
                        <th class="headerRow  booleanColumn">
                            <input type="checkbox" onClick="checkAll()" id="checker"/>
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" onclick="sortTableJs( '0');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Name.label}</a> {!sortOrder[0]}
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" onclick="sortTableJs( '1');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.SerialNumber.label}</a> {!sortOrder[1]}
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" >点检对象</a> {!sortOrder[2]}
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" onclick="sortTableJs( '3');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Department_Name__c.label}</a> {!sortOrder[3]}
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" onclick="sortTableJs( '4');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Installation_Site__c.label}</a> {!sortOrder[4]}
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" onclick="sortTableJs( '5');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Posting_Date__c.label}</a> {!sortOrder[5]}
                        </th>
                        <th class="headerRow  booleanColumn">
                            <a href="#" onclick="sortTableJs( '6');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Asset_Owner__c.label}</a> {!sortOrder[6]}
                        </th>
                    </tr>
 
                    <apex:repeat value="{!assetLists}" var="assetList" id="assetListTable">
                        <apex:repeat value="{!assetList}" var="asset" id="assetTable">
                            <tr class="dataRow">
                                <td class="dataCell">
                                    <apex:inputField value="{!asset.checkBox__c}" id="assetRowCheckbox"/>    
                                </td>
                                <td class="dataCell">
                                    <apex:outputField value="{!asset.name}"/>
                                </td>
                                <td class="dataCell">
                                    <apex:outputField value="{!asset.SerialNumber}"/>
                                </td>
                                <td class="dataCell">
                                    <apex:inputField value="{!asset.TransferToOther__c}"/>    
                                </td>
                                <td class="dataCell">
                                    <apex:outputField value="{!asset.Department_Name__c}"/>
                                </td>
                                <td class="dataCell">
                                    <apex:outputField value="{!asset.Installation_Site__c}"/>
                                </td>
                                <td class="dataCell">
                                    <apex:outputField value="{!asset.Posting_Date__c}"/>
                                </td>
                                <td class="dataCell">
                                    <apex:outputField value="{!asset.Asset_Owner__c}"/>
                                </td>
                            </tr>
                        </apex:repeat>
                    </apex:repeat>
                </table>
            </apex:outputPanel>
 
 
            <!-- <apex:pageblocktable value="{!assetRecords}" var="asset" id="assetTable">
 
                 <apex:column >
                     <apex:facet name="header"><input type='checkbox' onClick='checkAll()' id='checker'/></apex:facet>
                    <apex:inputField value="{!asset.checkBox__c}" id="assetRowCheckbox"/>
                 </apex:column>
                 <apex:column >
                     <apex:facet name="header"><a href="#" onclick="sortTable( '0');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Name.label}</a> {!sortOrder[0]}</apex:facet>
                     <apex:outputField value="{!asset.name}"/>
                 </apex:column>
                 <apex:column >
                     <apex:facet name="header"><a href="#" onclick="sortTable( '1');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.SerialNumber.label}</a> {!sortOrder[1]}</apex:facet>
                     <apex:outputField value="{!asset.SerialNumber}"/>
                    </apex:column>
                 <apex:column >
                     <apex:facet name="header"><a href="#" onclick="sortTable( '2');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Department_Name__c.label}</a> {!sortOrder[2]}</apex:facet>
                     <apex:outputField value="{!asset.Department_Name__c}"/>
                 </apex:column>
                 <apex:column >
                     <apex:facet name="header"><a href="#" onclick="sortTable( '3');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Installation_Site__c.label}</a> {!sortOrder[3]}</apex:facet>
                     <apex:outputField value="{!asset.Installation_Site__c}"/>
                 </apex:column>
                 <apex:column >
                     <apex:facet name="header"><a href="#" onclick="sortTable( '4');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Posting_Date__c.label}</a> {!sortOrder[4]}</apex:facet>
                     <apex:outputField value="{!asset.Posting_Date__c}"/>
                 </apex:column>
                 <apex:column >
                     <apex:facet name="header"><a href="#" onclick="sortTable( '5');return false;" style="text-decoration: underline;">{!$ObjectType.Asset.fields.Asset_Owner__c.label}</a> {!sortOrder[5]}</apex:facet>
                     <apex:outputField value="{!asset.Asset_Owner__c}"/>
                 </apex:column>
                
            </apex:pageblocktable> -->
        
        </apex:pageblocksection>
 
    </apex:pageBlock>
</apex:outputPanel>
</apex:form>
 
</apex:page>