From 7da4353b03a540e1de6f3b848a9613f84517db69 Mon Sep 17 00:00:00 2001
From: 李宇 <986321569@qq.com>
Date: 星期四, 10 三月 2022 12:28:16 +0800
Subject: [PATCH] 申购后进入价格确认环节,可修改价格

---
 src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java |    2 
 src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java   |    1 
 src/main/webapp/WEB-INF/spring-menu.xml                                 |    8 
 src/main/java/com/nanometer/smartlab/controller/PriceMngController.java |  502 +++++++++++++++++++++++++++++++++++++++++
 src/main/webapp/price_mng.xhtml                                         |  201 ++++++++++++++++
 5 files changed, 713 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java b/src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java
index 848286f..4fcfea1 100644
--- a/src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java
+++ b/src/main/java/com/nanometer/smartlab/controller/ApplyMngController.java
@@ -766,7 +766,7 @@
                 opeApply.setId(IDUtils.uuid());
                 opeApply.setApplyCode(applyCode);
                 opeApply.setApplyUserId(applyUser.getId());
-                opeApply.setStatus(ApplyStatus.PENDING_APPROVAL);
+                opeApply.setStatus(ApplyStatus.Price_CONFIRM);
             }
 
             this.opeApplyService.insertOpeApplyList(this.applyNewList);
