高章伟
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
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
219
220
<apex:page controller="EquipmentRentalLostReportController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="欠品中一览">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
 
<script type="text/javascript">
function savejs() {
    if (confirm('是否保存遗失报告?')) {
        blockme();
        saveBtn();
    }
}
function returnjs() {
    var rentalApplyId = j$(escapeVfId('allPage:allForm:allBlock:rentalApplyId')).text();
    if (rentalApplyId == null || rentalApplyId == '') {
        var transferApplyId = j$(escapeVfId('allPage:allForm:allBlock:transferApplyId')).text();
        var url = "/" + transferApplyId;
        window.location.href = url;
    }else{
        var url = "/" + rentalApplyId;
        window.location.href = url;
    }
}
function return1js() {
    var rentalApplyId = j$(escapeVfId('allPage:allForm:allBlock:rentalApplyId')).text();
    if (rentalApplyId == null || rentalApplyId == '') {
        var transferApplyId = j$(escapeVfId('allPage:allForm:allBlock:transferApplyId')).text();
        var url = "/apex/EquipmentRentalLostReport?tid=" + transferApplyId;
        window.location.href = url;
    }else{
        var url = "/apex/EquipmentRentalLostReport?raid=" + rentalApplyId;
        window.location.href = url;
 
    }
}
function refresh() {
    var hasError = j$(escapeVfId('allPage:allForm:allBlock:hasError')).text();
    if (hasError == 'false') {
        return1js();
    }
}
 
function checkAll(selfid, checkId) {
    var recCount = document.getElementById('allPage:allForm:EquipmentSetCnt').value;
 
    if (j$(escapeVfId(selfid)).attr('checked') == 'checked') {
        for (var i = 0; i < recCount; i++) {
            var disabled = j$(escapeVfId('allPage:allForm:allBlock:records:' + i + ':' + checkId)).prop('disabled');
            var disabled = j$(escapeVfId('allPage:allForm:allBlock:records1:' + i + ':' + checkId)).prop('disabled');
            if (disabled == false) {
                j$(escapeVfId('allPage:allForm:allBlock:records:' + i + ':' + checkId)).attr('checked',true);
                j$(escapeVfId('allPage:allForm:allBlock:records1:' + i + ':' + checkId)).attr('checked',true);
            }
        }
    } else {
        for (var i = 0; i < recCount; i++) {
            var disabled = j$(escapeVfId('allPage:allForm:allBlock:records:' + i + ':' + checkId)).prop('disabled');
            var disabled = j$(escapeVfId('allPage:allForm:allBlock:records1:' + i + ':' + checkId)).prop('disabled');
            if (disabled == false) {
                j$(escapeVfId('allPage:allForm:allBlock:records:' + i + ':' + checkId)).attr('checked',false);
                j$(escapeVfId('allPage:allForm:allBlock:records1:' + i + ':' + checkId)).attr('checked',false);
            }
        }
    }
}
 
