Subversion Repositories SmartDukaan

Rev

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

Rev 30017 Rev 30073
Line 9... Line 9...
9
    </div>
9
    </div>
10
 
10
 
11
    <div class="row" style="background:white;background-color:white;padding:10px;min-height:600px">
11
    <div class="row" style="background:white;background-color:white;padding:10px;min-height:600px">
12
 
12
 
13
        <form>
13
        <form>
-
 
14
            <div class="row">
14
            <div class="col-lg-2">
15
                <div class="col-lg-2">
15
                <div class="form-group">
16
                    <div class="form-group">
16
                    <label for="exampleFormControlSelect1">Select Warehouse</label>
17
                        <label for="warehouseId">Select Warehouse</label>
17
                    <select class="form-control" id="warehouseId">
18
                        <select class="form-control" id="warehouseId">
18
                        #foreach($warehouse in $warehouses.entrySet())
19
                            #foreach($warehouse in $warehouses.entrySet())
19
                            <option value="$warehouse.getKey()">$warehouse.getValue()</option>
20
                                <option value="$warehouse.getKey()">$warehouse.getValue()</option>
20
                        #end
21
                            #end
21
                    </select>
22
                        </select>
-
 
23
                    </div>
-
 
24
                </div>
-
 
25
                <div class="col-lg-4">
-
 
26
                    <label for="entityData">Choose Model</label>
-
 
27
                    <div class="input-group">
-
 
28
                        <input type="text" class="form-control typeahead" id="entityData"
-
 
29
                               placeholder="Search Models">
-
 
30
                        <span class="input-group-btn">
-
 
31
                            <button id="model-to-notify" class="btn btn-default" type="button">Add Model</button>
-
 
32
                        </span>
-
 
33
                    </div>
-
 
34
                </div>
-
 
35
                <div class="col-lg-2">
-
 
36
                    <label for="entityData">&nbsp;</label><br>
-
 
37
                    <button id="po-notify-send" class="btn btn-primary" type="button">Send Notification</button>
22
                </div>
38
                </div>
23
            </div>
39
            </div>
-
 
40
            <div class="row">
24
            <div class="col-lg-3">
41
                <div class="col-lg-8">
25
                <label for="exampleFormControlSelect1">Choose Model</label>
42
                    <table id="catalog-id-container" class="table table-striped">
26
                <div class="input-group">
43
                        <tr>
27
                    <input type="text" class="form-control typeahead" id="entityData"
44
                            <th>Model Name</th>
28
                           placeholder="Search Models"> <span class="input-group-btn">
45
                            <th>Action</th>
-
 
46
                        </tr>
-
 
47
                        <tbody>
29
				<button id="model-to-notify" class="btn btn-default" type="button">Select Model</button>
48
                        </tbody>
30
			</span>
49
                    </table>
31
                </div>
50
                </div>
32
            </div>
51
            </div>
33
        </form>
52
        </form>
34
    </div>
53
    </div>
35
</section>
54
</section>
Line 38... Line 57...
38
        getEntityAheadOptions($("#entityData"), function (selectedEntity) {
57
        getEntityAheadOptions($("#entityData"), function (selectedEntity) {
39
            itemCatalogId = selectedEntity.catalogId_i;
58
            itemCatalogId = selectedEntity.catalogId_i;
40
            itemTitle = selectedEntity.title_s
59
            itemTitle = selectedEntity.title_s
41
        });
60
        });
42
        $("#model-to-notify").click(function () {
61
        $("#model-to-notify").click(function () {
-
 
62
            let container = `<tr data-id="${itemCatalogId}">
-
 
63
                    <td>${itemTitle}</td>
-
 
64
                    <td><button class="btn btn-sm btn-primary mk_remove_model" type="button">Remove Model</button></td>
-
 
65
                </div>`;
-
 
66
            $("#catalog-id-container").append(container);
-
 
67
        });
-
 
68
        let catalogIds = [];
-
 
69
        $("#po-notify-send").click(function () {
43
            colorNumberHandler(itemCatalogId, 0, 'Notify for ' + itemTitle, 'Notify', function (itemQuantity, callback) {
70
            $("#catalog-id-container").toArray().forEach(function (index, ele) {
-
 
71
                catalogIds.push($(ele).data('id'));
-
 
72
            });
-
 
73
            if (catalogIds.length == 0) {
-
 
74
                alert("please select models");
-
 
75
            }
-
 
76
            if (confirm("Send Notification?")) {
-
 
77
 
44
                let poItemWarehouseModel = {
78
                let poItemWarehouseModel = {
45
                    warehouseId: $("#warehouseId").val(),
79
                    warehouseId: $("#warehouseId").val(),
46
                    itemIdQuantityList: itemQuantity
80
                    catalogIds: catalogIds
47
                }
81
                }
48
                doPostAjaxRequestWithJsonHandler(`${context}/indent/send-po-notification`, JSON.stringify(poItemWarehouseModel), function (response) {
82
                doPostAjaxRequestWithJsonHandler(`${context}/indent/send-po-notification`, JSON.stringify(poItemWarehouseModel), function (response) {
49
                    if (response) {
83
                    if (response) {
50
                        alert("Notified Successfully");
84
                        alert("Notified Successfully");
51
                    }
85
                    }
52
                    callback();
-
 
53
                })
86
                });
54
            })
87
            }
-
 
88
 
55
        });
89
        });
56
    });
90
    });
57
</script>
91
</script>