gdg
2021-02-02 aab1d1e20e7b4b72a9bd98c5d26fdfb087b4c57b
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<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">
<head></head>
<ui:composition>
    <h:form id="laboratoryMngForm">
        <p:panel styleClass="center-header">
            <p:outputLabel styleClass="title" value="实验室管理"></p:outputLabel>
            <p:panelGrid styleClass="filter" columns="7">
                <p:outputLabel value="实验室类型:"></p:outputLabel>
                <p:selectOneMenu value="#{laboratoryMngController.type}">
                    <f:selectItem itemLabel="全部" itemValue="#{null}" noSelectionOption="true"></f:selectItem>
                    <f:selectItems
                        value="#{baseMetaService.getBaseMetaList(constants.BASE_META_GROUP_LABORATORY_TYPE)}"
                        var="item" itemLabel="#{item.metaValue}" itemValue="#{item.id}"></f:selectItems>
                </p:selectOneMenu>
 
                <p:outputLabel value="实验室名:"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.name}"></p:inputText>
 
                <p:outputLabel value="课题组:"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.project}"></p:inputText>
 
                <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink>
            </p:panelGrid>
        </p:panel>
        <p:panel styleClass="center-body">
            <p:panelGrid columns="6" styleClass="btn">
                <p:commandButton value="新建" styleClass="new-btn" process="@this"
                    actionListener="#{laboratoryMngController.onNewBtnClick}"
                    oncomplete="PF('dialog').show();" update=":dialog,:dialogForm"></p:commandButton>
                <p:commandButton value="修改" styleClass="edit-btn" process="@form"
                    actionListener="#{laboratoryMngController.onEditBtnClick}"
                    update=":dialog,:dialogForm"></p:commandButton>
                <p:commandButton value="删除" styleClass="del-btn" process="@form"
                    actionListener="#{laboratoryMngController.onDeleteBtnClick}" update="@form">
                    <p:confirm header="确认" message="确认操作?"></p:confirm>
                </p:commandButton>
                <p:commandButton value="导入" styleClass="import-btn" onclick="importLab()"
                ></p:commandButton>
                <p:commandButton value="导出" styleClass="new-btn" ajax="false"  actionListener="#{laboratoryMngController.exportLab2Excel}"
                />
                <a href="resources/template/实验室导入模板.xlsx" style="display: inline-block;"><img src="resources/images/xlsx.png" width="30px;" alt=""/></a>
                <script>
                    function importLab(){
                        $("#laboratoryMngForm\\:importReagentBtn_input").click();
                    }
 
                </script>
            </p:panelGrid>
 
            <p:dataTable id="laboratoryMngDataTable" styleClass="data-table"
                paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
                lazy="true" value="#{laboratoryMngController.dataModel}" var="row"
                rowKey="#{row.id}" emptyMessage="无数据"
                selection="#{laboratoryMngController.selectedList}" rows="20" pageLinks="5">
                <p:column selectionMode="multiple" style="width: 30px;text-align: center;" />
 
                <p:column headerText="实验室类型">
                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.type)}"></h:outputText>
                </p:column>
 
                <p:column headerText="实验室名">
                    <h:outputText value="#{row.name}"></h:outputText>
                </p:column>
 
                <p:column headerText="课题组">
                    <h:outputText value="#{row.project}"></h:outputText>
                </p:column>
 
                <p:column headerText="状态码">
                    <h:outputText value="#{row.infoCode}"></h:outputText>
                </p:column>
 
                <p:column headerText="地址条码">
                    <h:outputText value="#{row.barCode}"></h:outputText>
                </p:column>
 
                <p:column headerText="使用地点">
                    <h:outputText value="#{'楼号:'.concat(row.location1).concat(' - 地址号:'.concat(row.location2))}"></h:outputText>
                </p:column>
 
                 <p:column headerText="负责部门">
                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.department)}"></h:outputText>
                </p:column>
            </p:dataTable>
        </p:panel>
 
        <div style="display: none" id='importDv'>
            <p:fileUpload fileUploadListener="#{laboratoryMngController.uploadFile}"
                          dragDropSupport="false" id="importReagentBtn"  label="导入"
                          update="@form" auto="true" sizeLimit="5000000"
                          mode="advanced"/>
        </div>
    </h:form>
    <p:dialog modal="true"
        header="#{laboratoryMngController.action==constants.ACTION_ADD?'新建':'修改'}"
        appendTo="@(body)" id="dialog" widgetVar="dialog" resizable="false"
        width="800">
        <h:form id="dialogForm">
            <p:panelGrid columns="4" styleClass="content2 grid-padding-bottom2">
 
                <p:outputLabel value="实验室类型"></p:outputLabel>
                <p:selectOneMenu value="#{laboratoryMngController.sysLaboratory.type}"
                    required="true" requiredMessage="请选择实验室类型">
                    <f:selectItems
                        value="#{baseMetaService.getBaseMetaList(constants.BASE_META_GROUP_LABORATORY_TYPE)}"
                        var="item" itemLabel="#{item.metaValue}" itemValue="#{item.id}"></f:selectItems>
                </p:selectOneMenu>
 
                <p:outputLabel value="实验室名"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.sysLaboratory.name}" maxlength="100"
                    required="true" requiredMessage="请输入实验室名"></p:inputText>
 
                <p:outputLabel value="状态码"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.sysLaboratory.infoCode}" maxlength="100"
                    required="true" requiredMessage="请输入状态码"></p:inputText>
 
                <p:outputLabel value="地点条码"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.sysLaboratory.barCode}" maxlength="200"
                             required="true" requiredMessage="请输入地点条码"></p:inputText>
 
                <p:outputLabel value="楼号"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.sysLaboratory.location1}" maxlength="100"></p:inputText>
 
                <p:outputLabel value="地址号"></p:outputLabel>
                <p:inputText value="#{laboratoryMngController.sysLaboratory.location2}" maxlength="100"></p:inputText>
 
                 <p:outputLabel value="负责部门"></p:outputLabel>
                <p:selectOneMenu value="#{laboratoryMngController.sysLaboratory.department}"
                                 required="true" requiredMessage="请选择负责部门">
                    <f:selectItems value="#{baseMetaService.getBaseMetaList(constants.BASE_META_GROUP_USER_DEPARTMENT)}"
                                   var="item" itemLabel="#{item.metaValue}" itemValue="#{item.id}"></f:selectItems>
                </p:selectOneMenu>
 
 
                <p:outputLabel value="所属课题组"  for="multiple"/>
                <p:selectCheckboxMenu id="multiple" value="#{laboratoryMngController.sysLaboratory.projects}" label="Cities" multiple="true"
                                      filter="true" filterMatchMode="startsWith" panelStyle="width:250px">
                    <f:selectItems value="#{sysProjectServiceImpl.getAll()}" var="item" itemValue="#{item.project}" itemLabel="#{item.project}"/>
                </p:selectCheckboxMenu>
            </p:panelGrid>
            <p:panel styleClass="btn">
                <p:commandButton value="保存"
                    actionListener="#{laboratoryMngController.onSaveBtnClick}" process="@form"
                    update=":laboratoryMngForm:laboratoryMngDataTable">
                    <p:confirm header="确认" message="确认操作?"></p:confirm>
                </p:commandButton>
            </p:panel>
        </h:form>
    </p:dialog>
</ui:composition>
</html>