<%--
  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="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.util.*" %>
<%
    Connection conn = null;
    Vector v_list;
    Hashtable ht = new Hashtable();
    Pub pub = new Pub();
    ConnectionFactory cf = new ConnectionFactory();
    String ly_id = pub.trimNull(request.getParameter("ly_id"));
    String zc_id = pub.trimNull(request.getParameter("zc_id"));
    List list_add = new ArrayList();
    try {
        conn = com.censoft.db.DBUtil.getConnection();
        StringBuffer sb_list = new StringBuffer();
        sb_list.append("select t1.*,t2.xm_id,ly_dept,ly_user,tel  from zc_register t1 left join zc_ly t2 on t1.zc_id=t2.zc_id where t1.zc_id=? ");
        list_add.add(zc_id);
        if(!"".equals(ly_id)){
            sb_list.append(" and t2.ly_id=?");
            list_add.add(ly_id);
        }
        v_list=cf.doQuery(conn,sb_list.toString(),null,list_add.toArray());
        if (v_list == null) {
            out.println("查询出错");
            return;
        }
        if (v_list.size() > 0) {
            ht = (Hashtable) v_list.get(0);
        }
    } catch (Exception e) {
        try {
            if(conn != null){
                conn.rollback();
            }
        } catch (SQLException e1) {
            e1.printStackTrace();
        }
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }
%>
<style>
    .col-sm-1{width: 12%;}
