高章伟
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
<apex:page Controller="ArriveGoodsController" tabStyle="ArriveGoodsMain__tab" showHeader="true" sidebar="true" action="{!init}" id="allPage" title="入库/返品">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<script>
function saveJs() {
    blockme();
    save();
}
function searchProductJs() {
    blockme();
    SearchPro();
}
 
function ArriveGoodsConfimJs(){
    var inventorysizeNum = j$(escapeVfId('consumableInventorysize')).value();
    if (inventorysizeNum > 0) {
        event.returnValue = confirm("确认入库吗?");
        if(event.returnValue == true){
            blockme();
            ArriveGoodsConfim();
        }
    }else{
        blockme();
        ArriveGoodsConfim();
    }
}
function UpdateGoodsOfReturnJs(){
    event.returnValue = confirm("确认返品吗?");
    if(event.returnValue == true){
        blockme();
        UpdateGoodsOfReturn();
    }
}
 
 
//用法如下//add by rentx 20210617 start
function cancleKongbai(){
    var aEle=document.getElementById('tableId').getElementsByTagName('td');
    
    for(var i=0;i<aEle.length;i++){
        if(aEle[i].className=='data2Col' || aEle[i].className=='data2Col last')
        {
            aEle[i].style.display = 'none';
        }
    }
};
//用法如下//add by rentx 20210617 end
 
window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
 
