Commit 07cff624ef9fe896916baecdeecd0b8b200f5a58
1 parent
e5c2ee5c
fix: 页面优化
Showing
2 changed files
with
29 additions
and
3 deletions
src/main/resources/templates/inventory/inventoryHeader/emptyIn.html
... | ... | @@ -66,6 +66,20 @@ |
66 | 66 | }); |
67 | 67 | |
68 | 68 | $(function () { |
69 | + $('#containerCode').on('input', debounce(function () { | |
70 | + let value = this.value; | |
71 | + if ($.common.isEmpty(value)) { | |
72 | + return | |
73 | + } | |
74 | + $('#vehicleCode').focus(); | |
75 | + }, 1500)) | |
76 | + $('#vehicleCode').on('input', debounce(function () { | |
77 | + let value = this.value; | |
78 | + if ($.common.isEmpty(value)) { | |
79 | + return | |
80 | + } | |
81 | + $('#destinationLocation').focus(); | |
82 | + }, 1500)) | |
69 | 83 | /*$('#fromPort').select2({ |
70 | 84 | ajax: { |
71 | 85 | url: ctx + 'config/station/getDataByType', |
... | ... | @@ -84,6 +98,18 @@ |
84 | 98 | } |
85 | 99 | });*/ |
86 | 100 | }) |
101 | + function debounce(fn, delay) { | |
102 | + let timeout = null; | |
103 | + return function () { | |
104 | + if (timeout !== null) { | |
105 | + clearTimeout(timeout); | |
106 | + } | |
107 | + timeout = setTimeout(() => { | |
108 | + //利用call(),让this的指针从指向window 转成指向input | |
109 | + fn.call(this); | |
110 | + }, delay); | |
111 | + } | |
112 | + } | |
87 | 113 | </script> |
88 | 114 | </body> |
89 | 115 | -</html> |
116 | +</html> | |
90 | 117 | \ No newline at end of file |
... | ... |
src/main/resources/templates/inventory/inventoryHeader/scrap.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | <div class="form-group"> |
19 | 19 | <label class="col-sm-3 control-label">载具编码:</label> |
20 | 20 | <div class="col-sm-8"> |
21 | - <input id="containerCode" name="containerCode" class="form-control" type="text" th:value="${locationCode}" readonly> | |
21 | + <input id="containerCode" name="containerCode" class="form-control" type="text" th:value="${containerCode}" readonly> | |
22 | 22 | </div> |
23 | 23 | </div> |
24 | 24 | <div class="form-group"> |
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | <div class="form-group"> |
31 | 31 | <label class="col-sm-3 control-label">库位编码:</label> |
32 | 32 | <div class="col-sm-8"> |
33 | - <input id="sourceLocation" name="sourceLocation" class="form-control" type="text" th:value="${containerCode}" readonly> | |
33 | + <input id="sourceLocation" name="sourceLocation" class="form-control" type="text" th:value="${locationCode}" readonly> | |
34 | 34 | </div> |
35 | 35 | </div> |
36 | 36 | <div class="form-group"> |
... | ... |