<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('领用单详情')" />
</head>
<body>
    <div class="main-content">
        <form class="form-horizontal" th:object="${amsReceiveOrder}">
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
                <div class="col-sm-4"><div class="form-group">
                    <label class="col-sm-4 control-label">领用单号：</label>
                    <div class="col-sm-8"><p class="form-control-plaintext" th:text="*{receiveNo}"></p></div>
                </div></div>
                <div class="col-sm-4"><div class="form-group">
                    <label class="col-sm-4 control-label">申请人：</label>
                    <div class="col-sm-8"><p class="form-control-plaintext" th:text="*{applicantName}"></p></div>
                </div></div>
                <div class="col-sm-4"><div class="form-group">
                    <label class="col-sm-4 control-label">申请部门：</label>
                    <div class="col-sm-8"><p class="form-control-plaintext" th:text="*{applyDeptName}"></p></div>
                </div></div>
            </div>
            <div class="row">
                <div class="col-sm-4"><div class="form-group">
                    <label class="col-sm-4 control-label">单据状态：</label>
                    <div class="col-sm-8"><p class="form-control-plaintext"
                        th:text="*{@dict.getLabel('ams_receive_status', orderStatus)}"></p></div>
                </div></div>
                <div class="col-sm-4"><div class="form-group">
                    <label class="col-sm-4 control-label">确认人：</label>
                    <div class="col-sm-8"><p class="form-control-plaintext" th:text="*{confirmUserName}"></p></div>
                </div></div>
                <div class="col-sm-4"><div class="form-group">
                    <label class="col-sm-4 control-label">确认时间：</label>
                    <div class="col-sm-8"><p class="form-control-plaintext"
                        th:text="*{confirmTime == null ? '' : #dates.format(confirmTime, 'yyyy-MM-dd HH:mm:ss')}"></p></div>
                </div></div>
            </div>
            <div class="row">
                <div class="col-sm-6"><div class="form-group">
                    <label class="col-sm-3 control-label">驳回原因：</label>
                    <div class="col-sm-9"><p class="form-control-plaintext" th:text="*{rejectReason}"></p></div>
                </div></div>
                <div class="col-sm-6"><div class="form-group">
                    <label class="col-sm-3 control-label">备注：</label>
                    <div class="col-sm-9"><p class="form-control-plaintext" th:text="*{remark}"></p></div>
                </div></div>
            </div>

            <h4 class="form-header h4">领用明细</h4>
            <div class="row">
                <div class="col-sm-12 select-table table-striped">
                    <table class="table table-bordered">
                        <thead><tr>
                            <th>序号</th><th>资产编码</th><th>资产名称</th><th>资产类别</th>
                            <th>领用前仓库/位置</th><th>领用部门/领用人</th><th>备注</th>
                        </tr></thead>
                        <tbody>
                            <tr th:each="item, stat : *{amsReceiveOrderItemList}">
                                <td th:text="${stat.count}"></td>
                                <td th:text="${item.assetCode}"></td>
                                <td th:text="${item.assetName}"></td>
                                <td th:text="${item.categoryName}"></td>
                                <td th:text="${(item.beforeWarehouseName ?: '-') + ' / ' + (item.beforeLocationName ?: '-')}"></td>
                                <td th:text="${(item.receiveDeptName ?: '-') + ' / ' + (item.receiveUserName ?: '-')}"></td>
                                <td th:text="${item.remark}"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
</body>
</html>
