李彤
2022-11-17 675ad74a96337da89845179a9606116d1f32e621
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
<apex:page action="{!init}" controller="ChoiceAssetController" id="allPage" showHeader="false" sidebar="false" title="选择保有设备">
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"></apex:stylesheet>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"></apex:includeScript>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"></apex:includeScript>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
    <style type="text/css"></style>
    <script>
        function searchProductJs() {
            searchAsset();
        }
 
        function saveJs(){
            save();
        }
        //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start
        function checkPartSupplyFinishDateJs(){
            var today = new Date();
            var todayNew = today.toLocaleDateString();
            var check;
            var num = 100000;
            for (var i = 0; i < 100; i++) {
                check = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:'+i+':consumablesCountproRowCheckbox')).attr('checked');
                if (check == 'checked'){
                    num = i;
                }
            }
            if (num != 100000){
                var partSupplyFinishDate = new Date(j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + num + ':partSupplyFinishDate')).value());
                if (partSupplyFinishDate != 'Invalid Date'){
                    var partSupplyFinishDateNew = partSupplyFinishDate.toLocaleDateString();
                    if (partSupplyFinishDateNew > todayNew){
                        alert('预计'+ partSupplyFinishDateNew +'零件即将停产,请送修前与工厂及RC联络');
                    }
                    if (partSupplyFinishDateNew <= todayNew){
                        alert('该型号零件已经停产,有特殊需求,请送修前与工厂RC联络');
                    }
                }
            }
        }
        //XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end
 
        function ClearJs(){
            blockme();
            document.getElementById("allPage:allForm:allBlock:searchBlock:FuselageNumber").value = "";
            document.getElementById("allPage:allForm:allBlock:searchBlock:AssetModel").value = "";
            document.getElementById("allPage:allForm:allBlock:searchBlock:HospitalName").value = "";
            searchAsset();
            
            // searchConsumableorderdetails();
        }
    </script>
    <apex:form id="allForm">
    <apex:actionFunction name="searchAsset" action="{!searchAsset}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
    </apex:actionFunction>
    <apex:actionFunction name="save" action="{!save}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
    </apex:actionFunction>
    
 
    <apex:outputPanel id="allPanel">
        <apex:pageBlock id="allBlock">
            <apex:pageBlock id="searchBlock" >
                    <table>
                        <colgroup>
                            
                            <col width="9%"/>
                            <col width="9%"/>
                            <col width="9%"/>
                            <col width="9%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            <col width="8%"/>
                            
                        </colgroup>
 
                        <tr>
                            
                            <td colspan="2"/>
                            <td colspan="4">机身编码:
                                <apex:inputText value="{!FuselageNumber}" id="FuselageNumber"/>
                            </td>                           
                             
                            <td align="right"></td>
                            <td><apex:commandButton value="保有设备搜索"  onclick="searchProductJs('0');return false;" /></td>
                            <td><input type="button" value="清空"  onclick="ClearJs();return false;" class="btn"/><apex:commandButton onclick="saveJs();" value="确定" rerender="dummy"  /></td>
                           <!--  <td>
                            <apex:commandButton onclick="saveJs();" value="确定" rerender="dummy"  />
                            </td> -->
                            
                            
                        </tr>
                        <!-- <td>
                            </td>
                            <td align="right"></td>
                            <td><apex:commandButton value="保有设备搜索" style="width: 80px;" onclick="searchProductJs('0');return false;" /></td>
                            <td><input type="button" value="清空" style="width: 80px;" onclick="ClearJs();return false;" class="btn"/></td>
                            <td>
                            <apex:commandButton onclick="saveJs();"           value="确定" style="width:80px" rerender="dummy"  />
                            </td> -->
                        <tr>
                            <td colspan="2"/>
                            <td colspan="4">设备型号:
                                <apex:inputText value="{!AssetModel}" id="AssetModel"/>
                            </td>
                            
                        </tr>
                        <tr>
                            <td colspan="2"/>
                            <td colspan="4">医院名称:
                                <apex:inputText value="{!HospitalName}" id="HospitalName"/>
                            </td>
                            
                        </tr>
                    </table>
                </apex:pageBlock>
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                 </apex:outputPanel>
                <apex:pageBlock title="保有设备查找" id="ConsumableorderdetailsSection">
                    <table class="list" border="0" cellpadding="0" cellspacing="0">
                        <tr class="headerRow">
                            <!-- <apex:variable var="v" value="" rendered="{!editAble}"> -->
                                <!-- <th><input type='checkbox' onClick='checkAll()' id='checker'/>选择</th> -->
                            <!-- </apex:variable> -->
                            
                            <th>选择</th>
                            <th>保有设备名称</th>
                            <!-- 20220927 ljh XLIU-CJN62G update start-->
                            <!-- <th>状态</th> -->
                            
                            <th>机身编码</th>
                            <th>医院</th>
                            <th>战略科室</th>
                            <th>科室</th>
                            <th>发货日</th>
                            <th>多年保修期至</th>
                            <th>最近一期维修合同结束日</th>
                            <!-- <th>集中管理库存</th> -->
                            <!-- 20220927 ljh XLIU-CJN62G update end-->
                        </tr>
                            <apex:repeat value="{!choiceAssetInfoRecordsview}" var="records" id="ConsumableorderdetailsTable">
                                <tr class="dataRow">
                                    <td>
                                    <apex:inputCheckbox value="{!records.check}" onclick="CheckSize(this);" id="consumablesCountproRowCheckbox" onchange="checkPartSupplyFinishDateJs(); return false;" disabled="{!!records.canSelect}"/>
                                    </td>
 
                                    <!-- <apex:variable var="v" value="" rendered="{!editAble}" id="variableinfo">
                                        <td>
                                        <apex:inputCheckbox value="{!records.check}" onclick="CheckSize(this);" id="consumablesCountproRowCheckbox" disabled="{!!records.canSelect}"/>
                                         <apex:inputCheckbox value="{!records.oldCheck}" id="proRowOldCheckbox" style="display:none"/></td>
                                     </apex:variable> -->
                                    <td class="dataCell">
                                        <apex:outputText value="{!records.ast.Name}"/>
                                    </td>
                                    <!-- <td class="dataCell">
                                        <apex:outputText value="{!records.ast.Status}"/>
                                    </td> -->
                                    
                                    <td class="dataCell">
                                        <apex:outputText value="{!records.ast.SerialNumber}"/>
                                    </td>
                                    <td class="dataCell">
                                        <apex:outputText value="{!records.ast.Hospital__r.Name}"/>
                                    </td>   
                                    <td class="dataCell">
                                        <apex:outputText value="{!records.ast.Department_Class__r.Name}"/>
                                    </td>   
                                    <td class="dataCell">
                                        <apex:outputText value="{!records.ast.Account.Name}"/>
                                    </td>
                                    <!-- <td class="dataCell">
                                        <apex:outputText value="{!records.ast.Product2.Asset_Model_No__c}"/>
                                    </td> -->
                                    <td class="dataCell">
                                        <apex:outputField value="{!records.ast.Posting_Date__c}"/>
                                    </td>
                                    <td class="dataCell">
                                        <apex:outputField value="{!records.ast.Extend_Gurantee_DateTo__c}"/>
                                    </td>
                                    <td class="dataCell">
                                        <apex:outputField value="{!records.ast.CurrentContract_End_Date__c}"/>
                                    </td>
                                    <!--XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 start -->
                                    <td>
                                        <apex:inputField value="{!records.ast.PartSupplyFinishDate__c}" id="partSupplyFinishDate" style="display: none" showDatePicker="false"/>
                                    </td>
                                    <!--XLIU-CJM7Z9 【委托】新建修理提示信息(停产及非修理对象品)LY 20221012 end  -->
                                    
                                </tr>
                            </apex:repeat>
                    </table>
                </apex:pageBlock>
        </apex:pageBlock>
    </apex:outputPanel>
</apex:form>
</apex:page>