</script>
<apex:form id="allForm">
        <apex:actionFunction name="SearchPro" action="{!SearchPro}" rerender="ConsumableorderdetailsSection,ConsumableorderdetailsSection1,ConsumabledetailsofReturn,productInventorydetails, message,detailsSummary" onComplete="unblockUI();cancleKongbai();">
        </apex:actionFunction>
        <apex:actionFunction name="ArriveGoodsConfim" action="{!ArriveGoodsConfim}" rerender="ConsumableorderdetailsSection,ConsumableorderdetailsSection1,ConsumabledetailsofReturn,productInventorydetails,message,EDCline_1,orderinfo,messageText" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="UpdateGoodsOfReturn" action="{!UpdateGoodsOfReturn}" rerender="ConsumableorderdetailsSection,ConsumableorderdetailsSection1,ConsumabledetailsofReturn,productInventorydetails,message" oncomplete="unblockUI();">
        </apex:actionFunction>
        <apex:outputPanel id="allPanel">
             <apex:outputPanel id="messageText">
                <table>
                        <tr>
                            <td>
                            <div id="ErrorName" style="color: red;font-weight: bold;" >{!alertMessage}</div>
                            </td>
                        </tr>
                </table>
            </apex:outputPanel>
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                </apex:outputPanel>
            <apex:pageBlock title="入库/返品" id="allBlock">
             <apex:pageBlock id="EDCline_1" >
                    <apex:commandButton onclick="ArriveGoodsConfimJs();return false;"   rendered="{!!ReturnFLGbln}" value="到货确认" style="width:150px" rerender="dummy" disabled="{!saveFLGbln}"/>
                    <apex:commandButton onclick="UpdateGoodsOfReturnJs();return false;"  rendered="{!ReturnFLGbln}"  value="登录返品" style="width: 150px" rerender="dummy"/>
            </apex:pageBlock>
            <apex:pageBlock rendered="{!IF(ESetId !='', true, false)}" title="订单信息" id="orderinfo">
                    <table>
                    <colgroup>
                            <col width="150px"/>
                            <col width="150px"/>
                            <col width="100px"/>
                            <col width="100px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="120px"/>
                            <col width="150px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                        <tr>
                            <!-- <td align="right">订单名称</td>
                            <td><apex:outputLink value="/{!coc.Id}" target="LINK_{!coc.Id}"><apex:outputField value="{!coc.Name}" style="width:100px"/></apex:outputLink></td>
                            <td/> -->
                             <td align="right">订单名称:</td>
                            <td><apex:outputField value="{!coc.Name}" style="width:100px"/></td>
                            <td/>
                            <td align="right">{!$ObjectType.Consumable_order__c.fields.Total_num__c.label}:</td>
                            <td><apex:outputField value="{!coc.Total_num__c}" style="width:100px"/></td>
                            <td/>
                            <td align="right">{!$ObjectType.Consumable_order__c.fields.OrderNumber_arrived__c.label}:</td>
                            <td><apex:outputField value="{!coc.OrderNumber_arrived__c}" style="width:100px"/></td>
                            <td/>
                            <td align="right">{!$ObjectType.Consumable_order__c.fields.OrderNumber_notarrive__c.label}:</td>
                            <td><apex:outputField value="{!coc.OrderNumber_notarrive__c}" style="width:100px"/></td>
                            <td/>
                        </tr>
                    </table>
                </apex:pageBlock> 
                <apex:pageBlock title="BarCode录入">
                    <table>
                        <colgroup>
                            <col width="160px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                        <tr>
                            <td align="right">BarCode号</td>
                            <td><apex:inputTextarea id="BarCodeArea"  value="{!barcode}" style="width:600px"/></td>
                            <td/>
                            <td align="right"></td>
                            <td><apex:commandButton value="获取明细" style="width: 150px;" onclick="searchProductJs(); return false;" /></td>
                            <td/>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                    </table>
                </apex:pageBlock>
 
                 <apex:outputPanel id="message">
                    <apex:pageMessages />
                 </apex:outputPanel>
                 <apex:pageBlock title="本次到货产品汇总" rendered="{!!ReturnFLGbln}">
                     <apex:pageblocksection columns="1" id="detailsSummary">
                        <apex:pageblocktable value="{!detailsSummary}" var="records" id="detailsSummaryTable">
                             <apex:column width="80">
                                 <apex:facet name="header">产品型号</apex:facet>
                                 <apex:outputField value="{!records.Prod.Asset_Model_No__c}"/>
                             </apex:column>
                             <apex:column width="80">
                                 <apex:facet name="header">产品名称</apex:facet>
                                 <apex:outputField value="{!records.Prod.Name__c}"/>
                             </apex:column>
                             <apex:column width="80" style="text-align:right;">
                                 <apex:facet name="header">到货数量</apex:facet>
                                 <apex:outputText value="{!records.arrivedCount}"/>
                             </apex:column>
                             <apex:column width="80" style="text-align:right;">
                                 <apex:facet name="header">到货金额</apex:facet>
                                 <apex:outputText value="{!records.arriveAmount}"/>
                             </apex:column>
                        </apex:pageblocktable>
                    </apex:pageblocksection>
                </apex:pageBlock>
                 <apex:pageBlock title="到货明细" rendered="{!!ReturnFLGbln}" id="ConsumableorderdetailsSection">
                     <!-- <apex:pageblocksection columns="1" id="ConsumableorderdetailsSection">add by rentx CHAN-C3K4ZQ 20210618 -->
                     <table class="list"  border="0" cellpadding="0" cellspacing="0" id="tableId" >
                        <colgroup>
                            <col width="160px"/>
                            <col width="160px"/>
                            <col width="160px"/>
                            <col width="160px"/>
                            <col width="160px"/>
                            <col width="160px"/>
                            <col width="200px"/>
                        </colgroup>
 
                        <tr class="headerRow">
                            <th width="16%">消耗品名称</th>
                            <th width="16%">规格</th>
                            <th width="16%">CFDA状态</th>
                            <th width="16%">注册证编码号</th>
                            <th width="16%">注册证效期</th>
                            <th width="20%">BarCode</th>
                        </tr>
                        <apex:repeat value="{!ConsumableorderdetailsRecordsview}" var="records" id="ConsumableorderdetailsTableOuter" >
                            <apex:repeat value="{!records}" var="item" id="ConsumableorderdetailsTable">
                                <tr class="dataRow">
                                    <td> {!item.Prod.Name__c} </td>
                                    <td> {!item.esd.ProductPacking_list_manual__c} </td>
                                    <td> {!item.esd.CFDA_Status__c} </td>
                                    <td> {!item.esd.Report_Product_Approbation__c} </td>
                                    <td> {!item.ReportProductExpirationDate} </td>
                                    <td> {!item.esd.Bar_Code__c} </td>
                                </tr>
                            </apex:repeat>
                        </apex:repeat>
                    </table>
                    <!-- add by rentx CHAN-C3K4ZQ 20210618 -->
 
                     <!-- //add by rentx CHAN-C3K4ZQ 20210602 start 注释by rentx start 20210618 -->
                        <!-- <apex:repeat value="{!ConsumableorderdetailsRecordsview}" var="records" id="ConsumableorderdetailsTableOuter" > -->
                     <!-- //add by rentx CHAN-C3K4ZQ 20210602 end -->
                     <!-- //update by rentx CHAN-C3K4ZQ 20210602 start -->
                            <!-- <apex:pageblocktable value="{!records}" var="records" id="ConsumableorderdetailsTable"> -->
                            <!-- <apex:pageblocktable value="{!records}" var="records" id="ConsumableorderdetailsTable"> -->
                     <!-- //update by rentx CHAN-C3K4ZQ 20210602 end -->
                                 <!-- <apex:column width="80"> -->
                                     <!-- <apex:facet name="header">消耗品名称</apex:facet> -->
                                     <!-- <apex:outputField value="{!records.Prod.Name__c}"/> -->
                                 <!-- </apex:column> -->
                                 <!-- <apex:column width="80" style="text-align: center;"> -->
                                     <!-- <apex:facet name="header">规格</apex:facet> -->
                                     <!-- <apex:outputField value="{!records.esd.ProductPacking_list_manual__c}"/> -->
                                 <!-- </apex:column> -->
                                 <!-- <apex:column width="80"> -->
                                     <!-- <apex:facet name="header">CFDA状态</apex:facet> -->
                                     <!-- <apex:outputField value="{!records.esd.CFDA_Status__c}"/> -->
                                 <!-- </apex:column> -->
                                 <!-- <apex:column width="80"> -->
                                     <!-- <apex:facet name="header">注册证编码号</apex:facet> -->
                                     <!-- <apex:outputField value="{!records.esd.Report_Product_Approbation__c}"/> -->
                                 <!-- </apex:column> -->
                                 <!-- <apex:column width="80"> -->
                                     <!-- <apex:facet name="header">注册证效期</apex:facet> -->
                                     <!-- <apex:outputField value="{!records.esd.Report_Product_Expiration__c}"/> -->
                                 <!-- </apex:column> -->
                                  <!-- <apex:column width="80"> -->
                                     <!-- <apex:facet name="header">BarCode</apex:facet> -->
                                     <!-- <apex:outputField value="{!records.esd.Bar_Code__c}"/> -->
                                 <!-- </apex:column> -->
                                <!-- <apex:column width="80">
                                     <apex:facet name="header">发货日期</apex:facet>
                                     <apex:outputField value="{!records.esd.Deliver_date__c}"/>
                                 </apex:column>
                                 <apex:column width="80">
                                     <apex:facet name="header">{!$ObjectType.Consumable_order_details__c.fields.IsArrival__c.label}</apex:facet>
                                     <apex:outputField value="{!records.esd.IsArrival__c}"/>
                                 </apex:column> -->
                            <!-- </apex:pageblocktable> -->
                        <!-- </apex:repeat> -->
                    <!-- </apex:pageblocksection> 注释byrentx end 20210618 end-->
                </apex:pageBlock>
 
                <apex:pageBlock title="返品明细" rendered="{!ReturnFLGbln}" id="returnTable">
                    <apex:pageBlockSection columns="1" id="ConsumabledetailsofReturn">
                        <apex:pageBlockTable id="ConsumabledetailsofReturnTable" value="{!ShowGoodsofReturnList}" var="ShowGR">
                            <apex:column width="80">
                                <apex:facet name="header">
                                    出库单
                                </apex:facet>
                                <apex:outputLink value="/summonsCreat?ESetid={!IF(ShowGR.esd.Consumable_Shipment_order__c=='', ShowGR.esd.Consumable_Sale_order__c, ShowGR.esd.Consumable_Shipment_order__c)}" target="_blank">
                                    <apex:outputText value="{!IF(ShowGR.esd.Consumable_Shipment_order__c=='', ShowGR.esd.Consumable_Sale_order__r.Name, ShowGR.esd.Consumable_Shipment_order__r.Name)}"/>
                                <!-- <apex:outputLink value="/summonsCreat?ESetid={!ShowGR.esd.Consumable_ZS_order__c}" target="_blank">
                                    <apex:outputText value="{!ShowGR.esd.Consumable_ZS_order__r.Name}"/> -->
                                </apex:outputLink>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    出库日
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.Product_OutDate__c}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    消耗品名称
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.Prod.Name__c}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    出库目的
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.SummonsForDirction_det__c}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    客户名
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.HospItal_Name__c}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    经销商
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.Order_Dealer_Info__c}"/>
                            </apex:column>
                          <apex:column width="80">
                                <apex:facet name="header">
                                    BarCode
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.Bar_Code__c}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    使用期限
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.Sterilization_limit__c}"/>
                            </apex:column>
                            <apex:column width="80" style="text-align: center;">
                                <apex:facet name="header">
                                    单位
                                </apex:facet>
                                <apex:outputField value="{!ShowGR.esd.Box_Piece__c}"/>
                            </apex:column>
                            <apex:column width="80" style="text-align: center;">
                                <apex:facet name="header">
                                    返品数量
                                </apex:facet>
                                <apex:outputField style="width:80px;"  value="{!ShowGR.esd.Rrturn_count__c}"  rendered="{!IF(ShowGR.esd.Box_Piece__c='盒',true,false)}" />
                                <apex:inputField style="width:80px;"  value="{!ShowGR.esd.Rrturn_count__c}" onchange="if ({!ShowGR.canEdit}){this.value='1'}" rendered="{!IF(ShowGR.esd.Box_Piece__c='个',true,false)}" />
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">
                                    返品原因
                                </apex:facet>
                                <apex:inputField value="{!ShowGR.esd.Return_reason__c}"/>
                            </apex:column>
                        </apex:pageBlockTable>
                    </apex:pageBlockSection>
                </apex:pageBlock>
 
 
                <apex:pageBlock title="入库明细"  id="inTable">
                     <apex:pageblocksection columns="1" id="productInventorydetails">
                     <input type="hidden" id="consumableInventorysize" value="{!inventorysize}" />
                        <apex:pageblocktable value="{!consumableInventory}" var="records" id="productInventorydetailsTable">
                             <apex:column width="160">
                                 <apex:facet name="header">消耗品名称</apex:facet>
                                 <apex:outputField value="{!records.Prod.Name__c}"/>
                             </apex:column>
                             <apex:column width="80">
                                 <apex:facet name="header">BarCode</apex:facet>
                                 <apex:outputText value="{!records.barCodeNo}"/>
                             </apex:column>
                             <apex:column width="80">
                                 <apex:facet name="header">使用期限</apex:facet>
                                 <apex:outputText value="{0, date, yyyy/MM/dd}">
                                    <apex:param value="{!records.sterilizationlimitDate}" />
                                </apex:outputText>
                             </apex:column>
                             <apex:column width="80">
                                 <apex:facet name="header">serialNoorLotNo</apex:facet>
                                 <apex:outputText value="{!records.serialNoorLotNo}"/>
                             </apex:column>
                             <apex:column width="80">
                                 <apex:facet name="header">tracingCode</apex:facet>
                                 <apex:outputText value="{!records.tracingCodeNo}"/>
                             </apex:column>
                             <apex:column width="80" rendered="{!ReturnFLGbln}">
                                <apex:facet name="header">
                                    返品原因
                                </apex:facet>
                                <apex:inputText value="{!records.ReturnReason}"/>
                            </apex:column>
                        </apex:pageblocktable>
                    </apex:pageblocksection>
                </apex:pageBlock>
 
 
                <apex:pageBlock title="错误明细" id="ConsumableorderdetailsSection1">
                    <table class="list" border="0" cellpadding="0" cellspacing="0">
                        <tr class="headerRow">
                            <th>消耗品订单</th>
                            <th>消耗品名称</th>
                            <th>BarCode</th>
                            <th>单位</th>
                            <th>数量</th>
                            <th>错误原因</th>
                        </tr>
                    <apex:repeat value="{!ConsumableorderdetailsRecordserror}" var="records" id="ConsumableorderdetailsTable1">
                        <tr class="dataRow">
                            <td Class="dataCell">
                                <apex:outputField value="{!records.esd.Consumable_order_minor__c}"/>
                            </td>
                            <td Class="dataCell">
                                <apex:outputField value="{!records.Prod.Name__c}"/>
                            </td>
                            <td Class="dataCell">
                                <apex:outputField value="{!records.esd.Bar_Code__c}"/>
                            </td>
                            <td Class="dataCell" style="text-align: center;">
                                <apex:outputField value="{!records.esd.Box_Piece__c}"/>
                            </td>
                            <td Class="dataCell" style="text-align: center;">
                                <apex:outputText value="{!records.intMark}"/>
                            </td>
                            <td Class="dataCell">
                                <apex:outputText value="{!records.ErrorReason}"/>
                            </td>
                        </tr>
                    </apex:repeat>
                    </table>
 
