Iniit
This commit is contained in:
@@ -0,0 +1,526 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Series;
|
||||
(function (Series) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class CreateSeries extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.InstalledAppId = 0;
|
||||
this.seriesManager = Series.Managers.SeriesManager.Instance();
|
||||
this.companymanager = Bizgaze.Apps.CRM.Companies.Managers.CompanyManager.Instance();
|
||||
}
|
||||
jsFiles() {
|
||||
return ['platform/series/managers/seriesmanager.js', 'apps/crm/companies/managers/companymanager.js', 'platform/series/components/series.js', "platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', 'platform/core/infos/status.js', 'platform/series/requests/series.js'];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = `<form id="frm_CreateSeries" method="post" data-validate="parsley">
|
||||
<div class="b-b bg-white header">
|
||||
<strong class="text-dark Title sp_title">Create Series</strong>
|
||||
</div>
|
||||
<div data-simplebar class="simple-scroll-bar scrollable control-sorting">
|
||||
<div id="div_SeriesMessage" class="clear">
|
||||
</div>
|
||||
<div class="section_Details card">
|
||||
<div class="card-body">
|
||||
<div class="row div_SName">
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_SeriesName">
|
||||
<label for="lblSeriesName" id="lbl_SeriesName">Series Name<span class="text-danger"> *</span></label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="txt_SeriesName" class="form-control required floating-label-control" data-isdynamic="false" placeholder="Series Name *" data-placeholder="Enter Series Name" data-label="Series Name *" />
|
||||
<input type="hidden" id="hf_StatusId" value="1" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6" id="div_AppliedFor">
|
||||
<label for="lblAppliedFor" id="lbl_AppliedFor">Applied For<span class="text-danger"> *</span></label>
|
||||
<select style="width:100%" id="txt_AppliedFor" class="form-control txt_AppliedFor required value-control floating-label-control" data-isdynamic="false" placeholder="Applied For" data-placeholder="Applied For" data-label="Applied For">
|
||||
</select>
|
||||
<input type="hidden" id="hf_AppliedFor" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row div_SFormat">
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_SeriesFormat">
|
||||
<label for="lblSeriesFormat" id="lbl_SeriesFormat">Series Format<span class="text-danger"> *</span></label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="txt_SeriesFormat" class="form-control required floating-label-control" data-isdynamic="false" data-placeholder="SE/{{SN}}" data-label="Series Format *" placeholder="Series Format *" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_StartingNo">
|
||||
<label for="lblStartingNo" id="lbl_StartingNo">Starting No<span class="text-danger"> *</span></label>
|
||||
<input type="text" id="txt_StartingNo" class="form-control required floating-label-control" data-isdynamic="false" data-placeholder="1" data-label="Starting No *" placeholder="Starting No *"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row div_Format">
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_NumberSize">
|
||||
<label for="lblNumberSize" id="lbl_NumberSize">Number Size<span class="text-danger"> *</span></label>
|
||||
<input type="text" id="txt_NumberSize" class="form-control required floating-label-control" data-isdynamic="false" data-placeholder="4" data-label="Number Size *" placeholder="Number Size *" maxlength="1" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_NumberPrefix">
|
||||
<label for="lblNumberPrefix" id="lbl_NumberPrefix">Number Prefix<span class="text-danger"> *</span></label>
|
||||
<input type="text" id="txt_NumberPrefix" class="form-control required floating-label-control" data-isdynamic="false" data-placeholder="0" data-label="Number Prefix *" placeholder="Number Prefix *" maxlength="1"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row div_Dates">
|
||||
<div class="col-sm-6 ">
|
||||
<div class="floating-label-form-group floating-label-form-group-with-value" id="div_FromDate">
|
||||
<label for="lblFromDate" id="lbl_FromDate">From Date<span class="text-danger"> *</span></label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="txt_fromdate" class="form-control value-control datepicker-input hasDatepicker required" data-date-format="dd/MM/yyyy" data-isdynamic="false" placeholder="From Date *" data-placeholder="dd/mm/yyyy" data-label="From Date *" />
|
||||
<a class="input-group-addon bg-white no-borders"><i class="fa fa-calendar"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group floating-label-form-group-with-value" id="div_ToDate">
|
||||
<label for="lblToDate" id="lbl_ToDate">To Date<span class="text-danger"> *</span></label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="txt_ToDate" class="form-control value-control datepicker-input hasDatepicker required" data-date-format="dd/MM/yyyy" data-isdynamic="false" placeholder="To Date *" data-placeholder="dd/mm/yyyy" data-label="To Date *" readonly="true" />
|
||||
<a class="input-group-addon bg-white no-borders"><i class="fa fa-calendar"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row div_ManualNum">
|
||||
<div class="col-sm-6 mt-30">
|
||||
<div class="form-group floating-label focus" id="div_istodate">
|
||||
<label for="frm_chk_istodate" id="lbl_istodate">Is To Date Undefined</label>
|
||||
<label class="switch pull-right">
|
||||
<input type="checkbox" id="chk_istodate" data-isdynamic="false" />
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 mt-30">
|
||||
<div class="form-group floating-label focus" id="div_ManualNumbering">
|
||||
<label for="frm_chk_ManualNumbering" id="lbl_ManualNumbering"><strong>Manual Numbering</strong></label>
|
||||
<label class="switch pull-right">
|
||||
<input type="checkbox" id="chk_ManualNumbering" data-isdynamic="false" />
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row div_SerialnumberSettings">
|
||||
<div class="col-sm-6 mt-30">
|
||||
<div class="form-group floating-label focus" id="div_IsRandom">
|
||||
<label for="frm_chk_IsRandom" id="lbl_IsRandom"><strong>IsRandom</strong></label>
|
||||
<label class="switch pull-right">
|
||||
<input type="hidden" id="hf_IsRandom" value="" />
|
||||
<input type="checkbox" id="chk_IsRandom" data-isdynamic="false" />
|
||||
<span></span>
|
||||
<input type="hidden" id="hf_IsRandom" value="">
|
||||
<label for="Validation" id="lblValidation_IsRandom"></label>
|
||||
<input type="hidden" id="hfFormPropertyId" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 div_SeriesType">
|
||||
<div class="form-group floating-label focus" id="divSeriesType">
|
||||
<label for="frm_chk_SeriesType" id="lbl_IsRandom">Series Type</label>
|
||||
<select id="ddl_SeriesType" class="form-control type-control value-control " placeholder = "Select SeriesType" data-placeholder="select SeriesType"><option value="0">--Select--</option><option value="1">Alphabets</option><option value="2">Numbers</option><option value="3">AlphaNumeric</option></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row div_CompnBranch">
|
||||
<div class="col-sm-6" id="div_Companies">
|
||||
<label for="lblCompanies" id="lbl_Companies">Companies</label>
|
||||
<select style="width:100%" id="sel_Companies" class="form-control txt_Companies floating-label-control" data-isdynamic="false" placeholder="Select" data-placeholder="Select" data-label="Companies" multiple="multiple">
|
||||
<input type="hidden" id="hfSelect2_Companies" class="hfSelect2_Roles' form-control value-control" data-isdynamic="true"/>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6" id="div_Branches">
|
||||
<label for="lblAppliedFor" id="lbl_Branches">Branches</label>
|
||||
<select style="width:100%" id="sel_Branches" class="form-control txt_Branches floating-label-control" data-isdynamic="false" placeholder="Select" data-placeholder="Select" data-label="Branches" multiple="multiple">
|
||||
<input type="hidden" id="hfSelect2_Branches" class="hfSelect2_Branches' form-control value-control" data-isdynamic="true"/>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section_Description card">
|
||||
<div class="card-header">Description</div>
|
||||
<div class="card-body">
|
||||
<div class="divsummernote wrapper bg-white" style="padding-top:0px;">
|
||||
<div id="div_Series_Description" data-isdynamic="false" placeholder="Description" data-placeholder="Enter Description" data-label="Description"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white footer b-t">
|
||||
<a id="btn_CloseSeries" class="btn btn-light btn-sm mr-auto btn-close"> Close</a>
|
||||
<a id="btn_SaveSeries" class="btn btn-primary btn-sm">Save</a>
|
||||
</div></form>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
instance.summernote();
|
||||
var InstalledAppId = Unibase.Platform.Series.Components.Series.Instance().InstalledAppId;
|
||||
instance.InstalledAppId = InstalledAppId;
|
||||
$('#txt_StartingNo').addClass('numberonly');
|
||||
$('#txt_NumberSize').addClass('numberonly');
|
||||
$('#txt_NumberPrefix').addClass('numberonly');
|
||||
$('.numberonly').keypress(function (event) {
|
||||
if ((event.which > 47 && event.which < 58)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}).on('paste', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
$("#txt_ToDate,#txt_fromdate").keypress(function (event) {
|
||||
if ((event.which > 44 && event.which < 58)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
var currentdate = new Date();
|
||||
var datetime = currentdate.getDate() + "/"
|
||||
+ (currentdate.getMonth() + 1) + "/"
|
||||
+ currentdate.getFullYear() + " ";
|
||||
$("#txt_fromdate").val("" + datetime + "");
|
||||
currentdate.setDate(currentdate.getDate() + 364);
|
||||
var datetime1 = currentdate.getDate() + "/"
|
||||
+ (currentdate.getMonth() + 1) + "/"
|
||||
+ (currentdate.getFullYear()) + " ";
|
||||
$('#txt_fromdate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
})
|
||||
.change(dateChanged)
|
||||
.on('changeDate', dateChanged);
|
||||
$("#txt_ToDate").val("" + datetime1 + "");
|
||||
$('#txt_ToDate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
minDate: datetime,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
});
|
||||
`1`;
|
||||
function dateChanged(ev) {
|
||||
var DateSplit = $("#txt_fromdate").val().toString().split('/');
|
||||
var DateArray = DateSplit.filter(function (v) { return v !== ''; });
|
||||
var Only = DateArray[2].split(" ");
|
||||
var onlyYear = parseInt(Only[0]);
|
||||
var fromdate = new Date(moment($("#txt_fromdate").val(), "DD/MM/YYYY").format("YYYY/MM/DD"));
|
||||
var todate_min = new Date(moment($("#txt_fromdate").val(), "DD/MM/YYYY").format("YYYY/MM/DD"));
|
||||
fromdate.setDate(fromdate.getDate() + 364);
|
||||
var datetime1 = fromdate.getDate() + "/"
|
||||
+ (fromdate.getMonth() + 1) + "/"
|
||||
+ (fromdate.getFullYear()) + " ";
|
||||
$("#txt_ToDate").val(datetime1);
|
||||
$('#txt_ToDate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
minDate: todate_min,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
});
|
||||
}
|
||||
$("#chk_istodate").on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#txt_ToDate').prop('disabled', true);
|
||||
$('#txt_ToDate').css("cursor", "not-allowed");
|
||||
$('#txt_ToDate').removeClass("required");
|
||||
}
|
||||
else {
|
||||
$('#txt_ToDate').prop('disabled', false);
|
||||
$('#txt_ToDate').addClass("required");
|
||||
$('#txt_ToDate').removeAttr("style");
|
||||
}
|
||||
});
|
||||
$("#chk_ManualNumbering").on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#txt_StartingNo').prop('disabled', true);
|
||||
$('#txt_NumberSize').prop('disabled', true);
|
||||
$('#txt_NumberPrefix').prop('disabled', true);
|
||||
$('#txt_SeriesFormat').prop('disabled', true);
|
||||
$('#txt_StartingNo').removeClass("required");
|
||||
$('#txt_SeriesFormat').removeClass("required");
|
||||
$('#txt_NumberPrefix').removeClass("required");
|
||||
$('#txt_NumberSize').removeClass("required");
|
||||
}
|
||||
else {
|
||||
$('#txt_StartingNo').prop('disabled', false);
|
||||
$('#txt_NumberSize').prop('disabled', false);
|
||||
$('#txt_NumberPrefix').prop('disabled', false);
|
||||
$('#txt_SeriesFormat').prop('disabled', false);
|
||||
$('#txt_StartingNo').addClass("required");
|
||||
$('#txt_SeriesFormat').addClass("required");
|
||||
$('#txt_NumberPrefix').addClass("required");
|
||||
$('#txt_NumberSize').addClass("required");
|
||||
}
|
||||
});
|
||||
$("#btn_SaveSeries").click(function () {
|
||||
let appcontrolid = "frm_CreateSeries";
|
||||
let result = Unibase.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation(appcontrolid);
|
||||
if (result == false) {
|
||||
MessageHelper.Instance().showError("Mandatory fields are missing", "div_SeriesMessage");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
instance.saveSeries(containerid, id);
|
||||
}
|
||||
});
|
||||
$(".div_SeriesType").addClass('hidden');
|
||||
$("#chk_IsRandom").on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$(".div_SeriesType").removeClass('hidden');
|
||||
}
|
||||
else {
|
||||
$(".div_SeriesType").addClass('hidden');
|
||||
}
|
||||
});
|
||||
instance.loaddata(id);
|
||||
}
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
|
||||
CreateSeries.Instance().init(Pk_Value);
|
||||
}
|
||||
init(seriesid) {
|
||||
this.navigationHelper.popup(seriesid, '', Unibase.Platform.Series.Components.CreateSeries.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
loaddata(seriesid) {
|
||||
var instance = this;
|
||||
let url = _appsettings.server_url() + "/apis/v4/unibase/platform/apps/appkeyautocomplete";
|
||||
AutoCompleteHelper.getHelper().Create("#txt_AppliedFor", "#hf_AppliedFor", url, function (response) {
|
||||
});
|
||||
var companyurl = _appsettings.server_url() + '/apis/v4/bizgaze/crm/companies/getcompaniesAutoComplete';
|
||||
AutoCompleteHelper.getHelper().Create("#sel_Companies", "#hfSelect2_Companies", companyurl, function (response) {
|
||||
});
|
||||
var branchurl = _appsettings.server_url() + '/apis/v4/bizgaze/crm/companies/getbranchesAutoComplete';
|
||||
AutoCompleteHelper.getHelper().Create("#sel_Branches", "#hfSelect2_Branches", branchurl, function (response) {
|
||||
});
|
||||
if (seriesid != 0) {
|
||||
$(".sp_title").text("Edit Series");
|
||||
$("#div_AppliedFor").addClass("hidden");
|
||||
$(".div_SFormat").remove();
|
||||
$(".div_Format").remove();
|
||||
$(".div_Dates").remove();
|
||||
$(".div_ManualNum").remove();
|
||||
this.seriesManager.getSeriesById(seriesid).then(function (response) {
|
||||
$("#txt_SeriesName").val(response.result.SeriesName);
|
||||
$("#hfSeriesId").val(response.result.SeriesId);
|
||||
$("#hf_AppliedFor").val(response.result.AppKeyId);
|
||||
$("#txt_AppliedFor").removeClass('required');
|
||||
$("#div_Series_Description").summernote("code", response.result.Description);
|
||||
$("#div_SeriesName").addClass("floating-label-form-group-with-value");
|
||||
if (response.result.IsRandom == true) {
|
||||
$("#chk_IsRandom").prop("checked", true);
|
||||
$("#ddl_SeriesType").val(response.result.SeriesType);
|
||||
$(".div_SeriesType").removeClass('hidden');
|
||||
}
|
||||
if (response.result.Companies != '' && response.result.Companies != null) {
|
||||
var cids = response.result.Companies;
|
||||
var Companies = [];
|
||||
var ids = [];
|
||||
instance.companymanager.getAssignedCompanies(cids).then(function (response) {
|
||||
if (response.result != null) {
|
||||
var options = "";
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
ids.push(response.result[i].CompanyId);
|
||||
options += '<option value="' + response.result[i].CompanyId + '">' + response.result[i].CompanyName + '</option>';
|
||||
}
|
||||
$("#sel_Companies").append(options).val(ids).trigger("change");
|
||||
}
|
||||
});
|
||||
}
|
||||
if (response.result.Branches != '' && response.result.Branches != null) {
|
||||
var userid = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().userId;
|
||||
instance.companymanager.getAssignedBranches(response.result.Branches, userid).then(function (response) {
|
||||
var Branches = [];
|
||||
var Ids = [];
|
||||
if (response.result != null) {
|
||||
var options = "";
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
Ids.push(response.result[i].BranchId);
|
||||
options += '<option value="' + response.result[i].BranchId + '">' + response.result[i].BranchName + '</option>';
|
||||
}
|
||||
$("#sel_Branches").append(options).val(Ids).trigger("change");
|
||||
}
|
||||
});
|
||||
}
|
||||
$('#hf_StatusId').val(response.result.StatusId);
|
||||
});
|
||||
}
|
||||
}
|
||||
summernote() {
|
||||
$('#div_Series_Description').summernote({
|
||||
height: 100,
|
||||
minHeight: null,
|
||||
maxHeight: null,
|
||||
focus: true,
|
||||
placeholder: "Enter Description",
|
||||
codemirror: {
|
||||
mode: 'text/html',
|
||||
htmlNode: true,
|
||||
lineNumbers: true
|
||||
},
|
||||
toolbar: [
|
||||
['font', ['bold', 'italic', 'underline']],
|
||||
['color', ['color']],
|
||||
['view', ['fullscreen', 'codeview', 'help']],
|
||||
],
|
||||
});
|
||||
}
|
||||
getSelectedBranches() {
|
||||
var Branchcount = new Array();
|
||||
var branches = $('#sel_Branches').val();
|
||||
if (branches != null && branches != "null" && branches != "" && branches != undefined) {
|
||||
branches = branches.toString();
|
||||
Branchcount = branches.split(',');
|
||||
var branch = "";
|
||||
for (var i = 0; i < Branchcount.length; i++) {
|
||||
if (Branchcount[i] != "") {
|
||||
branch += "|" + Branchcount[i] + "|";
|
||||
}
|
||||
}
|
||||
return branch;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
getSelectedCompanies() {
|
||||
var companycount = new Array();
|
||||
var companies = $('#sel_Companies').val();
|
||||
if (companies != null && companies != "null" && companies != "" && companies != undefined) {
|
||||
companies = companies.toString();
|
||||
companycount = companies.split(',');
|
||||
var company = "";
|
||||
for (var i = 0; i < companycount.length; i++) {
|
||||
if (companycount[i] != "") {
|
||||
company += "|" + companycount[i] + "|";
|
||||
}
|
||||
}
|
||||
return company;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
saveSeries(containerid, id) {
|
||||
var instance = this;
|
||||
var StartingNo = 0;
|
||||
var SeriesFormat = "";
|
||||
var NumberPrefix = "";
|
||||
var NumberSize = 0;
|
||||
var fromdatestring = moment($("#txt_fromdate").val(), "DD/MM/YYYY").add(1, 'days').format("YYYY/MM/DD");
|
||||
let todatestring = moment($("#txt_ToDate").val(), "DD/MM/YYYY").add(1, 'days').format("YYYY/MM/DD");
|
||||
var todate = new Date(todatestring);
|
||||
var fromdate = new Date(fromdatestring);
|
||||
if (id == 0) {
|
||||
if ($("#chk_ManualNumbering").is(':checked')) {
|
||||
StartingNo = 0;
|
||||
SeriesFormat = "";
|
||||
NumberPrefix = "";
|
||||
NumberSize = 0;
|
||||
}
|
||||
else {
|
||||
StartingNo = Number($('#txt_StartingNo').val());
|
||||
SeriesFormat = $('#txt_SeriesFormat').val().toString();
|
||||
NumberPrefix = $('#txt_NumberPrefix').val().toString();
|
||||
NumberSize = Number($('#txt_NumberSize').val());
|
||||
}
|
||||
}
|
||||
let seriesformat = {
|
||||
SeriesId: id,
|
||||
SeriesFormatId: 0,
|
||||
StartingNumber: StartingNo,
|
||||
SeriesFormat: SeriesFormat,
|
||||
NumberPrefix: NumberPrefix,
|
||||
NumberSize: NumberSize,
|
||||
FromDate: fromdate,
|
||||
ToDate: todate,
|
||||
LastNumber: 0,
|
||||
IsToDateUndefined: $("#chk_istodate").prop('checked')
|
||||
};
|
||||
var InstalledAppId = instance.InstalledAppId;
|
||||
var AppKeyId = 0;
|
||||
if (id == 0) {
|
||||
AppKeyId = Number($("#txt_AppliedFor").val());
|
||||
}
|
||||
else {
|
||||
AppKeyId = Number($("#hf_AppliedFor").val());
|
||||
}
|
||||
var description = $('#div_Series_Description').summernote('code').toString();
|
||||
if (description == '<p><br></p>')
|
||||
description = '';
|
||||
else {
|
||||
description = $('#div_Series_Description').summernote('code').toString();
|
||||
description = description.replace('<p>', '').replace('</p>', '');
|
||||
}
|
||||
let postData = {
|
||||
SeriesId: id,
|
||||
SeriesName: $('#txt_SeriesName').val(),
|
||||
Description: description,
|
||||
AppKeyId: AppKeyId,
|
||||
CreateSeriesFormat: seriesformat,
|
||||
NumberPrefix: id == 0 ? $('#txt_NumberPrefix').val() : "",
|
||||
NumberSize: id == 0 ? Number($('#txt_NumberSize').val()) : 0,
|
||||
InstalledAppId: InstalledAppId,
|
||||
ManualNumbering: $("#chk_ManualNumbering").is(":checked"),
|
||||
Companies: this.getSelectedCompanies(),
|
||||
Branches: this.getSelectedBranches(),
|
||||
IsRandom: $("#chk_IsRandom").is(":checked"),
|
||||
SeriesType: Number($("#ddl_SeriesType option:selected").val()),
|
||||
StatusId: Number($('#hf_StatusId').val())
|
||||
};
|
||||
if (id != 0) {
|
||||
postData.CreateSeriesFormat = null;
|
||||
}
|
||||
this.seriesManager.createSeries(postData).then(function (response) {
|
||||
if (response.status == Unibase.Data.Status.Error) {
|
||||
MessageHelper.Instance().showError(response.message, 'div_SeriesMessage');
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, 'div_SeriesMessage');
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
Unibase.Platform.Series.Components.Series.Instance().load(0, '', null);
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new CreateSeries();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.CreateSeries = CreateSeries;
|
||||
})(Components = Series.Components || (Series.Components = {}));
|
||||
})(Series = Platform.Series || (Platform.Series = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+148
File diff suppressed because one or more lines are too long
@@ -0,0 +1,298 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Series;
|
||||
(function (Series) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class CreateSeriesFormat extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.seriesmanager = Series.Managers.SeriesManager.Instance();
|
||||
this.datetimehelper = Unibase.Platform.Helpers.DateTimeHelper.Instance();
|
||||
}
|
||||
jsFiles() {
|
||||
return ['platform/series/managers/seriesmanager.js', "platform/forms/components/formviewer/formviewer.js", 'libs/parsley/parsley.min.js', 'platform/core/infos/status.js', 'platform/series/components/seriesformatlist.js'];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = `<form id="form_SeriesFormat" method="post" data-validate="parsley">
|
||||
<header class="b-b bg-white modal-header">
|
||||
<strong class="text-dark Title" id="serform_title">Create Series Format</strong>
|
||||
<input type="hidden" id="hfSeriesFormatId" value="0" />
|
||||
<input type="hidden" id="hfSeriesId" value="0" />
|
||||
</header>
|
||||
<div class="bg-light control-sorting modal-body">
|
||||
<div id="div_SeriesFormatMessage" class="clear">
|
||||
</div>
|
||||
<div class="section_Details card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_SeriesFormat">
|
||||
<label for="lblSeriesFormat" id="lbl_SeriesFormat">Series Format<span class="text-danger">*</span></label>
|
||||
<input type="text" id="txt_SeriesFormat" maxlength="50" class="form-control required floating-label-control" data-isdynamic="false" placeholder="Series Format*" data-placeholder="SE/{{SN}}" data-label="Series Format*" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_StartingNo">
|
||||
<label for="lblStartingNo" id="lbl_StartingNo">Starting Number<span class="text-danger">*</span></label>
|
||||
<input type="text" id="txt_StartingNo" class="form-control required floating-label-control" maxlength="50" data-isdynamic="false" placeholder="Starting Number*" data-placeholder="1" data-label="Starting Number*"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_NumberSize">
|
||||
<label for="lblNumberSize" id="lbl_NumberSize">Number Size<span class="text-danger">*</span></label>
|
||||
<input type="text" id="txt_NumberSize" class="form-control required floating-label-control" maxlength="1" data-isdynamic="false" placeholder="Number Size*" data-placeholder="4" data-label="Number Size*" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group form-group floating-label focus" id="div_NumberPrefix">
|
||||
<label for="lblNumberPrefix" id="lbl_NumberPrefix">Number Prefix<span class="text-danger">*</span></label>
|
||||
<input type="text" id="txt_NumberPrefix" class="form-control required floating-label-control" maxlength="1" data-isdynamic="false" placeholder="Number Prefix*" data-placeholder="0" data-label="Number Prefix*"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group floating-label-form-group-with-value" id="div_FromDate">
|
||||
<label for="lblFromDate" id="lbl_FromDate">From Date<span class="text-danger">*</span></label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="txt_FromDate" class="form-control required floating-label-control datepicker-input" data-isdynamic="false" placeholder="From Date*" data-placeholder="dd/mm/yyyy" data-label="From Date*" />
|
||||
<a class="input-group-addon bg-white no-borders"><i class="fa fa-calendar"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="floating-label-form-group floating-label-form-group-with-value" id="div_ToDate">
|
||||
<label for="lblToDate" id="lbl_ToDate">To Date<span class="text-danger">*</span></label>
|
||||
<div class="input-group">
|
||||
<input type="text" id="txt_ToDate" class="form-control required floating-label-control datepicker-input" data-isdynamic="false" placeholder="To Date*" data-placeholder="dd/mm/yyyy" data-label="To Date*" readonly="true"/>
|
||||
<a class="input-group-addon bg-white no-borders"><i class="fa fa-calendar"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 mt-40">
|
||||
<div class="form-group floating-label focus" id="div_istodate">
|
||||
<label for="frm_chk_istodate" id="lbl_istodate">Is To Date Undefined</label>
|
||||
<label class="switch pull-right">
|
||||
<input type="hidden" id="hf_istodate" value="" />
|
||||
<input type="checkbox" id="chk_istodate" data-isdynamic="false" />
|
||||
<span></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white footer b-t pa-5 ">
|
||||
<a id="btn_CloseSeriesFormat" class="btn btn-light btn-sm mr-auto"> Close</a>
|
||||
<a id="btn_SaveSeriesFormat" class="btn btn-primary btn-sm">Save</a>
|
||||
</div>
|
||||
</form>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
$('#txt_StartingNo').addClass('numberonly');
|
||||
$('#txt_NumberSize').addClass('numberonly');
|
||||
$('#txt_NumberPrefix').addClass('numberonly');
|
||||
$('.numberonly').keypress(function (event) {
|
||||
if ((event.which > 47 && event.which < 58)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
}).on('paste', function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
$("#txt_ToDate,#txt_FromDate").keypress(function (event) {
|
||||
if ((event.which > 44 && event.which < 58)) {
|
||||
}
|
||||
else {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
$("#chk_istodate").on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#txt_ToDate').prop('disabled', true);
|
||||
$('#txt_ToDate').css("cursor", "not-allowed");
|
||||
var currentdate = new Date();
|
||||
$('#txt_ToDate').removeClass("required");
|
||||
}
|
||||
else {
|
||||
$('#txt_ToDate').prop('disabled', false);
|
||||
$('#txt_ToDate').addClass("required");
|
||||
$('#txt_ToDate').removeAttr("style");
|
||||
}
|
||||
});
|
||||
var currentdate = new Date();
|
||||
var datetime = currentdate.getDate() + "/"
|
||||
+ (currentdate.getMonth() + 1) + "/"
|
||||
+ currentdate.getFullYear() + " ";
|
||||
$("#txt_FromDate").val("" + datetime + "");
|
||||
currentdate.setDate(currentdate.getDate() + 364);
|
||||
var datetime1 = currentdate.getDate() + "/"
|
||||
+ (currentdate.getMonth() + 1) + "/"
|
||||
+ (currentdate.getFullYear()) + " ";
|
||||
$('#txt_FromDate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
})
|
||||
.change(dateChanged)
|
||||
.on('changeDate', dateChanged);
|
||||
$("#txt_ToDate").val("" + datetime1 + "");
|
||||
$('#txt_ToDate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
minDate: datetime,
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
});
|
||||
function dateChanged(ev) {
|
||||
var instance = this;
|
||||
var DateSplit = ($("#txt_FromDate").val().toString().split('/'));
|
||||
var DateArray = DateSplit.filter(function (v) { return v !== ''; });
|
||||
var Only = DateArray[2].split(" ");
|
||||
var onlyYear = parseInt(Only[0]);
|
||||
var fromdate = new Date(moment($("#txt_FromDate").val(), "DD/MM/YYYY").format("YYYY/MM/DD"));
|
||||
var todate_min = new Date(moment($("#txt_FromDate").val(), "DD/MM/YYYY").format("YYYY/MM/DD"));
|
||||
fromdate.setDate(fromdate.getDate() + 364);
|
||||
var todate = (fromdate.getDate()) + "/"
|
||||
+ (fromdate.getMonth() + 1) + "/"
|
||||
+ (fromdate.getFullYear()) + " ";
|
||||
$("#txt_ToDate").val(todate);
|
||||
$('#txt_ToDate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minYear: 1901,
|
||||
minDate: new Date(todate_min),
|
||||
maxDate: new Date(2050, 11, 31)
|
||||
});
|
||||
}
|
||||
$("#btn_CloseSeriesFormat").click(function () {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
});
|
||||
$("#btn_SaveSeriesFormat").click(function () {
|
||||
let appcontrolid = "form_SeriesFormat";
|
||||
let result = Unibase.Platform.Forms.Components.FormViewer.Instance().requiredFieldValidation(appcontrolid);
|
||||
if (result == false) {
|
||||
MessageHelper.Instance().showError("Mandatory fields are missing", "div_SeriesFormatMessage");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
instance.Saveseriesformat(id, containerid);
|
||||
}
|
||||
});
|
||||
instance.loaddata(id);
|
||||
}
|
||||
render(id) {
|
||||
this.navigationHelper.popup(id, "", Unibase.Platform.Series.Components.CreateSeriesFormat.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
loaddata(id) {
|
||||
var instance = this;
|
||||
if (id != 0) {
|
||||
instance.seriesmanager.getSeriesFormat(id).then(function (response) {
|
||||
$("#serform_title").text(" Edit Series Format");
|
||||
$("#hf_StartingNo").val(response.result.StartingNumber);
|
||||
$('#txt_SeriesFormat').val(response.result.seriesformat);
|
||||
$('#txt_NumberPrefix').val(response.result.NumberPrefix);
|
||||
$('#txt_NumberSize').val(response.result.NumberSize);
|
||||
$("#txt_FromDate").val(instance.datetimehelper.formatLocalDate1(response.result.FromDate, ''));
|
||||
var lastnumber = response.result.LastNumber;
|
||||
if (lastnumber >= response.result.StartingNumber) {
|
||||
$("#lbl_StartingNo").text("Last Number").append("<span class='text-danger'>*</span>");
|
||||
$("#txt_StartingNo").attr("placeholder", "Last Number*");
|
||||
$("#txt_StartingNo").attr("data-label", "Last Number*");
|
||||
$('#txt_StartingNo').val(lastnumber);
|
||||
}
|
||||
else {
|
||||
$('#txt_StartingNo').val(response.result.StartingNumber);
|
||||
}
|
||||
$("#hf_SeriesId").val(response.result.SeriesId);
|
||||
$("#hfSeriesFormatId").val(response.result.SeriesFormatId);
|
||||
$("#chk_istodate").prop("checked", response.result.IsToDateUndefined);
|
||||
if (response.result.IsToDateUndefined == true) {
|
||||
$('#txt_ToDate').prop('disabled', true);
|
||||
$('#txt_ToDate').css("cursor", "not-allowed");
|
||||
$('#txt_ToDate').removeClass("required");
|
||||
}
|
||||
$("#txt_ToDate").val(instance.datetimehelper.formatLocalDate1(response.result.ToDate, ''));
|
||||
$('#txt_ToDate').daterangepicker({
|
||||
locale: {
|
||||
format: 'DD/MM/YYYY',
|
||||
},
|
||||
singleDatePicker: true,
|
||||
showDropdowns: true,
|
||||
minDate: new Date(instance.datetimehelper.formatLocalDate1(response.result.FromDate, 'YYYY/MM/DD')),
|
||||
});
|
||||
$("#div_SeriesFormat").addClass("floating-label-form-group-with-value");
|
||||
$("#div_StartingNo").addClass("floating-label-form-group-with-value");
|
||||
$("#div_NumberSize").addClass("floating-label-form-group-with-value");
|
||||
$("#div_NumberPrefix").addClass("floating-label-form-group-with-value");
|
||||
});
|
||||
}
|
||||
}
|
||||
Saveseriesformat(id, containerid) {
|
||||
var instance = this;
|
||||
var fromdatestring = moment($("#txt_FromDate").val(), "DD/MM/YYYY").add(1, 'days').format("YYYY/MM/DD");
|
||||
let todatestring = moment($("#txt_ToDate").val(), "DD/MM/YYYY").add(1, 'days').format("YYYY/MM/DD");
|
||||
let todate = new Date(todatestring);
|
||||
let fromdate = new Date(fromdatestring);
|
||||
var SeriesId = Number($("#hf_seriesid").val());
|
||||
let postData = {
|
||||
SeriesId: SeriesId,
|
||||
SeriesFormatId: id,
|
||||
SeriesFormatName: $('#txt_SeriesFormat').val().toString(),
|
||||
NumberPrefix: $('#txt_NumberPrefix').val().toString(),
|
||||
NumberSize: Number($('#txt_NumberSize').val()),
|
||||
StartingNumber: Number($('#txt_StartingNo').val()),
|
||||
FromDate: fromdate,
|
||||
ToDate: todate,
|
||||
LastNumber: 0,
|
||||
IsToDateUndefined: $("#chk_istodate").prop("checked")
|
||||
};
|
||||
instance.seriesmanager.saveSeriesFormat(postData).then(function (response) {
|
||||
if (response.status == Unibase.Data.Status.Error) {
|
||||
MessageHelper.Instance().showError(response.message, 'div_SeriesFormatMessage');
|
||||
}
|
||||
else {
|
||||
MessageHelper.Instance().showSuccess(response.message, 'div_SeriesFormatMessage');
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
Components.SeriesFormatList.Instance().FormatList();
|
||||
}
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new CreateSeriesFormat();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.CreateSeriesFormat = CreateSeriesFormat;
|
||||
})(Components = Series.Components || (Series.Components = {}));
|
||||
})(Series = Platform.Series || (Platform.Series = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
File diff suppressed because one or more lines are too long
+79
File diff suppressed because one or more lines are too long
@@ -0,0 +1,165 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Series;
|
||||
(function (Series_1) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class Series extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.Status = "";
|
||||
this.InstalledAppId = 0;
|
||||
}
|
||||
jsFiles() {
|
||||
var jsfiles = ['apps/crm/companies/managers/companymanager.js',
|
||||
'platform/core/helpers/datetimehelper/datetimehelper.js',
|
||||
'platform/series/components/createseries.js',
|
||||
'platform/series/managers/seriesmanager.js',
|
||||
'platform/apps/managers/appmanager.js',
|
||||
'platform/series/components/seriesformatlist.js'
|
||||
];
|
||||
return jsfiles;
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = `<form id="BizgazeApp_Series_edit" method="post" data-validate="parsley">
|
||||
<div class="b-b bg-white header">
|
||||
<strong class="text-dark Title" id="div_FormName">Series</strong>
|
||||
<div class="btn-group ml-auto d-flex">
|
||||
<a class="px-2 text-dark py-1" id="btnAddNewSeries" href="javascript:;" title="create" style="padding-left:10px !important;" onclick=" Unibase.Platform.Series.Components.CreateSeries.Instance().init(0);"><i class="fa fa-plus"></i></a>
|
||||
<a class="px-2 text-dark py-1" href="javascript:;" style="padding-right:10px !important;"><i class="ti-help-alt" title="help" target="_blank"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-simplebar class="simple-scroll-bar scrollable" id="div_body">
|
||||
<div class="clear" id="divMessage"></div>
|
||||
<input type="hidden" id="hf_seriesid" />
|
||||
<div id="bizgaze_SpiltErrorMessages" class="clear"></div>
|
||||
<div id="bizgaze_validationErrorMessages" class="clear"></div>
|
||||
<div class="Series-ListSearch row"></div>
|
||||
<div id="seriesdiv" class="nicescroll-bar">
|
||||
<ul id="Seieslist" class="list-group list-group-flush font-14"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white footer">
|
||||
<a href="javascript:;" id="btn_Close" class="btn btn-light btn-sm mr-auto btn-close"> Close</a>
|
||||
</div></form>`;
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = this;
|
||||
var appkeyid = 0;
|
||||
var InstalledAppId = instance.appSettings.InstalledAppId;
|
||||
instance.InstalledAppId = instance.appSettings.InstalledAppId;
|
||||
Unibase.Platform.Apps.Managers.AppManager.Instance().getInstallApp(InstalledAppId).then(function (response) {
|
||||
var data = response.result;
|
||||
appkeyid = data.AppKeyId;
|
||||
instance.loadserieslist(appkeyid, InstalledAppId);
|
||||
});
|
||||
}
|
||||
init(seriesid, callback) {
|
||||
this.render(seriesid, callback);
|
||||
}
|
||||
render(seriesid, callback) {
|
||||
this.navigationHelper.popup(seriesid, '', Unibase.Platform.Series.Components.Series.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
loadserieslist(appkeyid, InstalledAppId) {
|
||||
this.fileCacheHelper.loadJsFile('platform/series/managers/seriesmanager.js', function () {
|
||||
var _datetimehelper = Unibase.Platform.Helpers.DateTimeHelper.Instance();
|
||||
Unibase.Platform.Series.Managers.SeriesManager.Instance().getSeries(appkeyid, InstalledAppId).then(function (response) {
|
||||
$(".serieslist").remove();
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var res = response.result[i];
|
||||
var html = '';
|
||||
html += '<li class="list-group-item serieslist pa-10 text-dark" id="series_list">' +
|
||||
'<div class="col-2 pull-right">' +
|
||||
'<a href="javascript:;" data-toggle="dropdown" class="no-caret dropdown-toggle pull-right" aria-expanded="false">' +
|
||||
'<i class="row fa fa-ellipsis-h pull-right biz-highlight-bg-color"></i></a>' +
|
||||
'<ul class="dropdown-menu pull-right clearfix" id="statusproperties_' + res.SeriesId + '">' +
|
||||
'</ul>' +
|
||||
'<i id="iconstatus_' + res.SeriesId + '" class="row mt-20 fa fa-circle pull-right"></i>' +
|
||||
'</div>' +
|
||||
'<div class="col-10"><a href="javascript:;" class="text-dark" onclick="Unibase.Platform.Series.Components.Series.Instance().loadlist(' + res.SeriesId + ')">' +
|
||||
'<div class=""><strong class="row block copyItemName list-item-main-title">' + res.SeriesName + '</strong><span class="row block">' +
|
||||
' <span id="copyIndex text-dark">' + _datetimehelper.formatLocal(res.CreatedDate) + '</span>' +
|
||||
'</span></div></a><div></li>';
|
||||
$("#emptyItem").remove();
|
||||
$("#Seieslist").append(html);
|
||||
var StatusId = res.StatusId;
|
||||
var SeriesId = res.SeriesId;
|
||||
Unibase.Platform.Series.Components.Series.Instance().GetStatus(StatusId, SeriesId);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
GetStatus(StatusId, SeriesId) {
|
||||
if (StatusId == 1) {
|
||||
$("#statusproperties_" + SeriesId).html('<li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.CreateSeries.Instance().init(' + SeriesId + ')">Edit</a></li>' +
|
||||
'<li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.Series.Instance().changestatus(' + SeriesId + ',' + 2 + ')">De-activate</a></li>');
|
||||
$("#iconstatus_" + SeriesId).addClass("text-success");
|
||||
$("#iconstatus_" + SeriesId).removeClass("text-danger");
|
||||
}
|
||||
else {
|
||||
$("#statusproperties_" + SeriesId).html('<li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.CreateSeries.Instance().init(' + SeriesId + ')">Edit</a></li>' +
|
||||
'<li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.Series.Instance().changestatus(' + SeriesId + ',' + 1 + ')">Activate</a></li>');
|
||||
$("#iconstatus_" + SeriesId).removeClass("text-success");
|
||||
$("#iconstatus_" + SeriesId).addClass("text-danger");
|
||||
}
|
||||
}
|
||||
loadlist(seriesid) {
|
||||
$("#hf_seriesid").val(seriesid);
|
||||
var instance = this;
|
||||
instance.navigationHelper.popup(0, '', Unibase.Platform.Series.Components.SeriesFormatList.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
changestatus(SeriesId, status) {
|
||||
var msg = "";
|
||||
if (status == 1) {
|
||||
msg = "Are you sure you want to Activate ?";
|
||||
}
|
||||
else {
|
||||
msg = "Are you sure you want to De - Activate ?";
|
||||
}
|
||||
bootbox.confirm({
|
||||
message: msg,
|
||||
closeButton: false,
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Yes',
|
||||
className: 'btn-success'
|
||||
},
|
||||
cancel: {
|
||||
label: 'No',
|
||||
className: 'btn-defualt'
|
||||
}
|
||||
},
|
||||
callback: function (result) {
|
||||
if (result) {
|
||||
var _fileCacheHelper = Platform.Helpers.FileCacheHelper.Instance();
|
||||
_fileCacheHelper.loadJsFile('platform/series/managers/seriesmanager.js', null);
|
||||
Unibase.Platform.Series.Managers.SeriesManager.Instance().changeSeriesStatus(SeriesId, status).then(function (response) {
|
||||
MessageHelper.Instance().showSuccess(response.message, '');
|
||||
Unibase.Platform.Series.Components.Series.Instance().GetStatus(status, SeriesId);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
loadForm(FormId, Pk_Value, AppConfigurationId, Callback, ElementId) {
|
||||
Series.Instance().init(0, null);
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new Series();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.Series = Series;
|
||||
})(Components = Series_1.Components || (Series_1.Components = {}));
|
||||
})(Series = Platform.Series || (Platform.Series = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
+1
File diff suppressed because one or more lines are too long
+22
@@ -0,0 +1,22 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(i){class r extends t.Core.BaseComponent{constructor(){super(...arguments);this.Status="";this.InstalledAppId=0}jsFiles(){return["apps/crm/companies/managers/companymanager.js","platform/core/helpers/datetimehelper/datetimehelper.js","platform/series/components/createseries.js","platform/series/managers/seriesmanager.js","platform/apps/managers/appmanager.js","platform/series/components/seriesformatlist.js"]}cssFiles(){return[]}html(){return`<form id="BizgazeApp_Series_edit" method="post" data-validate="parsley">
|
||||
<div class="b-b bg-white header">
|
||||
<strong class="text-dark Title" id="div_FormName">Series</strong>
|
||||
<div class="btn-group ml-auto d-flex">
|
||||
<a class="px-2 text-dark py-1" id="btnAddNewSeries" href="javascript:;" title="create" style="padding-left:10px !important;" onclick=" Unibase.Platform.Series.Components.CreateSeries.Instance().init(0);"><i class="fa fa-plus"></i></a>
|
||||
<a class="px-2 text-dark py-1" href="javascript:;" style="padding-right:10px !important;"><i class="ti-help-alt" title="help" target="_blank"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-simplebar class="simple-scroll-bar scrollable" id="div_body">
|
||||
<div class="clear" id="divMessage"></div>
|
||||
<input type="hidden" id="hf_seriesid" />
|
||||
<div id="bizgaze_SpiltErrorMessages" class="clear"></div>
|
||||
<div id="bizgaze_validationErrorMessages" class="clear"></div>
|
||||
<div class="Series-ListSearch row"></div>
|
||||
<div id="seriesdiv" class="nicescroll-bar">
|
||||
<ul id="Seieslist" class="list-group list-group-flush font-14"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white footer">
|
||||
<a href="javascript:;" id="btn_Close" class="btn btn-light btn-sm mr-auto btn-close"> Close</a>
|
||||
</div></form>`}load(){var t=this,i=0,r=t.appSettings.InstalledAppId;t.InstalledAppId=t.appSettings.InstalledAppId;n.Platform.Apps.Managers.AppManager.Instance().getInstallApp(r).then(function(n){var u=n.result;i=u.AppKeyId;t.loadserieslist(i,r)})}init(n,t){this.render(n,t)}render(i){this.navigationHelper.popup(i,"",n.Platform.Series.Components.Series.Instance(),null,t.Helpers.Size.DockLeft)}loadserieslist(t,i){this.fileCacheHelper.loadJsFile("platform/series/managers/seriesmanager.js",function(){var r=n.Platform.Helpers.DateTimeHelper.Instance();n.Platform.Series.Managers.SeriesManager.Instance().getSeries(t,i).then(function(t){var u,i,f,e,o;for($(".serieslist").remove(),u=0;u<t.result.length;u++)i=t.result[u],f="",f+='<li class="list-group-item serieslist pa-10 text-dark" id="series_list"><div class="col-2 pull-right"><a href="javascript:;" data-toggle="dropdown" class="no-caret dropdown-toggle pull-right" aria-expanded="false"><i class="row fa fa-ellipsis-h pull-right biz-highlight-bg-color"><\/i><\/a><ul class="dropdown-menu pull-right clearfix" id="statusproperties_'+i.SeriesId+'"><\/ul><i id="iconstatus_'+i.SeriesId+'" class="row mt-20 fa fa-circle pull-right"><\/i><\/div><div class="col-10"><a href="javascript:;" class="text-dark" onclick="Unibase.Platform.Series.Components.Series.Instance().loadlist('+i.SeriesId+')"><div class=""><strong class="row block copyItemName list-item-main-title">'+i.SeriesName+'<\/strong><span class="row block"> <span id="copyIndex text-dark">'+r.formatLocal(i.CreatedDate)+"<\/span><\/span><\/div><\/a><div><\/li>",$("#emptyItem").remove(),$("#Seieslist").append(f),e=i.StatusId,o=i.SeriesId,n.Platform.Series.Components.Series.Instance().GetStatus(e,o)})})}GetStatus(n,t){n==1?($("#statusproperties_"+t).html('<li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.CreateSeries.Instance().init('+t+')">Edit<\/a><\/li><li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.Series.Instance().changestatus('+t+',2)">De-activate<\/a><\/li>'),$("#iconstatus_"+t).addClass("text-success"),$("#iconstatus_"+t).removeClass("text-danger")):($("#statusproperties_"+t).html('<li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.CreateSeries.Instance().init('+t+')">Edit<\/a><\/li><li><a href="javascript:;" class="dropdown-item" onclick="Unibase.Platform.Series.Components.Series.Instance().changestatus('+t+',1)">Activate<\/a><\/li>'),$("#iconstatus_"+t).removeClass("text-success"),$("#iconstatus_"+t).addClass("text-danger"))}loadlist(i){$("#hf_seriesid").val(i);var r=this;r.navigationHelper.popup(0,"",n.Platform.Series.Components.SeriesFormatList.Instance(),null,t.Helpers.Size.DockLeft)}changestatus(i,r){var u="";u=r==1?"Are you sure you want to Activate ?":"Are you sure you want to De - Activate ?";bootbox.confirm({message:u,closeButton:!1,buttons:{confirm:{label:"Yes",className:"btn-success"},cancel:{label:"No",className:"btn-defualt"}},callback:function(u){if(u){var f=t.Helpers.FileCacheHelper.Instance();f.loadJsFile("platform/series/managers/seriesmanager.js",null);n.Platform.Series.Managers.SeriesManager.Instance().changeSeriesStatus(i,r).then(function(t){MessageHelper.Instance().showSuccess(t.message,"");n.Platform.Series.Components.Series.Instance().GetStatus(r,i)})}}})}loadForm(){r.Instance().init(0,null)}static Instance(){return this.instance===undefined&&(this.instance=new r),this.instance}}i.Series=r})(r=i.Components||(i.Components={}))})(i=t.Series||(t.Series={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1,138 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Series;
|
||||
(function (Series) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class SeriesFormatDetails extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.seriesManager = Series.Managers.SeriesManager.Instance();
|
||||
this.datetimehelper = Platform.Helpers.DateTimeHelper.Instance();
|
||||
}
|
||||
jsFiles() {
|
||||
return ['platform/series/managers/seriesmanager.js', 'platform/core/helpers/datetimehelper/datetimehelper.js'];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = `<form id="frm_Series_SeriesFormatDetails" method="post" data-validate="parsley">
|
||||
<header class="b-b bg-white modal-header">
|
||||
<strong class="text-dark Title" id="div_FormName">Series Format Details</strong>
|
||||
<input type="hidden" id="hf_SeriesId" value="0" />
|
||||
<input type="hidden" id="hf_SeriesFormatId" value="0" />
|
||||
</header>
|
||||
<div class="bg-light control-sorting modal-body" style="overflow-y: auto; height: 826px;">
|
||||
<div id="bizgaze_ValidationsSummary" class="clear">
|
||||
</div>
|
||||
<div class="panel panel-default m-n">
|
||||
<div class="row font-14">
|
||||
<div class="col-sm-12">
|
||||
<ul class="list-group m-b-n">
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Series Format</strong>
|
||||
<span class="pull-right" id="sname"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Starting Number</strong>
|
||||
<span class="pull-right" id="snumber"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Last Number</strong>
|
||||
<span class="pull-right" id="lnumber"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Number Prefix</strong>
|
||||
<span class="pull-right" id="numprefix"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Number Size</strong>
|
||||
<span class="pull-right" id="numsize"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>From Date</strong>
|
||||
<span class="pull-right" id="fdate"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>To Date</strong>
|
||||
<span class="pull-right" id="tdate"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<footer class="bg-white modal-footer" style="position:absolute; bottom:0px;width:100%;">
|
||||
<a href="javascript:;" id="btn_SeriesFormatDetailsClose" class="btn btn-light btn-sm mr-auto"> Close</a>
|
||||
</footer>`;
|
||||
$("." + containerid).html(html);
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var instance = Unibase.Platform.Series.Components.SeriesFormatDetails.Instance();
|
||||
instance.GetSeriesFormatDetails();
|
||||
$("#btn_SeriesFormatDetailsClose").click(function () {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
});
|
||||
}
|
||||
GetSeriesFormatDetails() {
|
||||
var SeriesId = Number($("#hf_seriesid").val());
|
||||
var SeriesFormatId = Number($("#hf_seriesformatid").val());
|
||||
var _fileCacheHelper = this.fileCacheHelper;
|
||||
_fileCacheHelper.loadJsFile('platform/series/managers/seriesmanager.js', null);
|
||||
var _datetimehelper = Unibase.Platform.Helpers.DateTimeHelper.Instance();
|
||||
this.seriesManager.getSeriesFormatBySeriesId(SeriesId, SeriesFormatId).then(function (response) {
|
||||
$('#snumber').text(response.result.StartingNumber);
|
||||
$('#lnumber').text(response.result.LastNumber);
|
||||
$('#sname').text(response.result.seriesformat);
|
||||
$('#numprefix').text(response.result.NumberPrefix);
|
||||
$('#numsize').text(response.result.NumberSize);
|
||||
$("#fdate").text(_datetimehelper.formatLocalDate1(response.result.FromDate, ''));
|
||||
$("#tdate").text(_datetimehelper.formatLocalDate1(response.result.ToDate, ''));
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new SeriesFormatDetails();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.SeriesFormatDetails = SeriesFormatDetails;
|
||||
})(Components = Series.Components || (Series.Components = {}));
|
||||
})(Series = Platform.Series || (Platform.Series = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"seriesformatdetails.js","sourceRoot":"","sources":["seriesformatdetails.ts"],"names":[],"mappings":"AAGA,IAAU,OAAO,CA+IhB;AA/ID,WAAU,OAAO;IACb,IAAiB,QAAQ,CA6IxB;IA7ID,WAAi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EAAE,CAAC,CAAC,CAAC;wBAClF,CAAC,CAAC,CAAC;oBAEX,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;4BAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;yBAC7C;wBACD,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBAEJ;gBAvIY,8BAAmB,sBAuI/B,CAAA;YACL,CAAC,EAzIgB,UAAU,GAAV,iBAAU,KAAV,iBAAU,QAyI1B;QACL,CAAC,EA3IgB,MAAM,GAAN,eAAM,KAAN,eAAM,QA2ItB;IACL,CAAC,EA7IgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA6IxB;AACL,CAAC,EA/IS,OAAO,KAAP,OAAO,QA+IhB"}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super();this.seriesManager=i.Managers.SeriesManager.Instance();this.datetimehelper=t.Helpers.DateTimeHelper.Instance()}jsFiles(){return["platform/series/managers/seriesmanager.js","platform/core/helpers/datetimehelper/datetimehelper.js"]}cssFiles(){return[]}html(n,t){let i=`<form id="frm_Series_SeriesFormatDetails" method="post" data-validate="parsley">
|
||||
<header class="b-b bg-white modal-header">
|
||||
<strong class="text-dark Title" id="div_FormName">Series Format Details</strong>
|
||||
<input type="hidden" id="hf_SeriesId" value="0" />
|
||||
<input type="hidden" id="hf_SeriesFormatId" value="0" />
|
||||
</header>
|
||||
<div class="bg-light control-sorting modal-body" style="overflow-y: auto; height: 826px;">
|
||||
<div id="bizgaze_ValidationsSummary" class="clear">
|
||||
</div>
|
||||
<div class="panel panel-default m-n">
|
||||
<div class="row font-14">
|
||||
<div class="col-sm-12">
|
||||
<ul class="list-group m-b-n">
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Series Format</strong>
|
||||
<span class="pull-right" id="sname"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Starting Number</strong>
|
||||
<span class="pull-right" id="snumber"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Last Number</strong>
|
||||
<span class="pull-right" id="lnumber"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Number Prefix</strong>
|
||||
<span class="pull-right" id="numprefix"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>Number Size</strong>
|
||||
<span class="pull-right" id="numsize"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>From Date</strong>
|
||||
<span class="pull-right" id="fdate"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<strong>To Date</strong>
|
||||
<span class="pull-right" id="tdate"></span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<footer class="bg-white modal-footer" style="position:absolute; bottom:0px;width:100%;">
|
||||
<a href="javascript:;" id="btn_SeriesFormatDetailsClose" class="btn btn-light btn-sm mr-auto"> Close</a>
|
||||
</footer>`;return $("."+t).html(i),i}load(t,i){var r=n.Platform.Series.Components.SeriesFormatDetails.Instance();r.GetSeriesFormatDetails();$("#btn_SeriesFormatDetailsClose").click(function(){$("#"+i).modal("hide");$("#"+i).remove()})}GetSeriesFormatDetails(){var i=Number($("#hf_seriesid").val()),r=Number($("#hf_seriesformatid").val()),u=this.fileCacheHelper,t;u.loadJsFile("platform/series/managers/seriesmanager.js",null);t=n.Platform.Helpers.DateTimeHelper.Instance();this.seriesManager.getSeriesFormatBySeriesId(i,r).then(function(n){$("#snumber").text(n.result.StartingNumber);$("#lnumber").text(n.result.LastNumber);$("#sname").text(n.result.seriesformat);$("#numprefix").text(n.result.NumberPrefix);$("#numsize").text(n.result.NumberSize);$("#fdate").text(t.formatLocalDate1(n.result.FromDate,""));$("#tdate").text(t.formatLocalDate1(n.result.ToDate,""))})}static Instance(){return this.instance===undefined&&(this.instance=new u),this.instance}}r.SeriesFormatDetails=u})(r=i.Components||(i.Components={}))})(i=t.Series||(t.Series={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
@@ -0,0 +1,109 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Platform;
|
||||
(function (Platform) {
|
||||
let Series;
|
||||
(function (Series) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class SeriesFormatList extends Platform.Core.BaseComponent {
|
||||
constructor() {
|
||||
super();
|
||||
this.seriesManager = Series.Managers.SeriesManager.Instance();
|
||||
this.datetimehelper = Platform.Helpers.DateTimeHelper.Instance();
|
||||
}
|
||||
jsFiles() {
|
||||
return ['platform/series/managers/seriesmanager.js', 'platform/core/helpers/datetimehelper/datetimehelper.js', 'platform/series/components/createseriesformat.js', 'platform/series/components/seriesformatdetails.js'];
|
||||
}
|
||||
cssFiles() {
|
||||
return [];
|
||||
}
|
||||
html(id, containerid) {
|
||||
let html = `<form id="SeriesFormatList" method="post" data-validate="parsley">
|
||||
<header class="b-b bg-white modal-header">
|
||||
<strong class="text-dark Title">Series Format</strong>
|
||||
</header>
|
||||
<div class="bg-light control-sorting modal-body pl-0 pr-0 pt-0" style="overflow-y: auto; height: 826px;">
|
||||
<input type="hidden" id="hf_seriesid" />
|
||||
<input type="hidden" id="hf_seriesformatid" />
|
||||
<div id="seriesformatdiv" class="bg-cyan-light-4">
|
||||
<div class="mb-10 d-none d-sm-block">
|
||||
<h6>
|
||||
<div class="pull-right mr-10"></div>
|
||||
<div class="col-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 ml-1">Format</div>
|
||||
<div class="col-sm-4">From Date</div>
|
||||
<div class="col-sm-3">To Date</div>
|
||||
</div>
|
||||
</div>
|
||||
</h6>
|
||||
</div>
|
||||
<ul id="seriesformatList" class="list-group list-group-flush font-14"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white footer b-t">
|
||||
<a id="btn_CloseSeriesFormatList" class="btn btn-light btn-sm mr-auto"> Close</a>
|
||||
<a id="btnAddNewSeriesFormat" class="btn btn-sm"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</form>`;
|
||||
$("." + containerid).html(html);
|
||||
return html;
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
var Id = Number(id);
|
||||
var instance = this;
|
||||
instance.FormatList();
|
||||
$("#btn_CloseSeriesFormatList").click(function () {
|
||||
$('#' + containerid).modal('hide');
|
||||
$('#' + containerid).remove();
|
||||
});
|
||||
$("#btnAddNewSeriesFormat").click(function () {
|
||||
Unibase.Platform.Series.Components.CreateSeriesFormat.Instance().render(id);
|
||||
});
|
||||
}
|
||||
FormatList() {
|
||||
var SeriesId = Number($("#hf_seriesid").val());
|
||||
var _datetimehelper = Unibase.Platform.Helpers.DateTimeHelper.Instance();
|
||||
this.seriesManager.getSeriesFormats(SeriesId).then(function (response) {
|
||||
$('.seriesformatlist').remove();
|
||||
var html = "";
|
||||
for (var i = 0; i < response.result.length; i++) {
|
||||
var index = i + 1;
|
||||
var data = response.result[i];
|
||||
html = '<li class="row list-group-item seriesformatlist clear">' +
|
||||
'<a id="edit' + i + '"class="pull-right col-2 btn_EditFormat" href="javascript:;" onclick="Unibase.Platform.Series.Components.CreateSeriesFormat.Instance().render(' + data.SeriesFormatId + ');">' +
|
||||
'<i class="pull-right fa fa-pencil m-t " ></i></a>' +
|
||||
'<a class="text-light-60" href="javascript:;" onclick="javascript:return Unibase.Platform.Series.Components.SeriesFormatList.Instance().SeriesFormatDetails(' + data.SeriesId + ', ' + data.SeriesFormatId + ');">' +
|
||||
'<div class="col-10">' +
|
||||
'<div class="row">' +
|
||||
'<div class="txt_format col-sm-4">' + data.seriesformat + '</div>' +
|
||||
'<div class="date_fromdate col-sm-4 ml-1 d-none d-sm-block">' + _datetimehelper.formatLocalDate1(data.FromDate, '') + '</div>' +
|
||||
'<div class="col-sm-4 d-block d-sm-none">' + _datetimehelper.formatLocalDate1(data.FromDate, '') + '</div>' +
|
||||
'<div class="date_todate_' + index + ' col-sm-3 ml-1 d-none d-sm-block">' + _datetimehelper.formatLocalDate1(data.ToDate, '') + '</div>' +
|
||||
'<div class="col-sm-3 d-block d-sm-none">' + _datetimehelper.formatLocalDate1(data.ToDate, '') + '</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</a></li>';
|
||||
$('#seriesformatList').append(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
SeriesFormatDetails(SeriesId, SeriesFormatId) {
|
||||
$("#hf_seriesid").val(SeriesId);
|
||||
$("#hf_seriesformatid").val(SeriesFormatId);
|
||||
var instance = this;
|
||||
instance.navigationHelper.popup(SeriesId, '', Unibase.Platform.Series.Components.SeriesFormatDetails.Instance(), null, Platform.Helpers.Size.DockLeft);
|
||||
}
|
||||
static Instance() {
|
||||
if (this.instance === undefined) {
|
||||
this.instance = new SeriesFormatList();
|
||||
}
|
||||
return this.instance;
|
||||
}
|
||||
}
|
||||
Components.SeriesFormatList = SeriesFormatList;
|
||||
})(Components = Series.Components || (Series.Components = {}));
|
||||
})(Series = Platform.Series || (Platform.Series = {}));
|
||||
})(Platform = Unibase.Platform || (Unibase.Platform = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"seriesformatlist.js","sourceRoot":"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U,KAAV,iBAAU,QAyG1B;QACL,CAAC,EA3GgB,MAAM,GAAN,eAAM,KAAN,eAAM,QA2GtB;IACL,CAAC,EA7GgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA6GxB;AACL,CAAC,EA/GS,OAAO,KAAP,OAAO,QA+GhB"}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(r){class u extends t.Core.BaseComponent{constructor(){super();this.seriesManager=i.Managers.SeriesManager.Instance();this.datetimehelper=t.Helpers.DateTimeHelper.Instance()}jsFiles(){return["platform/series/managers/seriesmanager.js","platform/core/helpers/datetimehelper/datetimehelper.js","platform/series/components/createseriesformat.js","platform/series/components/seriesformatdetails.js"]}cssFiles(){return[]}html(n,t){let i=`<form id="SeriesFormatList" method="post" data-validate="parsley">
|
||||
<header class="b-b bg-white modal-header">
|
||||
<strong class="text-dark Title">Series Format</strong>
|
||||
</header>
|
||||
<div class="bg-light control-sorting modal-body pl-0 pr-0 pt-0" style="overflow-y: auto; height: 826px;">
|
||||
<input type="hidden" id="hf_seriesid" />
|
||||
<input type="hidden" id="hf_seriesformatid" />
|
||||
<div id="seriesformatdiv" class="bg-cyan-light-4">
|
||||
<div class="mb-10 d-none d-sm-block">
|
||||
<h6>
|
||||
<div class="pull-right mr-10"></div>
|
||||
<div class="col-10">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 ml-1">Format</div>
|
||||
<div class="col-sm-4">From Date</div>
|
||||
<div class="col-sm-3">To Date</div>
|
||||
</div>
|
||||
</div>
|
||||
</h6>
|
||||
</div>
|
||||
<ul id="seriesformatList" class="list-group list-group-flush font-14"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white footer b-t">
|
||||
<a id="btn_CloseSeriesFormatList" class="btn btn-light btn-sm mr-auto"> Close</a>
|
||||
<a id="btnAddNewSeriesFormat" class="btn btn-sm"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</form>`;return $("."+t).html(i),i}load(t,i){var u=Number(t),r=this;r.FormatList();$("#btn_CloseSeriesFormatList").click(function(){$("#"+i).modal("hide");$("#"+i).remove()});$("#btnAddNewSeriesFormat").click(function(){n.Platform.Series.Components.CreateSeriesFormat.Instance().render(t)})}FormatList(){var i=Number($("#hf_seriesid").val()),t=n.Platform.Helpers.DateTimeHelper.Instance();this.seriesManager.getSeriesFormats(i).then(function(n){var u,r,f,i;for($(".seriesformatlist").remove(),u="",r=0;r<n.result.length;r++)f=r+1,i=n.result[r],u='<li class="row list-group-item seriesformatlist clear"><a id="edit'+r+'"class="pull-right col-2 btn_EditFormat" href="javascript:;" onclick="Unibase.Platform.Series.Components.CreateSeriesFormat.Instance().render('+i.SeriesFormatId+');"><i class="pull-right fa fa-pencil m-t " ><\/i><\/a><a class="text-light-60" href="javascript:;" onclick="javascript:return Unibase.Platform.Series.Components.SeriesFormatList.Instance().SeriesFormatDetails('+i.SeriesId+", "+i.SeriesFormatId+');"><div class="col-10"><div class="row"><div class="txt_format col-sm-4">'+i.seriesformat+'<\/div><div class="date_fromdate col-sm-4 ml-1 d-none d-sm-block">'+t.formatLocalDate1(i.FromDate,"")+'<\/div><div class="col-sm-4 d-block d-sm-none">'+t.formatLocalDate1(i.FromDate,"")+'<\/div><div class="date_todate_'+f+' col-sm-3 ml-1 d-none d-sm-block">'+t.formatLocalDate1(i.ToDate,"")+'<\/div><div class="col-sm-3 d-block d-sm-none">'+t.formatLocalDate1(i.ToDate,"")+"<\/div><\/div><\/div><\/a><\/li>",$("#seriesformatList").append(u)})}SeriesFormatDetails(i,r){$("#hf_seriesid").val(i);$("#hf_seriesformatid").val(r);var u=this;u.navigationHelper.popup(i,"",n.Platform.Series.Components.SeriesFormatDetails.Instance(),null,t.Helpers.Size.DockLeft)}static Instance(){return this.instance===undefined&&(this.instance=new u),this.instance}}r.SeriesFormatList=u})(r=i.Components||(i.Components={}))})(i=t.Series||(t.Series={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
Reference in New Issue
Block a user