Subversion Repositories SmartDukaan

Rev

Rev 34546 | Rev 34577 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34546 Rev 34568
Line 48... Line 48...
48
            <tbody>
48
            <tbody>
49
                #foreach($item in $liquidations)
49
                #foreach($item in $liquidations)
50
                    <tr>
50
                    <tr>
51
                        <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>
52
                        <td>$item.price</td>
52
                        <td>$item.price</td>
53
                        <td>#if($bidsMap.get($item.getId()).size() > 0) $bidsMap.get($item.getId()).size() #else 0 #end</td>
53
                        <td>#if($bidsMap.get($item.getId()).size() > 0)
-
 
54
                            <a role="button" onclick="viewBids($item.getId(), `$saholicStockMap.get($item.catalogId).getBrand() $saholicStockMap.get($item.catalogId).getModelNumber()`)">
-
 
55
                                $bidsMap.get($item.getId()).size()
-
 
56
                            </a>
-
 
57
                            #else 0 #end
-
 
58
                        </td>
54
                        <td>$item.startDate.format($dateTimeFormatter) - $item.endDate.format($dateTimeFormatter)</td>
59
                        <td>$item.startDate.format($dateTimeFormatter) - $item.endDate.format($dateTimeFormatter)</td>
55
                        <td>$item.status</td>
60
                        <td>$item.status</td>
56
                        <td>
61
                        <td>
57
                            <a role="button" onclick="editLiquidation($item.id)" class="btn btn-sm btn-info"><i class="fa fa-eye"></i> View</a>
62
                            <a role="button" onclick="editLiquidation($item.id)" class="btn btn-sm btn-info"><i class="fa fa-eye"></i> View</a>
58
                            #*<a role="button" onclick="deleteLiquidation($item.id)" class="btn btn-sm btn-danger">Delete</a>*#
63
                            #*<a role="button" onclick="deleteLiquidation($item.id)" class="btn btn-sm btn-danger">Delete</a>*#
Line 197... Line 202...
197
            </div>
202
            </div>
198
        </div>
203
        </div>
199
    </div>
204
    </div>
200
</div>
205
</div>
201
 
206
 
-
 
207
<div id="biddingListModal" class="modal" role="dialog">
-
 
208
    <div class="modal-dialog">
-
 
209
        <div class="modal-content modal-lg">
-
 
210
            <div class="modal-header">
-
 
211
                <button type="button" class="close" data-dismiss="modal">&times;</button>
-
 
212
                <h4 class="modal-title"><span id="catalogName"></span></h4>
-
 
213
            </div>
-
 
214
            <div class="modal-body" id="bidListModalBody">
-
 
215
                <table class="table table-bordered" id="bids-table">
-
 
216
                    <thead class="table-light">
-
 
217
                        <tr>
-
 
218
                            <th></th>
-
 
219
                            <th>Retailer</th>
-
 
220
                            <th>Bid Quantity</th>
-
 
221
                            <th>Bid Price</th>
-
 
222
                            <th>Bid Time</th>
-
 
223
                            <th>Status</th>
-
 
224
                        </tr>
-
 
225
                    </thead>
-
 
226
                    <tbody id="bidsList"></tbody>
-
 
227
                </table>
-
 
228
            </div>
-
 
229
            <div class="modal-footer">
-
 
230
                <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
-
 
231
                <button type="button" class="btn btn-primary publish-liquidation">Publish</button>
-
 
232
            </div>
-
 
233
        </div>
-
 
234
    </div>
-
 
235
</div>
-
 
236
 
202
<script>
237
<script>
203
    $(function() {
238
    $(function() {
204
        const realFileInput = $("#real-file");
239
        const realFileInput = $("#real-file");
205
        const addMedia = $("#add-media");
240
        const addMedia = $("#add-media");
206
        const fileNameDisplay = $("#file-name");
241
        const fileNameDisplay = $("#file-name");
Line 224... Line 259...
224
            } else {
259
            } else {
225
                fileNameDisplay.text("No file chosen");
260
                fileNameDisplay.text("No file chosen");
226
            }
261
            }
227
        });
262
        });
228
    });
263
    });
-
 
264
 
-
 
265
    function viewBids(liquidationId, catalogName){
-
 
266
        const bidsMap = $!bidsMapJson;
-
 
267
        const retailerMap = $!retailersJson;
-
 
268
        let html = '';
-
 
269
        console.log("bidsMap[liquidationId]",bidsMap[liquidationId])
-
 
270
        if (bidsMap.hasOwnProperty(liquidationId) && bidsMap[liquidationId].length) {
-
 
271
            bidsMap[liquidationId].forEach((bid, index) => {
-
 
272
                html += `<tr>
-
 
273
                <td>${(index+1)}</td>
-
 
274
                <td>${(retailerMap[bid.fofoId].displayName)}</td>
-
 
275
                <td>${bid.quantity}</td>
-
 
276
                <td>${(bid.biddingAmount.toLocaleString())}</td>
-
 
277
                <td>${(bid.createdAt.split('T')).join(" ")}</td>
-
 
278
                <td>${bid.status}</td>
-
 
279
            </tr>`;
-
 
280
            });
-
 
281
            $('#catalogName').text(catalogName);
-
 
282
            $('#bidsList').html(html);
-
 
283
            $('#biddingListModal').modal('show');
-
 
284
        } else {
-
 
285
            alert(`No Bids found for ${catalogName}`);
-
 
286
        }
-
 
287
    }
229
</script>
288
</script>
230
289