<!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 m" id="form-location-add">
            <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="locationCode" 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">位置名称：</label>
                    <div class="col-sm-8">
                        <input name="locationName" 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">所属仓库：</label>
                    <div class="col-sm-8">
                        <select name="warehouseId" class="form-control" required>
                            <option value="">请选择</option>
                            <option th:each="warehouse : ${warehouseList}" th:text="${warehouse.warehouseName}" th:value="${warehouse.warehouseId}"></option>
                        </select>
                    </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">
                        <input name="detailAddress" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">启用状态：</label>
                    <div class="col-sm-8">
                        <div class="radio-box" th:each="dict : ${@dict.getType('ams_enabled_status')}">
                            <input type="radio" th:id="${'enabled_' + dict.dictCode}" name="enabled" th:value="${dict.dictValue}" th:checked="${dict.default}" required>
                            <label th:for="${'enabled_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                    </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">
                        <textarea name="remark" class="form-control"></textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "asset/location"
        $("#form-location-add").validate({
            focusCleanup: true
        });

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