<!--
                    <apex:pageblocktable value="{!ConsumableorderdetailsRecordserror}" var="records" id="ConsumableorderdetailsTable1">
                         <apex:column width="80">
                             <apex:facet name="header">消耗品订单</apex:facet>
                             <apex:outputField id="consumablesCount11" value="{!records.esd.Consumable_order_minor__c}"/>
                         </apex:column>
                         <apex:column width="80">
                             <apex:facet name="header">消耗品名称</apex:facet>
                             <apex:outputField value="{!records.Prod.Name__c}"/>
                         </apex:column>
                          <apex:column width="80">
                             <apex:facet name="header">BarCode</apex:facet>
                             <apex:outputField value="{!records.esd.Bar_Code__c}"/>
                         </apex:column>
                         <apex:column width="80">
                             <apex:facet name="header">单位</apex:facet>
                             <apex:outputField value="{!records.esd.Box_Piece__c}" />
                         </apex:column>
                         <apex:column width="80">
                             <apex:facet name="header">数量</apex:facet>
                             <apex:outputText value="{!records.intMark}" />
                         </apex:column>
                         <apex:column width="80">
                             <apex:facet name="header">错误原因</apex:facet>
                             <apex:outputText value="{!records.ErrorReason}" />
                         </apex:column>
                    </apex:pageblocktable>-->
                    <table class="list" cellpadding="0" cellspacing="0" border="none">
                        <tr>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;text-align: center;"><apex:outputText id="sumPrice_buttom" value="合计:{!errorsize}"/></td>
                            <td style="border: none;"></td>
                        </tr>
                    </table>
                </apex:pageBlock>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
</apex:page>