kongzy
2024-07-01 47a751cb301d05276ae5d75145d57b2d090fe4e1
src/main/webapp/view_order_mng.xhtml
@@ -6,6 +6,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:p="http://primefaces.org/ui"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:c="http://java.sun.com/jsp/jstl/core">
@@ -27,6 +28,16 @@
                                 process="@form"
                                 actionListener="#{supplierOrderMngController.onUpdateStockClick}"
                update=":dialogStock,:dialogFormStock">
                </p:commandButton>
                <p:commandButton value="查看条码" styleClass="edit-btn"
                                 process="@form"
                                 actionListener="#{supplierOrderMngController.onViewBarcodeClick}"
                                 update=":viewReagentCodeList,:dialogViewReagentCodeForm">
                </p:commandButton>
                <p:commandButton value="打印二维码" styleClass="edit-btn"
                                 process="@form"
                                 actionListener="#{supplierOrderMngController.onPrintBarcodeClick}"
                                 update=":dialogReagentCode,:dialogReagentCodeForm">
                </p:commandButton>
            </p:panelGrid>
         <p:dataTable id="confirmOrderMngDataTable" styleClass="data-table"
@@ -50,17 +61,17 @@
            </p:column>
                <p:column headerText="管制品">
                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagent.controlProducts)}"></h:outputText>
                    <h:outputText value="#{row.reagent.controlProducts}"></h:outputText>
                </p:column>
                <p:column headerText="规格型号">
                    <h:outputText
                            value="#{baseMetaService.getBaseMetaValue(row.reagent.reagentFormat)}"></h:outputText>
                            value="#{row.reagent.reagentFormat}"></h:outputText>
                </p:column>
                <p:column headerText="包装">
                    <h:outputText
                            value="#{''.concat(row.reagent.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagent.reagentUnit))}"></h:outputText>
                            value="#{''.concat(row.reagent.mainMetering).concat(row.reagent.reagentUnit)}"></h:outputText>
                </p:column>
                <p:column headerText="含税售价">
@@ -78,15 +89,15 @@
            </p:column>
                <p:column headerText="危险性质">
                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagent.reagentCharacter)}"></h:outputText>
                    <h:outputText value="#{row.reagent.reagentCharacter}"></h:outputText>
                </p:column>
                <p:column headerText="厂家">
                    <h:outputText value="#{row.reagent.productHomeName}"></h:outputText>
                    <h:outputText value="#{row.reagent.productHome}"></h:outputText>
                </p:column>
                <p:column headerText="试剂类型">
                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagent.reagentType)}"></h:outputText>
                    <h:outputText value="#{row.reagent.reagentType}"></h:outputText>
                </p:column>
                <p:column headerText="申购人">
@@ -241,5 +252,88 @@
            </p:panel>
        </h:form>
    </p:dialog>
    <p:dialog modal="true" header="打印条码" appendTo="@(body)"
              id="dialogReagentCode" widgetVar="dialogReagentCode"
              resizable="false" width="500">
        <h:form id="dialogReagentCodeForm">
            <!--50*40 label尺寸 -->
            <p:panel styleClass="center-body">
                <div style="max-height: 800px;overflow: auto;height: 500px;width: 100%;">
                    <div id="reagentCodeContent" style="width: 190px;">
                        <c:if test="#{supplierOrderMngController.reagentCodeList!=null and supplierOrderMngController.reagentCodeList.size()>0}">
                            <c:forEach items="#{supplierOrderMngController.reagentCodeList[0].reagentCodes}" var="reagentCode">
                                <div style="margin-bottom: 5px;">
                                <table style="height: 130px;width: 100%;text-align: center;border:1px solid #000;" cellspacing="0" cellpadding="0">
                                    <tbody>
                                        <tr>
                                            <td colspan="2" style="border:1px solid #000;">
                                                <div><h:outputText value="#{supplierOrderMngController.reagentCodeList[0].reagent.name}" style="font-size:14px;font-weight: bold;"></h:outputText></div>
                                                <div><h:graphicImage  value="data:image/png;base64,#{supplierOrderMngController.getQrcode(reagentCode)}" style="width: 50px; height: 50px;" dataURI="true"/></div>
                                                <div><h:outputText value="#{reagentCode}" style="font-size:10px;"></h:outputText></div>
                                            </td>
                                        </tr>
                                        <tr><td style="border:1px solid #000;">【CAS号】</td><td style="border:1px solid #000;"><h:outputText value="#{supplierOrderMngController.reagentCodeList[0].reagent.cas}"></h:outputText></td></tr>
                                        <tr><td style="border:1px solid #000;">【危险性质】</td><td style="border:1px solid #000;"><h:outputText value="#{supplierOrderMngController.reagentCodeList[0].reagent.reagentCharacter}"></h:outputText></td></tr>
                                    </tbody>
                                </table>
                                </div>
                            </c:forEach>
                        </c:if>
                    </div>
                </div>
            </p:panel>
            <p:panel styleClass="btn  no-print">
                <div class="div-btn cancel" id="codeCancel">关闭</div>
                <div class="div-btn print" id="codePrint">打印</div>
                <script type="text/javascript" src="resources/js/print.js"/>
                <script type="text/javascript">
                    $(function () {
                        $("#codePrint").on("click", function () {
                            jQuery.print('#reagentCodeContent')
                        })
                        $("#codeCancel").on("click", function () {
                            $("#dialogReagentCode a").click();
                        })
                    })
                </script>
            </p:panel>
        </h:form>
    </p:dialog>
    <p:dialog modal="true" header="条码列表" appendTo="@(body)"
              id="viewReagentCodeList" widgetVar="viewReagentCodeList"
              resizable="false" width="1000">
        <h:form id="dialogViewReagentCodeForm">
            <p:dataTable styleClass="data-table"
                         paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
                         value="#{supplierOrderMngController.viewReagentCodeList}" var="row" rowKey="#{row.reagentCode}"
                         emptyMessage="无数据">
                <p:column headerText="试剂名称">
                    <h:outputText value="#{row.name}"></h:outputText>
                </p:column>
                <p:column headerText="CAS号">
                    <h:outputText value="#{row.cas}"></h:outputText>
                </p:column>
                <p:column headerText="危险性质">
                    <h:outputText value="#{row.reagentCharacter}"></h:outputText>
                </p:column>
                <p:column headerText="条码" width="280px;">
                    <h:outputText value="#{row.reagentCode}"></h:outputText>
                </p:column>
                <p:column headerText="条形码" >
                    <p:commandButton value="打印条码" styleClass="edit-btn" process="@form"
                                     actionListener="#{supplierOrderMngController.onPrintSingleBarcodeClick(row.reagentCode)}"
                                     update=":dialogReagentCode,:dialogReagentCodeForm">
                    </p:commandButton>
                </p:column>
            </p:dataTable>
        </h:form>
    </p:dialog>
</ui:composition>
</html>