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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<apex:page standardcontroller="Asset" extensions="SelectAssetExtension" showHeader="true" id="allPage" lightningStylesheets="true">
<apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/>
<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)}"/>
<style>
    div.pbHeader td.pbButton {
        padding-left: 203px;
    }
 
</style>
<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);
}
function afterSaveBtnJs() {
    window.location.href = '/' + "{!contract.Id}";
}
function searchJs() {
    blockme();
    searchfunc();
}
function saveJs() {
    blockme();  
}
</script>
 
<apex:form id="allForm">
 
<apex:actionFunction name="sortTable" action="{!sortTable}" rerender="assetSection">
    <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
</apex:actionFunction>
<apex:actionFunction name="searchfunc" action="{!searchBtn}" rerender="Form,Block,assetSection2,pageMessages,allBlock" onComplete="unblockUI();"></apex:actionFunction>
<apex:actionFunction name="savefunc" action="{!save}" rerender="Form,Block,assetSection2,pageMessages,allBlock" onComplete="unblockUI();"></apex:actionFunction>
 
 
<apex:outputPanel id="allPanel">
    <apex:pageBlock title="保有设备选择" id="allBlock">
    
        <apex:pageBlockButtons >
                <!-- <apex:commandButton onclick='saveJs();' action='{!save}'  value="保存" onComplete="afterSaveBtnJs();"/> -->
                <apex:commandButton onclick="saveJs();"  action="{!save}"   value="保存" onComplete="afterSaveBtnJs();" />
                <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">
              <!-- zzm 230831增加检索条件解决数据超量报错的问题 start -->
            <apex:outputPanel layout="block" styleClass="container2">
            <apex:outputText value="选择条件"/>&nbsp;&nbsp;
                <apex:selectList value="{!text1}" id="text1" size="1" style="width:150px">
                    <apex:selectOptions value="{!textOpts}"/>
                </apex:selectList> &nbsp;&nbsp;
                <apex:selectList value="{!cond1}" id="cond1" size="1" style="width:100px">
                <apex:selectOptions value="{!equalOpts}"/>
                </apex:selectList> &nbsp;&nbsp;
                <apex:inputText value="{!val1}" 
                id="val1" style="width:150px; "/>
                &nbsp;
                <!-- zzm 240109维修合同添加设备bug start -->
                <apex:commandButton value="检索" onclick="searchJs();" action="{!searchBtn}" style="width:100px" rerender="dummy" onComplete="unblockUI();"/>
                <!-- zzm 240109维修合同添加设备bug end -->
            </apex:outputPanel>
        <!-- zzm 230831增加检索条件解决数据超量报错的问题 end -->
            <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> -->
                        <th class="headerRow  booleanColumn">
                            {!$ObjectType.Asset.fields.Name.label}
                            
                        </th>
                        <th class="headerRow  booleanColumn">
                            {!$ObjectType.Asset.fields.SerialNumber.label}
                        </th>
                        <th class="headerRow  booleanColumn">
                            点检对象
                            
                        </th>
                        <th class="headerRow  booleanColumn">
                            {!$ObjectType.Asset.fields.Department_Name__c.label}
                        </th>
                        <th class="headerRow  booleanColumn">
                            {!$ObjectType.Asset.fields.Installation_Site__c.label}
                        </th>
                        <th class="headerRow  booleanColumn">
                            {!$ObjectType.Asset.fields.Posting_Date__c.label}
                        </th>
                        <th class="headerRow  booleanColumn">
                            {!$ObjectType.Asset.fields.Asset_Owner__c.label}
                        </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>