<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/11
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="org.omg.CosCollection.IteratorInBetween" %>
<%!
    public boolean isChecked(ConnectionFactory cf,Connection conn,String zc_id,String ly_id){
        Vector list = cf.doQuery(conn,"select zc_id from zc_ly where zc_id=? and ly_id=?",null,new Object[]{zc_id,ly_id});
        if(list!=null&&list.size()>0){
            return true;
        }else{
            return false;
        }
    }
%>
<%
    ConnectionFactory cf = new ConnectionFactory();
    Pub pub = new Pub();
    Connection conn = null;
    Vector v_list = null;
    String page_number = pub.trimNull(request.getParameter("page_number"));
    if ("".equals(page_number)) page_number = "1";
    String page_size = pub.trimNull(request.getParameter("page_size"));
    String pd_number = pub.trimNull(request.getParameter("pd_number"));
    String pd_user = pub.trimNull(request.getParameter("pd_user"));
    if ("".equals(page_size)) page_size = "10";
    List list_s = new ArrayList();
    try {
        StringBuffer sb = new StringBuffer();
        sb.append("select t2.*,t3.xm_id,t1.pd_b_time from zc_pd t1 join zc_register t2 on t1.zc_id=t2.zc_id left join zc_ly t3 on t2.zc_id=t3.zc_id" +
                " where t1.pd_number=? ");
        list_s.add(pd_number);
        sb.append(" order by add_time desc");
        conn = com.censoft.db.DBUtil.getConnection();
        v_list = cf.doPageQueryWithCount(conn, sb.toString(), page_number, page_size, null, list_s.toArray());
        if (v_list == null) {
            out.println("查询出错" + cf.getMsg());
            return;
        }
        Hashtable ht_row = (Hashtable) v_list.get(0);
        String rowCnt = pub.trimNull((String) ht_row.get("ROWCOUNT"));
        String pageCnt = pub.trimNull((String) ht_row.get("PAGECOUNT"));
%>
<form action="" method="post" id="form1" name="form1">
    <div class="text-l" style="width: 70%;">
        <table class="search-table ">
            <tr style="width: 520px;">
                <td class="search-label" style="width: 120px;" >
                    盘点单号：
                </td>
                <td class="search-input" >
                    <input type="text" value="<%=pd_number%>" class="input-text" style="width: 120px;" />
                </td>
                <td class="search-label" style="width: 120px;" >
                    盘点人：
                </td>
                <td class="search-input" >
                    <input type="text" value="<%=pd_user%>" class="input-text" style="width: 120px;" />
                </td>
            </tr>
        </table>
    </div>
    <div class="table-list" style="height:460px;">
        <table class="table  table-hover table-bg">
            <thead>
            <tr class="text-c">
                <th width="50px">条码</th>
                <th width="50px">所属项目</th>
                <th width="50px">资产名称</th>
                <th width="50px">国标大类</th>
                <th width="50px">规格型号</th>
                <th width="50px">价值</th>
                <th width="50px">设备类型</th>
                <th width="50px">盘点时间</th>
                <th width="50px">财务入账日期</th>
            </tr>
            </thead>
            <tbody>
            <%
                if (v_list != null && v_list.size() > 0) {
                    for (int i = 1; i < v_list.size(); i++) {
                        Hashtable ht = (Hashtable) v_list.get(i);
                        String xm_id = pub.trimNull((String) ht.get("xm_id"));
                        String sb_type = pub.trimNull((String) ht.get("sb_type"));
                        String zc_name = pub.trimNull((String) ht.get("zc_name"));
                        String zc_gj_type = pub.trimNull((String) ht.get("zc_gj_type"));
                        String pd_b_time = pub.trimNull((String) ht.get("pd_b_time"));
                        String gg_type = pub.trimNull((String) ht.get("gg_type"));
                        String jiazhi = pub.trimNull((String) ht.get("jiazhi"));
                        String cw_date = pub.trimNull((String) ht.get("cw_date"));
            %>
            <tr <%if(i%2==0){%>id="tr_doub"<%}else{%>id="tr_single"<%}%> class="text-c">
                <td>
                    123141241
                </td>
                <td>
                    <%=xm_id%>
                </td>
                <td><%=zc_name%>
                </td>
                <td><%=zc_gj_type%>
                </td>
                <td><%=gg_type%>
                </td>
                <td><%=jiazhi%>
                </td>
                <td><%=sb_type%>
                </td>
                <td><%=pd_b_time%>
                </td>
                <td><%=cw_date%>
                </td>
            </tr>
            <%
                    }
                }
            %>
            </tbody>
        </table>
    </div>
</form>
<jsp:include page="/common/page_ajax.jsp" >
    <jsp:param name="page_number" value="<%=page_number%>" />
    <jsp:param name="rowCnt" value="<%=rowCnt%>" />
    <jsp:param name="page_size" value="<%=page_size%>" />
</jsp:include>
<%
    } catch (Exception e) {
        out.println("查询异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
%>