Iniit
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
var Bizgaze;
|
||||
(function (Bizgaze) {
|
||||
let Apps;
|
||||
(function (Apps) {
|
||||
let Transact;
|
||||
(function (Transact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Forecast extends Unibase.Platform.Core.BaseComponent {
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, PortletWidgetId) {
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
jsFiles() {
|
||||
return ["apps/transact/managers/forecast/forecastmanager.js", 'apps/transact/components/forecast.js'];
|
||||
}
|
||||
html(id) {
|
||||
return `<div class="card border-0 shadow p-3">
|
||||
<div id="div_configError" class="clear"></div>
|
||||
<div class="check_in_body">
|
||||
<div id="div_Duration" class="">
|
||||
<label id="lbl_Duration">Days</label>
|
||||
<div class="input-group">
|
||||
<input type="number" id="txt_Duration" class="type-control validationss form-control" data-isdefault="false" data-required="false" data-regularexp="" data-validatemsg="" value="" data-isdynamic="false" data-label="Days" data-placeholder="Enter Days" placeholder="Enter Days">
|
||||
<div class="input-group-btn Div_AlertTime">
|
||||
<select id="ddl_AlertTime" class="form-control" onchange="javascript:Bizgaze.Apps.Transact.Components.Forecast.Instance().changeDuration()">
|
||||
<option value="1">Days</option>
|
||||
<option value="2">Months</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between pb-1">
|
||||
<span class="biz-highlight-bg-color font-weight-400 font-16"></span>
|
||||
<div style="background-color:#FFFFFF;">
|
||||
<br>
|
||||
<h1></h1>
|
||||
<div class="button">
|
||||
<button class="btn btn-outline-primary btn-forecastbutton" id="forecastbutton" style="width:700 height=110" onclick="javascript:Bizgaze.Apps.Transact.Components.Forecast.Instance()">ForeCast</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
}
|
||||
init(Containerid) {
|
||||
var instance = this;
|
||||
var html = instance.html(Containerid);
|
||||
$("." + Containerid).append(html);
|
||||
instance.load(0, Containerid, null);
|
||||
$("#forecastbutton").click(function () {
|
||||
var duration = $("#txt_Duration").val();
|
||||
var wise = "";
|
||||
if ($("#ddl_AlertTime").val() == 1)
|
||||
wise = "days";
|
||||
else if ($("#ddl_AlertTime").val() == 2)
|
||||
wise = "months";
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().showLoading();
|
||||
instance.forecastbutton(wise, duration);
|
||||
});
|
||||
}
|
||||
forecastbutton(wise, duration) {
|
||||
var instance = this;
|
||||
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("apps/transact/managers/forecast/forecastmanager.js", function () {
|
||||
Bizgaze.Apps.Transact.Managers.Forecast.ForecastManager.Instance().executeforecastdata(wise, duration).then((response) => {
|
||||
Unibase.Platform.Helpers.NavigationHelper.Instance().hideLoading();
|
||||
if (response.status == Unibase.Data.Status.Success)
|
||||
MessageHelper.Instance().showSuccess(response.message, '');
|
||||
else
|
||||
MessageHelper.Instance().showError(response.code, 'div_configError');
|
||||
});
|
||||
});
|
||||
}
|
||||
changeDuration() {
|
||||
var DurationType = $('#ddl_AlertTime').val();
|
||||
if (DurationType == 1) {
|
||||
$("input").focus(function () {
|
||||
$("#txt_Duration").attr('placeholder', 'Enter Days');
|
||||
});
|
||||
$("input").blur(function () {
|
||||
$("#txt_Duration").attr('placeholder', 'Days');
|
||||
});
|
||||
$('#txt_Duration').removeAttr('placeholder');
|
||||
$('#lbl_Duration').text('Days');
|
||||
$("#txt_Duration").attr('placeholder', 'Enter Days');
|
||||
$("#txt_Duration").attr('data-label', 'Days');
|
||||
$("#txt_Duration").attr('data-placeholder', 'Enter Days');
|
||||
}
|
||||
else if (DurationType == 2) {
|
||||
$("input").focus(function () {
|
||||
$("#txt_Duration").attr('placeholder', 'Enter Months');
|
||||
});
|
||||
$("input").blur(function () {
|
||||
$("#txt_Duration").attr('placeholder', 'Months');
|
||||
});
|
||||
$('#txt_Duration').removeAttr('placeholder');
|
||||
$('#lbl_Duration').text('Months');
|
||||
$("#txt_Duration").attr('placeholder', 'Enter Months');
|
||||
$("#txt_Duration").attr('data-label', 'Months');
|
||||
$("#txt_Duration").attr('data-placeholder', 'Enter Months');
|
||||
}
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new Forecast();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.Forecast = Forecast;
|
||||
})(Components = Transact.Components || (Transact.Components = {}));
|
||||
})(Transact = Apps.Transact || (Apps.Transact = {}));
|
||||
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
|
||||
})(Bizgaze || (Bizgaze = {}));
|
||||
Reference in New Issue
Block a user