</style>
<article class="page-container" style="overflow: hidden;">
    <form class="form form-horizontal" id="form-admin-add">
        <div class="cl pd-5  bk-gray divOverflow" style="overflow:hidden;margin-bottom: 20px;">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">资产编号：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="ly_id"  value="<%=pub.trimNull((String)ht.get("zc_id"))%>" class="input-text ">
                </div>
                <label class="form-label col-xs-4 col-sm-1">资产名称：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="zc_name" id="zc_name"  value="<%=pub.trimNull((String)ht.get("zc_name"))%>" class="input-text ">
                </div>
                <label class="form-label col-xs-4 col-sm-1">所属项目：</label>
                <div class="formControls col-xs-8 col-sm-2" id="xm_id">
                    <script>
                        var value='<%=pub.trimNull((String)ht.get("xm_id"))%>';
                        value=encodeURI(encodeURI(value));
                        $.post("../zd/zd_view_list.jsp?value="+value+"&name_id=xm_id&zd_e_name=xm_id&math="+Math.random(),function(data){
                                document.getElementById("xm_id").innerHTML=data;
                            }
                        );
                    </script>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">使用部门：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text"  value="<%=pub.trimNull((String)ht.get("ly_dept"))%>" class="input-text ">
                </div>
                <label class="form-label col-xs-4 col-sm-1">使用人：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" value="<%=pub.trimNull((String)ht.get("ly_user"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">联系方式：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" value="<%=pub.trimNull((String)ht.get("tel"))%>" class="input-text">
                </div>
            </div>
            <div class="row cl">

                <label class="form-label col-xs-4 col-sm-1">国标大类：</label>
                <div class="formControls col-xs-8 col-sm-2" id="zc_gj_type">
                    <script>
                        var value='<%=pub.trimNull((String)ht.get("zc_gj_type"))%>';
                        value=encodeURI(encodeURI(value));
                        $.post("../zd/zd_view_list.jsp?value="+value+"&name_id=zc_gj_type&zd_e_name=gjdl&math="+Math.random(),function(data){
                                document.getElementById("zc_gj_type").innerHTML=data;
                            }
                        );
                    </script>
                </div>
                <label class="form-label col-xs-4 col-sm-1">资产分类：</label>
                <div class="formControls col-xs-8 col-sm-2" id="zc_fl">
                    <script>
                        var value='<%=pub.trimNull((String)ht.get("zc_fl"))%>';
                        value=encodeURI(encodeURI(value));
                        $.post("../zd/zd_view_list.jsp?value="+value+"&name_id=zc_fl&zd_e_name=zc_fl&math="+Math.random(),function(data){
                                document.getElementById("zc_fl").innerHTML=data;
                            }
                        );
                    </script>
                </div>
                <label class="form-label col-xs-4 col-sm-1">资产分类代码：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="zc_fl_code" id="zc_fl_code" value="<%=pub.trimNull((String)ht.get("zc_fl_code"))%>" class="input-text ">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">设备类型：</label>
                <div class="formControls col-xs-8 col-sm-2" id="sb_type">
                    <script>
                        var value='<%=pub.trimNull((String)ht.get("sb_type"))%>';
                        value=encodeURI(encodeURI(value));
                        $.post("../zd/zd_view_list.jsp?value="+value+"&name_id=sb_type&zd_e_name=sb_type&math="+Math.random(),function(data){
                                document.getElementById("sb_type").innerHTML=data;
                            }
                        );
                    </script>
                </div>
                <label class="form-label col-xs-4 col-sm-1">品牌：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="pinpai" value="<%=pub.trimNull((String)ht.get("pinpai"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">规格型号：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="gg_type" id="gg_type" value="<%=pub.trimNull((String)ht.get("gg_type"))%>" class="input-text ">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">价值类型：</label>
                <div class="formControls col-xs-8 col-sm-2" id="jz_type">
                    <script>
                        var value='<%=pub.trimNull((String)ht.get("jz_type"))%>';
                        value=encodeURI(encodeURI(value));
                        $.post("../zd/zd_view_list.jsp?value="+value+"&name_id=jz_type&zd_e_name=jz_type&math="+Math.random(),function(data){
                                document.getElementById("jz_type").innerHTML=data;
                            }
                        );
                    </script>
                </div>
                <label class="form-label col-xs-4 col-sm-1">价   值：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="jiazhi" value="<%=pub.trimNull((String)ht.get("jiazhi"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">来源：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="zc_resource" value="<%=pub.trimNull((String)ht.get("zc_resource"))%>" class="input-text ">
                </div>
                <%--<label class="form-label col-xs-4 col-sm-1">价格：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="jiage" value="<%=pub.trimNull((String)ht.get("jiage"))%>" class="input-text ">
                </div>--%>
            </div>
            <div class="row cl">
                <%--<label class="form-label col-xs-4 col-sm-1">数量：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="counts" value="<%=pub.trimNull((String)ht.get("counts"))%>" class="input-text ">
                </div>--%>
                <label class="form-label col-xs-4 col-sm-1">管理部门：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="dept" value="<%=pub.trimNull((String)ht.get("dept"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">出厂日期：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="chuchang_date" class="input-text Wdate"  autocomplete="off" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="<%=pub.trimNull((String)ht.get("chuchang_date"))%>" >
                </div>
                <label class="form-label col-xs-4 col-sm-1">财务入账日期：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="cw_date" value="<%=pub.trimNull((String)ht.get("cw_date"))%>" class="input-text Wdate"  autocomplete="off" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                </div>
            </div>
            <div class="row cl">

                <label class="form-label col-xs-4 col-sm-1">会计凭证号：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="kj_id" value="<%=pub.trimNull((String)ht.get("kj_id"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">财政性资金：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="czx_money" value="<%=pub.trimNull((String)ht.get("czx_money"))%>" class="input-text ">
                </div>
                <label class="form-label col-xs-4 col-sm-1">非财政性资金：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="fczx_money" value="<%=pub.trimNull((String)ht.get("fczx_money"))%>" class="input-text">
                </div>
            </div>
            <div class="row cl">

                <label class="form-label col-xs-4 col-sm-1">累计折旧：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="ljzj" value="<%=pub.trimNull((String)ht.get("ljzj"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">净    值：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="jingzhi" value="<%=pub.trimNull((String)ht.get("jingzhi"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">已提月折旧：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="ytyzj" value="<%=pub.trimNull((String)ht.get("ytyzj"))%>" class="input-text">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">是否利旧：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="is_lj" value="<%=pub.trimNull((String)ht.get("is_lj"))%>" class="input-text ">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">备注：</label>
                <div class="formControls col-xs-8 col-sm-9">
                <textarea name="beizhu" cols="" rows="2" class="textarea" placeholder=""
                          dragonfly="true"><%=pub.trimNull((String) ht.get("beizhu"))%></textarea>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">车辆识别号：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="car_id" value="<%=pub.trimNull((String)ht.get("car_id"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">车辆用途分类：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="car_type" value="<%=pub.trimNull((String)ht.get("car_type"))%>" class="input-text">
                </div>
                <label class="form-label col-xs-4 col-sm-1">发动机号：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="car_fdj_id" value="<%=pub.trimNull((String)ht.get("car_fdj_id"))%>" class="input-text ">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-1">存放地：</label>
                <div class="formControls col-xs-8 col-sm-2">
                    <input type="text" name="car_address" value="<%=pub.trimNull((String)ht.get("car_address"))%>" class="input-text ">
                </div>
            </div>
        </div>
    </form>
</article>
