<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('报废处置单详细')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal" th:object="${amsDisposalOrder}">
            <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="*{disposalNo}"></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="*{@dict.getLabel('ams_disposal_status', orderStatus)}"></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="*{applicantName}"></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="*{applyDeptName}"></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="*{disposalMethod}"></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="*{#dates.format(createTime, 'yyyy-MM-dd HH:mm:ss')}"></p>
                        </div>
                    </div>
                </div>
            </div>

            <h4 class="form-header h4" th:if="*{confirmUserId != null}">确认信息</h4>
            <div class="row" th:if="*{confirmUserId != null}">
                <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 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="*{#dates.format(confirmTime, 'yyyy-MM-dd HH:mm:ss')}"></p>
                        </div>
                    </div>
                </div>
            </div>

            <h4 class="form-header h4" th:if="*{rejectReason != null and rejectReason != ''}">驳回信息</h4>
            <div class="row" th:if="*{rejectReason != null and rejectReason != ''}">
                <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 text-danger" th:text="*{rejectReason}"></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 id="bootstrap-table"></table>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        $(function() {
            var data = [[${amsDisposalOrder.amsDisposalOrderItemList}]];
            var options = {
                data: data,
                pagination: false,
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                sidePagination: "client",
                columns: [
                {
                    field: 'index',
                    title: '序号',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {
                    field: 'assetCode',
                    title: '资产编码'
                },
                {
                    field: 'assetName',
                    title: '资产名称'
                },
                {
                    field: 'categoryName',
                    title: '资产类别'
                },
                {
                    field: 'specModel',
                    title: '规格型号'
                },
                {
                    field: 'brand',
                    title: '品牌'
                },
                {
                    field: 'disposalReason',
                    title: '报废原因',
                    formatter: function(value) {
                        return value || "-";
                    }
                },
                {
                    field: 'disposalRemark',
                    title: '处置备注',
                    formatter: function(value) {
                        return value || "-";
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
