高章伟
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
<apex:page Controller="OverdueStockController" 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)}" />
<script>
function searchProductJs() {
    blockme();
    searchorderBean();
}
 
function saveJs() {
    blockme();
    save();
}
 
function checkAll() {
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:overdueSection:overdueCnt')).value();
    if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
        for (var i = 0; i < productCount; i++) {
            j$(escapeVfId('allPage:allForm:allBlock:overdueSection:overdueTable:' + i + ':RowCheckbox')).attr('checked',true);
        }
    } else {
        for (var i = 0; i < productCount; i++) {
            j$(escapeVfId('allPage:allForm:allBlock:overdueSection:overdueTable:' + i + ':RowCheckbox')).attr('checked',false);
        }
    }
}
 
</script>
 
    <apex:form id="allForm">
         <apex:actionFunction name="searchorderBean"
            action="{!searchorderBean}" rerender="overdueSection,overdueSection1,message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="save" action="{!save}"
            rerender="overdueSection,overdueSection1,message"
            onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <apex:outputPanel id="message">
                <apex:pageMessages />
            </apex:outputPanel>
            <apex:pageBlock title="过期销存" id="allBlock">
                <apex:pageBlockButtons location="top">
                    <apex:commandButton onclick="saveJs();" value="销存确认" rerender="dummy" style="width: 150px;"  />
                </apex:pageBlockButtons>
                <apex:pageBlock id="searchBlock">
                    <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 value="{!barcode}" style="width:600px" /></td>
                            <td />
                            <td align="right"></td>
                            <td><apex:commandButton value="BarCode录入" 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="过期库存一览" id="overdueSection">
                <input type="hidden" id="allPage:allForm:allBlock:overdueSection:overdueCnt" value="{!pageRecordsSize}" />
                    <table class="list" cellpadding="0" cellspacing="0" >
                        <tr class="headerRow">
                            <th width="20"><input type='checkbox' onClick='checkAll()' id='checker'/>是否销存</th>
                            <th>消耗品名称</th>
                            <th>单位</th>
                            <th>过期数量</th>
                            <th>销存数量</th>
                        </tr>
            <apex:repeat value="{!codPageRecords}" var="m" id="overdueTable">
                        <tr class="dataRow">
                            <td>
                                <apex:inputCheckbox value="{!m.check}" id="RowCheckbox" styleClass="proRowCheckbox"/>
                            </td>
                            <td Class="dataCell">{!m.prodname}</td>
                            <td class="dataCell">{!m.boxPiece}</td>
                            <td class="dataCell" style="text-align: center;">{!m.overlimitCount}</td>
                            <td class="dataCell" style="text-align: center;">{!m.pandian}</td>
                        </tr>
            </apex:repeat>
                    </table>
                </apex:pageBlock>
                <!-- 销存产品详情 -->
                <apex:pageBlock id="overdueSection1" title="销存明细">
                    <apex:pageblocktable value="{!overduePageRecords}" var="records" id="overdueTable1">
                        <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">单位</apex:facet>
                            <apex:outputField value="{!records.orderdetails2.Box_Piece__c}" />
                        </apex:column>
                        <apex:column width="80">
                            <apex:facet name="header">BarCode</apex:facet>
                            <apex:outputField value="{!records.orderdetails2.Bar_Code__c}"/>
                        </apex:column>
                        <apex:column width="80">
                            <apex:facet name="header">使用期限</apex:facet>
                            <apex:outputField value="{!records.orderdetails2.Sterilization_limit__c}" />
                        </apex:column>
                        <apex:column width="80">
                            <apex:facet name="header">销存原因</apex:facet>
                            <apex:outputText value="{!records.DiffReason}" />
                        </apex:column>
                    </apex:pageblocktable>
                </apex:pageBlock>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
</apex:page>