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

lab_gzf 发布系统代码

上级 02aeeb2c
<studio-view-style2 viewName="salesorderinfo_soview" viewTitle="订单编辑视图" class='deeditview sales-order-info-soview'> <studio-view-style2 viewName="salesorderinfo_soview" viewTitle="订单编辑视图" class='deeditview sales-order-info-soview from-dashboard-style'>
<view_form <view_form
:viewState="viewState" :viewState="viewState"
:viewparams="viewparams" :viewparams="viewparams"
......
...@@ -62,36 +62,36 @@ export default class AccountServiceBase extends EntityService { ...@@ -62,36 +62,36 @@ export default class AccountServiceBase 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 listaccountsData:any = []; let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any); contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){ if(contactsData && contactsData.length && contactsData.length > 0){
listaccountsData.forEach((item:any) => { contactsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.contactid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listaccounts = listaccountsData; masterData.contacts = contactsData;
let contactsData:any = []; let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any); listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){ if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
contactsData.forEach((item:any) => { listaccountsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.contactid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.contacts = contactsData; masterData.listaccounts = listaccountsData;
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;
...@@ -101,8 +101,8 @@ export default class AccountServiceBase extends EntityService { ...@@ -101,8 +101,8 @@ export default class AccountServiceBase 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`,data,isloading); let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
return res; return res;
} }
...@@ -117,40 +117,40 @@ export default class AccountServiceBase extends EntityService { ...@@ -117,40 +117,40 @@ export default class AccountServiceBase 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 listaccountsData:any = []; let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any); contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){ if(contactsData && contactsData.length && contactsData.length > 0){
listaccountsData.forEach((item:any) => { contactsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.contactid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listaccounts = listaccountsData; masterData.contacts = contactsData;
let contactsData:any = []; let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any); listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){ if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
contactsData.forEach((item:any) => { listaccountsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.contactid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.contacts = contactsData; masterData.listaccounts = listaccountsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading); let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts)); this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
return res; return res;
} }
...@@ -178,8 +178,8 @@ export default class AccountServiceBase extends EntityService { ...@@ -178,8 +178,8 @@ export default class AccountServiceBase 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(`/accounts/${context.account}`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts)); this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
return res; return res;
} }
...@@ -195,8 +195,8 @@ export default class AccountServiceBase extends EntityService { ...@@ -195,8 +195,8 @@ export default class AccountServiceBase 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(`/accounts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/accounts/getdraft`,isloading);
res.data.account = data.account; res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts)); this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
return res; return res;
} }
...@@ -224,40 +224,40 @@ export default class AccountServiceBase extends EntityService { ...@@ -224,40 +224,40 @@ export default class AccountServiceBase 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 listaccountsData:any = []; let contactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any); contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any);
if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){ if(contactsData && contactsData.length && contactsData.length > 0){
listaccountsData.forEach((item:any) => { contactsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.contactid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listaccounts = listaccountsData; masterData.contacts = contactsData;
let contactsData:any = []; let listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_contacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
contactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_contacts') as any); listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
if(contactsData && contactsData.length && contactsData.length > 0){ if(listaccountsData && listaccountsData.length && listaccountsData.length > 0){
contactsData.forEach((item:any) => { listaccountsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.contactid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.contacts = contactsData; masterData.listaccounts = listaccountsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts)); this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
return res; return res;
} }
......
...@@ -66,36 +66,36 @@ export default class ContactServiceBase extends EntityService { ...@@ -66,36 +66,36 @@ 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 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;
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);
...@@ -120,42 +120,42 @@ export default class ContactServiceBase extends EntityService { ...@@ -120,42 +120,42 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
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;
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);
...@@ -180,8 +180,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -180,8 +180,8 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
...@@ -198,36 +198,36 @@ export default class ContactServiceBase extends EntityService { ...@@ -198,36 +198,36 @@ 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 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;
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);
...@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService { ...@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService {
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
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;
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);
...@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService {
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
...@@ -332,14 +332,14 @@ export default class ContactServiceBase extends EntityService { ...@@ -332,14 +332,14 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
...@@ -357,15 +357,15 @@ export default class ContactServiceBase extends EntityService { ...@@ -357,15 +357,15 @@ 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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
...@@ -382,36 +382,36 @@ export default class ContactServiceBase extends EntityService { ...@@ -382,36 +382,36 @@ 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 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;
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,8 +429,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService {
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
...@@ -449,36 +449,36 @@ export default class ContactServiceBase extends EntityService { ...@@ -449,36 +449,36 @@ 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 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;
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,42 +496,42 @@ export default class ContactServiceBase extends EntityService { ...@@ -496,42 +496,42 @@ export default class ContactServiceBase extends EntityService {
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
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;
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);
...@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService {
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
...@@ -567,36 +567,36 @@ export default class ContactServiceBase extends EntityService { ...@@ -567,36 +567,36 @@ 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 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;
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);
...@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService {
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res; return res;
} }
......
...@@ -69,21 +69,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -69,21 +69,21 @@ 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 opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -99,21 +99,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -99,21 +99,21 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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;
...@@ -123,28 +123,28 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -123,28 +123,28 @@ 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(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading); 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)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && true){ if(context.contact && true){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -160,21 +160,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -160,21 +160,21 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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;
...@@ -184,27 +184,27 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -184,27 +184,27 @@ 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(`/contacts/${context.contact}/opportunities`,data,isloading); 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)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -220,21 +220,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -220,21 +220,21 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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+'_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)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -262,21 +262,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -262,21 +262,21 @@ 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 opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -292,45 +292,45 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -292,45 +292,45 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -346,44 +346,44 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -346,44 +346,44 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -399,26 +399,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -399,26 +399,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -518,21 +518,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -518,21 +518,21 @@ 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 opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -548,45 +548,45 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -548,45 +548,45 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -602,26 +602,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -602,26 +602,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
...@@ -639,21 +639,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -639,21 +639,21 @@ 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 opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -669,45 +669,45 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -669,45 +669,45 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/lose`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -723,26 +723,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -723,26 +723,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/lose`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/lose`,data,isloading);
...@@ -760,21 +760,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -760,21 +760,21 @@ 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 opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -790,45 +790,45 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -790,45 +790,45 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -844,44 +844,44 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -844,44 +844,44 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -897,26 +897,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -897,26 +897,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -932,21 +932,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -932,21 +932,21 @@ 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 opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -962,45 +962,45 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -962,45 +962,45 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/win`,data,isloading); 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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
opportunityproductsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null; item.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -1016,26 +1016,26 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1016,26 +1016,26 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.quotes = quotesData; masterData.quotes = quotesData;
let opportunitycompetitorsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.opportunityproductid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunityproducts = opportunityproductsData;
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+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; 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.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
let productpricelevelsData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){ if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productpricelevelsData.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.productpricelevelid = null; item.productsubstituteid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productpricelevels = productpricelevelsData; masterData.productsubstitutes = productsubstitutesData;
let productsubstitutesData:any = []; let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){ if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productsubstitutesData.forEach((item:any) => { productpricelevelsData.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.productpricelevelid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productsubstitutes = productsubstitutesData; masterData.productpricelevels = productpricelevelsData;
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+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
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.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
let productpricelevelsData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){ if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productpricelevelsData.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.productpricelevelid = null; item.productsubstituteid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productpricelevels = productpricelevelsData; masterData.productsubstitutes = productsubstitutesData;
let productsubstitutesData:any = []; let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){ if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productsubstitutesData.forEach((item:any) => { productpricelevelsData.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.productpricelevelid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productsubstitutes = productsubstitutesData; masterData.productpricelevels = productpricelevelsData;
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+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
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+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
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+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
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.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
let productpricelevelsData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){ if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){
productpricelevelsData.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.productpricelevelid = null; item.productsubstituteid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productpricelevels = productpricelevelsData; masterData.productsubstitutes = productsubstitutesData;
let productsubstitutesData:any = []; let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productsubstitutesData && productsubstitutesData.length && productsubstitutesData.length > 0){ if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productsubstitutesData.forEach((item:any) => { productpricelevelsData.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.productpricelevelid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.productsubstitutes = productsubstitutesData; masterData.productpricelevels = productpricelevelsData;
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+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res; return res;
} }
......
...@@ -62,11 +62,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -62,11 +62,11 @@ 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 productsalesliteraturesData:any = []; let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any); competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){ if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => { competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -76,7 +76,7 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -76,7 +76,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; 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);
...@@ -92,11 +92,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -92,11 +92,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
} }
masterData.salesliteratureitems = salesliteratureitemsData; masterData.salesliteratureitems = salesliteratureitemsData;
let competitorsalesliteraturesData:any = []; let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any); productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){ if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => { productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.competitorsalesliteratures = competitorsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res; return res;
} }
...@@ -133,11 +133,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -133,11 +133,11 @@ 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 productsalesliteraturesData:any = []; let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any); competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){ if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => { competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -147,7 +147,7 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -147,7 +147,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; 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);
...@@ -163,11 +163,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -163,11 +163,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
} }
masterData.salesliteratureitems = salesliteratureitemsData; masterData.salesliteratureitems = salesliteratureitemsData;
let competitorsalesliteraturesData:any = []; let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any); productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){ if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => { productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.competitorsalesliteratures = competitorsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res; return res;
} }
...@@ -258,11 +258,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -258,11 +258,11 @@ 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 productsalesliteraturesData:any = []; let competitorsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any); competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){ if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => { competitorsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -272,7 +272,7 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -272,7 +272,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; 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);
...@@ -288,11 +288,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -288,11 +288,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
} }
} }
masterData.salesliteratureitems = salesliteratureitemsData; masterData.salesliteratureitems = salesliteratureitemsData;
let competitorsalesliteraturesData:any = []; let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
competitorsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorsalesliteratures') as any); productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(competitorsalesliteraturesData && competitorsalesliteraturesData.length && competitorsalesliteraturesData.length > 0){ if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
competitorsalesliteraturesData.forEach((item:any) => { productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.competitorsalesliteratures = competitorsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
return res; return res;
} }
......
...@@ -4558,7 +4558,7 @@ ...@@ -4558,7 +4558,7 @@
<!--输出实体[ACCOUNT]数据结构 --> <!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-367-55"> <changeSet author="a_LAB01_e85d8801c" id="tab-account-370-55">
<createTable tableName="ACCOUNT"> <createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)"> <column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column> </column>
...@@ -8582,7 +8582,7 @@ ...@@ -8582,7 +8582,7 @@
<!--输出实体[SALESORDER]数据结构 --> <!--输出实体[SALESORDER]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-salesorder-50-96"> <changeSet author="a_LAB01_e85d8801c" id="tab-salesorder-52-96">
<createTable tableName="SALESORDER"> <createTable tableName="SALESORDER">
<column name="ENTITYIMAGE" remarks="" type="VARCHAR(100)"> <column name="ENTITYIMAGE" remarks="" type="VARCHAR(100)">
</column> </column>
...@@ -11199,31 +11199,31 @@ ...@@ -11199,31 +11199,31 @@
<addForeignKeyConstraint baseColumnNames="METRICID" baseTableName="GOAL" constraintName="DER1N_GOAL__METRIC__METRICID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="METRICID" referencedTableName="METRIC" validate="true"/> <addForeignKeyConstraint baseColumnNames="METRICID" baseTableName="GOAL" constraintName="DER1N_GOAL__METRIC__METRICID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="METRICID" referencedTableName="METRIC" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[ACCOUNT]外键关系 --> <!--输出实体[ACCOUNT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-account-367-259"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-259">
<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-367-260"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-260">
<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-367-261"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-261">
<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-367-262"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-262">
<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-367-263"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-263">
<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-367-264"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-264">
<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-367-265"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-265">
<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-367-266"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-266">
<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-367-267"> <changeSet author="a_LAB01_e85d8801c" id="fk-account-370-267">
<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>
<!--输出实体[KNOWLEDGEARTICLEVIEWS]外键关系 --> <!--输出实体[KNOWLEDGEARTICLEVIEWS]外键关系 -->
...@@ -11522,22 +11522,22 @@ ...@@ -11522,22 +11522,22 @@
<addForeignKeyConstraint baseColumnNames="RESOURCECATEGORY" baseTableName="BOOKABLERESCATEGORYASSN" constraintName="DER1N_BOOKABLERESCATEGORYASSN_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="BOOKABLERESCATEGORYID" referencedTableName="BOOKABLERESCATEGORY" validate="true"/> <addForeignKeyConstraint baseColumnNames="RESOURCECATEGORY" baseTableName="BOOKABLERESCATEGORYASSN" constraintName="DER1N_BOOKABLERESCATEGORYASSN_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="BOOKABLERESCATEGORYID" referencedTableName="BOOKABLERESCATEGORY" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[SALESORDER]外键关系 --> <!--输出实体[SALESORDER]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-50-364"> <changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-52-364">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__CAMPAIGN__CA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/> <addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__CAMPAIGN__CA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-50-365"> <changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-52-365">
<addForeignKeyConstraint baseColumnNames="OPPORTUNITYID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__OPPORTUNITY_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/> <addForeignKeyConstraint baseColumnNames="OPPORTUNITYID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__OPPORTUNITY_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYID" referencedTableName="OPPORTUNITY" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-50-366"> <changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-52-366">
<addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__PRICELEVEL__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/> <addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__PRICELEVEL__" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-50-367"> <changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-52-367">
<addForeignKeyConstraint baseColumnNames="QUOTEID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__QUOTE__QUOTE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="QUOTEID" referencedTableName="QUOTE" validate="true"/> <addForeignKeyConstraint baseColumnNames="QUOTEID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__QUOTE__QUOTE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="QUOTEID" referencedTableName="QUOTE" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-50-368"> <changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-52-368">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/> <addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__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-salesorder-50-369"> <changeSet author="a_LAB01_e85d8801c" id="fk-salesorder-52-369">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__TRANSACTIONC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/> <addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="SALESORDER" constraintName="DER1N_SALESORDER__TRANSACTIONC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[LEADADDRESS]外键关系 --> <!--输出实体[LEADADDRESS]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册