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

xignzi006 发布系统代码

上级 911bc20a
...@@ -653,6 +653,10 @@ export default { ...@@ -653,6 +653,10 @@ export default {
caption: "激活", caption: "激活",
tip: "激活", tip: "激活",
}, },
tbitem17_addlist_sep: {
caption: "",
tip: "",
},
tbitem17_addlist: { tbitem17_addlist: {
caption: "添加到市场营销列表", caption: "添加到市场营销列表",
tip: "添加到市场营销列表", tip: "添加到市场营销列表",
......
...@@ -652,6 +652,10 @@ export default { ...@@ -652,6 +652,10 @@ export default {
caption: "激活", caption: "激活",
tip: "激活", tip: "激活",
}, },
tbitem17_addlist_sep: {
caption: "",
tip: "",
},
tbitem17_addlist: { tbitem17_addlist: {
caption: "添加到市场营销列表", caption: "添加到市场营销列表",
tip: "添加到市场营销列表", tip: "添加到市场营销列表",
......
...@@ -640,6 +640,10 @@ export default { ...@@ -640,6 +640,10 @@ export default {
caption: "激活", caption: "激活",
tip: "激活", tip: "激活",
}, },
tbitem17_addlist_sep: {
caption: "",
tip: "",
},
tbitem17_addlist: { tbitem17_addlist: {
caption: "添加到市场营销列表", caption: "添加到市场营销列表",
tip: "添加到市场营销列表", tip: "添加到市场营销列表",
......
...@@ -639,6 +639,10 @@ export default { ...@@ -639,6 +639,10 @@ export default {
caption: "激活", caption: "激活",
tip: "激活", tip: "激活",
}, },
tbitem17_addlist_sep: {
caption: "",
tip: "",
},
tbitem17_addlist: { tbitem17_addlist: {
caption: "添加到市场营销列表", caption: "添加到市场营销列表",
tip: "添加到市场营销列表", tip: "添加到市场营销列表",
......
...@@ -653,14 +653,26 @@ export default { ...@@ -653,14 +653,26 @@ export default {
caption: "丢单", caption: "丢单",
tip: "丢单", tip: "丢单",
}, },
tbitem14_unable_sep: {
caption: "",
tip: "",
},
tbitem14_unable: { tbitem14_unable: {
caption: "无法联系", caption: "无法联系",
tip: "无法联系", tip: "无法联系",
}, },
tbitem14_nointerested_sep: {
caption: "",
tip: "",
},
tbitem14_nointerested: { tbitem14_nointerested: {
caption: "不再感兴趣", caption: "不再感兴趣",
tip: "不再感兴趣", tip: "不再感兴趣",
}, },
tbitem14_cancel_sep: {
caption: "",
tip: "",
},
tbitem14_cancel: { tbitem14_cancel: {
caption: "取消", caption: "取消",
tip: "取消", tip: "取消",
......
...@@ -652,14 +652,26 @@ export default { ...@@ -652,14 +652,26 @@ export default {
caption: "丢单", caption: "丢单",
tip: "丢单", tip: "丢单",
}, },
tbitem14_unable_sep: {
caption: "",
tip: "",
},
tbitem14_unable: { tbitem14_unable: {
caption: "无法联系", caption: "无法联系",
tip: "无法联系", tip: "无法联系",
}, },
tbitem14_nointerested_sep: {
caption: "",
tip: "",
},
tbitem14_nointerested: { tbitem14_nointerested: {
caption: "不再感兴趣", caption: "不再感兴趣",
tip: "不再感兴趣", tip: "不再感兴趣",
}, },
tbitem14_cancel_sep: {
caption: "",
tip: "",
},
tbitem14_cancel: { tbitem14_cancel: {
caption: "取消", caption: "取消",
tip: "取消", tip: "取消",
......
...@@ -73,6 +73,7 @@ export class AccountInfoBase extends TabExpViewBase { ...@@ -73,6 +73,7 @@ export class AccountInfoBase extends TabExpViewBase {
tbitem17_active_sep: { name: 'tbitem17_active_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem17_active_sep: { name: 'tbitem17_active_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem17_active: { name: 'tbitem17_active', caption: '激活','isShowCaption':true,'isShowIcon':true, tooltip: '激活', iconcls: 'fa fa-play-circle-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Active', target: 'SINGLEKEY' }, class: '' }, tbitem17_active: { name: 'tbitem17_active', caption: '激活','isShowCaption':true,'isShowIcon':true, tooltip: '激活', iconcls: 'fa fa-play-circle-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Active', target: 'SINGLEKEY' }, class: '' },
tbitem17_addlist_sep: { name: 'tbitem17_addlist_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem17_addlist: { name: 'tbitem17_addlist', caption: '添加到市场营销列表','isShowCaption':true,'isShowIcon':true, tooltip: '添加到市场营销列表', iconcls: 'fa fa-plus', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'AddList', target: 'SINGLEKEY' }, class: '' }, tbitem17_addlist: { name: 'tbitem17_addlist', caption: '添加到市场营销列表','isShowCaption':true,'isShowIcon':true, tooltip: '添加到市场营销列表', iconcls: 'fa fa-plus', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'AddList', target: 'SINGLEKEY' }, class: '' },
tbitem2: { name: 'tbitem2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem2: { name: 'tbitem2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
......
...@@ -72,6 +72,7 @@ export class ContactInfoBase extends TabExpViewBase { ...@@ -72,6 +72,7 @@ export class ContactInfoBase extends TabExpViewBase {
tbitem17_active_sep: { name: 'tbitem17_active_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem17_active_sep: { name: 'tbitem17_active_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem17_active: { name: 'tbitem17_active', caption: '激活','isShowCaption':true,'isShowIcon':true, tooltip: '激活', iconcls: 'fa fa-play-circle-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Active', target: 'SINGLEKEY' }, class: '' }, tbitem17_active: { name: 'tbitem17_active', caption: '激活','isShowCaption':true,'isShowIcon':true, tooltip: '激活', iconcls: 'fa fa-play-circle-o', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Active', target: 'SINGLEKEY' }, class: '' },
tbitem17_addlist_sep: { name: 'tbitem17_addlist_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem17_addlist: { name: 'tbitem17_addlist', caption: '添加到市场营销列表','isShowCaption':true,'isShowIcon':true, tooltip: '添加到市场营销列表', iconcls: 'fa fa-plus', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'AddList', target: 'SINGLEKEY' }, class: '' }, tbitem17_addlist: { name: 'tbitem17_addlist', caption: '添加到市场营销列表','isShowCaption':true,'isShowIcon':true, tooltip: '添加到市场营销列表', iconcls: 'fa fa-plus', icon: '', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'AddList', target: 'SINGLEKEY' }, class: '' },
tbitem2: { name: 'tbitem2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem2: { name: 'tbitem2', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
......
...@@ -84,10 +84,13 @@ export class LeadOnGridViewBase extends GridViewBase { ...@@ -84,10 +84,13 @@ export class LeadOnGridViewBase extends GridViewBase {
tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem10: { name: 'tbitem10', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14_lostorder: { name: 'tbitem14_lostorder', caption: '丢单','isShowCaption':true,'isShowIcon':true, tooltip: '丢单', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'LostOrder', target: 'SINGLEKEY' }, class: '' }, tbitem14_lostorder: { name: 'tbitem14_lostorder', caption: '丢单','isShowCaption':true,'isShowIcon':true, tooltip: '丢单', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'LostOrder', target: 'SINGLEKEY' }, class: '' },
tbitem14_unable_sep: { name: 'tbitem14_unable_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14_unable: { name: 'tbitem14_unable', caption: '无法联系','isShowCaption':true,'isShowIcon':true, tooltip: '无法联系', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Unable', target: 'SINGLEKEY' }, class: '' }, tbitem14_unable: { name: 'tbitem14_unable', caption: '无法联系','isShowCaption':true,'isShowIcon':true, tooltip: '无法联系', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Unable', target: 'SINGLEKEY' }, class: '' },
tbitem14_nointerested_sep: { name: 'tbitem14_nointerested_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14_nointerested: { name: 'tbitem14_nointerested', caption: '不再感兴趣','isShowCaption':true,'isShowIcon':true, tooltip: '不再感兴趣', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'NoInterested', target: 'SINGLEKEY' }, class: '' }, tbitem14_nointerested: { name: 'tbitem14_nointerested', caption: '不再感兴趣','isShowCaption':true,'isShowIcon':true, tooltip: '不再感兴趣', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'NoInterested', target: 'SINGLEKEY' }, class: '' },
tbitem14_cancel_sep: { name: 'tbitem14_cancel_sep', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
tbitem14_cancel: { name: 'tbitem14_cancel', caption: '取消','isShowCaption':true,'isShowIcon':true, tooltip: '取消', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Cancel', target: 'SINGLEKEY' }, class: '' }, tbitem14_cancel: { name: 'tbitem14_cancel', caption: '取消','isShowCaption':true,'isShowIcon':true, tooltip: '取消', disabled: false, type: 'DEUIACTION', visabled: true, dataaccaction: '', uiaction: { tag: 'Cancel', target: 'SINGLEKEY' }, class: '' },
tbitem15: { name: 'tbitem15', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } }, tbitem15: { name: 'tbitem15', type: 'SEPERATOR', visabled: true, dataaccaction: '', uiaction: { } },
......
...@@ -68,21 +68,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -68,21 +68,21 @@ export default class ContactServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && true){ if(context.account && true){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -98,21 +98,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -98,21 +98,21 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -122,27 +122,27 @@ export default class ContactServiceBase extends EntityService { ...@@ -122,27 +122,27 @@ export default class ContactServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts`,data,isloading); 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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -158,21 +158,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -158,21 +158,21 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService { ...@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts`,data,isloading); let res:any = await Http.getInstance().post(`/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -200,21 +200,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -200,21 +200,21 @@ export default class ContactServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -230,44 +230,44 @@ export default class ContactServiceBase extends EntityService { ...@@ -230,44 +230,44 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading); 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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -283,26 +283,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -283,26 +283,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading); let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService { ...@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService { ...@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService {
if(context.account && true){ if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading);
res.data.contact = data.contact; res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact; res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -399,21 +399,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -399,21 +399,21 @@ export default class ContactServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -429,26 +429,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -429,26 +429,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading); return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading);
...@@ -466,21 +466,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -466,21 +466,21 @@ export default class ContactServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -496,26 +496,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -496,26 +496,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading); return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading);
...@@ -548,21 +548,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -548,21 +548,21 @@ export default class ContactServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -578,44 +578,44 @@ export default class ContactServiceBase extends EntityService { ...@@ -578,44 +578,44 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading); 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+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -631,26 +631,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -631,26 +631,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -666,21 +666,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -666,21 +666,21 @@ export default class ContactServiceBase extends EntityService {
public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
leadsData.forEach((item:any) => { opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.leadid = null; item.opportunityid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.opportunities = opportunitiesData;
let listcontactsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
...@@ -696,26 +696,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -696,26 +696,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let opportunitiesData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
opportunitiesData.forEach((item:any) => { leadsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunities = opportunitiesData; masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading); return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading);
......
...@@ -69,21 +69,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -69,21 +69,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){ if(context.account && context.contact && true){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -114,22 +99,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -114,22 +99,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && true){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -145,6 +114,22 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -145,6 +114,22 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && true){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -175,21 +160,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -175,21 +160,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -205,6 +175,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -205,6 +175,21 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -235,6 +220,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -235,6 +220,21 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -244,9 +244,9 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -244,9 +244,9 @@ export default class OpportunityServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities`,data,isloading); let res:any = await Http.getInstance().post(`/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -262,21 +262,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -262,21 +262,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -307,15 +292,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -307,15 +292,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -331,6 +307,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -331,6 +307,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -361,14 +346,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -361,14 +346,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -384,6 +361,14 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -384,6 +361,14 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -414,11 +399,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -414,11 +399,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading); let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -453,22 +453,22 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -453,22 +453,22 @@ export default class OpportunityServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -485,24 +485,24 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -485,24 +485,24 @@ export default class OpportunityServiceBase extends EntityService {
if(context.account && context.contact && true){ if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
if(context.contact && true){ if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -518,21 +518,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -518,21 +518,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -563,15 +548,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -563,15 +548,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -587,6 +563,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -587,6 +563,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -617,11 +602,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -617,11 +602,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/active`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/active`,data,isloading);
...@@ -639,21 +639,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -639,21 +639,6 @@ export default class OpportunityServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -684,15 +669,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -684,15 +669,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -708,6 +684,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -708,6 +684,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -738,11 +723,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -738,11 +723,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
...@@ -760,21 +760,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -760,21 +760,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Lose(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Lose(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -805,15 +790,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -805,15 +790,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -829,6 +805,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -829,6 +805,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -859,11 +844,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -859,11 +844,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/lose`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/lose`,data,isloading);
...@@ -881,21 +881,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -881,21 +881,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -926,15 +911,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -926,15 +911,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -950,6 +926,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -950,6 +926,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -980,14 +965,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -980,14 +965,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
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+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -1003,6 +980,14 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1003,6 +980,14 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -1033,11 +1018,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1033,11 +1018,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading); let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -1053,21 +1053,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1053,21 +1053,6 @@ export default class OpportunityServiceBase extends EntityService {
public async Win(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Win(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData: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.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -1098,15 +1083,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1098,15 +1083,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunitycompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
...@@ -1122,6 +1098,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1122,6 +1098,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -1152,11 +1137,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1152,11 +1137,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; 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) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts)); this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/win`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/win`,data,isloading);
......
...@@ -77,36 +77,36 @@ export default class ProductServiceBase extends EntityService { ...@@ -77,36 +77,36 @@ export default class ProductServiceBase extends EntityService {
} }
} }
masterData.productpricelevels = productpricelevelsData; masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = []; let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){ if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productsubstitutesData.forEach((item:any) => { productassociationsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null; item.productassociationid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productsubstitutes = productsubstitutesData; masterData.productassociations = productassociationsData;
let productassociationsData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){ if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productassociationsData.forEach((item:any) => { productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null; item.productsubstituteid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productassociations = productassociationsData; masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -117,8 +117,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -117,8 +117,8 @@ export default class ProductServiceBase extends EntityService {
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading); let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels)); 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)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res; return res;
} }
...@@ -148,41 +148,41 @@ export default class ProductServiceBase extends EntityService { ...@@ -148,41 +148,41 @@ export default class ProductServiceBase extends EntityService {
} }
} }
masterData.productpricelevels = productpricelevelsData; masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = []; let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){ if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productsubstitutesData.forEach((item:any) => { productassociationsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null; item.productassociationid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productsubstitutes = productsubstitutesData; masterData.productassociations = productassociationsData;
let productassociationsData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){ if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productassociationsData.forEach((item:any) => { productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null; item.productsubstituteid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productassociations = productassociationsData; masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading); let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels)); 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)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res; return res;
} }
...@@ -211,8 +211,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -211,8 +211,8 @@ export default class ProductServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading); let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels)); 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)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res; return res;
} }
...@@ -229,8 +229,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -229,8 +229,8 @@ export default class ProductServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/products/getdraft`,isloading); let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product; res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels)); 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)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res; return res;
} }
...@@ -273,41 +273,41 @@ export default class ProductServiceBase extends EntityService { ...@@ -273,41 +273,41 @@ export default class ProductServiceBase extends EntityService {
} }
} }
masterData.productpricelevels = productpricelevelsData; masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = []; let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){ if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){
productsubstitutesData.forEach((item:any) => { productassociationsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.productsubstituteid = null; item.productassociationid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productsubstitutes = productsubstitutesData; masterData.productassociations = productassociationsData;
let productassociationsData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productassociationsData && productassociationsData.length && productassociationsData.length > 0){ if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productassociationsData.forEach((item:any) => { productsubstitutesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.productassociationid = null; item.productsubstituteid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productassociations = productassociationsData; masterData.productsubstitutes = productsubstitutesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading); let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels)); 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)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
return res; return res;
} }
......
...@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = []; let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any); salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
...@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading); let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = []; let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any); salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
...@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading); let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading); let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading); let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature; res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let salesliteratureitemsData:any = []; let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any); salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
...@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading); let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!--输出实体[ACCOUNT]数据结构 --> <!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-429-1"> <changeSet author="a_LAB01_e85d8801c" id="tab-account-437-1">
<createTable tableName="ACCOUNT"> <createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)"> <column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column> </column>
...@@ -10879,7 +10879,7 @@ ...@@ -10879,7 +10879,7 @@
<!--输出实体[WEBSITECHANNEL]数据结构 --> <!--输出实体[WEBSITECHANNEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-websitechannel-68-129"> <changeSet author="a_LAB01_e85d8801c" id="tab-websitechannel-69-129">
<createTable tableName="WEBSITECHANNEL"> <createTable tableName="WEBSITECHANNEL">
<column name="WEBSITECHANNELID" remarks="" type="VARCHAR(100)"> <column name="WEBSITECHANNELID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_WEBSITECHANNEL_WEBSITECHANN"/> <constraints primaryKey="true" primaryKeyName="PK_WEBSITECHANNEL_WEBSITECHANN"/>
...@@ -10978,31 +10978,31 @@ ...@@ -10978,31 +10978,31 @@
</changeSet> </changeSet>
<!--输出实体[ACCOUNT]外键关系 --> <!--输出实体[ACCOUNT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-132"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-132">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__ACCOUNT__PARENT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__ACCOUNT__PARENT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-133"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-133">
<addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__CONTACT__PRIMAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PRIMARYCONTACTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__CONTACT__PRIMAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-134"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-134">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-135"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-135">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/> <addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-136"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-136">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/> <addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-137"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-137">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/> <addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-138"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-138">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/> <addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-139"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-139">
<addForeignKeyConstraint baseColumnNames="TERRITORYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TERRITORY__TERR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TERRITORYID" referencedTableName="TERRITORY" validate="true"/> <addForeignKeyConstraint baseColumnNames="TERRITORYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TERRITORY__TERR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TERRITORYID" referencedTableName="TERRITORY" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-429-140"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-437-140">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/> <addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[ACTIVITYMIMEATTACHMENT]外键关系 --> <!--输出实体[ACTIVITYMIMEATTACHMENT]外键关系 -->
...@@ -11904,10 +11904,10 @@ ...@@ -11904,10 +11904,10 @@
<!--输出实体[UOMSCHEDULE]外键关系 --> <!--输出实体[UOMSCHEDULE]外键关系 -->
<!--输出实体[WEBSITE]外键关系 --> <!--输出实体[WEBSITE]外键关系 -->
<!--输出实体[WEBSITECHANNEL]外键关系 --> <!--输出实体[WEBSITECHANNEL]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-websitechannel-68-427"> <changeSet author="a_LAB01_e85d8801c" id="fk-websitechannel-69-427">
<addForeignKeyConstraint baseColumnNames="PWEBSITECHANNELID" baseTableName="WEBSITECHANNEL" constraintName="DER1N_WEBSITECHANNEL_WEBSITECH" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITECHANNELID" referencedTableName="WEBSITECHANNEL" validate="true"/> <addForeignKeyConstraint baseColumnNames="PWEBSITECHANNELID" baseTableName="WEBSITECHANNEL" constraintName="DER1N_WEBSITECHANNEL_WEBSITECH" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITECHANNELID" referencedTableName="WEBSITECHANNEL" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-websitechannel-68-428"> <changeSet author="a_LAB01_e85d8801c" id="fk-websitechannel-69-428">
<addForeignKeyConstraint baseColumnNames="WEBSITEID" baseTableName="WEBSITECHANNEL" constraintName="DER1N_WEBSITECHANNEL_WEBSITE_W" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITEID" referencedTableName="WEBSITE" validate="true"/> <addForeignKeyConstraint baseColumnNames="WEBSITEID" baseTableName="WEBSITECHANNEL" constraintName="DER1N_WEBSITECHANNEL_WEBSITE_W" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WEBSITEID" referencedTableName="WEBSITE" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[WEBSITECONTENT]外键关系 --> <!--输出实体[WEBSITECONTENT]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册