function sortTableJs(key) {
  sortTablefunc(key);
}
</script>
 
    <apex:form id="allForm">
        <apex:inputHidden id="EquipmentSetCnt" value="{!EquipmentSetCnt}"/>
        <apex:actionFunction name="saveBtn1" action="{!saveBtn1}" rerender="allBlock" onComplete="unblockUI();refresh();"/>
        <apex:actionFunction name="saveBtn" action="{!saveBtn}" rerender="allBlock" onComplete="unblockUI();refresh();"/>
        <apex:actionFunction name="sortTablefunc" action="{!sortTable}" rerender="allBlock" status="statusPreload" onComplete="unblockUI();">
            <apex:param name="psortKey" value="" />
        </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <apex:pageBlock title="欠品中一览" id="allBlock">
                <apex:pageBlockButtons >
                    <apex:commandButton onclick="returnjs(); return false;" value="返回" rerender="dummy"/>
                    <apex:commandButton onclick="savejs(); return false;" rerender="allBlock" value="保存遗失报告" oncomplete="unblockUI();refresh();"/>
                    <apex:commandButton onclick="blockme();" value="保存确认遗失"  rerender="allBlock" action="{!saveBtn1}" oncomplete="unblockUI();refresh();"/>
                </apex:pageBlockButtons>
 
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                </apex:outputPanel>
                <apex:outputText id="rentalApplyId" value="{!rentalApplyId}" style="display:none"/>
                <apex:outputText id="hasError" value="{!hasError}" style="display:none"/>
                <apex:outputText id="transferApplyId" value="{!transferApplyId}" style="display:none"/>
                <!--  <apex:pageBlockSectionItem >
                    <apex:outputLabel style="font-size: 15px;" value="{!$ObjectType.Rental_Apply__c.fields.Name.label}" for="Name"/>
                    <apex:outputLink style="font-size: 15px;" value="/{!rentalApply.Id}" id="Name">{!rentalApply.Name}</apex:outputLink>
                </apex:pageBlockSectionItem> -->
 
                <apex:pageBlockSection rendered="{!IF(rentalApplyId == null ,false, true)}"  >
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel style="font-size: 15px;" value="{!$ObjectType.Rental_Apply__c.fields.Name.label}" for="Name"/>
                        <apex:outputLink style="font-size: 15px;" value="/{!rentalApply.Id}" id="Name">{!rentalApply.Name}</apex:outputLink>
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
 
                <apex:pageBlockSection rendered="{!IF(rentalApplyId == null || rentalApplyId == '' ,true, false)}"  >
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel style="font-size: 15px;" value="{!$ObjectType.TransferApply__c.fields.Name.label}" for="Name"/>
                        <apex:outputLink style="font-size: 15px;" value="/{!TransferApply.Id}" id="Name">{!TransferApply.Name}</apex:outputLink>
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
                <!-- update by rentx 2021-04-10 end -->
 
            <apex:outputPanel rendered="{!IF(rentalApplyId == null ,false, true)}">
                <table class="linetable" border="1" style="border-collapse: collapse;">
                    <colgroup>
                        <col width="25"/>
                        <col width="25"/>
                        <col width="110"/>
                        <col width="50"/>
                        <col width="50"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                    </colgroup>
                    <tr style="background-color:#DCDCDC;">
                        <th style="text-align:center">报告对象<input type='checkbox' onClick='checkAll("checker","rowCheck")' id='checker'/></th>
                        <apex:variable value="{!0}" var="index"/>
                        <apex:repeat value="{!titleList}" var="title">
 
                            <th style="text-align:center">
                                <a href="#" name="out_Div_a" onclick="sortTableJs('{!index}');return false;" style="text-decoration: underline;">
                                    {!sortOrder[index]}{!title}
                                </a>
                            </th>
                            <apex:variable var="index" value="{!index + 1}"/>
                        </apex:repeat>
                        <th style="text-align:center">确认遗失<input type='checkbox' onClick='checkAll("checker1", "rowCheck1")' id='checker1'/></th>
                    </tr>
                    <apex:repeat value="{!lineInfoList}" var="info" id="records">
                        <tr>
                            <td align="center"><apex:inputCheckbox disabled="{!info.checkBoxdisabled}" value="{!info.isSelect}" id="rowCheck"/></td>
                            <apex:repeat value="{!columnsApi}" var="c">
                                <td align="left">
                                    <apex:outputPanel rendered="{!(c.size==2 && info.raesd[c[0]] != null)}" layout="none">
                                        <apex:outputField value="{!info.raesd[c[0]][c[1]]}"/>
                                    </apex:outputPanel>
                                    <apex:outputPanel rendered="{!(c.size==1 && info.raesd[c[0]] != null && (c[0] != 'DeleteLostReport_Detail_Reason__c' || info.checkBoxdisabled == true))}" layout="none">
                                        <apex:outputField value="{!info.raesd[c[0]]}"/>
                                    </apex:outputPanel>
                                    <apex:outputPanel rendered="{!(c.size==1 && c[0] == 'DeleteLostReport_Detail_Reason__c' && info.checkBoxdisabled == false)}" layout="none">
                                        <apex:inputField value="{!info.raesd[c[0]]}"/>
                                    </apex:outputPanel>
                                </td>
                            </apex:repeat>
                            <td align="center"><apex:inputCheckbox value="{!info.haveConfirm_Lost_Date}" disabled="{!info.lrdApprovaled}" id="rowCheck1"/></td>
                        </tr>
                    </apex:repeat>
                </table>
            </apex:outputPanel>
 
            <!-- //update by rentx 2021-05-13 start 1635 -->
            <apex:outputPanel rendered="{!IF(rentalApplyId == null ,true, false)}">
                <table class="linetable" border="1" style="border-collapse: collapse;">
                    <colgroup>
                        <col width="25"/>
                        <col width="25"/>
                        <col width="110"/>
                        <col width="50"/>
                        <col width="50"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                        <col width="110"/>
                    </colgroup>
                    <tr style="background-color:#DCDCDC;">
                        <th style="text-align:center">报告对象<input type='checkbox' onClick='checkAll("checker","rowCheck")' id='checker'/></th>
                        <apex:variable value="{!0}" var="index"/>
                        <apex:repeat value="{!titleList}" var="title">
 
                            <th style="text-align:center">
                                <a href="#" name="out_Div_a" onclick="sortTableJs('{!index}');return false;" style="text-decoration: underline;">
                                    {!sortOrder[index]}{!title}
                                </a>
                            </th>
                            <apex:variable var="index" value="{!index + 1}"/>
                        </apex:repeat>
                        <th style="text-align:center">确认遗失<input type='checkbox' onClick='checkAll("checker1", "rowCheck1")' id='checker1'/></th>
                    </tr>
                    <apex:repeat value="{!lineInfoList}" var="info" id="records1">
                        <tr>
                            <td align="center"><apex:inputCheckbox disabled="{!info.checkBoxdisabled}" value="{!info.isSelect}" id="rowCheck"/></td>
                            <apex:repeat value="{!columnsApi}" var="c">
                                <td align="left">
                                    <apex:outputPanel rendered="{!(c.size==2 && info.raesd1[c[0]] != null)}" layout="none">
                                        <apex:outputField value="{!info.raesd1[c[0]][c[1]]}"/>
                                    </apex:outputPanel>
                                    <apex:outputPanel rendered="{!(c.size==1 && info.raesd1[c[0]] != null && (c[0] != 'DeleteLostReport_Detail_Reason__c' || info.checkBoxdisabled == true))}" layout="none">
                                        <apex:outputField value="{!info.raesd1[c[0]]}"/>
                                    </apex:outputPanel>
                                    <apex:outputPanel rendered="{!(c.size==1 && c[0] == 'DeleteLostReport_Detail_Reason__c' && info.checkBoxdisabled == false)}" layout="none">
                                        <apex:inputField value="{!info.raesd1[c[0]]}"/>
                                    </apex:outputPanel>
                                </td>
                            </apex:repeat>
                            <td align="center"><apex:inputCheckbox value="{!info.haveConfirm_Lost_Date}" disabled="{!info.lrdApprovaled}" id="rowCheck1"/></td>
                        </tr>
                    </apex:repeat>
                </table>
            </apex:outputPanel>
            <!-- //update by rentx 2021-05-13 end 1635 -->
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
 
</apex:page>