<%@ 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-card">
        <div class="layui-col-xs12 mt-10 mb-10 pr-30 pl-30">
            <table class="layui-table">
                <thead>
                <th>订单编号</th>
                <th>订单状态</th>
                <th>下单人</th>
                <th>下单备注</th>
                <th>下单时间</th>
                <th>冻结数量</th>
                </thead>
                <tbody id="materialTbody">
                <c:forEach items="${recordList}" var="record" varStatus="vs">
                    <tr>
                        <td>${record.columns.number}</td>
                        <td>
                            <c:if test="${record.columns.orderType eq '1'}">
                                <c:if test="${record.columns.status eq '1'}">
                                    待审批
                                </c:if>
                                <c:if test="${record.columns.status eq '2'}">
                                    采购分配
                                </c:if>
                                <c:if test="${record.columns.status eq '3'}">
                                    分配打回
                                </c:if>
                                <c:if test="${record.columns.status eq '4'}">
                                    采购审批
                                </c:if>
                                <c:if test="${record.columns.status eq '5'}">
                                    待发货
                                </c:if>
                                <c:if test="${record.columns.status eq '6'}">
                                    待签收
                                </c:if>
                                <c:if test="${record.columns.status eq '7'}">
                                    已完成
                                </c:if>
                                <c:if test="${record.columns.status eq '8'}">
                                    已并单
                                </c:if>
                                <c:if test="${record.columns.status eq '9'}">
                                    发货打回
                                </c:if>
                            </c:if>
                            <c:if test="${record.columns.orderType eq '2'}">
                                <c:if test="${record.columns.status eq '1'}">
                                    待调出方出库
                                </c:if>
                                <c:if test="${record.columns.status eq '2'}">
                                    待调入方入库
                                </c:if>
                                <c:if test="${record.columns.status eq '3'}">
                                    待审核
                                </c:if>
                                <c:if test="${record.columns.status eq '4'}">
                                    审核驳回
                                </c:if>
                            </c:if>
                        </td>
                        <td>${record.columns.place_name}</td>
                        <td>${record.columns.remarks}</td>
                        <td><fmt:formatDate value="${record.columns.place_time}" pattern="yyyy-MM-dd HH:mm"/> </td>
                        <td>
                            <c:if test="${record.columns.orderType eq '1'}">
                                <c:if test="${record.columns.status eq '1' || record.columns.status eq '4'}">
                                    ${record.columns.apply_amount}
                                </c:if>
                                <c:if test="${record.columns.status eq '2' || record.columns.status eq '5' || record.columns.status eq '6'}">
                                    ${record.columns.out_amount}
                                </c:if>
                            </c:if>
                            <c:if test="${record.columns.orderType eq '2'}">
                                ${record.columns.inout_amount}
                            </c:if>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </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 $;
    var imgs = '';
    var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
    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;
        var element = layui.element;
        $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>
