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

lab_gzf 发布系统代码

上级 7f8770a6
...@@ -193,6 +193,7 @@ export default { ...@@ -193,6 +193,7 @@ export default {
abstractinfo_form: { abstractinfo_form: {
details: { details: {
group1: "商机基本信息", group1: "商机基本信息",
grouppanel1: "详细信息",
formpage1: "基本信息", formpage1: "基本信息",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
srforikey: "", srforikey: "",
...@@ -210,6 +211,7 @@ export default { ...@@ -210,6 +211,7 @@ export default {
budgetamount: "预算金额", budgetamount: "预算金额",
purchaseprocess: "采购程序", purchaseprocess: "采购程序",
description: "说明", description: "说明",
pricelevelname: "价目表",
currentsituation: "当前状况", currentsituation: "当前状况",
customerneed: "客户需求", customerneed: "客户需求",
proposedsolution: "已拟定解决方案", proposedsolution: "已拟定解决方案",
...@@ -218,9 +220,9 @@ export default { ...@@ -218,9 +220,9 @@ export default {
uiactions: { uiactions: {
}, },
}, },
productinfo_form: { main_form: {
details: { details: {
group1: "价目表信息", group1: "基本信息",
druipart1: "", druipart1: "",
grouppanel1: "产品明细信息", grouppanel1: "产品明细信息",
formpage1: "基本信息", formpage1: "基本信息",
...@@ -232,15 +234,30 @@ export default { ...@@ -232,15 +234,30 @@ export default {
srfuf: "", srfuf: "",
srfdeid: "", srfdeid: "",
srfsourcekey: "", srfsourcekey: "",
opportunityname: "商机名称",
parentcontactname: "联系人",
parentaccountname: "帐户",
purchasetimeframe: "购买时间范围",
transactioncurrencyname: "货币",
budgetamount: "预算金额",
purchaseprocess: "采购程序",
description: "说明",
currentsituation: "当前状况",
customerneed: "客户需求",
proposedsolution: "已拟定解决方案",
pricelevelname: "价目表", pricelevelname: "价目表",
parentcontactid: "联系人",
parentaccountid: "帐户",
transactioncurrencyid: "货币",
opportunityid: "商机", opportunityid: "商机",
pricelevelid: "价目表",
}, },
uiactions: { uiactions: {
}, },
}, },
main_form: { productinfo_form: {
details: { details: {
group1: "基本信息", group1: "价目表信息",
druipart1: "", druipart1: "",
grouppanel1: "产品明细信息", grouppanel1: "产品明细信息",
formpage1: "基本信息", formpage1: "基本信息",
...@@ -252,23 +269,8 @@ export default { ...@@ -252,23 +269,8 @@ export default {
srfuf: "", srfuf: "",
srfdeid: "", srfdeid: "",
srfsourcekey: "", srfsourcekey: "",
opportunityname: "商机名称",
parentcontactname: "联系人",
parentaccountname: "帐户",
purchasetimeframe: "购买时间范围",
transactioncurrencyname: "货币",
budgetamount: "预算金额",
purchaseprocess: "采购程序",
description: "说明",
currentsituation: "当前状况",
customerneed: "客户需求",
proposedsolution: "已拟定解决方案",
pricelevelname: "价目表", pricelevelname: "价目表",
parentcontactid: "联系人",
parentaccountid: "帐户",
transactioncurrencyid: "货币",
opportunityid: "商机", opportunityid: "商机",
pricelevelid: "价目表",
}, },
uiactions: { uiactions: {
}, },
......
...@@ -192,6 +192,7 @@ export default { ...@@ -192,6 +192,7 @@ export default {
abstractinfo_form: { abstractinfo_form: {
details: { details: {
group1: "商机基本信息", group1: "商机基本信息",
grouppanel1: "详细信息",
formpage1: "基本信息", formpage1: "基本信息",
srfupdatedate: "更新时间", srfupdatedate: "更新时间",
srforikey: "", srforikey: "",
...@@ -209,6 +210,7 @@ export default { ...@@ -209,6 +210,7 @@ export default {
budgetamount: "预算金额", budgetamount: "预算金额",
purchaseprocess: "采购程序", purchaseprocess: "采购程序",
description: "说明", description: "说明",
pricelevelname: "价目表",
currentsituation: "当前状况", currentsituation: "当前状况",
customerneed: "客户需求", customerneed: "客户需求",
proposedsolution: "已拟定解决方案", proposedsolution: "已拟定解决方案",
...@@ -217,9 +219,9 @@ export default { ...@@ -217,9 +219,9 @@ export default {
uiactions: { uiactions: {
}, },
}, },
productinfo_form: { main_form: {
details: { details: {
group1: "价目表信息", group1: "基本信息",
druipart1: "", druipart1: "",
grouppanel1: "产品明细信息", grouppanel1: "产品明细信息",
formpage1: "基本信息", formpage1: "基本信息",
...@@ -231,15 +233,30 @@ export default { ...@@ -231,15 +233,30 @@ export default {
srfuf: "", srfuf: "",
srfdeid: "", srfdeid: "",
srfsourcekey: "", srfsourcekey: "",
opportunityname: "商机名称",
parentcontactname: "联系人",
parentaccountname: "帐户",
purchasetimeframe: "购买时间范围",
transactioncurrencyname: "货币",
budgetamount: "预算金额",
purchaseprocess: "采购程序",
description: "说明",
currentsituation: "当前状况",
customerneed: "客户需求",
proposedsolution: "已拟定解决方案",
pricelevelname: "价目表", pricelevelname: "价目表",
parentcontactid: "联系人",
parentaccountid: "帐户",
transactioncurrencyid: "货币",
opportunityid: "商机", opportunityid: "商机",
pricelevelid: "价目表",
}, },
uiactions: { uiactions: {
}, },
}, },
main_form: { productinfo_form: {
details: { details: {
group1: "基本信息", group1: "价目表信息",
druipart1: "", druipart1: "",
grouppanel1: "产品明细信息", grouppanel1: "产品明细信息",
formpage1: "基本信息", formpage1: "基本信息",
...@@ -251,23 +268,8 @@ export default { ...@@ -251,23 +268,8 @@ export default {
srfuf: "", srfuf: "",
srfdeid: "", srfdeid: "",
srfsourcekey: "", srfsourcekey: "",
opportunityname: "商机名称",
parentcontactname: "联系人",
parentaccountname: "帐户",
purchasetimeframe: "购买时间范围",
transactioncurrencyname: "货币",
budgetamount: "预算金额",
purchaseprocess: "采购程序",
description: "说明",
currentsituation: "当前状况",
customerneed: "客户需求",
proposedsolution: "已拟定解决方案",
pricelevelname: "价目表", pricelevelname: "价目表",
parentcontactid: "联系人",
parentaccountid: "帐户",
transactioncurrencyid: "货币",
opportunityid: "商机", opportunityid: "商机",
pricelevelid: "价目表",
}, },
uiactions: { uiactions: {
}, },
......
...@@ -21,7 +21,6 @@ export const PageComponents = { ...@@ -21,7 +21,6 @@ export const PageComponents = {
Vue.component('task-quick-create', () => import('@pages/base/task-quick-create/task-quick-create.vue')); Vue.component('task-quick-create', () => import('@pages/base/task-quick-create/task-quick-create.vue'));
Vue.component('opportunity-quick-create', () => import('@pages/sales/opportunity-quick-create/opportunity-quick-create.vue')); Vue.component('opportunity-quick-create', () => import('@pages/sales/opportunity-quick-create/opportunity-quick-create.vue'));
Vue.component('product-price-level-pro-prilv-edit-view', () => import('@pages/product/product-price-level-pro-prilv-edit-view/product-price-level-pro-prilv-edit-view.vue')); Vue.component('product-price-level-pro-prilv-edit-view', () => import('@pages/product/product-price-level-pro-prilv-edit-view/product-price-level-pro-prilv-edit-view.vue'));
Vue.component('opportunity-info-product', () => import('@pages/sales/opportunity-info-product/opportunity-info-product.vue'));
Vue.component('invoice-quick-create-view', () => import('@pages/finance/invoice-quick-create-view/invoice-quick-create-view.vue')); Vue.component('invoice-quick-create-view', () => import('@pages/finance/invoice-quick-create-view/invoice-quick-create-view.vue'));
Vue.component('opportunity-competitor-opp-comp-grid-view', () => import('@pages/sales/opportunity-competitor-opp-comp-grid-view/opportunity-competitor-opp-comp-grid-view.vue')); Vue.component('opportunity-competitor-opp-comp-grid-view', () => import('@pages/sales/opportunity-competitor-opp-comp-grid-view/opportunity-competitor-opp-comp-grid-view.vue'));
Vue.component('goal-info-goal-view', () => import('@pages/sales/goal-info-goal-view/goal-info-goal-view.vue')); Vue.component('goal-info-goal-view', () => import('@pages/sales/goal-info-goal-view/goal-info-goal-view.vue'));
...@@ -82,8 +81,8 @@ export const PageComponents = { ...@@ -82,8 +81,8 @@ export const PageComponents = {
Vue.component('competitor-grid-view', () => import('@pages/sales/competitor-grid-view/competitor-grid-view.vue')); Vue.component('competitor-grid-view', () => import('@pages/sales/competitor-grid-view/competitor-grid-view.vue'));
Vue.component('account-summary', () => import('@pages/base/account-summary/account-summary.vue')); Vue.component('account-summary', () => import('@pages/base/account-summary/account-summary.vue'));
Vue.component('sales-literature-info-view', () => import('@pages/sales/sales-literature-info-view/sales-literature-info-view.vue')); Vue.component('sales-literature-info-view', () => import('@pages/sales/sales-literature-info-view/sales-literature-info-view.vue'));
Vue.component('opportunity-product-opp-opp-pro-grid-view', () => import('@pages/sales/opportunity-product-opp-opp-pro-grid-view/opportunity-product-opp-opp-pro-grid-view.vue'));
Vue.component('ibiz-list-quick-create', () => import('@pages/marketing/ibiz-list-quick-create/ibiz-list-quick-create.vue')); Vue.component('ibiz-list-quick-create', () => import('@pages/marketing/ibiz-list-quick-create/ibiz-list-quick-create.vue'));
Vue.component('opportunity-product-opp-opp-pro-grid-view', () => import('@pages/sales/opportunity-product-opp-opp-pro-grid-view/opportunity-product-opp-opp-pro-grid-view.vue'));
Vue.component('product-association-grid-view', () => import('@pages/product/product-association-grid-view/product-association-grid-view.vue')); Vue.component('product-association-grid-view', () => import('@pages/product/product-association-grid-view/product-association-grid-view.vue'));
Vue.component('appointment-quick-create', () => import('@pages/base/appointment-quick-create/appointment-quick-create.vue')); Vue.component('appointment-quick-create', () => import('@pages/base/appointment-quick-create/appointment-quick-create.vue'));
Vue.component('quote-detail-quo-detail-grid-view', () => import('@pages/sales/quote-detail-quo-detail-grid-view/quote-detail-quo-detail-grid-view.vue')); Vue.component('quote-detail-quo-detail-grid-view', () => import('@pages/sales/quote-detail-quo-detail-grid-view/quote-detail-quo-detail-grid-view.vue'));
...@@ -129,7 +128,6 @@ export const PageComponents = { ...@@ -129,7 +128,6 @@ export const PageComponents = {
Vue.component('quote-opp-qua-grid-view', () => import('@pages/sales/quote-opp-qua-grid-view/quote-opp-qua-grid-view.vue')); Vue.component('quote-opp-qua-grid-view', () => import('@pages/sales/quote-opp-qua-grid-view/quote-opp-qua-grid-view.vue'));
Vue.component('invoice-info-view', () => import('@pages/finance/invoice-info-view/invoice-info-view.vue')); Vue.component('invoice-info-view', () => import('@pages/finance/invoice-info-view/invoice-info-view.vue'));
Vue.component('contact-by-account', () => import('@pages/base/contact-by-account/contact-by-account.vue')); Vue.component('contact-by-account', () => import('@pages/base/contact-by-account/contact-by-account.vue'));
Vue.component('opportunity-opp-pro-dashboard-view', () => import('@pages/sales/opportunity-opp-pro-dashboard-view/opportunity-opp-pro-dashboard-view.vue'));
Vue.component('ibiz-list-summary', () => import('@pages/marketing/ibiz-list-summary/ibiz-list-summary.vue')); Vue.component('ibiz-list-summary', () => import('@pages/marketing/ibiz-list-summary/ibiz-list-summary.vue'));
Vue.component('sales-literature-item-grid-view', () => import('@pages/sales/sales-literature-item-grid-view/sales-literature-item-grid-view.vue')); Vue.component('sales-literature-item-grid-view', () => import('@pages/sales/sales-literature-item-grid-view/sales-literature-item-grid-view.vue'));
Vue.component('lead-dashboard-view', () => import('@pages/sales/lead-dashboard-view/lead-dashboard-view.vue')); Vue.component('lead-dashboard-view', () => import('@pages/sales/lead-dashboard-view/lead-dashboard-view.vue'));
......
...@@ -528,51 +528,6 @@ const router = new Router({ ...@@ -528,51 +528,6 @@ const router = new Router({
}, },
component: () => import('@pages/product/product-price-level-pro-prilv-edit-view/product-price-level-pro-prilv-edit-view.vue'), component: () => import('@pages/product/product-price-level-pro-prilv-edit-view/product-price-level-pro-prilv-edit-view.vue'),
}, },
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/info_product/:info_product?',
meta: {
caption: 'entities.opportunity.views.info_product.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'info_product', parameterName: 'info_product' },
],
requireAuth: true,
},
component: () => import('@pages/sales/opportunity-info-product/opportunity-info-product.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/info_product/:info_product?',
meta: {
caption: 'entities.opportunity.views.info_product.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'info_product', parameterName: 'info_product' },
],
requireAuth: true,
},
component: () => import('@pages/sales/opportunity-info-product/opportunity-info-product.vue'),
},
{
path: 'opportunities/:opportunity?/info_product/:info_product?',
meta: {
caption: 'entities.opportunity.views.info_product.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'info_product', parameterName: 'info_product' },
],
requireAuth: true,
},
component: () => import('@pages/sales/opportunity-info-product/opportunity-info-product.vue'),
},
{ {
path: 'invoices/:invoice?/quickcreateview/:quickcreateview?', path: 'invoices/:invoice?/quickcreateview/:quickcreateview?',
meta: { meta: {
...@@ -2095,6 +2050,20 @@ const router = new Router({ ...@@ -2095,6 +2050,20 @@ const router = new Router({
}, },
component: () => import('@pages/sales/sales-literature-info-view/sales-literature-info-view.vue'), component: () => import('@pages/sales/sales-literature-info-view/sales-literature-info-view.vue'),
}, },
{
path: 'ibizlists/:ibizlist?/quickcreate/:quickcreate?',
meta: {
caption: 'entities.ibizlist.views.quickcreate.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'quickcreate', parameterName: 'quickcreate' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/ibiz-list-quick-create/ibiz-list-quick-create.vue'),
},
{ {
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/opportunityproducts/:opportunityproduct?/opp_oppprogridview/:opp_oppprogridview?', path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/opportunityproducts/:opportunityproduct?/opp_oppprogridview/:opp_oppprogridview?',
meta: { meta: {
...@@ -2157,20 +2126,6 @@ const router = new Router({ ...@@ -2157,20 +2126,6 @@ const router = new Router({
}, },
component: () => import('@pages/sales/opportunity-product-opp-opp-pro-grid-view/opportunity-product-opp-opp-pro-grid-view.vue'), component: () => import('@pages/sales/opportunity-product-opp-opp-pro-grid-view/opportunity-product-opp-opp-pro-grid-view.vue'),
}, },
{
path: 'ibizlists/:ibizlist?/quickcreate/:quickcreate?',
meta: {
caption: 'entities.ibizlist.views.quickcreate.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'ibizlists', parameterName: 'ibizlist' },
{ pathName: 'quickcreate', parameterName: 'quickcreate' },
],
requireAuth: true,
},
component: () => import('@pages/marketing/ibiz-list-quick-create/ibiz-list-quick-create.vue'),
},
{ {
path: 'products/:product?/productassociations/:productassociation?/gridview/:gridview?', path: 'products/:product?/productassociations/:productassociation?/gridview/:gridview?',
meta: { meta: {
...@@ -3467,51 +3422,6 @@ const router = new Router({ ...@@ -3467,51 +3422,6 @@ const router = new Router({
}, },
component: () => import('@pages/base/contact-by-account/contact-by-account.vue'), component: () => import('@pages/base/contact-by-account/contact-by-account.vue'),
}, },
{
path: 'accounts/:account?/contacts/:contact?/opportunities/:opportunity?/oppprodashboardview/:oppprodashboardview?',
meta: {
caption: 'entities.opportunity.views.oppprodashboardview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'accounts', parameterName: 'account' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'oppprodashboardview', parameterName: 'oppprodashboardview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/opportunity-opp-pro-dashboard-view/opportunity-opp-pro-dashboard-view.vue'),
},
{
path: 'contacts/:contact?/opportunities/:opportunity?/oppprodashboardview/:oppprodashboardview?',
meta: {
caption: 'entities.opportunity.views.oppprodashboardview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'oppprodashboardview', parameterName: 'oppprodashboardview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/opportunity-opp-pro-dashboard-view/opportunity-opp-pro-dashboard-view.vue'),
},
{
path: 'opportunities/:opportunity?/oppprodashboardview/:oppprodashboardview?',
meta: {
caption: 'entities.opportunity.views.oppprodashboardview.title',
info:'',
parameters: [
{ pathName: 'central', parameterName: 'central' },
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'oppprodashboardview', parameterName: 'oppprodashboardview' },
],
requireAuth: true,
},
component: () => import('@pages/sales/opportunity-opp-pro-dashboard-view/opportunity-opp-pro-dashboard-view.vue'),
},
{ {
path: 'salesliteratures/:salesliterature?/competitorsalesliteratures/:competitorsalesliterature?/sallitcompgridview/:sallitcompgridview?', path: 'salesliteratures/:salesliterature?/competitorsalesliteratures/:competitorsalesliterature?/sallitcompgridview/:sallitcompgridview?',
meta: { meta: {
......
...@@ -62,11 +62,11 @@ export default class CampaignServiceBase extends EntityService { ...@@ -62,11 +62,11 @@ export default class CampaignServiceBase 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 campaignlistsData:any = []; let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any); campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){ if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaignlistsData.forEach((item:any) => { campaigncampaignsData.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 CampaignServiceBase extends EntityService { ...@@ -76,7 +76,7 @@ export default class CampaignServiceBase extends EntityService {
}); });
} }
} }
masterData.campaignlists = campaignlistsData; masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
...@@ -92,11 +92,11 @@ export default class CampaignServiceBase extends EntityService { ...@@ -92,11 +92,11 @@ export default class CampaignServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
let campaigncampaignsData:any = []; let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any); campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){ if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaigncampaignsData.forEach((item:any) => { campaignlistsData.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 CampaignServiceBase extends EntityService { ...@@ -106,7 +106,7 @@ export default class CampaignServiceBase extends EntityService {
}); });
} }
} }
masterData.campaigncampaigns = campaigncampaignsData; masterData.campaignlists = campaignlistsData;
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 CampaignServiceBase extends EntityService { ...@@ -116,9 +116,9 @@ export default class CampaignServiceBase 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(`/campaigns`,data,isloading); let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns)); this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res; return res;
} }
...@@ -133,11 +133,11 @@ export default class CampaignServiceBase extends EntityService { ...@@ -133,11 +133,11 @@ export default class CampaignServiceBase 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 campaignlistsData:any = []; let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any); campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){ if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaignlistsData.forEach((item:any) => { campaigncampaignsData.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 CampaignServiceBase extends EntityService { ...@@ -147,7 +147,7 @@ export default class CampaignServiceBase extends EntityService {
}); });
} }
} }
masterData.campaignlists = campaignlistsData; masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
...@@ -163,11 +163,11 @@ export default class CampaignServiceBase extends EntityService { ...@@ -163,11 +163,11 @@ export default class CampaignServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
let campaigncampaignsData:any = []; let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any); campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){ if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaigncampaignsData.forEach((item:any) => { campaignlistsData.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 CampaignServiceBase extends EntityService { ...@@ -177,12 +177,12 @@ export default class CampaignServiceBase extends EntityService {
}); });
} }
} }
masterData.campaigncampaigns = campaigncampaignsData; masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading); let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns)); this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res; return res;
} }
...@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService { ...@@ -210,9 +210,9 @@ export default class CampaignServiceBase 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(`/campaigns/${context.campaign}`,isloading); let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns)); this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res; return res;
} }
...@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService { ...@@ -228,9 +228,9 @@ export default class CampaignServiceBase 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(`/campaigns/getdraft`,isloading); let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign; res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns)); this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
return res; return res;
} }
...@@ -258,11 +258,11 @@ export default class CampaignServiceBase extends EntityService { ...@@ -258,11 +258,11 @@ export default class CampaignServiceBase 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 campaignlistsData:any = []; let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any); campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){ if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaignlistsData.forEach((item:any) => { campaigncampaignsData.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 CampaignServiceBase extends EntityService { ...@@ -272,7 +272,7 @@ export default class CampaignServiceBase extends EntityService {
}); });
} }
} }
masterData.campaignlists = campaignlistsData; masterData.campaigncampaigns = campaigncampaignsData;
let leadsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
...@@ -288,11 +288,11 @@ export default class CampaignServiceBase extends EntityService { ...@@ -288,11 +288,11 @@ export default class CampaignServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
let campaigncampaignsData:any = []; let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any); campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){ if(campaignlistsData && campaignlistsData.length && campaignlistsData.length > 0){
campaigncampaignsData.forEach((item:any) => { campaignlistsData.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 CampaignServiceBase extends EntityService { ...@@ -302,12 +302,12 @@ export default class CampaignServiceBase extends EntityService {
}); });
} }
} }
masterData.campaigncampaigns = campaigncampaignsData; masterData.campaignlists = campaignlistsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading); let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns)); this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
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 leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') 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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') 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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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 leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService { ...@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService {
masterData.opportunities = opportunitiesData; masterData.opportunities = opportunitiesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading); let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService {
masterData.opportunities = opportunitiesData; masterData.opportunities = opportunitiesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading); let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact; res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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 leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService {
masterData.opportunities = opportunitiesData; masterData.opportunities = opportunitiesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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 leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -496,42 +496,42 @@ export default class ContactServiceBase extends EntityService { ...@@ -496,42 +496,42 @@ export default class ContactServiceBase extends EntityService {
masterData.opportunities = opportunitiesData; masterData.opportunities = opportunitiesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res; return res;
} }
let masterData:any = {}; let masterData:any = {};
let leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService {
masterData.opportunities = opportunitiesData; masterData.opportunities = opportunitiesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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 leadsData:any = []; let listcontactsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any);
if(leadsData && leadsData.length && leadsData.length > 0){ if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){
leadsData.forEach((item:any) => { listcontactsData.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.relationshipsid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.leads = leadsData; masterData.listcontacts = listcontactsData;
let listcontactsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
listcontactsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listcontacts') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(listcontactsData && listcontactsData.length && listcontactsData.length > 0){ if(leadsData && leadsData.length && leadsData.length > 0){
listcontactsData.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.relationshipsid = null; item.leadid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.listcontacts = listcontactsData; masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService { ...@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService {
masterData.opportunities = opportunitiesData; masterData.opportunities = opportunitiesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
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);
......
...@@ -62,36 +62,36 @@ export default class ProductServiceBase extends EntityService { ...@@ -62,36 +62,36 @@ export default class ProductServiceBase 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 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;
let productassociationsData:any = []; let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any); productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
...@@ -116,8 +116,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -116,8 +116,8 @@ export default class ProductServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading); let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_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));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res; return res;
} }
...@@ -133,36 +133,36 @@ export default class ProductServiceBase extends EntityService { ...@@ -133,36 +133,36 @@ export default class ProductServiceBase 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 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;
let productassociationsData:any = []; let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any); productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
...@@ -180,8 +180,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -180,8 +180,8 @@ export default class ProductServiceBase extends EntityService {
masterData.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading); let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_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));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res; return res;
} }
...@@ -210,8 +210,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -210,8 +210,8 @@ export default class ProductServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading); let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_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));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res; return res;
} }
...@@ -228,8 +228,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -228,8 +228,8 @@ export default class ProductServiceBase 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(`/products/getdraft`,isloading); let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product; res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_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));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res; return res;
} }
...@@ -258,36 +258,36 @@ export default class ProductServiceBase extends EntityService { ...@@ -258,36 +258,36 @@ export default class ProductServiceBase 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 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;
let productassociationsData:any = []; let productassociationsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productassociations'),'undefined')){
productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any); productassociationsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productassociations') as any);
...@@ -305,8 +305,8 @@ export default class ProductServiceBase extends EntityService { ...@@ -305,8 +305,8 @@ export default class ProductServiceBase extends EntityService {
masterData.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading); let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_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));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
return res; return res;
} }
......
...@@ -77,11 +77,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -77,11 +77,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;
...@@ -91,12 +91,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -91,12 +91,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.competitorsalesliteratures = competitorsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
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;
...@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -117,8 +117,8 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -117,8 +117,8 @@ 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+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -148,11 +148,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -148,11 +148,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;
...@@ -162,12 +162,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -162,12 +162,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.competitorsalesliteratures = competitorsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
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;
...@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading); let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures)); this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -211,8 +211,8 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -211,8 +211,8 @@ 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+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures)); this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -229,8 +229,8 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -229,8 +229,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
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+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures)); this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
...@@ -273,11 +273,11 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -273,11 +273,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;
...@@ -287,12 +287,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -287,12 +287,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.competitorsalesliteratures = competitorsalesliteraturesData; masterData.productsalesliteratures = productsalesliteraturesData;
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;
...@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService { ...@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
}); });
} }
} }
masterData.productsalesliteratures = productsalesliteraturesData; masterData.competitorsalesliteratures = competitorsalesliteraturesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading); let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems)); 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+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures)); this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
return res; return res;
} }
......
...@@ -1123,10 +1123,10 @@ export const viewstate: any = { ...@@ -1123,10 +1123,10 @@ export const viewstate: any = {
viewaction: '', viewaction: '',
viewdatachange: false, viewdatachange: false,
refviews: [ refviews: [
'9693fc63348c320c4b0dff17cb9a9f25',
'177c00d1674621e8933efe6db68bce0e', '177c00d1674621e8933efe6db68bce0e',
'7bf35293fd1d9db7816755a74c4d575e', '7bf35293fd1d9db7816755a74c4d575e',
'78862ad65295f145e7520291f1183604', '78862ad65295f145e7520291f1183604',
'6c67094479c2f8af7ea1575eee584056',
], ],
}, },
{ {
...@@ -1212,16 +1212,6 @@ export const viewstate: any = { ...@@ -1212,16 +1212,6 @@ export const viewstate: any = {
'a5213905238dbc5d8e1a505029105cc9', 'a5213905238dbc5d8e1a505029105cc9',
], ],
}, },
{
viewtag: '9693fc63348c320c4b0dff17cb9a9f25',
viewmodule: 'Sales',
viewname: 'OpportunityOppProDashboardView',
viewaction: '',
viewdatachange: false,
refviews: [
'c74c14188b89f72079643170a83c25f5',
],
},
{ {
viewtag: '96cc644d7d763e47f3644aed0d9850f0', viewtag: '96cc644d7d763e47f3644aed0d9850f0',
viewmodule: 'Sales', viewmodule: 'Sales',
...@@ -1656,16 +1646,6 @@ export const viewstate: any = { ...@@ -1656,16 +1646,6 @@ export const viewstate: any = {
refviews: [ refviews: [
], ],
}, },
{
viewtag: 'c74c14188b89f72079643170a83c25f5',
viewmodule: 'Sales',
viewname: 'OpportunityInfo_Product',
viewaction: '',
viewdatachange: false,
refviews: [
'6c67094479c2f8af7ea1575eee584056',
],
},
{ {
viewtag: 'c7d0ca0f6fa1b27bbd1b5c422d1a108d', viewtag: 'c7d0ca0f6fa1b27bbd1b5c422d1a108d',
viewmodule: 'Marketing', viewmodule: 'Marketing',
......
...@@ -206,6 +206,7 @@ export default class OpportunityUIServiceBase extends UIService { ...@@ -206,6 +206,7 @@ export default class OpportunityUIServiceBase extends UIService {
const parameters: any[] = [ const parameters: any[] = [
{ pathName: 'opportunities', parameterName: 'opportunity' }, { pathName: 'opportunities', parameterName: 'opportunity' },
]; ];
actionContext.closeView(null);
const openDrawer = (view: any, data: any) => { const openDrawer = (view: any, data: any) => {
let container: Subject<any> = actionContext.$appdrawer.openDrawer(view, context,data); let container: Subject<any> = actionContext.$appdrawer.openDrawer(view, context,data);
container.subscribe((result: any) => { container.subscribe((result: any) => {
...@@ -213,6 +214,12 @@ export default class OpportunityUIServiceBase extends UIService { ...@@ -213,6 +214,12 @@ export default class OpportunityUIServiceBase extends UIService {
return; return;
} }
const _this: any = actionContext; const _this: any = actionContext;
if (xData && xData.refresh && xData.refresh instanceof Function) {
xData.refresh(args);
}
if (this.Opportunity_OpenInfoView && this.Opportunity_OpenInfoView instanceof Function) {
this.Opportunity_OpenInfoView(result.datas,context,params, $event, xData,actionContext);
}
if(window.opener){ if(window.opener){
window.opener.postMessage({status:'OK',identification:'WF'},Environment.uniteAddress); window.opener.postMessage({status:'OK',identification:'WF'},Environment.uniteAddress);
window.close(); window.close();
...@@ -294,6 +301,59 @@ export default class OpportunityUIServiceBase extends UIService { ...@@ -294,6 +301,59 @@ export default class OpportunityUIServiceBase extends UIService {
backend(); backend();
} }
/**
* 打开主信息界面
*
* @param {any[]} args 当前数据
* @param {any} context 行为附加上下文
* @param {*} [params] 附加参数
* @param {*} [$event] 事件源
* @param {*} [xData] 执行行为所需当前部件
* @param {*} [actionContext] 执行行为上下文
* @param {*} [srfParentDeName] 父实体名称
* @returns {Promise<any>}
*/
public async Opportunity_OpenInfoView(args: any[], context:any = {} ,params: any={}, $event?: any, xData?: any,actionContext?:any,srfParentDeName?:string) {
let data: any = {};
let parentContext:any = {};
let parentViewParam:any = {};
const _this: any = actionContext;
const _args: any[] = Util.deepCopy(args);
const actionTarget: string | null = 'SINGLEKEY';
Object.assign(context, { opportunity: '%opportunity%' });
Object.assign(params, { opportunityid: '%opportunity%' });
Object.assign(params, { opportunityname: '%opportunityname%' });
if(_this.context){
parentContext = _this.context;
}
if(_this.viewparams){
parentViewParam = _this.viewparams;
}
context = UIActionTool.handleContextParam(actionTarget,_args,parentContext,parentViewParam,context);
data = UIActionTool.handleActionParam(actionTarget,_args,parentContext,parentViewParam,params);
context = Object.assign({},actionContext.context,context);
let parentObj:any = {srfparentdename:srfParentDeName?srfParentDeName:null,srfparentkey:srfParentDeName?context[srfParentDeName.toLowerCase()]:null};
Object.assign(data,parentObj);
Object.assign(context,parentObj);
let deResParameters: any[] = [];
if(context.contact && true){
deResParameters = [
{ pathName: 'contacts', parameterName: 'contact' },
]
}
const parameters: any[] = [
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'info', parameterName: 'info' },
];
const openIndexViewTab = (data: any) => {
const routePath = actionContext.$viewTool.buildUpRoutePath(actionContext.$route, context, deResParameters, parameters, _args, data);
actionContext.$router.push(routePath);
return null;
}
openIndexViewTab(data);
}
/** /**
* 编辑 * 编辑
* *
......
<div class='portlet view-lead-con ' :style="{}"> <div class='portlet view-lead-con ' :style="{}">
<p class='portlet-title'> <div class="portlet-without-title">
<span>
联系人
</span>
</p>
<div class="portlet-with-title">
<lead-info-contact :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></lead-info-contact> <lead-info-contact :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></lead-info-contact>
</div> </div>
</div> </div>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 18, offset: 0 }"> <i-col :md="{ span: 24, offset: 0 }" :lg="{ span: 18, offset: 0 }">
<card class="portlet-card" :bordered="false" dis-hover :padding="0"> <card class="portlet-card" :bordered="false" dis-hover :padding="0">
<span> <span>
<div class='portlet-container summarydashboard-container1 ' :style="{}"> <div class='portlet-container summarydashboard-container1 portlet-container-no-border' :style="{}">
<row> <row>
<i-col :md="{ span: 24, offset: 0 }"> <i-col :md="{ span: 24, offset: 0 }">
<div class="portlet-without-title"> <div class="portlet-without-title">
......
...@@ -63,6 +63,7 @@ export class AbstractInfoEditFormBase extends EditFormControlBase { ...@@ -63,6 +63,7 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
budgetamount: null, budgetamount: null,
purchaseprocess: null, purchaseprocess: null,
description: null, description: null,
pricelevelname: null,
currentsituation: null, currentsituation: null,
customerneed: null, customerneed: null,
proposedsolution: null, proposedsolution: null,
...@@ -86,7 +87,9 @@ export class AbstractInfoEditFormBase extends EditFormControlBase { ...@@ -86,7 +87,9 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
* @memberof AbstractInfoEditFormBase * @memberof AbstractInfoEditFormBase
*/ */
public detailsModel: any = { public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '商机基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: false, form: this, uiActionGroup: { caption: '', langbase: 'entities.opportunity.abstractinfo_form', extractMode: 'ITEM', details: [] } }), group1: new FormGroupPanelModel({ caption: '商机基本信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.opportunity.abstractinfo_form', extractMode: 'ITEM', details: [] } }),
grouppanel1: new FormGroupPanelModel({ caption: '详细信息', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, uiActionGroup: { caption: '', langbase: 'entities.opportunity.abstractinfo_form', extractMode: 'ITEM', details: [] } }),
formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }), formpage1: new FormPageModel({ caption: '基本信息', detailType: 'FORMPAGE', name: 'formpage1', visible: true, isShowCaption: true, form: this }),
...@@ -122,6 +125,8 @@ export class AbstractInfoEditFormBase extends EditFormControlBase { ...@@ -122,6 +125,8 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
description: new FormItemModel({ caption: '说明', detailType: 'FORMITEM', name: 'description', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }), description: new FormItemModel({ caption: '说明', detailType: 'FORMITEM', name: 'description', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
pricelevelname: new FormItemModel({ caption: '价目表', detailType: 'FORMITEM', name: 'pricelevelname', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
currentsituation: new FormItemModel({ caption: '当前状况', detailType: 'FORMITEM', name: 'currentsituation', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }), currentsituation: new FormItemModel({ caption: '当前状况', detailType: 'FORMITEM', name: 'currentsituation', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
customerneed: new FormItemModel({ caption: '客户需求', detailType: 'FORMITEM', name: 'customerneed', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }), customerneed: new FormItemModel({ caption: '客户需求', detailType: 'FORMITEM', name: 'customerneed', visible: true, isShowCaption: true, form: this, disabled: false, enableCond: 3 }),
......
...@@ -95,6 +95,11 @@ export default class AbstractInfoModel { ...@@ -95,6 +95,11 @@ export default class AbstractInfoModel {
prop: 'description', prop: 'description',
dataType: 'TEXT', dataType: 'TEXT',
}, },
{
name: 'pricelevelname',
prop: 'pricelevelname',
dataType: 'PICKUPTEXT',
},
{ {
name: 'currentsituation', name: 'currentsituation',
prop: 'currentsituation', prop: 'currentsituation',
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<row > <row >
<i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.group1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.opportunity.abstractinfo_form.details.group1')" :isShowCaption="false" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" > <app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.group1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.opportunity.abstractinfo_form.details.group1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="0" :isInfoGroupMode="true" >
<row> <row>
<i-col v-show="detailsModel.opportunityname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }"> <i-col v-show="detailsModel.opportunityname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='opportunityname' :itemRules="this.rules.opportunityname" class='' :caption="$t('entities.opportunity.abstractinfo_form.details.opportunityname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.opportunityname.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='opportunityname' :itemRules="this.rules.opportunityname" class='' :caption="$t('entities.opportunity.abstractinfo_form.details.opportunityname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.opportunityname.error" :isEmptyCaption="false" labelPos="LEFT">
...@@ -60,6 +60,21 @@ ...@@ -60,6 +60,21 @@
<app-span name='description' :value="data.description" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span> <app-span name='description' :value="data.description" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item> </app-form-item>
</i-col>
</row>
</app-form-group>
</i-col>
<i-col v-show="detailsModel.grouppanel1.visible" :style="{}" :lg="{ span: 24, offset: 0 }">
<app-form-group layoutType="TABLE_24COL" titleStyle="" class='' :uiActionGroup="detailsModel.grouppanel1.uiActionGroup" @groupuiactionclick="groupUIActionClick($event)" :caption="$t('entities.opportunity.abstractinfo_form.details.grouppanel1')" :isShowCaption="true" uiStyle="DEFAULT" :titleBarCloseMode="1" :isInfoGroupMode="true" >
<row>
<i-col v-show="detailsModel.pricelevelname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='pricelevelname' :itemRules="this.rules.pricelevelname" class='' :caption="$t('entities.opportunity.abstractinfo_form.details.pricelevelname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.pricelevelname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='pricelevelname' :value="data.pricelevelname" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
</app-form-item>
</i-col> </i-col>
<i-col v-show="detailsModel.currentsituation.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }"> <i-col v-show="detailsModel.currentsituation.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 24, offset: 0 }" :xl="{ span: 24, offset: 0 }">
<app-form-item name='currentsituation' :itemRules="this.rules.currentsituation" class='' :caption="$t('entities.opportunity.abstractinfo_form.details.currentsituation')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.currentsituation.error" :isEmptyCaption="false" labelPos="LEFT"> <app-form-item name='currentsituation' :itemRules="this.rules.currentsituation" class='' :caption="$t('entities.opportunity.abstractinfo_form.details.currentsituation')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.currentsituation.error" :isEmptyCaption="false" labelPos="LEFT">
......
<div class='tabviewpanel' v-if='isActivied'> <div class='tabviewpanel' v-if='isActivied'>
<opportunity-opp-pro-dashboard-view <opportunity-product-opp-opp-pro-grid-view
class='viewcontainer2' class='viewcontainer2'
:viewdata="viewdata" :viewdata="viewdata"
:viewparam="viewparam" :viewparam="viewparam"
@viewload="viewDatasChange($event)" @viewload="viewDatasChange($event)"
:viewDefaultUsage="false" > :viewDefaultUsage="false" >
</opportunity-opp-pro-dashboard-view> </opportunity-product-opp-opp-pro-grid-view>
</div> </div>
\ No newline at end of file
<div class='portlet view-opp-abs ' :style="{}"> <div class='portlet view-opp-abs ' :style="{}">
<p class='portlet-title'> <div class="portlet-without-title">
<span>
摘要信息
</span>
</p>
<div class="portlet-with-title">
<opportunity-info-abstract :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></opportunity-info-abstract> <opportunity-info-abstract :viewdata="JSON.stringify(context)" :viewDefaultUsage="false" ></opportunity-info-abstract>
</div> </div>
</div> </div>
...@@ -5948,7 +5948,7 @@ ...@@ -5948,7 +5948,7 @@
<!--输出实体[OPPORTUNITYPRODUCT]数据结构 --> <!--输出实体[OPPORTUNITYPRODUCT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-opportunityproduct-9-67"> <changeSet author="a_LAB01_e85d8801c" id="tab-opportunityproduct-10-67">
<createTable tableName="OPPORTUNITYPRODUCT"> <createTable tableName="OPPORTUNITYPRODUCT">
<column name="PRICEOVERRIDDEN" remarks="" type="INT"> <column name="PRICEOVERRIDDEN" remarks="" type="INT">
</column> </column>
...@@ -10506,7 +10506,7 @@ ...@@ -10506,7 +10506,7 @@
<!--输出实体[OPPORTUNITY]数据结构 --> <!--输出实体[OPPORTUNITY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-opportunity-124-124"> <changeSet author="a_LAB01_e85d8801c" id="tab-opportunity-132-124">
<createTable tableName="OPPORTUNITY"> <createTable tableName="OPPORTUNITY">
<column name="DECISIONMAKER" remarks="" type="INT"> <column name="DECISIONMAKER" remarks="" type="INT">
</column> </column>
...@@ -11365,16 +11365,16 @@ ...@@ -11365,16 +11365,16 @@
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="EXPIREDPROCESS" constraintName="DER1N_EXPIREDPROCESS__TRANSACT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/> <addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="EXPIREDPROCESS" constraintName="DER1N_EXPIREDPROCESS__TRANSACT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[OPPORTUNITYPRODUCT]外键关系 --> <!--输出实体[OPPORTUNITYPRODUCT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-9-297"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-10-297">
<addForeignKeyConstraint baseColumnNames="PARENTBUNDLEIDREF" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__OPPO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYPRODUCTID" referencedTableName="OPPORTUNITYPRODUCT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PARENTBUNDLEIDREF" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__OPPO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="OPPORTUNITYPRODUCTID" referencedTableName="OPPORTUNITYPRODUCT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-9-299"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-10-299">
<addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__PROD" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__PROD" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-9-300"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-10-300">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__TRAN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/> <addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__TRAN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-9-301"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunityproduct-10-301">
<addForeignKeyConstraint baseColumnNames="UOMID" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__UOM_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="UOMID" referencedTableName="UOM" validate="true"/> <addForeignKeyConstraint baseColumnNames="UOMID" baseTableName="OPPORTUNITYPRODUCT" constraintName="DER1N_OPPORTUNITYPRODUCT__UOM_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="UOMID" referencedTableName="UOM" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[POSITION]外键关系 --> <!--输出实体[POSITION]外键关系 -->
...@@ -11740,25 +11740,25 @@ ...@@ -11740,25 +11740,25 @@
<!--输出实体[RELATIONSHIPS]外键关系 --> <!--输出实体[RELATIONSHIPS]外键关系 -->
<!--输出实体[CONNECTIONROLE]外键关系 --> <!--输出实体[CONNECTIONROLE]外键关系 -->
<!--输出实体[OPPORTUNITY]外键关系 --> <!--输出实体[OPPORTUNITY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-124-414"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-414">
<addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__ACCOUNT__PA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PARENTACCOUNTID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__ACCOUNT__PA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-124-415"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-415">
<addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__CAMPAIGN__C" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/> <addForeignKeyConstraint baseColumnNames="CAMPAIGNID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__CAMPAIGN__C" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CAMPAIGNID" referencedTableName="CAMPAIGN" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-124-416"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-416">
<addForeignKeyConstraint baseColumnNames="PARENTCONTACTID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__CONTACT__PA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/> <addForeignKeyConstraint baseColumnNames="PARENTCONTACTID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__CONTACT__PA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONTACTID" referencedTableName="CONTACT" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-124-417"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-417">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__LEAD__ORIGI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/> <addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__LEAD__ORIGI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-124-418"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-418">
<addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__PRICELEVEL_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/> <addForeignKeyConstraint baseColumnNames="PRICELEVELID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__PRICELEVEL_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet> </changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-124-419"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-419">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/> <addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__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-opportunity-124-420"> <changeSet author="a_LAB01_e85d8801c" id="fk-opportunity-132-420">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__TRANSACTION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/> <addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="OPPORTUNITY" constraintName="DER1N_OPPORTUNITY__TRANSACTION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet> </changeSet>
<!--输出实体[OPPORTUNITYCOMPETITOR]外键关系 --> <!--输出实体[OPPORTUNITYCOMPETITOR]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册