<!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="${amsTransferOrder}">
            <h4 class="form-header h4">基本信息</h4>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">调拨单号：</label>
                        <div class="col-sm-8">
                            <p class="form-control-plaintext" th:text="*{transferNo}"></p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <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>
            <div class="row">
                <div class="col-sm-6">
                    <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_transfer_status', orderStatus)}"></p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <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>
            <div class="row">
                <div class="col-sm-6">
                    <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 class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">调拨原因：</label>
                        <div class="col-sm-8">
                            <p class="form-control-plaintext" th:text="*{transferReason}"></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注：</label>
                        <div class="col-sm-10">
                            <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 : *{amsTransferOrderItemList}">
                                <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.oldWarehouseName ?: '-') + ' / ' + (item.oldLocationName ?: '-')}"></td>
                                <td th:text="${(item.newWarehouseName ?: '-') + ' / ' + (item.newLocationName ?: '-')}"></td>
                                <td th:text="${item.remark}"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
</body>
</html>
