Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
ea59519c
提交
ea59519c
编写于
7月 02, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_gzf 发布系统代码
上级
7f8770a6
变更
19
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
673 行增加
和
708 行删除
+673
-708
opportunity_en_US.ts
...c/locale/lanres/entities/opportunity/opportunity_en_US.ts
+21
-19
opportunity_zh_CN.ts
...c/locale/lanres/entities/opportunity/opportunity_zh_CN.ts
+21
-19
page-register.ts
app_CRM/src/pages/ungroup/central/page-register.ts
+1
-3
router.ts
app_CRM/src/pages/ungroup/central/router.ts
+14
-104
campaign-service-base.ts
app_CRM/src/service/campaign/campaign-service-base.ts
+46
-46
contact-service-base.ts
app_CRM/src/service/contact/contact-service-base.ts
+124
-124
opportunity-service-base.ts
app_CRM/src/service/opportunity/opportunity-service-base.ts
+252
-252
product-service-base.ts
app_CRM/src/service/product/product-service-base.ts
+47
-47
sales-literature-service-base.ts
...service/sales-literature/sales-literature-service-base.ts
+41
-41
state.ts
app_CRM/src/store/modules/view-action/state.ts
+1
-21
opportunity-ui-service-base.ts
.../src/uiservice/opportunity/opportunity-ui-service-base.ts
+60
-0
view-lead-con-portlet.html
...ets/lead/view-lead-con-portlet/view-lead-con-portlet.html
+1
-7
abstract-info-dashboard.html
...nity/abstract-info-dashboard/abstract-info-dashboard.html
+1
-1
abstract-info-form-base.tsx
...pportunity/abstract-info-form/abstract-info-form-base.tsx
+6
-1
abstract-info-form-model.ts
...pportunity/abstract-info-form/abstract-info-form-model.ts
+5
-0
abstract-info-form.html
...ts/opportunity/abstract-info-form/abstract-info-form.html
+16
-1
infotabviewpanel2-tabviewpanel.html
...ewpanel2-tabviewpanel/infotabviewpanel2-tabviewpanel.html
+2
-2
view-opp-abs-portlet.html
...pportunity/view-opp-abs-portlet/view-opp-abs-portlet.html
+1
-7
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+13
-13
未找到文件。
app_CRM/src/locale/lanres/entities/opportunity/opportunity_en_US.ts
浏览文件 @
ea59519c
...
...
@@ -193,6 +193,7 @@ export default {
abstractinfo_form
:
{
details
:
{
group1
:
"商机基本信息"
,
grouppanel1
:
"详细信息"
,
formpage1
:
"基本信息"
,
srfupdatedate
:
"更新时间"
,
srforikey
:
""
,
...
...
@@ -210,6 +211,7 @@ export default {
budgetamount
:
"预算金额"
,
purchaseprocess
:
"采购程序"
,
description
:
"说明"
,
pricelevelname
:
"价目表"
,
currentsituation
:
"当前状况"
,
customerneed
:
"客户需求"
,
proposedsolution
:
"已拟定解决方案"
,
...
...
@@ -218,9 +220,9 @@ export default {
uiactions
:
{
},
},
productinfo
_form
:
{
main
_form
:
{
details
:
{
group1
:
"
价目表
信息"
,
group1
:
"
基本
信息"
,
druipart1
:
""
,
grouppanel1
:
"产品明细信息"
,
formpage1
:
"基本信息"
,
...
...
@@ -232,15 +234,30 @@ export default {
srfuf
:
""
,
srfdeid
:
""
,
srfsourcekey
:
""
,
opportunityname
:
"商机名称"
,
parentcontactname
:
"联系人"
,
parentaccountname
:
"帐户"
,
purchasetimeframe
:
"购买时间范围"
,
transactioncurrencyname
:
"货币"
,
budgetamount
:
"预算金额"
,
purchaseprocess
:
"采购程序"
,
description
:
"说明"
,
currentsituation
:
"当前状况"
,
customerneed
:
"客户需求"
,
proposedsolution
:
"已拟定解决方案"
,
pricelevelname
:
"价目表"
,
parentcontactid
:
"联系人"
,
parentaccountid
:
"帐户"
,
transactioncurrencyid
:
"货币"
,
opportunityid
:
"商机"
,
pricelevelid
:
"价目表"
,
},
uiactions
:
{
},
},
main
_form
:
{
productinfo
_form
:
{
details
:
{
group1
:
"
基本
信息"
,
group1
:
"
价目表
信息"
,
druipart1
:
""
,
grouppanel1
:
"产品明细信息"
,
formpage1
:
"基本信息"
,
...
...
@@ -252,23 +269,8 @@ export default {
srfuf
:
""
,
srfdeid
:
""
,
srfsourcekey
:
""
,
opportunityname
:
"商机名称"
,
parentcontactname
:
"联系人"
,
parentaccountname
:
"帐户"
,
purchasetimeframe
:
"购买时间范围"
,
transactioncurrencyname
:
"货币"
,
budgetamount
:
"预算金额"
,
purchaseprocess
:
"采购程序"
,
description
:
"说明"
,
currentsituation
:
"当前状况"
,
customerneed
:
"客户需求"
,
proposedsolution
:
"已拟定解决方案"
,
pricelevelname
:
"价目表"
,
parentcontactid
:
"联系人"
,
parentaccountid
:
"帐户"
,
transactioncurrencyid
:
"货币"
,
opportunityid
:
"商机"
,
pricelevelid
:
"价目表"
,
},
uiactions
:
{
},
...
...
app_CRM/src/locale/lanres/entities/opportunity/opportunity_zh_CN.ts
浏览文件 @
ea59519c
...
...
@@ -192,6 +192,7 @@ export default {
abstractinfo_form
:
{
details
:
{
group1
:
"商机基本信息"
,
grouppanel1
:
"详细信息"
,
formpage1
:
"基本信息"
,
srfupdatedate
:
"更新时间"
,
srforikey
:
""
,
...
...
@@ -209,6 +210,7 @@ export default {
budgetamount
:
"预算金额"
,
purchaseprocess
:
"采购程序"
,
description
:
"说明"
,
pricelevelname
:
"价目表"
,
currentsituation
:
"当前状况"
,
customerneed
:
"客户需求"
,
proposedsolution
:
"已拟定解决方案"
,
...
...
@@ -217,9 +219,9 @@ export default {
uiactions
:
{
},
},
productinfo
_form
:
{
main
_form
:
{
details
:
{
group1
:
"
价目表
信息"
,
group1
:
"
基本
信息"
,
druipart1
:
""
,
grouppanel1
:
"产品明细信息"
,
formpage1
:
"基本信息"
,
...
...
@@ -231,15 +233,30 @@ export default {
srfuf
:
""
,
srfdeid
:
""
,
srfsourcekey
:
""
,
opportunityname
:
"商机名称"
,
parentcontactname
:
"联系人"
,
parentaccountname
:
"帐户"
,
purchasetimeframe
:
"购买时间范围"
,
transactioncurrencyname
:
"货币"
,
budgetamount
:
"预算金额"
,
purchaseprocess
:
"采购程序"
,
description
:
"说明"
,
currentsituation
:
"当前状况"
,
customerneed
:
"客户需求"
,
proposedsolution
:
"已拟定解决方案"
,
pricelevelname
:
"价目表"
,
parentcontactid
:
"联系人"
,
parentaccountid
:
"帐户"
,
transactioncurrencyid
:
"货币"
,
opportunityid
:
"商机"
,
pricelevelid
:
"价目表"
,
},
uiactions
:
{
},
},
main
_form
:
{
productinfo
_form
:
{
details
:
{
group1
:
"
基本
信息"
,
group1
:
"
价目表
信息"
,
druipart1
:
""
,
grouppanel1
:
"产品明细信息"
,
formpage1
:
"基本信息"
,
...
...
@@ -251,23 +268,8 @@ export default {
srfuf
:
""
,
srfdeid
:
""
,
srfsourcekey
:
""
,
opportunityname
:
"商机名称"
,
parentcontactname
:
"联系人"
,
parentaccountname
:
"帐户"
,
purchasetimeframe
:
"购买时间范围"
,
transactioncurrencyname
:
"货币"
,
budgetamount
:
"预算金额"
,
purchaseprocess
:
"采购程序"
,
description
:
"说明"
,
currentsituation
:
"当前状况"
,
customerneed
:
"客户需求"
,
proposedsolution
:
"已拟定解决方案"
,
pricelevelname
:
"价目表"
,
parentcontactid
:
"联系人"
,
parentaccountid
:
"帐户"
,
transactioncurrencyid
:
"货币"
,
opportunityid
:
"商机"
,
pricelevelid
:
"价目表"
,
},
uiactions
:
{
},
...
...
app_CRM/src/pages/ungroup/central/page-register.ts
浏览文件 @
ea59519c
...
...
@@ -21,7 +21,6 @@ export const PageComponents = {
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
(
'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
(
'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'
));
...
...
@@ -82,8 +81,8 @@ export const PageComponents = {
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
(
'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
(
'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
(
'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'
));
...
...
@@ -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
(
'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
(
'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
(
'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'
));
...
...
app_CRM/src/pages/ungroup/central/router.ts
浏览文件 @
ea59519c
...
...
@@ -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'
),
},
{
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?'
,
meta
:
{
...
...
@@ -2095,6 +2050,20 @@ const router = new Router({
},
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?'
,
meta
:
{
...
...
@@ -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'
),
},
{
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?'
,
meta
:
{
...
...
@@ -3467,51 +3422,6 @@ const router = new Router({
},
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?'
,
meta
:
{
...
...
app_CRM/src/service/campaign/campaign-service-base.ts
浏览文件 @
ea59519c
...
...
@@ -62,11 +62,11 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
campaign
list
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
list
s'
),
'undefined'
)){
campaign
listsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
campaign
listsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
campaign
list
sData
.
forEach
((
item
:
any
)
=>
{
let
campaign
campaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
campaign
s'
),
'undefined'
)){
campaign
campaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaign
campaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaign
campaign
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -76,7 +76,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData
.
campaign
lists
=
campaignlist
sData
;
masterData
.
campaign
campaigns
=
campaigncampaign
sData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
...
...
@@ -92,11 +92,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
leads
=
leadsData
;
let
campaign
campaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
campaign
s'
),
'undefined'
)){
campaign
campaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaign
campaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaign
campaign
sData
.
forEach
((
item
:
any
)
=>
{
let
campaign
list
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
list
s'
),
'undefined'
)){
campaign
listsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
campaign
listsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
campaign
list
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -106,7 +106,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData
.
campaign
campaigns
=
campaigncampaign
sData
;
masterData
.
campaign
lists
=
campaignlist
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
}
...
...
@@ -133,11 +133,11 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
campaign
list
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
list
s'
),
'undefined'
)){
campaign
listsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
campaign
listsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
campaign
list
sData
.
forEach
((
item
:
any
)
=>
{
let
campaign
campaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
campaign
s'
),
'undefined'
)){
campaign
campaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaign
campaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaign
campaign
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -147,7 +147,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData
.
campaign
lists
=
campaignlist
sData
;
masterData
.
campaign
campaigns
=
campaigncampaign
sData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
...
...
@@ -163,11 +163,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
leads
=
leadsData
;
let
campaign
campaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
campaign
s'
),
'undefined'
)){
campaign
campaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaign
campaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaign
campaign
sData
.
forEach
((
item
:
any
)
=>
{
let
campaign
list
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
list
s'
),
'undefined'
)){
campaign
listsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
campaign
listsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
campaign
list
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -177,12 +177,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData
.
campaign
campaigns
=
campaigncampaign
sData
;
masterData
.
campaign
lists
=
campaignlist
sData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
}
...
...
@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
}
...
...
@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/getdraft`
,
isloading
);
res
.
data
.
campaign
=
data
.
campaign
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
}
...
...
@@ -258,11 +258,11 @@ export default class CampaignServiceBase extends EntityService {
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
campaign
list
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
list
s'
),
'undefined'
)){
campaign
listsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
campaign
listsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
campaign
list
sData
.
forEach
((
item
:
any
)
=>
{
let
campaign
campaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
campaign
s'
),
'undefined'
)){
campaign
campaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaign
campaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaign
campaign
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -272,7 +272,7 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData
.
campaign
lists
=
campaignlist
sData
;
masterData
.
campaign
campaigns
=
campaigncampaign
sData
;
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
...
...
@@ -288,11 +288,11 @@ export default class CampaignServiceBase extends EntityService {
}
}
masterData
.
leads
=
leadsData
;
let
campaign
campaign
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
campaign
s'
),
'undefined'
)){
campaign
campaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaign
s'
)
as
any
);
if
(
campaign
campaignsData
&&
campaigncampaignsData
.
length
&&
campaigncampaign
sData
.
length
>
0
){
campaign
campaign
sData
.
forEach
((
item
:
any
)
=>
{
let
campaign
list
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaign
list
s'
),
'undefined'
)){
campaign
listsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
campaign
listsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
campaign
list
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -302,12 +302,12 @@ export default class CampaignServiceBase extends EntityService {
});
}
}
masterData
.
campaign
campaigns
=
campaigncampaign
sData
;
masterData
.
campaign
lists
=
campaignlist
sData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
}
...
...
app_CRM/src/service/contact/contact-service-base.ts
浏览文件 @
ea59519c
...
...
@@ -66,36 +66,36 @@ export default class ContactServiceBase extends EntityService {
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
true
){
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -120,42 +120,42 @@ export default class ContactServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -180,8 +180,8 @@ export default class ContactServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
@@ -198,36 +198,36 @@ export default class ContactServiceBase extends EntityService {
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
@@ -332,14 +332,14 @@ export default class ContactServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
let
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
@@ -357,15 +357,15 @@ export default class ContactServiceBase extends EntityService {
if
(
context
.
account
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/getdraft`
,
isloading
);
res
.
data
.
contact
=
data
.
contact
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/getdraft`
,
isloading
);
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
@@ -382,36 +382,36 @@ export default class ContactServiceBase extends EntityService {
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
@@ -449,36 +449,36 @@ export default class ContactServiceBase extends EntityService {
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -496,42 +496,42 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
@@ -567,36 +567,36 @@ export default class ContactServiceBase extends EntityService {
public
async
SetPrimary
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
eads
=
lead
sData
;
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
...
@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
...
...
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
ea59519c
...
...
@@ -69,21 +69,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -99,21 +99,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -123,28 +123,28 @@ export default class OpportunityServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -160,21 +160,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -184,27 +184,27 @@ export default class OpportunityServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -220,21 +220,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -244,9 +244,9 @@ export default class OpportunityServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -262,21 +262,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -292,45 +292,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -346,44 +346,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -399,26 +399,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -453,22 +453,22 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -485,24 +485,24 @@ export default class OpportunityServiceBase extends EntityService {
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -518,21 +518,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -548,45 +548,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -602,26 +602,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
...
...
@@ -639,21 +639,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Lose
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -669,45 +669,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -723,26 +723,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
...
...
@@ -760,21 +760,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -790,45 +790,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -844,44 +844,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -897,26 +897,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
...
...
@@ -932,21 +932,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Win
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -962,45 +962,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
...
@@ -1016,26 +1016,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
...
...
app_CRM/src/service/product/product-service-base.ts
浏览文件 @
ea59519c
...
...
@@ -62,36 +62,36 @@ export default class ProductServiceBase extends EntityService {
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
pricelevel
id
=
null
;
item
.
product
substitute
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
product
pricelevels
=
productpricelevel
sData
;
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
product
substitutes
=
productsubstitute
sData
;
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
substitute
id
=
null
;
item
.
product
pricelevel
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
product
substitutes
=
productsubstitute
sData
;
masterData
.
product
pricelevels
=
productpricelevel
sData
;
let
productassociationsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
...
...
@@ -116,8 +116,8 @@ export default class ProductServiceBase extends EntityService {
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
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
));
return
res
;
}
...
...
@@ -133,36 +133,36 @@ export default class ProductServiceBase extends EntityService {
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
pricelevel
id
=
null
;
item
.
product
substitute
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
product
pricelevels
=
productpricelevel
sData
;
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
product
substitutes
=
productsubstitute
sData
;
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
substitute
id
=
null
;
item
.
product
pricelevel
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
product
substitutes
=
productsubstitute
sData
;
masterData
.
product
pricelevels
=
productpricelevel
sData
;
let
productassociationsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
...
...
@@ -180,8 +180,8 @@ export default class ProductServiceBase extends EntityService {
masterData
.
productassociations
=
productassociationsData
;
Object
.
assign
(
data
,
masterData
);
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
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
return
res
;
}
...
...
@@ -210,8 +210,8 @@ export default class ProductServiceBase extends EntityService {
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/
${
context
.
product
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
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
));
return
res
;
}
...
...
@@ -228,8 +228,8 @@ export default class ProductServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/getdraft`
,
isloading
);
res
.
data
.
product
=
data
.
product
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
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
));
return
res
;
}
...
...
@@ -258,36 +258,36 @@ export default class ProductServiceBase extends EntityService {
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
pricelevel
id
=
null
;
item
.
product
substitute
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
product
pricelevels
=
productpricelevel
sData
;
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
masterData
.
product
substitutes
=
productsubstitute
sData
;
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
substitute
id
=
null
;
item
.
product
pricelevel
id
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
product
substitutes
=
productsubstitute
sData
;
masterData
.
product
pricelevels
=
productpricelevel
sData
;
let
productassociationsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
...
...
@@ -305,8 +305,8 @@ export default class ProductServiceBase extends EntityService {
masterData
.
productassociations
=
productassociationsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products/
${
context
.
product
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
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
));
return
res
;
}
...
...
app_CRM/src/service/sales-literature/sales-literature-service-base.ts
浏览文件 @
ea59519c
...
...
@@ -77,11 +77,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -91,12 +91,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
...
...
@@ -117,8 +117,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
}
...
...
@@ -148,11 +148,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -162,12 +162,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
}
...
...
@@ -211,8 +211,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
}
...
...
@@ -229,8 +229,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/getdraft`
,
isloading
);
res
.
data
.
salesliterature
=
data
.
salesliterature
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
}
...
...
@@ -273,11 +273,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -287,12 +287,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
...
...
@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures/
${
context
.
salesliterature
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
}
...
...
app_CRM/src/store/modules/view-action/state.ts
浏览文件 @
ea59519c
...
...
@@ -1123,10 +1123,10 @@ export const viewstate: any = {
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'9693fc63348c320c4b0dff17cb9a9f25'
,
'177c00d1674621e8933efe6db68bce0e'
,
'7bf35293fd1d9db7816755a74c4d575e'
,
'78862ad65295f145e7520291f1183604'
,
'6c67094479c2f8af7ea1575eee584056'
,
],
},
{
...
...
@@ -1212,16 +1212,6 @@ export const viewstate: any = {
'a5213905238dbc5d8e1a505029105cc9'
,
],
},
{
viewtag
:
'9693fc63348c320c4b0dff17cb9a9f25'
,
viewmodule
:
'Sales'
,
viewname
:
'OpportunityOppProDashboardView'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'c74c14188b89f72079643170a83c25f5'
,
],
},
{
viewtag
:
'96cc644d7d763e47f3644aed0d9850f0'
,
viewmodule
:
'Sales'
,
...
...
@@ -1656,16 +1646,6 @@ export const viewstate: any = {
refviews
:
[
],
},
{
viewtag
:
'c74c14188b89f72079643170a83c25f5'
,
viewmodule
:
'Sales'
,
viewname
:
'OpportunityInfo_Product'
,
viewaction
:
''
,
viewdatachange
:
false
,
refviews
:
[
'6c67094479c2f8af7ea1575eee584056'
,
],
},
{
viewtag
:
'c7d0ca0f6fa1b27bbd1b5c422d1a108d'
,
viewmodule
:
'Marketing'
,
...
...
app_CRM/src/uiservice/opportunity/opportunity-ui-service-base.ts
浏览文件 @
ea59519c
...
...
@@ -206,6 +206,7 @@ export default class OpportunityUIServiceBase extends UIService {
const
parameters
:
any
[]
=
[
{
pathName
:
'opportunities'
,
parameterName
:
'opportunity'
},
];
actionContext
.
closeView
(
null
);
const
openDrawer
=
(
view
:
any
,
data
:
any
)
=>
{
let
container
:
Subject
<
any
>
=
actionContext
.
$appdrawer
.
openDrawer
(
view
,
context
,
data
);
container
.
subscribe
((
result
:
any
)
=>
{
...
...
@@ -213,6 +214,12 @@ export default class OpportunityUIServiceBase extends UIService {
return
;
}
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
){
window
.
opener
.
postMessage
({
status
:
'OK'
,
identification
:
'WF'
},
Environment
.
uniteAddress
);
window
.
close
();
...
...
@@ -294,6 +301,59 @@ export default class OpportunityUIServiceBase extends UIService {
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
);
}
/**
* 编辑
*
...
...
app_CRM/src/widgets/lead/view-lead-con-portlet/view-lead-con-portlet.html
浏览文件 @
ea59519c
<div
class=
'portlet view-lead-con '
:style=
"{}"
>
<p
class=
'portlet-title'
>
<span>
联系人
</span>
</p>
<div
class=
"portlet-with-title"
>
<div
class=
"portlet-without-title"
>
<lead-info-contact
:viewdata=
"JSON.stringify(context)"
:viewDefaultUsage=
"false"
></lead-info-contact>
</div>
</div>
app_CRM/src/widgets/opportunity/abstract-info-dashboard/abstract-info-dashboard.html
浏览文件 @
ea59519c
...
...
@@ -6,7 +6,7 @@
<i-col
:md=
"{ span: 24, offset: 0 }"
:lg=
"{ span: 18, offset: 0 }"
>
<card
class=
"portlet-card"
:bordered=
"false"
dis-hover
:padding=
"0"
>
<span>
<div
class=
'portlet-container summarydashboard-container1 '
:style=
"{}"
>
<div
class=
'portlet-container summarydashboard-container1
portlet-container-no-border
'
:style=
"{}"
>
<row>
<i-col
:md=
"{ span: 24, offset: 0 }"
>
<div
class=
"portlet-without-title"
>
...
...
app_CRM/src/widgets/opportunity/abstract-info-form/abstract-info-form-base.tsx
浏览文件 @
ea59519c
...
...
@@ -63,6 +63,7 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
budgetamount
:
null
,
purchaseprocess
:
null
,
description
:
null
,
pricelevelname
:
null
,
currentsituation
:
null
,
customerneed
:
null
,
proposedsolution
:
null
,
...
...
@@ -86,7 +87,9 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
* @memberof AbstractInfoEditFormBase
*/
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
}),
...
...
@@ -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
}),
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
}),
customerneed
:
new
FormItemModel
({
caption
:
'客户需求'
,
detailType
:
'FORMITEM'
,
name
:
'customerneed'
,
visible
:
true
,
isShowCaption
:
true
,
form
:
this
,
disabled
:
false
,
enableCond
:
3
}),
...
...
app_CRM/src/widgets/opportunity/abstract-info-form/abstract-info-form-model.ts
浏览文件 @
ea59519c
...
...
@@ -95,6 +95,11 @@ export default class AbstractInfoModel {
prop
:
'description'
,
dataType
:
'TEXT'
,
},
{
name
:
'pricelevelname'
,
prop
:
'pricelevelname'
,
dataType
:
'PICKUPTEXT'
,
},
{
name
:
'currentsituation'
,
prop
:
'currentsituation'
,
...
...
app_CRM/src/widgets/opportunity/abstract-info-form/abstract-info-form.html
浏览文件 @
ea59519c
...
...
@@ -3,7 +3,7 @@
<row
>
<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=
"
fals
e"
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=
"
tru
e"
uiStyle=
"DEFAULT"
:titleBarCloseMode=
"0"
:isInfoGroupMode=
"true"
>
<row>
<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"
>
...
...
@@ -60,6 +60,21 @@
<app-span
name=
'description'
:value=
"data.description"
:data=
"data"
:context=
"context"
:viewparams=
"viewparams"
:localContext =
'{ }'
:localParam =
'{ }'
style=
""
></app-span>
</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
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_CRM/src/widgets/opportunity/infotabviewpanel2-tabviewpanel/infotabviewpanel2-tabviewpanel.html
浏览文件 @
ea59519c
<div
class=
'tabviewpanel'
v-if=
'isActivied'
>
<opportunity-
opp-pro-dashboar
d-view
<opportunity-
product-opp-opp-pro-gri
d-view
class=
'viewcontainer2'
:viewdata=
"viewdata"
:viewparam=
"viewparam"
@
viewload=
"viewDatasChange($event)"
:viewDefaultUsage=
"false"
>
</opportunity-
opp-pro-dashboar
d-view>
</opportunity-
product-opp-opp-pro-gri
d-view>
</div>
\ No newline at end of file
app_CRM/src/widgets/opportunity/view-opp-abs-portlet/view-opp-abs-portlet.html
浏览文件 @
ea59519c
<div
class=
'portlet view-opp-abs '
:style=
"{}"
>
<p
class=
'portlet-title'
>
<span>
摘要信息
</span>
</p>
<div
class=
"portlet-with-title"
>
<div
class=
"portlet-without-title"
>
<opportunity-info-abstract
:viewdata=
"JSON.stringify(context)"
:viewDefaultUsage=
"false"
></opportunity-info-abstract>
</div>
</div>
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
ea59519c
...
...
@@ -5948,7 +5948,7 @@
<!--输出实体[OPPORTUNITYPRODUCT]数据结构 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-opportunityproduct-
9
-67"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-opportunityproduct-
10
-67"
>
<createTable
tableName=
"OPPORTUNITYPRODUCT"
>
<column
name=
"PRICEOVERRIDDEN"
remarks=
""
type=
"INT"
>
</column>
...
...
@@ -10506,7 +10506,7 @@
<!--输出实体[OPPORTUNITY]数据结构 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-opportunity-1
24
-124"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-opportunity-1
32
-124"
>
<createTable
tableName=
"OPPORTUNITY"
>
<column
name=
"DECISIONMAKER"
remarks=
""
type=
"INT"
>
</column>
...
...
@@ -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"
/>
</changeSet>
<!--输出实体[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"
/>
</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"
/>
</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"
/>
</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"
/>
</changeSet>
<!--输出实体[POSITION]外键关系 -->
...
...
@@ -11740,25 +11740,25 @@
<!--输出实体[RELATIONSHIPS]外键关系 -->
<!--输出实体[CONNECTIONROLE]外键关系 -->
<!--输出实体[OPPORTUNITY]外键关系 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-414"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-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"
/>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-415"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-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"
/>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-416"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-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"
/>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-417"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-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"
/>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-418"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-418"
>
<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
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-419"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-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"
/>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
24
-420"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-opportunity-1
32
-420"
>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"OPPORTUNITY"
constraintName=
"DER1N_OPPORTUNITY__TRANSACTION"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
</changeSet>
<!--输出实体[OPPORTUNITYCOMPETITOR]外键关系 -->
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录