高章伟
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
<apex:page Controller="InventoryViewController" showHeader="true" tabStyle="InventoryView__tab" sidebar="true" id="allPage" action="{!init}" title="库存管理">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<script>
function ClearJs(){
    blockme();
    //document.getElementById("allPage:allForm:allBlock:searchBlock:OrderCodeSearch").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:OrderDateSearch").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category3Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category4Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category5Search").value = "";
    //j$(escapeVfId("allPage:allForm:allBlock:editAble:OrderDircteion")).attr('disabled',false);
    //j$(escapeVfId("allPage:allForm:allBlock:editAble:OrderExpectDate")).attr('disabled',false);
    searchConsumableorderdetails();
}
function InventoryJs(){
    window.open("/customer/Inventory");
}
// 过期库存销存
function OverdueStockJs(){
    window.open("/customer/OverdueStock");
}
function RemoveBoxJs(){
    window.open("/customer/RemoveBox");
}
function CancelRemoveBoxJs(){
    window.open("/customer/CancelRemoveBox");
}
//function DownPageJs(){
// blockme();
//DownPage();
//}
//function UpPageJs(){
// blockme();
//UpPage();
//}
function searchProductJs() {
    blockme();
    searchConsumableorderdetails();
}
 
function showCate() {
    //var productCount = j$(escapeVfId('allPage:allForm:allBlock:searchBlock:category3Search')).value();
    categoryload();
}
 
function showAllCate() {
    //var productCount = j$(escapeVfId('allPage:allForm:allBlock:searchBlock:category3Search')).value();
    categoryAllload();
}
 
function refreshPageSizeJs() {
        refreshPageSize();
}
 
//正常排序
function SortLimitedJs(key){
    blockme();
    SortLimited(key);
}
 
//库存排序
function SortStoreJs(key){
    blockme();
    SortStore(key);
}
 
//库存排序
//function popSortJs(key){
//    blockme();
//    popSort(key);
//}
 
 
function setDisabled() {
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCnt')).value();
    for (var i = 0; i < productCount; i++) {
        var canselect = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':canSelect')).value();
        if (canselect == 'false') {
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':shelfnumber')).attr('disabled',true);
        }
    }
}
 
function calonLoad() {
}
window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
</script>
<style>
    .dateFormat  {
        display: none;
    }
    tr.dataRow {
      background-color:white;
    }
    td.dataRowCFDA {
        background-color:red;
    }
    td.columuslowercolour {
        background-color:red;
        text-align: right;
    }
    td.columuscuperolour {
        background-color: yellow;
        text-align: right;
    }
    tr.dataRow:hover {
      background-color: #e3f3ff;
    };
