提交 bff00940 编写于 作者: ibizdev's avatar ibizdev

chitanda 发布系统代码

上级 1a90f638
......@@ -58,7 +58,7 @@ mock.onGet('v7/centralappmenu').reply((config: any) => {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-certificate',
iconcls: 'fa fa-cog',
icon: '',
textcls: '',
appfunctag: 'Auto26',
......
......@@ -64,21 +64,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -109,6 +94,21 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -118,9 +118,9 @@ export default class CampaignServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -135,21 +135,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -180,11 +165,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -212,9 +212,9 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -230,9 +230,9 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......@@ -275,21 +275,6 @@ export default class CampaignServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -320,11 +305,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData.campaignlists = campaignlistsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -107,6 +92,21 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class CompetitorServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/competitors`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -133,21 +133,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -178,11 +163,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -210,9 +210,9 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/${context.competitor}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -228,9 +228,9 @@ export default class CompetitorServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading);
res.data.competitor = data.competitor;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -258,21 +258,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -303,11 +288,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......
......@@ -68,21 +68,6 @@ export default class ContactServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && true){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -113,21 +98,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
......@@ -143,6 +113,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -173,6 +158,21 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -200,21 +200,6 @@ export default class ContactServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -245,14 +230,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
......@@ -268,6 +245,14 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -298,11 +283,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService {
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -399,21 +399,6 @@ export default class ContactServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -444,11 +429,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading);
......@@ -466,21 +466,6 @@ export default class ContactServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -511,11 +496,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading);
......@@ -548,21 +548,6 @@ export default class ContactServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -593,14 +578,6 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
......@@ -616,6 +593,14 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -646,11 +631,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -666,21 +666,6 @@ export default class ContactServiceBase extends EntityService {
public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){
let masterData:any = {};
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
......@@ -711,11 +696,26 @@ export default class ContactServiceBase extends EntityService {
}
}
masterData.opportunities = opportunitiesData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading);
......
......@@ -64,11 +64,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -78,12 +78,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -93,12 +93,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -108,12 +108,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -123,7 +123,7 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -133,10 +133,10 @@ export default class IBizListServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/ibizlists`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -151,11 +151,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -165,12 +165,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -180,12 +180,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -195,12 +195,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -210,13 +210,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/ibizlists/${context.ibizlist}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -244,10 +244,10 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizlists/${context.ibizlist}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -263,10 +263,10 @@ export default class IBizListServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/ibizlists/getdraft`,isloading);
res.data.ibizlist = data.ibizlist;
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......@@ -309,11 +309,11 @@ export default class IBizListServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -323,12 +323,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -338,12 +338,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listcontacts = listcontactsData;
let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaignlistsData.forEach((item:any) => {
masterData.listaccounts = listaccountsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -353,12 +353,12 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.campaignlists = campaignlistsData;
let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
listaccountsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
listcontactsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -368,13 +368,13 @@ export default class IBizListServiceBase extends EntityService {
});
}
}
masterData.listaccounts = listaccountsData;
masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/ibizlists/${context.ibizlist}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
......
......@@ -79,11 +79,11 @@ export default class LeadServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -93,12 +93,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -108,7 +108,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -118,17 +118,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && true){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -138,12 +138,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -153,7 +153,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -163,17 +163,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && true){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -183,12 +183,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -198,7 +198,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -208,17 +208,17 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && true){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -228,12 +228,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -243,7 +243,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -253,16 +253,16 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -272,12 +272,12 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
if(listleadsData && listleadsData.length && listleadsData.length > 0){
listleadsData.forEach((item:any) => {
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -287,7 +287,7 @@ export default class LeadServiceBase extends EntityService {
});
}
}
masterData.listleads = listleadsData;
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -297,8 +297,8 @@ export default class LeadServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/leads`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -314,21 +314,6 @@ export default class LeadServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -344,14 +329,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -367,6 +344,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -382,14 +367,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -405,6 +382,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -420,14 +405,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -443,6 +420,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -458,13 +443,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -480,6 +458,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -495,10 +480,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/leads/${context.lead}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -539,31 +539,31 @@ export default class LeadServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let res:any = await Http.getInstance().get(`/leads/${context.lead}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -580,35 +580,35 @@ export default class LeadServiceBase extends EntityService {
if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && true){
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let res:any = await Http.getInstance().get(`/leads/getdraft`,isloading);
res.data.lead = data.lead;
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -624,21 +624,6 @@ export default class LeadServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -654,14 +639,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -677,6 +654,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -692,14 +677,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -715,6 +692,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -730,14 +715,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -753,6 +730,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -768,10 +753,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/active`,data,isloading);
......@@ -789,21 +789,6 @@ export default class LeadServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -819,14 +804,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -842,6 +819,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -857,14 +842,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -880,6 +857,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -895,14 +880,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -918,6 +895,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -933,10 +918,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/addlist`,data,isloading);
......@@ -969,21 +969,6 @@ export default class LeadServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -999,14 +984,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1022,6 +999,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1037,14 +1022,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1060,6 +1037,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1075,14 +1060,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1098,6 +1075,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1113,10 +1098,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/checkkey`,data,isloading);
......@@ -1134,21 +1134,6 @@ export default class LeadServiceBase extends EntityService {
public async DisQualification(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1164,14 +1149,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1187,6 +1164,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1202,14 +1187,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1225,6 +1202,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1240,14 +1225,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1263,6 +1240,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1278,10 +1263,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/disqualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/disqualification`,data,isloading);
......@@ -1329,21 +1329,6 @@ export default class LeadServiceBase extends EntityService {
public async Qualification(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1359,14 +1344,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1382,6 +1359,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1397,14 +1382,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1420,6 +1397,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1435,14 +1420,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1458,6 +1435,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1473,10 +1458,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/qualification`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
return Http.getInstance().post(`/leads/${context.lead}/qualification`,data,isloading);
......@@ -1494,21 +1494,6 @@ export default class LeadServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1524,14 +1509,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1547,6 +1524,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.contact && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1562,14 +1547,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1585,6 +1562,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.campaign && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1600,14 +1585,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1623,6 +1600,14 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
if(context.account && context.lead){
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1638,13 +1623,6 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
return res;
}
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
......@@ -1660,6 +1638,13 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
let masterData:any = {};
let listleadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listleads'),'undefined')){
listleadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listleads') as any);
......@@ -1675,10 +1660,25 @@ export default class LeadServiceBase extends EntityService {
}
}
masterData.listleads = listleadsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/leads/${context.lead}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_listleads',JSON.stringify(res.data.listleads));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......
......@@ -74,36 +74,36 @@ export default class OpportunityServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -128,43 +128,43 @@ export default class OpportunityServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -189,43 +189,43 @@ export default class OpportunityServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && true){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -250,42 +250,42 @@ export default class OpportunityServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -310,8 +310,8 @@ export default class OpportunityServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......@@ -328,36 +328,36 @@ export default class OpportunityServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -375,43 +375,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -429,43 +429,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -483,42 +483,42 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -536,8 +536,8 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......@@ -576,28 +576,28 @@ export default class OpportunityServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......@@ -615,31 +615,31 @@ export default class OpportunityServiceBase extends EntityService {
if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......@@ -656,36 +656,36 @@ export default class OpportunityServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -703,43 +703,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -757,43 +757,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -811,8 +811,8 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......@@ -831,36 +831,36 @@ export default class OpportunityServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -878,43 +878,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -932,43 +932,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -986,8 +986,8 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......@@ -1021,36 +1021,36 @@ export default class OpportunityServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1068,43 +1068,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1122,43 +1122,43 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1176,42 +1176,42 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let masterData:any = {};
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.quoteid = null;
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.quotes = quotesData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => {
masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
if(quotesData && quotesData.length && quotesData.length > 0){
quotesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
item.quoteid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
masterData.quotes = quotesData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
......@@ -1229,8 +1229,8 @@ export default class OpportunityServiceBase extends EntityService {
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
......
......@@ -65,21 +65,6 @@ export default class ProductServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -110,6 +95,21 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productsubstitutes = productsubstitutesData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -119,9 +119,9 @@ export default class ProductServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -136,21 +136,6 @@ export default class ProductServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -181,11 +166,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productsubstitutes = productsubstitutesData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -213,9 +213,9 @@ export default class ProductServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -231,9 +231,9 @@ export default class ProductServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......@@ -291,21 +291,6 @@ export default class ProductServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
......@@ -336,11 +321,26 @@ export default class ProductServiceBase extends EntityService {
}
}
masterData.productsubstitutes = productsubstitutesData;
let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productassociationsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productassociations = productassociationsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res;
}
......
......@@ -78,21 +78,6 @@ export default class QuoteServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -108,21 +93,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -138,6 +108,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -153,21 +138,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -183,6 +153,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -198,21 +183,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -228,6 +198,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && true){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -243,20 +228,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -272,6 +243,20 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
}
if(data.srffrontuf){
delete data.srffrontuf;
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -287,6 +272,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -296,8 +296,8 @@ export default class QuoteServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/quotes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -313,21 +313,6 @@ export default class QuoteServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -343,14 +328,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -366,6 +343,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -381,14 +366,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -404,6 +381,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -419,14 +404,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -442,6 +419,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -457,13 +442,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -479,6 +457,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -494,10 +479,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/quotes/${context.quote}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -538,31 +538,31 @@ export default class QuoteServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let res:any = await Http.getInstance().get(`/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -579,35 +579,35 @@ export default class QuoteServiceBase extends EntityService {
if(context.account && context.contact && context.opportunity && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let res:any = await Http.getInstance().get(`/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -638,21 +638,6 @@ export default class QuoteServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -668,14 +653,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -691,6 +668,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -706,14 +691,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -729,6 +706,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -744,14 +729,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -767,6 +744,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -782,10 +767,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/checkkey`,data,isloading);
......@@ -818,21 +818,6 @@ export default class QuoteServiceBase extends EntityService {
public async GenSalesOrder(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -848,14 +833,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -871,6 +848,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -886,14 +871,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -909,6 +886,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -924,14 +909,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -947,6 +924,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -962,10 +947,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/gensalesorder`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/gensalesorder`,data,isloading);
......@@ -983,21 +983,6 @@ export default class QuoteServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1013,14 +998,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1036,6 +1013,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.contact && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1051,14 +1036,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1074,6 +1051,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.account && context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1089,14 +1074,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1112,6 +1089,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
if(context.opportunity && context.quote){
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1127,13 +1112,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
return res;
}
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1149,6 +1127,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
let masterData:any = {};
let quotedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1164,10 +1149,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/quotes/${context.quote}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
......@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
......@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
......@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
if(salesliteratureitemsData && salesliteratureitemsData.length && salesliteratureitemsData.length > 0){
salesliteratureitemsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesliteratureitemid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......
......@@ -155,7 +155,6 @@ export default class IncidentUIServiceBase extends UIService {
const parameters: any[] = [
{ pathName: 'incidents', parameterName: 'incident' },
];
actionContext.closeView(null);
const openDrawer = (view: any, data: any) => {
let container: Subject<any> = actionContext.$appdrawer.openDrawer(view, context,data);
container.subscribe((result: any) => {
......
......@@ -63,7 +63,7 @@ export default class CentralModel {
hidden: false,
hidesidebar: false,
opendefault: false,
iconcls: 'fa fa-certificate',
iconcls: 'fa fa-cog',
icon: '',
textcls: '',
appfunctag: 'Auto26',
......
......@@ -4769,7 +4769,7 @@
<!--输出实体[INCIDENT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-incident-93-59">
<changeSet author="a_LAB01_e85d8801c" id="tab-incident-94-59">
<createTable tableName="INCIDENT">
<column name="LASTONHOLDTIME" remarks="" type="DATETIME">
</column>
......@@ -11357,43 +11357,43 @@
<addForeignKeyConstraint baseColumnNames="RESOURCESPECID" baseTableName="SERVICE" constraintName="DER1N_SERVICE__RESOURCESPEC__R" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="RESOURCESPECID" referencedTableName="RESOURCESPEC" validate="true"/>
</changeSet>
<!--输出实体[INCIDENT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-260">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-260">
<addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTACT__PRIMA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-261">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-261">
<addForeignKeyConstraint baseColumnNames="RESPONSIBLECONTACTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTACT__RESPO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-262">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-262">
<addForeignKeyConstraint baseColumnNames="CONTRACTDETAILID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTRACTDETAIL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTRACTDETAILID" referencedTableName="CONTRACTDETAIL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-263">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-263">
<addForeignKeyConstraint baseColumnNames="CONTRACTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__CONTRACT__CONT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTRACTID" referencedTableName="CONTRACT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-264">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-264">
<addForeignKeyConstraint baseColumnNames="ENTITLEMENTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__ENTITLEMENT__E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ENTITLEMENTID" referencedTableName="ENTITLEMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-265">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-265">
<addForeignKeyConstraint baseColumnNames="EXISTINGCASE" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__INCIDENT__EXIS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-266">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-266">
<addForeignKeyConstraint baseColumnNames="MASTERID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__INCIDENT__MAST" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-267">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-267">
<addForeignKeyConstraint baseColumnNames="PARENTCASEID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__INCIDENT__PARE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="INCIDENTID" referencedTableName="INCIDENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-268">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-268">
<addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__PRODUCT__PRODU" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-269">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-269">
<addForeignKeyConstraint baseColumnNames="FIRSTRESPONSEBYKPIID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__SLAKPIINSTANCE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAKPIINSTANCEID" referencedTableName="SLAKPIINSTANCE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-271">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-271">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-272">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-272">
<addForeignKeyConstraint baseColumnNames="SUBJECTID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__SUBJECT__SUBJE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SUBJECTID" referencedTableName="SUBJECT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-93-273">
<changeSet author="a_LAB01_e85d8801c" id="fk-incident-94-273">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="INCIDENT" constraintName="DER1N_INCIDENT__TRANSACTIONCUR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[INCIDENTCUSTOMER]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册