<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
    <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">
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.css" media="all">
    <style>html {
        background-color: #fff;
        padding-bottom: 50px;
    }

    td, th {
        text-align: center !important;
    }</style>
</head>

<body>
<div class="layui-form">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">表单信息</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="layui-card">
                    <div class="layui-elem-quote" style="display: flex;justify-content: space-between;">
                        <p>订单信息</p>
                        <p>下单时间：${order.columns.place_time}</p>
                    </div>
                    <div class="layui-tab-content">
                        <div class="layui-row">
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">订单编号：</label>
                                <div class="layui-input-block ">
                                    <input type="text" name="inWarehouseName" readonly
                                           class="layui-input layui-bg-gray"
                                           value="${order.columns.power_station_code}">
                                </div>
                            </div>
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">订单状态：</label>
                                <div class="layui-input-block ">
                                    <input type="text" disabled name="type" readonly class="layui-input layui-bg-gray"
                                    <c:choose>
                                           <c:when test="${order.columns.status eq '0'}">value="暂存"</c:when>
                                           <c:when test="${order.columns.status eq '1'}">value="待审核"</c:when>
                                           <c:when test="${order.columns.status eq '2'}">value="审核驳回"</c:when>
                                           <c:when test="${order.columns.status eq '3'}">value="待下单"</c:when>
                                           <c:when test="${order.columns.status eq '4'}">value="待安装"</c:when>
                                           <c:when test="${order.columns.status eq '5'}">value="待安装验收"</c:when>
                                           <c:when test="${order.columns.status eq '6'}">value="待并网"</c:when>
                                           <c:when test="${order.columns.status eq '7'}">value="待并网验收"</c:when>
                                           <c:when test="${order.columns.status eq '10'}">value="并网验收驳回"</c:when>
                                           <c:when test="${order.columns.status eq 'a'}">value="已完成"</c:when>
                                           <c:when test="${order.columns.status eq 'd'}">value="待上传发票"</c:when>
                                           <c:when test="${order.columns.status eq 'e'}">value="待签署合同"</c:when>
                                           <c:when test="${order.columns.status eq 'f'}">value="安装验收退回"</c:when>
                                           <c:when test="${order.columns.status eq 'w'}">value="准入登记"</c:when>
                                    </c:choose>
                                    >
                                </div>
                            </div>
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">订单类型：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="type" readonly class="layui-input layui-bg-gray"
                                           value="电站安装">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">入库仓库：</label>
                                <div class="layui-input-block ">
                                    <input type="text" name="inWarehouseName" readonly
                                           class="layui-input layui-bg-gray" value="">
                                </div>
                            </div>
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">接货人：</label>
                                <div class="layui-input-block ">
                                    <input type="text" name="personInCharge" readonly
                                           class="layui-input layui-bg-gray" value="">
                                </div>
                            </div>
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">联系电话：</label>
                                <div class="layui-input-block ">
                                    <input type="text" readonly class="layui-input layui-bg-gray"
                                           value="">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs8">
                                <label class="layui-form-label ">仓库地址：</label>
                                <div class="layui-input-block ">
                                    <input type="text" readonly class="layui-input layui-bg-gray"
                                           value="">
                                </div>
                            </div>
                            <div class="layui-col-xs4">
                                <label class="layui-form-label ">代理商名称：</label>
                                <div class="layui-input-block ">
                                    <input type="text" readonly class="layui-input layui-bg-gray"
                                           value="${order.columns.trader_name}">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-xs12">
                                <label class="layui-form-label">订单备注：</label>
                                <div class="layui-input-block ">
                                    <input type="text" readonly class="layui-input layui-bg-gray"
                                           value="${order.columns.remarks}">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-form-item mb-5">
                                <label class="layui-form-label">分配说明：</label>
                                <div class="layui-input-block ">
                                    <input type="text" readonly class="layui-input layui-bg-gray"
                                           value="">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-elem-quote" style="display: flex;justify-content: space-between;">
                        <p>发货信息</p>
                    </div>
                    <div class="layui-tab-content">
                        <div class="layui-row">
                            <div class=" layui-col-xs4">
                                <label class="layui-form-label w-130">发货仓库：</label>
                                <div class="layui-input-block ">
                                    <input type="text" class="layui-input layui-bg-gray" readonly
                                           value="${warehouseName}">
                                </div>
                            </div>
                            <div class=" layui-col-xs4">
                                <label class="layui-form-label w-130">发货方式：</label>
                                <div class="layui-input-block ">
                                    <input type="text" class="layui-input layui-bg-gray" readonly
                                           value="">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-form-item otherDiv">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label w-130">司机：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="deliverDriver"
                                               class="layui-input layui-bg-gray" readonly
                                               value="">
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label w-130">联系方式：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="deliverMobile"
                                               class="layui-input layui-bg-gray" readonly
                                               value="">
                                    </div>
                                </div>
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label w-130">车牌号：</label>
                                    <div class="layui-input-block ">
                                        <input type="text" name="deliverCarNum"
                                               class="layui-input layui-bg-gray" readonly
                                               value="">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-form-item mb-5">
                                <label class="layui-form-label w-130">发货说明：</label>
                                <div class="layui-input-block ">
                                    <input type="text" readonly class="layui-input layui-bg-gray"
                                           value="">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-elem-quote" style="display: flex;justify-content: space-between;">
                        <p>物料清单</p>
                    </div>
                    <div class="layui-tab-content">
                        <div class="layui-row">
                            <table class="layui-table">
                                <thead>
                                <th>序号</th>
                                <th>物料代码</th>
                                <th>物料名称</th>
                                <th>物料类型</th>
                                <th>物料品牌</th>
                                <th>物料规格</th>
                                <th>发货数量</th>
                                </thead>
                                <tbody id="materialTbody">
                                <c:forEach items="${details}" var="applyDetail" varStatus="vs">
                                    <tr data-id="${applyDetail.columns.id}">
                                        <td>${vs.count}</td>
                                        <td>${applyDetail.columns.code}</td>
                                        <td>${applyDetail.columns.name}</td>
                                        <td>${applyDetail.columns.type}</td>
                                        <td>${applyDetail.columns.material_brand}</td>
                                        <td>${applyDetail.columns.spec}</td>
                                        <td>${applyDetail.columns.amount}</td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="operate-footer">
        <button type="button" class="layui-btn layui-btn-primary " onclick="closeDiv();">关闭</button>
    </div>
</div>
<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
    //初始数据
    var $form;
    var form;
    var $;
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form', 'layedit', 'laydate', 'jquery', 'layer', 'element', 'upload'], function () {
        $ = layui.jquery;
        form = layui.form;
    })

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

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