| Line 21... |
Line 21... |
| 21 |
<h3 class="page-header"><i class="icon_document_alt"></i>Bids</h3>
|
21 |
<h3 class="page-header"><i class="icon_document_alt"></i>Bids</h3>
|
| 22 |
<ol class="breadcrumb">
|
22 |
<ol class="breadcrumb">
|
| 23 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Dashboard</a></li>
|
23 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Dashboard</a></li>
|
| 24 |
<li><i class="icon_document_alt"></i>Bids</li>
|
24 |
<li><i class="icon_document_alt"></i>Bids</li>
|
| 25 |
<li class="pull-right">
|
25 |
<li class="pull-right">
|
| - |
|
26 |
<button class="btn btn-success map-catalog" type="button" data-toggle="modal" data-target="#publishLiquidationModal">
|
| - |
|
27 |
<i class="icon_document_alt"></i> Publish</button>
|
| - |
|
28 |
</li>
|
| - |
|
29 |
<li class="pull-right">
|
| 26 |
<button class="btn btn-primary map-catalog" type="button" data-toggle="modal" data-target="#manageLiquidationModal">
|
30 |
<button class="btn btn-primary map-catalog" type="button" data-toggle="modal" data-target="#manageLiquidationModal">
|
| 27 |
<i class="icon_document_alt"></i> Create New</button>
|
31 |
<i class="icon_document_alt"></i> Create New</button>
|
| 28 |
</li>
|
32 |
</li>
|
| 29 |
</ol>
|
33 |
</ol>
|
| 30 |
</div>
|
34 |
</div>
|
| Line 44... |
Line 48... |
| 44 |
<tbody>
|
48 |
<tbody>
|
| 45 |
#foreach($item in $liquidations)
|
49 |
#foreach($item in $liquidations)
|
| 46 |
<tr>
|
50 |
<tr>
|
| 47 |
<td>$saholicStockMap.get($item.catalogId).getBrand() $saholicStockMap.get($item.catalogId).getModelNumber()</td>
|
51 |
<td>$saholicStockMap.get($item.catalogId).getBrand() $saholicStockMap.get($item.catalogId).getModelNumber()</td>
|
| 48 |
<td>$item.price</td>
|
52 |
<td>$item.price</td>
|
| 49 |
<td>$bidsMap.get($item.getId()).size()</td>
|
53 |
<td>#if($bidsMap.get($item.getId()).size() > 0) $bidsMap.get($item.getId()).size() #else 0 #end</td>
|
| 50 |
<td>$item.startDate.format($dateTimeFormatter) - $item.endDate.format($dateTimeFormatter)</td>
|
54 |
<td>$item.startDate.format($dateTimeFormatter) - $item.endDate.format($dateTimeFormatter)</td>
|
| 51 |
<td>$item.status</td>
|
55 |
<td>$item.status</td>
|
| 52 |
<td>
|
56 |
<td>
|
| 53 |
<a role="button" onclick="editLiquidation($item.id)" class="btn btn-sm btn-info"><i class="fa fa-eye"></i> View</a>
|
57 |
<a role="button" onclick="editLiquidation($item.id)" class="btn btn-sm btn-info"><i class="fa fa-eye"></i> View</a>
|
| 54 |
#*<a role="button" onclick="deleteLiquidation($item.id)" class="btn btn-sm btn-danger">Delete</a>*#
|
58 |
#*<a role="button" onclick="deleteLiquidation($item.id)" class="btn btn-sm btn-danger">Delete</a>*#
|
| Line 72... |
Line 76... |
| 72 |
<input type="hidden" name="id" id="id">
|
76 |
<input type="hidden" name="id" id="id">
|
| 73 |
<input type="hidden" name="quantity" id="quantity">
|
77 |
<input type="hidden" name="quantity" id="quantity">
|
| 74 |
|
78 |
|
| 75 |
<div class="col-md-7">
|
79 |
<div class="col-md-7">
|
| 76 |
<div class="form-group">
|
80 |
<div class="form-group">
|
| 77 |
<label class="form-label" for="catalogId">Catalog</label>
|
81 |
<label class="form-label" for="catalogId">Catalog <span class="text-danger">*</span></label>
|
| 78 |
<span class="pull-right"><input name="restricted" value="true" id="restricted" type="checkbox"> Restricted?</span>
|
82 |
<span class="pull-right"><input name="restricted" value="true" id="restricted" type="checkbox"> Restricted?</span>
|
| 79 |
<select name="catalogId" id="catalogId" class="form-select catalogId" required>
|
83 |
<select name="catalogId" id="catalogId" class="form-select catalogId" required>
|
| 80 |
<option value="">Select</option>
|
84 |
<option value="">Select</option>
|
| 81 |
#foreach($entry in $catalogs)
|
85 |
#foreach($entry in $catalogs)
|
| 82 |
<option value="$entry.catalogId" data-qty="$entry.shaholicNetAvailability">$entry.brand $entry.modelNumber ($entry.shaholicNetAvailability)</option>
|
86 |
<option value="$entry.catalogId" data-qty="$entry.shaholicNetAvailability">$entry.brand $entry.modelNumber ($entry.shaholicNetAvailability)</option>
|
| Line 85... |
Line 89... |
| 85 |
</div>
|
89 |
</div>
|
| 86 |
</div>
|
90 |
</div>
|
| 87 |
|
91 |
|
| 88 |
<div class="col-md-5">
|
92 |
<div class="col-md-5">
|
| 89 |
<div class="form-group">
|
93 |
<div class="form-group">
|
| 90 |
<label for="price" class="form-label">Bidding Price</label>
|
94 |
<label for="price" class="form-label">Bidding Price <span class="text-danger">*</span></label>
|
| 91 |
<input type="number" name="price" id="price" class="form-control" required>
|
95 |
<input type="number" name="price" id="price" class="form-control" required>
|
| 92 |
</div>
|
96 |
</div>
|
| 93 |
</div>
|
97 |
</div>
|
| 94 |
|
98 |
|
| 95 |
<div class="col-md-3">
|
99 |
<div class="col-md-3">
|
| 96 |
<div class="form-group">
|
100 |
<div class="form-group">
|
| 97 |
<label for="incrementStep" class="form-label">Increment Step</label>
|
101 |
<label for="incrementStep" class="form-label">Increment Step <span class="text-danger">*</span></label>
|
| 98 |
<input type="number" name="incrementStep" id="incrementStep" class="form-control" required value="10">
|
102 |
<input type="number" name="incrementStep" id="incrementStep" class="form-control" required value="10">
|
| 99 |
</div>
|
103 |
</div>
|
| 100 |
</div>
|
104 |
</div>
|
| 101 |
|
- |
|
| 102 |
<div class="col-md-3">
|
105 |
<div class="col-md-7">
|
| - |
|
106 |
<div class="row">
|
| - |
|
107 |
<div class="col-md-6">
|
| 103 |
<div class="form-group">
|
108 |
<div class="form-group">
|
| 104 |
<label for="startDate" class="form-label">Start Date</label>
|
109 |
<label for="startDate" class="form-label">Start Date <span class="text-danger">*</span></label>
|
| 105 |
<input type="datetime-local" name="startDate" id="startDate" class="form-control" required>
|
110 |
<input type="datetime-local" name="startDate" id="startDate" class="form-control" required>
|
| 106 |
</div>
|
111 |
</div>
|
| 107 |
</div>
|
112 |
</div>
|
| 108 |
|
113 |
|
| 109 |
<div class="col-md-3">
|
114 |
<div class="col-md-6">
|
| 110 |
<div class="form-group">
|
115 |
<div class="form-group">
|
| 111 |
<label for="endDate" class="form-label">End Date</label>
|
116 |
<label for="endDate" class="form-label">End Date <span class="text-danger">*</span></label>
|
| 112 |
<input type="datetime-local" name="endDate" id="endDate" class="form-control" required>
|
117 |
<input type="datetime-local" name="endDate" id="endDate" class="form-control" required>
|
| - |
|
118 |
</div>
|
| - |
|
119 |
</div>
|
| 113 |
</div>
|
120 |
</div>
|
| 114 |
</div>
|
121 |
</div>
|
| 115 |
|
- |
|
| 116 |
<div class="col-md-3">
|
122 |
<div class="col-md-2">
|
| 117 |
<div class="form-group">
|
123 |
<div class="form-group">
|
| 118 |
<label for="status" class="form-label">Status</label>
|
124 |
<label for="status" class="form-label">Status <span class="text-danger">*</span></label>
|
| 119 |
<select name="status" id="status" class="form-select">
|
125 |
<select name="status" id="status" class="form-select">
|
| 120 |
<option value="ACTIVE">Active</option>
|
126 |
<option value="ACTIVE">Active</option>
|
| 121 |
<option value="INACTIVE">Inactive</option>
|
127 |
<option value="INACTIVE">Inactive</option>
|
| 122 |
<option value="CLOSED">Closed</option>
|
128 |
<option value="CLOSED">Closed</option>
|
| 123 |
</select>
|
129 |
</select>
|
| 124 |
</div>
|
130 |
</div>
|
| 125 |
</div>
|
131 |
</div>
|
| - |
|
132 |
<input type="file" id="real-file" style="display: none;">
|
| - |
|
133 |
<input type="hidden" name="mediaId" id="mediaId" value="0">
|
| 126 |
</form>
|
134 |
</form>
|
| 127 |
</div>
|
135 |
</div>
|
| 128 |
<div class="modal-footer">
|
136 |
<div class="modal-footer">
|
| - |
|
137 |
<div class="row">
|
| - |
|
138 |
<div class="col-md-6">
|
| - |
|
139 |
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
| - |
|
140 |
<button type="button" class="btn btn-primary save-liquidation">Save</button>
|
| - |
|
141 |
</div>
|
| - |
|
142 |
</div>
|
| - |
|
143 |
</div>
|
| - |
|
144 |
</div>
|
| - |
|
145 |
</div>
|
| - |
|
146 |
</div>
|
| - |
|
147 |
|
| - |
|
148 |
<div id="publishLiquidationModal" class="modal" role="dialog">
|
| - |
|
149 |
<div class="modal-dialog">
|
| - |
|
150 |
<div class="modal-content modal-lg">
|
| - |
|
151 |
<div class="modal-header">
|
| - |
|
152 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
| - |
|
153 |
<h4 class="modal-title">Publish Bids</h4>
|
| - |
|
154 |
</div>
|
| - |
|
155 |
<div class="modal-body" id="manageLiquidationModalBody">
|
| - |
|
156 |
<div class="col-md-12">
|
| - |
|
157 |
<div class="row">
|
| - |
|
158 |
<div class="col-md-3"></div>
|
| - |
|
159 |
<div class="col-md-6 text-center">
|
| - |
|
160 |
<input type="file" accept="image/*" id="real-file" style="display: none;">
|
| - |
|
161 |
<input type="hidden" id="mediaId">
|
| - |
|
162 |
<button class="btn btn-success" id="add-media">Choose file</button>
|
| - |
|
163 |
<br>
|
| - |
|
164 |
<span id="file-name"></span>
|
| - |
|
165 |
<img src="" alt="" id="imgPreview" width="100%">
|
| - |
|
166 |
</div>
|
| - |
|
167 |
</div>
|
| - |
|
168 |
</div>
|
| - |
|
169 |
<table class="table table-bordered" id="liquidation-table">
|
| - |
|
170 |
<thead class="table-light">
|
| - |
|
171 |
<tr>
|
| - |
|
172 |
<th></th>
|
| - |
|
173 |
<th>Catalog</th>
|
| - |
|
174 |
<th>Start Price</th>
|
| - |
|
175 |
<th>Start - End</th>
|
| - |
|
176 |
<th>Status</th>
|
| - |
|
177 |
</tr>
|
| - |
|
178 |
</thead>
|
| - |
|
179 |
<tbody>
|
| - |
|
180 |
#foreach($item in $liquidations)
|
| - |
|
181 |
#if($item.status == "ACTIVE")
|
| - |
|
182 |
<tr>
|
| - |
|
183 |
<td><input type="checkbox" class="selectLiquidations" value="$item.getId()"></td>
|
| - |
|
184 |
<td>$saholicStockMap.get($item.catalogId).getBrand() $saholicStockMap.get($item.catalogId).getModelNumber()</td>
|
| - |
|
185 |
<td>$item.price</td>
|
| - |
|
186 |
<td>$item.startDate.format($dateTimeFormatter) - $item.endDate.format($dateTimeFormatter)</td>
|
| - |
|
187 |
<td>$item.status</td>
|
| - |
|
188 |
</tr>
|
| - |
|
189 |
#end
|
| - |
|
190 |
#end
|
| - |
|
191 |
</tbody>
|
| - |
|
192 |
</table>
|
| - |
|
193 |
</div>
|
| - |
|
194 |
<div class="modal-footer">
|
| 129 |
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
195 |
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
| 130 |
<button type="button" class="btn btn-primary save-liquidation">Save</button>
|
196 |
<button type="button" class="btn btn-primary publish-liquidation">Publish</button>
|
| 131 |
</div>
|
197 |
</div>
|
| 132 |
</div>
|
198 |
</div>
|
| 133 |
</div>
|
199 |
</div>
|
| 134 |
</div>
|
- |
|
| 135 |
|
200 |
</div>
|
| - |
|
201 |
|
| - |
|
202 |
<script>
|
| - |
|
203 |
$(function() {
|
| - |
|
204 |
const realFileInput = $("#real-file");
|
| - |
|
205 |
const addMedia = $("#add-media");
|
| - |
|
206 |
const fileNameDisplay = $("#file-name");
|
| - |
|
207 |
addMedia.click(function(){
|
| - |
|
208 |
realFileInput.click();
|
| - |
|
209 |
});
|
| - |
|
210 |
|
| - |
|
211 |
realFileInput.change(function(event) {
|
| - |
|
212 |
const files = event.target.files;
|
| - |
|
213 |
console.log("change triggered", files);
|
| - |
|
214 |
if (files.length > 0) {
|
| - |
|
215 |
var output = document.getElementById('imgPreview');
|
| - |
|
216 |
output.src = URL.createObjectURL(event.target.files[0]);
|
| - |
|
217 |
output.onload = function() {
|
| - |
|
218 |
URL.revokeObjectURL(output.src)
|
| - |
|
219 |
}
|
| - |
|
220 |
fileNameDisplay.text(files[0].name);
|
| - |
|
221 |
uploadDocument(files[0], function (documentId) {
|
| - |
|
222 |
$('#mediaId').val(documentId);
|
| - |
|
223 |
});
|
| - |
|
224 |
} else {
|
| - |
|
225 |
fileNameDisplay.text("No file chosen");
|
| - |
|
226 |
}
|
| - |
|
227 |
});
|
| - |
|
228 |
});
|
| - |
|
229 |
</script>
|
| - |
|
230 |
|
| 136 |
|
231 |
|