<%--
  Created by IntelliJ IDEA.
  User: user
  Date: 2019/8/19
  Time: 13:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<link rel="stylesheet" href="${ctxp}/static/plugin/assets/layui/css/layui.css">
<link rel="stylesheet" href="${ctxp}/static/plugin/assets/common.css"/>
<script type="text/javascript" src="${ctxp}/static/plugin/assets/jquery-3.2.1.min.js"></script>
<script src="${ctxp}/static/plugin/assets/layui/layui.js"></script>
<html>
<head>
    <title>添加工程</title>
    <style>
        .layui-input{
            height: 28px;
            margin-top: 6px;
        }
    </style>
</head>
<body>
<form id="inputForm"class="layui-form" action="${ctx}/project/import" method="post" enctype="multipart/form-data">
    <input id="newText1" hidden name="projectId" value=""/>
    <div class="layui-form-item">
        <div class="layui-inline" style="margin-left:30px;margin-top: 10px;display: flex">
            <input type="button" class="layui-btn-primary layui-btn-sm layui-btn-radius" onclick="uploadwj()" value="选择结算文件" id="btnxz"/>
            <span id="myspan" style="flex: 1;margin-top: 4px">&nbsp;*结算书文件为博微导出xls/xlsx格式文件</span>
            <input type="file" style="display: none;" accept=".xls,.xlsx"  name="file" id="myfile"/>
        </div>
    </div>
    <!---------列表---------->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">*项目划分</label>
            <div class="layui-input-inline">
                <select name="type" lay-verify="required" lay-search="">
                    <option value="">请选择</option>
                    <option value="1">架空线路工程</option>
                    <option value="2">电缆工程</option>
                </select>
            </div>
        </div>
    </div>
    <%--<div class="layui-form-item">--%>
        <%--<div class="layui-inline">--%>
            <%--<label class="layui-form-label">*调整文件</label>--%>
            <%--<div class="layui-input-inline">--%>
                <%--<select name="tzwj" lay-verify="required" lay-search="">--%>
                    <%--<option value="">请选择</option>--%>
                    <%--<option value="1">2016年调差价系数文件（50号文件）</option>--%>
                    <%--<option value="2">-空-</option>--%>
                <%--</select>--%>
            <%--</div>--%>
        <%--</div>--%>
    <%--</div>--%>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">项目名称</label>
            <div class="layui-input-inline">
                <input type="text" name="name"  class="layui-input" id="inputwrite">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">项目编号</label>
            <div class="layui-input-inline">
                <input type="text" name="" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="mysubmit" type="submit" id="newProject" style="display: none;">创建</button>
            <!--<button type="reset" class="layui-btn layui-btn-primary">取消</button>-->
        </div>
    </div>
</form>
</body>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form;
        form.render();
        //自定义验证规则
        form.verify({
            context: function(value){
                if(value.length <=0){
                    return '请选择导入的文件';
                }
            }
        });
        var newText1 = parent.$('#addtext').val();
        $("#newText1").val(newText1);
    })
    function doSubmit(obj){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
        $("#inputForm").submit();
    }
</script>
<script>
    $("#btnxz").click(function(){
        $("#myfile").trigger("click");
    })
    $("#myfile").bind("change",function(){
        var w= $("#myfile").val();
        $("#myspan").html('&nbsp;'+w);
    });
</script>
</html>
