Subversion Repositories SmartDukaan

Rev

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

Rev 34445 Rev 34546
Line 49... Line 49...
49
        });
49
        });
50
});
50
});
51
 
51
 
52
$(document).on('click', ".save-liquidation", function () {
52
$(document).on('click', ".save-liquidation", function () {
53
    const params = serializeFormToJson('form#biddingForm');
53
    const params = serializeFormToJson('form#biddingForm');
54
    params.restricted = $('#restricted:checked').length
54
    params.restricted = $('#restricted:checked').length;
-
 
55
    if (!params.catalogId || params.catalogId === "") {
-
 
56
        alert("Please select the catalog");
-
 
57
        return false;
-
 
58
    }
-
 
59
    if (!params.price || params.price === "") {
-
 
60
        alert("Bidding Price can not be empty");
-
 
61
        return false;
-
 
62
    }
-
 
63
    if (!params.startDate || params.startDate === "") {
-
 
64
        alert("Please select the start date");
-
 
65
        return false;
-
 
66
    }
-
 
67
    if (!params.endDate || params.endDate === "") {
-
 
68
        alert("Please select the end date");
-
 
69
        return false;
-
 
70
    }
55
    doAjaxRequestWithJsonHandler(context + "/liquidation", "POST", JSON.stringify(params), (response) => {
71
    doAjaxRequestWithJsonHandler(context + "/liquidation", "POST", JSON.stringify(params), (response) => {
56
        if (response) {
72
        if (response) {
57
            $('.liquidation-list').trigger('click');
73
            $('.liquidation-list').trigger('click');
58
            $('#manageLiquidationModal').modal('hide');
74
            $('#manageLiquidationModal').modal('hide');
59
            alert("Saved successfully");
75
            alert("Saved successfully");
Line 94... Line 110...
94
        } else {
110
        } else {
95
            alert("Liquidation not found");
111
            alert("Liquidation not found");
96
        }
112
        }
97
    }
113
    }
98
}
114
}
-
 
115
 
-
 
116
$(document).on('click','.publish-liquidation', function () {
-
 
117
    const mediaId = $('#mediaId').val();
-
 
118
    const liquidationIds = $('.selectLiquidations:checked').map(function() { return $(this).val();}).get().join(',');
-
 
119
    doAjaxRequestWithJsonHandler(context + "/liquidation/publish", "POST", JSON.stringify({'mediaId': mediaId,'liquidationIds':liquidationIds}), (response) => {
-
 
120
        if (response) {
-
 
121
            $('.liquidation-list').trigger('click');
-
 
122
            $('#publishLiquidationModal').modal('hide');
-
 
123
            alert("Published successfully!");
-
 
124
        } else {
-
 
125
            alert("Something went wrong!");
-
 
126
        }
-
 
127
    });
-
 
128
});
99
129