<apex:page Controller="ConsumableOrderManageController" showHeader="true" tabStyle="ConsumableOrderManage__tab" sidebar="true" id="allPage" action="{!init1}" title="订单管理">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<script>
function searchProductJs() {
    blockme();
    searchConsumableorderdetails();
}
function calonLoad() {
}
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:OrderStatusSearch").value = "";
    searchConsumableorderdetails();
}
window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
</script>
<style>
    .dateFormat  {
        display: none;
    }
</style>
    <apex:form id="allForm">
        <apex:actionFunction name="searchConsumableorderdetails" action="{!searchConsumableorderdetails}" rerender="ConsumableorderdetailsSection,searchdeal, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <apex:pageBlock id="allBlock">
            <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 action="{!neworder}" value="新建订货" rerender="dummy" style="width:100px;" /></td>
                            <td/>
                        </tr> -->
                        <tr>
                            <td align="right"></td>
                            <!-- //update by rentx 2020-11-20 start -->
                            <!-- <td><apex:commandButton action="{!neworder}" value="新建订货" rerender="dummy" style="width:100px;" /></td> -->
                            <td><apex:commandButton action="{!agreementorder}" value="协议订货" rerender="dummy" style="width:100px;" /></td>
                            <td style="width: 100px" />
                            <apex:detail rendered="{!agencyProType == 'ENG'}">
                                <td><apex:commandButton rendered="{!hasHop}" action="{!hospitalorder}" value="医院特价" rerender="dummy" style="width:100px;" /></td>
                                <td style="width: 100px" />
                            </apex:detail>
                            <td><apex:commandButton rendered="{!hasSpecial}" action="{!promotionorder}" value="促销订货" rerender="dummy" style="width:100px;" /></td>
                            <td/>
                            <!-- //update by rentx 2020-11-20 end -->

                        </tr>
                    </table>
                </apex:pageBlock>
                <apex:pageBlock id="searchBlock" title="检索条件">
                    <table>
                        <colgroup>
                            <col width="160px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                        <tr>
                            <td align="right">消耗品订单名称</td>
                            <td><apex:inputtext id="OrderCodeSearch" value="{!category1}" style="width:100px"/></td>
                            <td/>
                            <td align="right">订单日期</td>
                            <td><apex:inputField id="OrderDateSearch" value="{!coc.Order_date__c}" style="width:100px"/></td>
                            <td/>
                            <td align="right">订单状态</td>
                            
                            <td align="left">
                            <apex:selectList id="OrderStatusSearch" value="{!coc.Order_status__c}" style="width:175px" size="1">
                                <apex:selectOptions value="{!provinceOpts}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                            <td align="right"></td>
                            <td><apex:commandButton value="搜索" style="width: 100px;" onclick="searchProductJs(); return false;" /></td>
                            
                            <td align="right"></td>
                            <td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs()" class="btn"/></td>
                            <td/>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                    </table>
                </apex:pageBlock> 
                
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                    
                    
                 </apex:outputPanel>
                 <apex:pageBlock id="searchdeal" title="订货明细">
                 <table class="list" border="1" style="border-collapse:collapse;table-layout:fixed;border: 1px solid #e0e3e5;border-spacing:0;width:100%">
        <tr style="background-color:#DCDCDC;" class="headerRow">
<apex:repeat value="{!title}" var="t">
            <td><apex:outputText value="{!t}"/></td>
</apex:repeat>
        </tr>
<apex:repeat id="dataline" value="{!raesList}" var="raesInfo">
        <tr>
    <apex:repeat value="{!columns}" var="c">
            <td>
                <apex:outputPanel rendered="{!(c.size==1)}" layout="none">
                <apex:outputPanel rendered="{!c[0]=='Name'}" layout="none">
                <apex:outputLink value="/Consumable?ESetid={!raesInfo.Id}" target="LINK_{!raesInfo.Id}"><apex:outputField value="{!raesInfo[c[0]]}"/></apex:outputLink>
                </apex:outputPanel>
                <apex:outputPanel rendered="{!c[0]<>'Name'}" layout="none">
                <apex:outputField value="{!raesInfo[c[0]]}"/>
                </apex:outputPanel>
                </apex:outputPanel>
        <apex:outputPanel rendered="{!(c.size==2)}" layout="none">
                <apex:outputField value="{!raesInfo[c[0]][0][c[1]]}"/>
        </apex:outputPanel>
            </td>
    </apex:repeat>
        </tr>
</apex:repeat>
    </table>            
     </apex:pageBlock>            
            </apex:pageBlock> 
        </apex:outputPanel>
    </apex:form>
</apex:page>