<%@ 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;
        }

        .hx_l {
            position: relative;
        }

        .hx_l > span {
            position: absolute;
            right: 10px;
            top: 5px
        }

        .hx_del {
            font-size: 12px;
            color: #0e8ee7;
            position: relative;
            top: 4px;
            display: none
        }

        #attachFile > li {
            height: 26px
        }

        #attachFile > li:hover .hx_del {
            display: inline-block
        }

        .hx_ts {
            font-size: 12px;
            color: red;
        }

        .layui-textarea {
            min-height: 50px;
        }
    </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">

              <c:if test="${userType eq '1'}">
                  <div class="layui-col-xs12 mb-10 pr-30">
                      <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" value="${order.columns.creator}" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </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" value="<fmt:formatDate value="${order.columns.create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </div>
                  </div>
                  <div class="layui-col-xs12 mb-10 pr-30">
                      <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" value="${order.columns.confirmor}" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </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" value="<fmt:formatDate value="${order.columns.confirm_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </div>
                  </div>
                  <div class="layui-col-xs12 mb-10 pr-30">
                      <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" value="${order.columns.examiner}" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </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" value="${order.columns.warehouseName}" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </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" value="<fmt:formatDate value="${order.columns.examine_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                     class="layui-input">
                          </div>
                      </div>
                  </div>
              </c:if>
                <c:if test="${userType eq '8'}">
                    <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" value="${order.columns.number}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${order.columns.create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label w-130">SAP采购号：</label>
                        <div class="layui-input-block w-200">
                            <input type="text" value="${order.columns.spa_number}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="${order.columns.confirmor}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${order.columns.confirm_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${order.columns.examine_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="${order.columns.examiner}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="${order.columns.warehouseName}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${order.columns.latest_examine_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                </c:if>
                <c:if test="${userType eq '4'}">
                    <div class="layui-inline layui-col-xs4">
                        <label class="layui-form-label w-130">SAP采购号：</label>
                        <div class="layui-input-block w-200">
                            <input type="text" value="${order.columns.spa_number}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${order.columns.examine_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${inspection.columns.create_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="${inspection.columns.examine_name}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="${inspection.columns.warehouse_name}" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </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" value="<fmt:formatDate value="${inspection.columns.finish_time}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                </c:if>


            <div class="layui-inline layui-col-xs12">
                <label class="layui-form-label w-130">订单备注：</label>
                <div class="layui-input-block w-200 hx_l">
                    <textarea readonly class="layui-textarea">${order.columns.remark}</textarea>
                </div>
            </div>

            <div class="layui-inline layui-col-xs12 mt-10">
                <label class="layui-form-label w-130">检验备注：</label>
                <div class="layui-input-block w-200 hx_l">
                    <textarea readonly class="layui-textarea">${order.columns.examine_remark}</textarea>
                </div>
            </div>


            <div class="layui-col-xs12 mb-20 pr-30 mt-20">

                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">物料明细</li>
                        <li>过程记录</li>
                        <c:if test="${userType eq '8'}">
                            <li>报检记录</li>
                        </c:if>
                    </ul>
                    <div class="layui-tab-content" style="height: 260px; overflow: auto">
                        <div class="layui-tab-item layui-show">
                            <table class="layui-table">
                                <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>物料代码</th>
                                    <th>物料类型</th>
                                    <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.columns.material_code}</td>
                                        <td>${material.columns.material_type}</td>
                                        <td>${material.columns.material_group}</td>
                                        <td>${material.columns.material_unit}</td>
                                        <td>${material.columns.material_remark}</td>
                                        <td>${material.columns.amount}</td>
                                        <td>${material.columns.wait_amount}</td>
                                        <td>${material.columns.in_amount}</td>
                                        <td>${material.columns.location}</td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                        <div class="layui-tab-item">
                            <ul>
                                <c:forEach var="msg" items="${msgs}">
                                    <li><fmt:formatDate value="${msg.columns.operate_time}" pattern="yyy-MM-dd HH:mm:ss"/> &nbsp;&nbsp;&nbsp;

                                            ${msg.columns.operator} &nbsp;&nbsp;&nbsp;${msg.columns.content}
                                    </li>
                                </c:forEach>

                            </ul>
                        </div>
                        <c:if test="${userType eq '8'}">
                            <div class="layui-tab-item">
                                <table class="layui-table">
                                    <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th width="8%">物料代码</th>
                                        <th width="8%">物料类型</th>
                                        <th width="8%">物料组</th>
                                        <th>单位</th>
                                        <th>物料描述</th>
                                        <th width="5%">采购数量</th>
                                        <th width="5%">检验数量</th>
                                        <th width="5%">报检数量</th>
                                        <th width="8%">检验状态</th>
                                        <th>报检时间</th>
                                        <th>检验完成时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${inspectionDetails}" varStatus="vs" var="material">
                                        <tr>
                                            <td>${vs.count}</td>
                                            <td>${material.columns.material_code}</td>
                                            <td>${material.columns.material_type}</td>
                                            <td>${material.columns.material_group}</td>
                                            <td>${material.columns.material_unit}</td>
                                            <td>${material.columns.material_remark}</td>
                                            <td>${material.columns.amount}</td>
                                            <td>${material.columns.inspection_amount}</td>
                                            <td>${material.columns.bjAmount}</td>
                                            <td>${material.columns.insStaus eq '1' ? "待检验":"已检验"}</td>
                                            <td><fmt:formatDate value="${material.columns.create_time}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                            <td><fmt:formatDate value="${material.columns.finish_time}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </c:if>

                    </div>
                </div>
            </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 $;
    var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
    layui.use(['form', 'table', 'upload', 'jquery','element'], function () {
        $ = layui.jquery;
        element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        form = layui.form;
        upload = layui.upload;
        $form = $('form');

    })

    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>


