<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="decorator" content="base"/>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="${ctxPlugin}/static/css/reset.css" media="all">
    <style>
        .layui-form-select dl{
            max-height:200px;
            width: 80%;
        }
        html {
            background-color: #fff;
        }
        .layui-table td, .layui-table th {
            text-align: center;
        }
    </style>
</head>
<body>
<div class="aaa">
    <div class="layui-form">
        <div class="layui-card-body over pt-20 pb-40 h-350" action="" id="detailSet">
            <div class="layui-col-xs12 mb-10 pr-30">

                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130"><i class="red">*</i>出库仓库：</label>
                    <div class="layui-input-block w-200">
                        <select name="warehouseId" lay-verify="required" id="warehouseId" lay-filter="warehouseId">
                            <option value="">请选择</option>
                            <c:forEach items="${warehouseList}" var="warehouse">
                                <option value="${warehouse.columns.id}" ${warehouse.columns.id eq order.warehouseId ? 'selected' : ''}>${warehouse.columns.name}</option>
                            </c:forEach>
                        </select>
                    </div>
                    <input type="text" class="layui-hide warehouseId">
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">操作人：</label>
                    <div class="layui-input-block w-200">
                        <input type="text" class="layui-input" name="creator" value="${order.creator}"/>
                    </div>
                    <input type="text" class="layui-hide warehouseId">
                </div>
                <div class="layui-inline layui-col-xs4">
                    <label class="layui-form-label w-130">使用时间：</label>
                    <div class="layui-input-block w-200">
                        <input type="text" class="layui-input" name="createTime" value="<fmt:formatDate value="${order.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
                    </div>
                    <input type="text" class="layui-hide warehouseId">
                </div>
                <div class="layui-inline layui-col-xs12">
                    <label class="layui-form-label w-130">使用说明：</label>
                    <div class="layui-input-block w-200" >
                        <textarea name="remarks" class="layui-textarea">${order.remarks}</textarea>
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 mb-20 pr-30 mt-20">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>物料代码</th>
                        <th>物料类型</th>
                        <th>物料组</th>
                        <th>单位</th>
                        <th>物料描述</th>

                        <th>使用数量</th>
                    </tr>
                    </thead>
                    <tbody id="materialTable">
                    <c:forEach items="${details}" varStatus="vs" var="material">
                        <tr>
                            <td>${vs.count}</td>
                            <td>${material.materialCode}</td>
                            <td>${material.materialType}</td>
                            <td>${material.materialGroup}</td>
                            <td>${material.materialUnit}</td>
                            <td>${material.materialRemarks}</td>

                            <td>${material.amount}</td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="layui-form-item operate-footer" style="text-align: center;">

            <button type="button" class="layui-btn layui-btn-primary " onclick="closeDiv();">取消</button>
        </div>

    </div>
</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
    //初始数据
    var $form;
    var form;
    var upload;
    var $;
    var imgs='';

    layui.use(['form', 'table', 'jquery'], function () {
        $ = layui.jquery;
        form = layui.form;
        upload = layui.upload;
        $form = $('form');

        $('select').prop('disabled', true);
        form.render();
        $('input').prop('disabled', true).addClass('layui-bg-gray');
        $('textarea').prop('disabled', true).addClass('layui-bg-gray');

    });

    function  closeDiv() {
        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
        parent.layer.close(index);
    }

    function isBlank(val) {
        if (val == null || val == '' || val == undefined) {
            return true;
        }
        return false;
    }

</script>
</body>
</html>
