<!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-task-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">范围类型：</label>
                <div class="col-sm-8">
                    <select name="scopeType" class="form-control" th:with="type=${@dict.getType('ams_inventory_scope_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库：</label>
                <div class="col-sm-8">
                    <select name="warehouseId" class="form-control">
                        <option value="">请选择仓库</option>
                        <option th:each="warehouse : ${warehouseList}" th:value="${warehouse.warehouseId}"
                                th:text="${warehouse.warehouseCode + ' - ' + warehouse.warehouseName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">位置：</label>
                <div class="col-sm-8">
                    <select name="locationId" class="form-control">
                        <option value="">请选择位置</option>
                        <option th:each="location : ${locationList}" th:value="${location.locationId}"
                                th:text="${location.locationCode + ' - ' + location.locationName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">资产类别：</label>
                <div class="col-sm-8">
                    <select name="categoryId" class="form-control">
                        <option value="">请选择资产类别</option>
                        <option th:each="category : ${categoryList}" th:value="${category.categoryId}"
                                th:text="${category.categoryCode + ' - ' + category.categoryName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control" rows="3" maxlength="500"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "asset/task";
        $("#form-task-add").validate({ focusCleanup: true });

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