<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改RFID标签')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-tag-edit" th:object="${amsRfidTag}">
            <input name="tagId" th:field="*{tagId}" type="hidden">
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">标签编码：</label>
                    <div class="col-sm-8">
                        <input name="tagCode" th:field="*{tagCode}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">EPC编码：</label>
                    <div class="col-sm-8">
                        <input name="epcCode" th:field="*{epcCode}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-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_tag_status', tagStatus)}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-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_tag_bind_status', bindStatus)}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-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="*{assetCode}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-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="*{assetName}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-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="${amsRfidTag.bindTime == null ? '' : #dates.format(amsRfidTag.bindTime, 'yyyy-MM-dd HH:mm:ss')}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-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="*{bindUserName}"></p>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-2 control-label">备注：</label>
                    <div class="col-sm-10">
                        <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "asset/tag";
        $("#form-tag-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-tag-edit').serialize());
            }
        }
    </script>
</body>
</html>