</style>
    <apex:form id="allForm">
        <apex:actionFunction name="categoryAllload" action="{!categoryAllload}" rerender="searchBlock" onComplete="unblockUI();">
        </apex:actionFunction>
         <apex:actionFunction name="categoryload" action="{!categoryload}" rerender="searchBlock" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="searchConsumableorderdetails" action="{!searchConsumableorderdetails}" rerender="ConsumableorderdetailsSection,ConsumableorderdetailsUnSection,searchBlock" onComplete="unblockUI();"> 
        </apex:actionFunction>
        <apex:actionFunction name="SortStore" action="{!SortStore}" rerender="allBlock" onComplete="unblockUI();">
            <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="SortLimited" action="{!SortLimited}" rerender="allBlock" onComplete="unblockUI();">
            <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="refreshPageSize" action="{!refreshPageSize}" status="fetchStatus" reRender="ConsumableorderdetailsSection,message"/>
        <apex:outputPanel id="allPanel">
            <apex:pageBlock id="allBlock" title="库存管理">
                <apex:pageBlock id="newBlock">
                    <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"></td>
                            <td><apex:commandButton onclick="InventoryJs()"   value="库存盘点" style="width:150px" rerender="dummy" /></td>
                            <td/>
                             <td align="right"></td>
                            <td><apex:commandButton onclick="OverdueStockJs();"   value="过期库存销存" style="width:150px" rerender="dummy" /></td>
                            <td/>
                            <td align="right"></td>
                            <td><apex:commandButton onclick="RemoveBoxJs();" value="拆盒" style="width:150px" rerender="dummy" /></td>
                            <td/>
                            <td align="right"></td>
                            <td><apex:commandButton onclick="CancelRemoveBoxJs();" value="取消拆盒" style="width:150px" rerender="dummy"  /></td>
                            <td/>
                        </tr>
                    </table>
                </apex:pageBlock>
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                 </apex:outputPanel>
 
      <apex:pageBlock id="searchBlock" >
                    <table>
                        <colgroup>
                            <col width="10px"/>
                            <col width="10px"/>
                            <col width="60px"/>
                            <col width="220px"/>
                            <col width="60px"/>
                            <col width="60px"/>
                            <col width="180px"/>
                            <col width="60px"/>
                            <col width="60px"/>
                            <col width="180px"/>
                            <col width="60px"/>
                            <col width="60px"/>
                            <col width="180px"/>
                            <col width="60px"/>
                            <col width="80px"/>
                            <col width="80px"/>
                            <col width="80px"/>
                            <col width="35px"/>
                            <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"></td>
                            <td></td>
                            <td/>
                            <td align="right">消耗品名称</td>
                            <td><apex:inputText id="OrderDateSearch" value="{!category1}" style="width:100px"/></td>
                            <td/>
                             <td align="right">第3分类</td>
                            <td>
                             <apex:selectList id="category3Search" value="{!category3}" style="width:100px" size="1" onchange="showAllCate();">
                                <apex:selectOptions value="{!categoryOptionList}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                             <td align="right">第4分类</td>
                            <td>
                             <apex:selectList id="category4Search" value="{!category4}" style="width:100px" size="1" onchange="showCate();">
                                <apex:selectOptions value="{!category4OptionList}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                             <td align="right">第5分类</td>
                             <td>
                             <apex:selectList id="category5Search" value="{!category5}" style="width:100px" size="1">
                                <apex:selectOptions value="{!category5OptionList}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                        
                            <td align="right"></td>
                            <td><apex:commandButton value="消耗品搜索" style="width: 100px;"  onclick="searchProductJs();return false;"  /></td>
                            <td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs();" class="btn"/></td>
                            <td/> 
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                    </table>
                </apex:pageBlock>
 
 
                <apex:pageBlock title="库存详情" id="ConsumableorderdetailsSection">
                    <table class="list" border="0" cellpadding="0" cellspacing="0">
                         <tr class="headerRow">
                            <th><a href="#" onclick="SortLimitedJs('0');return false;" style="text-decoration: underline;">消耗品名称</a>{!sortOrder[0]}</th>
                            <th><a href="#" onclick="SortLimitedJs('3');return false;" style="text-decoration: underline;">第3分类</a>{!sortOrder[3]}</th>
                            <th><a href="#" onclick="SortLimitedJs('4');return false;" style="text-decoration: underline;">第4分类</a>{!sortOrder[4]}</th>
                            <th><a href="#" onclick="SortLimitedJs('5');return false;" style="text-decoration: underline;">第5分类</a>{!sortOrder[5]}</th>
                            <th>规格</th>
                            <th>单位</th>
                            <th>注册证编码号</th>
                            <th>注册证效期</th>
                            <th>CFDA状态</th>
                        <!--    <th><a href="#" onclick="SortLimitedJs('1');return false;" style="text-decoration: underline;">产品型号</a>{!sortOrder[1]}</th>-->
                          <!--   <th>产品数量下限</th> -->
                        <!--    <th>产品数量上限</th>-->
                            <th>使用期限</th>
 
                        <!--    <th>{!$ObjectType.Product2__c.fields.SFDA_Status__c.label}</th> -->
                            <th><a href="#" onclick="SortStoreJs('6');return false;" style="text-decoration: underline;">有效期内库存</a>{!sortOrder[6]}</th>
                            <th>过期库存</th>
                        <!--    <th><a href="#" onclick="popSortJs('2');return false;" style="text-decoration: underline;">库存</a>{!sortOrder[2]}</th>-->
                        <!-- //add by rentx 2020-12-09 -->
                        <apex:detail rendered="{!hasHos}">
                            <th>医院特价</th>
                        </apex:detail>
                        <!-- //add by rentx 2020-12-09 -->
 
                        </tr>
                        <apex:repeat value="{!pageRecords}" var="m" id="theRepeat">
                        <tr class="dataRow">
                            <td Class="dataCell">{!m.Prod.Name__c}</td>
                            <td class="dataCell">{!m.Prod.Category3__c}</td>
                            <td class="dataCell">{!m.Prod.Category4__c}</td>
                            <td class="dataCell">{!m.Prod.Category5__c}</td>
                            <td class="dataCell" style="text-align: center;">{!m.packing_list}</td>
                            <td class="dataCell">{!m.BoxPiece}</td>
                            <td class="dataCell">{!m.approbation_No}</td>
                            <td class="dataCell">
                                <apex:outputText value="{0, date, yyyy/MM/dd}">
                                    <apex:param value="{!m.expiration_Date}" />
                                </apex:outputText>
                            </td>
                            <td class="dataCell">{!m.Prod.SFDA_Status__c}</td>
                        <!--    <td class="dataCell">{!m.Prod.Asset_Model_No__c}</td>-->
                            <!-- <td class="dataCell" style="text-align: right;">{!m.lowerlimit}</td> -->
                        <!--    <td class="dataCell" style="text-align: right;">{!m.upperlimit}</td>-->
                            <td class="dataCell">
                                <apex:outputText value="{0, date, yyyy/MM/dd}">
                                  <apex:param value="{!m.guaranteeperiod}" />
                                </apex:outputText></td>
 
                        <!--    <td class="dataCell">{!m.Prod.SFDA_Status__c}</td> -->
                            <td Class="{!IF(m.upperlimit != null && m.upperlimit != null &&  m.BoxPiece=='盒',IF(m.limitCount > m.upperlimit,'columuscuperolour', IF(m.limitCount < m.lowerlimit,'columuslowercolour', 'dataCell')), 'dataCell')}" style="text-align: center;">{!m.limitCount}</td>
                            <td class="dataCell" style="text-align: center;">{!m.overlimitCount}</td>
                        <!--    <td Class="dataCell" style="text-align: right;">{!m.allnumber}</td> -->
                        <!-- add by rentx 2020-11-26 start -->
                            <td class="dataCell" >
                                <apex:detail rendered="{!m.hospitalSpecialOffer}">
                                        √
                                </apex:detail>
