<!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="${amsReturnOrder}">
            <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="*{returnNo}"></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="*{applyDeptName}"></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="*{receiveWarehouseName}"></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_return_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="*{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 : *{amsReturnOrderItemList}">
                                <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.beforeDeptName ?: '-') + ' / ' + (item.beforeUserName ?: '-')}"></td>
                                <td th:text="${(item.afterWarehouseName ?: '-') + ' / ' + (item.afterLocationName ?: '-')}"></td>
                                <td th:text="${item.remark}"></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
</body>
</html>