diff --git a/src/main/java/com/nanometer/smartlab/controller/PriceMngController.java b/src/main/java/com/nanometer/smartlab/controller/PriceMngController.java
new file mode 100644
index 0000000..a240bd2
--- /dev/null
+++ b/src/main/java/com/nanometer/smartlab/controller/PriceMngController.java
@@ -0,0 +1,502 @@
+package com.nanometer.smartlab.controller;
+
+import com.nanometer.smartlab.entity.OpeApply;
+import com.nanometer.smartlab.entity.SysProject;
+import com.nanometer.smartlab.entity.SysUser;
+import com.nanometer.smartlab.entity.enumtype.ApplyStatus;
+import com.nanometer.smartlab.entity.enumtype.SeeFlag;
+import com.nanometer.smartlab.service.BaseMetaService;
+import com.nanometer.smartlab.service.OpeApplyService;
+import com.nanometer.smartlab.service.SysProjectService;
+import com.nanometer.smartlab.service.SysUserService;
+import com.nanometer.smartlab.util.FacesUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.primefaces.context.RequestContext;
+import org.primefaces.model.LazyDataModel;
+import org.primefaces.model.SortOrder;
+import org.springframework.context.annotation.Scope;
+import org.springframework.stereotype.Controller;
+
+import javax.annotation.Resource;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.Timestamp;
+import java.util.*;
+
+/**
+ * Created by johnny on 17/12/14.
+ */
+@Controller
+@Scope("session")
+public class PriceMngController extends BaseController {
+
+    private static Logger logger = Logger.getLogger(PriceMngController.class);
+
+    @Resource
+    private OpeApplyService opeApplyService;
+    @Resource
+    private SysUserService sysUserService;
+    @Resource
+    private BaseMetaService baseMetaService;
+
+    @Resource
+    private SysProjectService sysProjectService;
+
+
+
+
+
+
+    private String applyUserName;
+    private String approvaUserName;
+
+    public String getApplyUserName() {
+        return applyUserName;
+    }
+
+    public void setApplyUserName(String applyUserName) {
+        this.applyUserName = applyUserName;
+    }
+
+    public String getApprovaUserName() {
+        return approvaUserName;
+    }
+
+    public void setApprovaUserName(String approvaUserName) {
+        this.approvaUserName = approvaUserName;
+    }
+
+    private LazyDataModel<OpeApply> dataModel;
+    private List<OpeApply> selectedList;
+    private OpeApply opeApply;
+    private String reagentName;
+    private Timestamp startDeadline;
+    private Timestamp endDeadline;
+    private String applyUserId;
+    private Integer status;
+    private List<ApplyStatus> statusSelectList;
+    private String memo;
+    private String approvalUserId;
+    private List<SysUser> approvalUserList;
+    private Boolean approvalFlag;
+
+    public Boolean getApprovalFlag() {
+        String id=getUserId();
+        SysUser sysUser = sysUserService.getSysUser(id);
+        // 不是管理员时
+        if (sysUser.getSeeFlag().getKey() != SeeFlag.MANAGE.getKey()
+        && sysUser.getSeeFlag().getKey() != SeeFlag.LEADING.getKey()) {
+            this.approvalFlag=false;
+        }else {
+            this.approvalFlag=true;
+        }
+        return approvalFlag;
+    }
+
+
+    public void setApprovalFlag(Boolean approvalFlag) {
+        this.approvalFlag = approvalFlag;
+    }
+
+    public String getApprovalUserId() {
+        return approvalUserId;
+    }
+
+    public void setApprovalUserId(String approvalUserId) {
+        this.approvalUserId = approvalUserId;
+    }
+
+    public List<SysUser> getApprovalUserList() {
+        if (this.approvalUserList == null) {
+            initApprovalUserList();
+        }
+        return approvalUserList;
+    }
+    public void initApprovalUserList() {
+        this.approvalUserList = this.sysUserService.getApproverUserList(null);
+    }
+    public void setApprovalUserList(List<SysUser> approvalUserList) {
+        this.approvalUserList = approvalUserList;
+    }
+
+    private String adminApproveUserId;
+
+    private List<SysUser> adminApproveUserIdSelectList;
+
+    private boolean dangerousFlag;
+
+    public void initListPage() {
+        status = ApplyStatus.Price_CONFIRM.getKey();
+    }
+
+
+    public void onApprovalBtnClick() {
+        if (this.selectedList == null
+                || this.selectedList.size() == 0) {
+            FacesUtils.warn("请选择数据。");
+            return;
+        }
+
+        this.dangerousFlag = false;
+        this.adminApproveUserId = null;
+        for (OpeApply opeApply : this.selectedList) {
+            if (!opeApply.getStatus().equals(ApplyStatus.Price_CONFIRM)) {
+                FacesUtils.warn("只有价格确认状态的数据可以操作。");
+                return;
+            }
+
+            String controlProducts = opeApply.getReagent().getControlProducts();
+            if (StringUtils.isNotBlank(controlProducts)) {
+                String baseMetaValue = baseMetaService.getBaseMetaValue(controlProducts);
+                if (StringUtils.isNotBlank(baseMetaValue) && !"15fc90a1f7bf43bda01313904b543195".equals(this.getUser().getRoleId())) {
+                    dangerousFlag = true;
+                }
+            }
+        }
+
+        this.memo = null;
+
+        RequestContext.getCurrentInstance().execute("PF('approvalDialog').show()");
+    }
+
+    public void onYesBtnClick() {
+        try {
+            if (this.selectedList == null
+                    || this.selectedList.size() == 0) {
+                FacesUtils.warn("价格修改数据为空。");
+                return;
+            }
+
+            if (!getUser().getRoleName().equals("系统管理员")) {
+                FacesUtils.warn("请选择系统管理员修改。");
+                return;
+            }
+
+            for (OpeApply opeApply : this.selectedList) {
+                this.opeApplyService.updaetOpeApplyPrice(opeApply.getApplyPrice(),opeApply.getId());
+            }
+            FacesUtils.info("价格修改成功。");
+            RequestContext.getCurrentInstance().execute("PF('approvalDialog').hide()");
+            RequestContext.getCurrentInstance().update("priceMngForm:priceMngDataTable");
+        } catch (Exception e) {
+            logger.error("操作失败。", e);
+            FacesUtils.warn("操作失败。");
+        }
+    }
+
+    public void onExportFileBtnClickNew(){
+        ServletOutputStream out = null;
+        InputStream is = null;
+        try {
+            FacesContext ctx = FacesContext.getCurrentInstance();
+            ctx.responseComplete();
+            String contentType = "application/x-download";
+            HttpServletResponse response = (HttpServletResponse) ctx
+                    .getExternalContext().getResponse();
+            response.setContentType(contentType);
+            StringBuffer contentDisposition = new StringBuffer();
+            contentDisposition.append("attachment;");
+            contentDisposition.append("filename=\"");
+            contentDisposition.append("价格管理.xls");
+            contentDisposition.append("\"");
+            response.setHeader(
+                    "Content-Disposition",
+                    new String(contentDisposition.toString().getBytes(
+                            System.getProperty("file.encoding")), "ISO8859-1"));
+            out = response.getOutputStream();
+            Map<String, Integer> tempMap = new HashMap<String,Integer>();
+            List<OpeApply> realDataList = new ArrayList<>();
+            //map=null;
+            String approveUserId = getUserId();
+            if(selectedList!=null&selectedList.size()>0){
+                realDataList=selectedList;
+            }else {
+                realDataList= opeApplyService.getOpeApplyListForApproval(applyUserName,approvaUserName,reagentName, startDeadline, endDeadline, status, null, approveUserId, null, null, null, null,null);
+            }
+            List<String> headerList = new ArrayList<>();
+            headerList.add("申购编号");
+            headerList.add("产品编号");
+            headerList.add("试剂名称");
+            headerList.add("管制品");
+            headerList.add("规格型号");
+            headerList.add("包装");
+            headerList.add("含税售价");
+            headerList.add("数量");
+            headerList.add("CAS号");
+            headerList.add("危险性质");
+            headerList.add("厂家");
+            headerList.add("试剂类型");
+            headerList.add("申购人");
+            headerList.add("申购日期");
+            headerList.add("一级审批者");
+            headerList.add("二级审批者");
+            headerList.add("订单状态");
+            headerList.add("课题编号");
+            HSSFWorkbook hssfWorkbook =exportExcelNew(headerList, realDataList);
+            hssfWorkbook.write(out);
+            out.flush();
+            ctx.responseComplete();
+        }catch (Exception e) {
+            if(is!=null){
+                try {
+                    is.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+            if(out!=null){
+                try {
+                    out.close();
+                } catch (IOException e1) {
+                    e1.printStackTrace();
+                }
+            }
+            e.printStackTrace();
+        }finally {
+            if (is != null) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+    }
+    public  HSSFWorkbook exportExcelNew(List<String> headerList, List<OpeApply> dataList) {
+        HSSFWorkbook hssfWorkbook = new HSSFWorkbook();
+
+
+        Integer total = null;
+        HSSFSheet sheet = hssfWorkbook.createSheet("审批详情");
+        HSSFRow titlerRow = sheet.createRow(0);
+        for(int i = 0; i < headerList.size(); i++) {
+            titlerRow.createCell(i).setCellValue(headerList.get(i));
+        }
+        for (int i = 0; i < dataList.size(); i++) {
+            HSSFRow dataRow = sheet.createRow(i + 1);
+            dataRow.createCell(0).setCellValue(dataList.get(i).getApplyCode()== null ? "": String.valueOf(dataList.get(i).getApplyCode()));
+            dataRow.createCell(1).setCellValue(dataList.get(i).getReagent().getProductSn()== null ? "": String.valueOf(dataList.get(i).getReagent().getProductSn()));
+            dataRow.createCell(2).setCellValue(dataList.get(i).getReagent().getName()== null ? "": String.valueOf(dataList.get(i).getReagent().getName()));
+            dataRow.createCell(3).setCellValue(dataList.get(i).getReagent().getControlProducts()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getControlProducts())));
+            dataRow.createCell(4).setCellValue(dataList.get(i).getReagent().getReagentFormat()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentFormat())));
+            dataRow.createCell(5).setCellValue(dataList.get(i).getReagent().getMainMetering()== null ? "": String.valueOf(dataList.get(i).getReagent().getMainMetering())+baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentUnit()));
+            dataRow.createCell(6).setCellValue(dataList.get(i).getReagent().getPrice()== null ? "": String.valueOf(dataList.get(i).getReagent().getPrice()));
+            dataRow.createCell(7).setCellValue(String.valueOf(dataList.get(i).getNum()));
+            dataRow.createCell(8).setCellValue(dataList.get(i).getReagent().getCas()== null ? "": String.valueOf(dataList.get(i).getReagent().getCas()));
+            dataRow.createCell(9).setCellValue(dataList.get(i).getReagent().getReagentCharacter()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentCharacter())));
+            dataRow.createCell(10).setCellValue(dataList.get(i).getReagent().getProductHomeName()== null ? "": String.valueOf(dataList.get(i).getReagent().getProductHomeName()));
+            dataRow.createCell(11).setCellValue(dataList.get(i).getReagent().getReagentType()== null ? "": String.valueOf(baseMetaService.getBaseMetaValue(dataList.get(i).getReagent().getReagentType())));
+
+            dataRow.createCell(12).setCellValue(String.valueOf(dataList.get(i).getApplyUserName()));
+            dataRow.createCell(13).setCellValue(String.valueOf(dataList.get(i).getCreateTime()));
+           /* SysUser u=sysUserService.getSysUser(dataList.get(i).getApproveUserId());
+            *//*if(dataList.get(i).getBeforeApproveUserId()!=null){
+                u=sysUserService.getSysUser(dataList.get(i).getBeforeApproveUserId());
+            }*//*
+            dataRow.createCell(14).setCellValue(String.valueOf(u.getName()));*/
+            dataRow.createCell(14).setCellValue(String.valueOf(dataList.get(i).getFirName()));
+            if(dataList.get(i).getBeforeApproveUserId()!=null && !dataList.get(i).getBeforeApproveUserId().equals("")){
+                dataRow.createCell(15).setCellValue(String.valueOf(dataList.get(i).getApproveUserName()));
+            }
+            dataRow.createCell(16).setCellValue(String.valueOf(dataList.get(i).getStatus().getText()));
+            SysProject project = sysProjectService.getProjectByProId(dataList.get(i).getObjective());
+            dataRow.createCell(17).setCellValue(project.getProjectName()==null ?"":String.valueOf(project.getProjectName()));
+        }
+
+        return hssfWorkbook;
+    }
+    public void onConfirmBtnClick() {
+        try {
+            if (this.selectedList == null
+                    || this.selectedList.size() == 0) {
+                FacesUtils.warn("请选择数据。");
+                return;
+            }
+
+            for (OpeApply oa : this.selectedList) {
+                if (!oa.getStatus().equals(ApplyStatus.Price_CONFIRM)) {
+                    FacesUtils.warn("只有价格确认状态的数据可以操作。");
+                    return;
+                }
+            }
+
+            for (OpeApply oa : this.selectedList) {
+                oa.setStatus(ApplyStatus.PENDING_APPROVAL);
+                this.opeApplyService.updateOpeApply(oa);
+            }
+
+            FacesUtils.info("确认成功。");
+        } catch (Exception e) {
+            logger.error("操作失败。", e);
+            FacesUtils.warn("操作失败。");
+        }
+    }
+
+    public LazyDataModel<OpeApply> getDataModel() {
+        if (this.dataModel == null) {
+            this.dataModel = new LazyDataModel<OpeApply>() {
+                @Override
+                public List<OpeApply> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
+                    List<OpeApply> list = null;
+                    //try {
+                        String approveUserId = getUserId();
+                        int count = 0;
+                        if (StringUtils.isNotBlank(approveUserId)) {
+                            count = opeApplyService.getOpeApplyTotalCountForApproval(applyUserName,approvaUserName,reagentName, startDeadline, endDeadline, status, null, approveUserId, null, null,null);
+                        }
+                        this.setRowCount(count);
+                        if (count > 0) {
+                            list = opeApplyService.getOpeApplyListForApproval(applyUserName,approvaUserName,reagentName, startDeadline, endDeadline, status, null, approveUserId, null, first, pageSize, null,null);
+                            for(int i=0;i<list.size();i++){
+                               /* if(list.get(i).getSecondUserName()!=null&&!list.get(i).getSecondUserName().equals("")){
+                                    String name=list.get(i).getApproveUserName();
+                                    list.get(i).setApproveUserName(list.get(i).getSecondUserName());
+                                    list.get(i).setSecondUserName(name);
+                                }*/
+                                if(list.get(i).getBeforeApproveUserId()!=null&&!list.get(i).getBeforeApproveUserId().equals("")){
+                                    String name=list.get(i).getApproveUserName();
+                                    list.get(i).setFirst(list.get(i).getFirName());
+                                    list.get(i).setSecond(name);
+                                }else {
+                                    list.get(i).setFirst(list.get(i).getApproveUserName());
+                                    list.get(i).setSecond(list.get(i).getSecondUserName());
+                                }
+                            }
+                        }
+                    /*} catch (Exception e) {
+                        logger.error(e);
+                    }*/
+                    selectedList = null;
+                    return list;
+                }
+
+                @Override
+                public OpeApply getRowData(String rowKey) {
+//                    Iterator<OpeApply> iterator = this.iterator();
+//                    if (iterator != null) {
+//                        OpeApply oa = null;
+//                        while (iterator.hasNext()) {
+//                            oa = iterator.next();
+//                            if (rowKey.equals(oa.getId())) {
+//                                return oa;
+//                            }
+//                        }
+//                    }
+                    return opeApplyService.getOpeApply(rowKey);
+                }
+            };
+        }
+
+        return dataModel;
+    }
+
+    public OpeApply getOpeApply() {
+        return opeApply;
+    }
+
+    public void setOpeApply(OpeApply opeApply) {
+        this.opeApply = opeApply;
+    }
+
+    public String getReagentName() {
+        return reagentName;
+    }
+
+    public void setReagentName(String reagentName) {
+        this.reagentName = reagentName;
+    }
+
+    public Timestamp getStartDeadline() {
+        return startDeadline;
+    }
+
+    public void setStartDeadline(Timestamp startDeadline) {
+        this.startDeadline = startDeadline;
+    }
+
+    public Timestamp getEndDeadline() {
+        return endDeadline;
+    }
+
+    public void setEndDeadline(Timestamp endDeadline) {
+        this.endDeadline = endDeadline;
+    }
+
+    public String getApplyUserId() {
+        return applyUserId;
+    }
+
+    public void setApplyUserId(String applyUserId) {
+        this.applyUserId = applyUserId;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public List<OpeApply> getSelectedList() {
+        return selectedList;
+    }
+
+    public void setSelectedList(List<OpeApply> selectedList) {
+        this.selectedList = selectedList;
+    }
+
+    public List<ApplyStatus> getStatusSelectList() {
+        if (this.statusSelectList == null) {
+            this.statusSelectList = Arrays.asList(ApplyStatus.values());
+        }
+        return statusSelectList;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public String getAdminApproveUserId() {
+        return adminApproveUserId;
+    }
+
+    public void setAdminApproveUserId(String adminApproveUserId) {
+        this.adminApproveUserId = adminApproveUserId;
+    }
+
+    public List<SysUser> getAdminApproveUserIdSelectList() {
+        return adminApproveUserIdSelectList;
+    }
+
+    public void setAdminApproveUserIdSelectList(List<SysUser> adminApproveUserIdSelectList) {
+        this.adminApproveUserIdSelectList = adminApproveUserIdSelectList;
+    }
+
+    public boolean isDangerousFlag() {
+        return dangerousFlag;
+    }
+
+    public void setDangerousFlag(boolean dangerousFlag) {
+        this.dangerousFlag = dangerousFlag;
+    }
+}
diff --git a/src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java b/src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java
index dcddaa4..02d8f5b 100644
--- a/src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java
+++ b/src/main/java/com/nanometer/smartlab/entity/enumtype/ApplyStatus.java
@@ -4,6 +4,7 @@
 
 public enum ApplyStatus {
 	REFUSE(0, "拒绝"),
+	Price_CONFIRM(11, "价格确认"),
 	PENDING_APPROVAL(1, "待审批"),
 	APPROVED(2, "已审批"),
 	PENDING_PURCHASE(3, "待采购"),
diff --git a/src/main/webapp/WEB-INF/spring-menu.xml b/src/main/webapp/WEB-INF/spring-menu.xml
index 590a754..c160a71 100644
--- a/src/main/webapp/WEB-INF/spring-menu.xml
+++ b/src/main/webapp/WEB-INF/spring-menu.xml
@@ -23,6 +23,14 @@
                         <property name="privilegeCode" value="apply_mng"></property>
                     </bean>
                     <bean class="com.nanometer.smartlab.model.MenuModel">
+                        <property name="id" value="price_mng"></property>
+                        <property name="title" value="价格管理"></property>
+                        <property name="page" value="price_mng"></property>
+                        <property name="privilegeCode" value="price_mng"></property>
+                        <property name="initClazz" value="priceMngController"></property>
+                        <property name="initMethod" value="initListPage"></property>
+                    </bean>
+                    <bean class="com.nanometer.smartlab.model.MenuModel">
                         <property name="id" value="approval_mng"></property>
                         <property name="title" value="审批管理"></property>
                         <property name="page" value="approval_mng"></property>
diff --git a/src/main/webapp/price_mng.xhtml b/src/main/webapp/price_mng.xhtml
new file mode 100644
index 0000000..d2260c5
--- /dev/null
+++ b/src/main/webapp/price_mng.xhtml
@@ -0,0 +1,201 @@
+<?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="priceMngForm">
+        <p:panel styleClass="center-header">
+            <p:outputLabel styleClass="title" value="价格管理"></p:outputLabel>
+
+            <p:panelGrid styleClass="filter" columns="15">
+                <p:outputLabel value="申购产品:"></p:outputLabel>
+                <p:inputText value="#{priceMngController.reagentName}"></p:inputText>
+
+                <p:outputLabel value="货期:"></p:outputLabel>
+                <p:calendar value="#{priceMngController.startDeadline}" converter="timestampConvert"
+                            pattern="yyyy-MM-dd" locale="zh_CN"></p:calendar>
+                <p:outputLabel value=" ~ " style="margin-left: 10px;margin-right: 10px"></p:outputLabel>
+                <p:calendar value="#{priceMngController.endDeadline}" converter="timestampConvert"
+                            pattern="yyyy-MM-dd" locale="zh_CN"></p:calendar>
+
+                <p:outputLabel value="申购人:"></p:outputLabel>
+                <p:inputText value="#{priceMngController.applyUserName}"></p:inputText>
+                <p:outputLabel value="审批者:" rendered="#{priceMngController.approvalFlag==true}"></p:outputLabel>
+                <p:inputText value="#{priceMngController.approvaUserName}" rendered="#{priceMngController.approvalFlag==true}"></p:inputText>
+                <p:outputLabel value="状态:"></p:outputLabel>
+                <p:selectOneMenu value="#{priceMngController.status}" style="width: 70px">
+                    <f:selectItem itemLabel="全部" itemValue="#{null}" noSelectionOption="true"></f:selectItem>
+                    <f:selectItems value="#{priceMngController.statusSelectList}" var="item"
+                                   itemLabel="#{item.text}" itemValue="#{item.key}"></f:selectItems>
+                </p:selectOneMenu>
+
+                <p:commandLink styleClass="search" process="@form" update="@form"></p:commandLink>
+            </p:panelGrid>
+        </p:panel>
+        <p:panel styleClass="center-body">
+            <p:panelGrid columns="3" styleClass="btn">
+                <p:commandButton value="修改价格" styleClass="edit-btn"
+                                 process="@form"
+                                 actionListener="#{priceMngController.onApprovalBtnClick}"
+                                 update=":approvalDialog"></p:commandButton>
+                <p:commandButton value="确认价格" styleClass="edit-btn"
+                                 process="@form"
+                                 actionListener="#{priceMngController.onConfirmBtnClick}"
+                                 update="@form">
+                    <p:confirm header="确认" message="确认操作?"></p:confirm>
+                </p:commandButton>
+                <p:commandButton update=":centerRootPanel" actionListener="#{priceMngController.onExportFileBtnClickNew}"
+                                 ajax="false" value="导出" styleClass="new-btn" />
+            </p:panelGrid>
+
+            <p:dataTable id="priceMngDataTable" styleClass="data-table"
+                         paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
+                         lazy="true" value="#{priceMngController.dataModel}" var="row" rowKey="#{row.id}"
+                         emptyMessage="无数据" selection="#{priceMngController.selectedList}"
+                         rows="20" pageLinks="5">
+                <p:column selectionMode="multiple" style="width: 30px;text-align: center;"/>
+                <p:column headerText="订单状态" width="60px;" style="text-align: center">
+                    <h:outputText value="#{row.status!=null?row.status.text:''}"></h:outputText>
+                </p:column>
+                <p:column headerText="申购编号" width="118px;">
+                    <h:outputText value="#{row.applyCode}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="产品编号">
+                    <h:outputText value="#{row.reagent!=null?row.reagent.productSn:''}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="试剂名称" width="129px;">
+                    <h:outputText value="#{row.reagent!=null?row.reagent.name:''}" style="font-size: 13px;"></h:outputText>
+                </p:column>
+
+                <p:column headerText="管制品">
+                    <h:outputText value="#{row.reagent!=null?baseMetaService.getBaseMetaValue(row.reagent.controlProducts):''}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="规格型号" width="84px;">
+                    <h:outputText
+                            value="#{baseMetaService.getBaseMetaValue(row.reagent.reagentFormat)}" style="font-size:13px"></h:outputText>
+                </p:column>
+
+                <p:column headerText="包装">
+                    <h:outputText value="#{row.reagent!=null?(''.concat(row.reagent.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagent.reagentUnit))):''}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="含税售价" width="60px;">
+                    <h:outputText value="#{row.applyPrice}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="数量" width="34px;">
+                    <h:outputText value="#{row.num}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="CAS号">
+                    <h:outputText value="#{row.reagent!=null?row.reagent.cas:''}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="危险性质" width="85px;">
+                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagent.reagentCharacter)}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="厂家">
+                    <h:outputText value="#{row.reagent!=null?row.reagent.productHomeName:''}"></h:outputText>
+                </p:column>
+
+                <!--<p:column headerText="供应商">-->
+                    <!--<h:outputText value="#{row.reagent!=null?row.reagent.supplierName:''}"></h:outputText>-->
+                <!--</p:column>-->
+
+                <p:column headerText="试剂类型" width="60px;">
+                    <h:outputText value="#{baseMetaService.getBaseMetaValue(row.reagent.reagentType)}"></h:outputText>
+                </p:column>
+
+                <p:column headerText="申购人" style="text-align: center">
+                    <h:outputText value="#{row.applyUserName}" style="text-align: center;"></h:outputText>
+                </p:column>
+
+                <p:column headerText="申购日期"  width="73px;">
+                    <h:outputText value="#{row.createTime}">
+                        <f:convertDateTime pattern="yyyy-MM-dd" locale="zh_CN"></f:convertDateTime>
+                    </h:outputText>
+                </p:column>
+                <!--<p:column headerText="审批者">
+                    <h:outputText value="#{priceMngController.getUserName(row.approveUserId)}"></h:outputText>
+                </p:column>-->
+                <p:column headerText="一级审批者" style="text-align: center" width="71px;">
+                    <h:outputText value="#{row.first}"></h:outputText>
+                </p:column>
+                <p:column headerText="二级审批者" style="text-align: center" width="71px;">
+                    <h:outputText value="#{row.second}"></h:outputText>
+                </p:column>
+                <!--现在报销不按课题编号了,所以先注释掉-->
+<!--                <p:column headerText="课题编号" width="83px;">-->
+<!--                    <h:outputText value="#{row.objective}"></h:outputText>-->
+<!--                </p:column>-->
+                <p:column headerText="备注" width="83px;">
+                    <h:outputText value="#{row.memo}"></h:outputText>
+                </p:column>
+            </p:dataTable>
+        </p:panel>
+    </h:form>
+
+    <p:dialog modal="true" header="修改价格" appendTo="@(body)"
+              id="approvalDialog" widgetVar="approvalDialog"
+              resizable="false" width="1000">
+        <h:form id="approvalDialogForm">
+   	       <p:panel styleClass="center-body">
+	            <p:dataTable styleClass="data-table" var="row" value="#{priceMngController.selectedList}"
+             			rows="3" paginator="true" paginatorPosition="bottom"
+                        paginatorAlwaysVisible="false">
+
+	                <p:column headerText="申购产品">
+	                    <h:outputText value="#{row.reagent!=null?row.reagent.name:''}"></h:outputText>
+	                </p:column>
+
+	                <p:column headerText="规格">
+	                    <h:outputText value="#{row.reagent!=null?baseMetaService.getBaseMetaValue(row.reagent.reagentFormat):''}"></h:outputText>
+	                </p:column>
+
+	                <p:column headerText="包装">
+	                    <h:outputText value="#{row.reagent!=null?(''.concat(row.reagent.mainMetering).concat(baseMetaService.getBaseMetaValue(row.reagent.reagentUnit))):''}"></h:outputText>
+	                </p:column>
+
+	                <p:column headerText="含税价格">
+	                    <h:inputText value="#{row.applyPrice}"></h:inputText>
+	                </p:column>
+
+	                <p:column headerText="申购数量">
+	                    <h:outputText value="#{row.num}"></h:outputText>
+	                </p:column>
+
+	                <p:column headerText="货期">
+	                    <h:outputText value="#{row.deadline}">
+	                        <f:convertDateTime pattern="yyyy-MM-dd" locale="zh_CN"></f:convertDateTime>
+	                    </h:outputText>
+	                </p:column>
+
+	                <p:column headerText="申购目的">
+	                    <h:outputText value="#{row.applyGoal}"></h:outputText>
+	                </p:column>
+	            </p:dataTable>
+	        </p:panel>
+			<br />
+
+            <p:panel styleClass="btn" style="text-align: right">
+                <p:commandButton value="确认" actionListener="#{priceMngController.onYesBtnClick}"
+                                 process="@form"
+                                 styleClass="yes-btn">
+                </p:commandButton>
+            </p:panel>
+        </h:form>
+    </p:dialog>
+</ui:composition>
+</html>

--
Gitblit v1.9.2