<!--                                 <apex:detail rendered="{!!m.hospitalSpecialOffer}">
                                        ×
                                </apex:detail> -->
                             </td>
                        <!-- add by rentx 2020-11-26 end -->
                        </tr>
                        </apex:repeat>
                    </table>
                    <table style="width: 100%">  
                         <tr>  
                            <td>  
                                <!-- Page X of Y -->  
                                <!-- PageNumber:当前页面所在位置,ResultSize:记录总条数,PageSize:每页记录条数 -->  
                                <apex:outputText value="{!(currentpage * pagesize)+1-pagesize}-{!IF((currentpage * pagesize)>totalcount, totalcount,
                                 (currentpage * pagesize))} 共 {!totalcount} 个" />  
                            </td> 
                            <td align="center">  
                                <div class="paginator line1">
                                <span class="prevNextLinks">
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToFirst}" oncomplete="refreshPageSizeJs();" title="首页" >
                                <img src="/s.gif" title="首页" alt="首页" class="{!if((hasPrevious),'first','firstoff')}"/>
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection"  action="{!moveToPrevious}" oncomplete="refreshPageSizeJs();"  title="上一页">
                                <img src="/s.gif" title="上一页" alt="上一页" class="{!if((hasPrevious),'prev','prevoff')}"/>上一页
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToNext}" oncomplete="refreshPageSizeJs();" title="下一页">下一页
                                <img src="/s.gif" title="下一页" alt="下一页" class="{!if((hasNext),'next','nextoff')}"/>
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!moveToLast}"  oncomplete="refreshPageSizeJs();" title="尾页">
                                <img src="/s.gif" title="尾页" alt="尾页" class="{!if((hasNext),'last','lastoff')}"/>
                                </apex:commandLink>
                                </span>
                                </span>
                                </div>
                             </td> 
                             <td align="right" width="20%">  
                                <!-- Records per page -->  
                                <!--
                                每页记录数:  
                                    <apex:selectList value="{!size}" multiselect="false" size="1" onchange="refreshPageSize();">
                                <apex:selectOptions value="{!paginationSizeOptions}"/>
                                </apex:selectList> -->
                            </td>  
                        </tr> 
                    </table>
                </apex:pageBlock>
            </apex:pageBlock> 
        </apex:outputPanel>
 
    </apex:form>
<script>
 
</script>   
</apex:page>