<!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-edit" th:object="${amsInventoryTask}">
            <input name="taskId" th:field="*{taskId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">任务号：</label>
                <div class="col-sm-8">
                    <p class="form-control-static" th:text="*{taskNo}"></p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">负责人：</label>
                <div class="col-sm-8">
                    <p class="form-control-static" th:text="*{ownerUserName}"></p>
                </div>
            </div>
            <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:field="*{scopeType}"
                            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" th:field="*{warehouseId}">
                        <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" th:field="*{locationId}">
                        <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" th:field="*{categoryId}">
                        <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">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "asset/task";
        $("#form-task-edit").validate({ focusCleanup: true });

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