selectWarehouse.html
1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head 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-receiptHeader-add">
<div class="form-group">
<label class="control-label col-sm-2">仓库:</label>
<div class="col-sm-8" style="padding:0 5px;">
<select name="warehouse" id="warehouse" class="form-control" style="color:#333;">
</select>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary" onclick="save()">确定</button>
</div>
</div>
<div class="form-group">
<div class="form-control-static col-sm-offset-9">
</div>
</div>
</form>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
$(function () {
$.ajax({
url: ctx + "config/warehouse/list",
type: 'post',
dataType: "json",
success: function (value) {
$("#warehouse").contents().remove();
if (value != null && value.data.length >= 1)
for (let i = 0; i < value.data.length; i++) {
$('<option value=' + value.data[i].code + '>' + value.data[i].name + '</option>').appendTo('#warehouse');
}
}
})
});
function save() {
let data = $("#warehouse").val();
window.location.href = ctx +"reservation/view/"+data;
}
</script>
</body>
</html>