Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
0de5c374
提交
0de5c374
编写于
6月 30, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_gzf 发布系统代码
上级
02aeeb2c
变更
7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
534 行增加
和
534 行删除
+534
-534
sales-order-info-soview.html
...ales/sales-order-info-soview/sales-order-info-soview.html
+1
-1
account-service-base.ts
app_CRM/src/service/account/account-service-base.ts
+47
-47
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
+46
-46
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+17
-17
未找到文件。
app_CRM/src/pages/sales/sales-order-info-soview/sales-order-info-soview.html
浏览文件 @
0de5c374
<studio-view-style2
viewName=
"salesorderinfo_soview"
viewTitle=
"订单编辑视图"
class=
'deeditview sales-order-info-soview'
>
<studio-view-style2
viewName=
"salesorderinfo_soview"
viewTitle=
"订单编辑视图"
class=
'deeditview sales-order-info-soview
from-dashboard-style
'
>
<view
_form
<view
_form
:viewState=
"viewState"
:viewState=
"viewState"
:viewparams=
"viewparams"
:viewparams=
"viewparams"
...
...
app_CRM/src/service/account/account-service-base.ts
浏览文件 @
0de5c374
...
@@ -62,36 +62,36 @@ export default class AccountServiceBase extends EntityService {
...
@@ -62,36 +62,36 @@ export default class AccountServiceBase extends EntityService {
*/
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
listaccoun
tsData
:
any
=
[];
let
contac
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contac
ts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contac
ts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
if
(
contactsData
&&
contactsData
.
length
&&
contac
tsData
.
length
>
0
){
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
contac
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
contact
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
listaccounts
=
listaccoun
tsData
;
masterData
.
contacts
=
contac
tsData
;
let
contac
tsData
:
any
=
[];
let
listaccoun
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contac
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contac
ts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
if
(
contactsData
&&
contactsData
.
length
&&
contac
tsData
.
length
>
0
){
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
contac
tsData
.
forEach
((
item
:
any
)
=>
{
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
contact
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
contacts
=
contac
tsData
;
masterData
.
listaccounts
=
listaccoun
tsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -101,8 +101,8 @@ export default class AccountServiceBase extends EntityService {
...
@@ -101,8 +101,8 @@ export default class AccountServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
return
res
;
return
res
;
}
}
...
@@ -117,40 +117,40 @@ export default class AccountServiceBase extends EntityService {
...
@@ -117,40 +117,40 @@ export default class AccountServiceBase extends EntityService {
*/
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
listaccoun
tsData
:
any
=
[];
let
contac
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contac
ts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contac
ts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
if
(
contactsData
&&
contactsData
.
length
&&
contac
tsData
.
length
>
0
){
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
contac
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
contact
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
listaccounts
=
listaccoun
tsData
;
masterData
.
contacts
=
contac
tsData
;
let
contac
tsData
:
any
=
[];
let
listaccoun
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contac
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contac
ts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
if
(
contactsData
&&
contactsData
.
length
&&
contac
tsData
.
length
>
0
){
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
contac
tsData
.
forEach
((
item
:
any
)
=>
{
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
contact
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
contacts
=
contac
tsData
;
masterData
.
listaccounts
=
listaccoun
tsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
return
res
;
return
res
;
}
}
...
@@ -178,8 +178,8 @@ export default class AccountServiceBase extends EntityService {
...
@@ -178,8 +178,8 @@ export default class AccountServiceBase extends EntityService {
*/
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
return
res
;
return
res
;
}
}
...
@@ -195,8 +195,8 @@ export default class AccountServiceBase extends EntityService {
...
@@ -195,8 +195,8 @@ export default class AccountServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/getdraft`
,
isloading
);
res
.
data
.
account
=
data
.
account
;
res
.
data
.
account
=
data
.
account
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
return
res
;
return
res
;
}
}
...
@@ -224,40 +224,40 @@ export default class AccountServiceBase extends EntityService {
...
@@ -224,40 +224,40 @@ export default class AccountServiceBase extends EntityService {
*/
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
listaccoun
tsData
:
any
=
[];
let
contac
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contac
ts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contac
ts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
if
(
contactsData
&&
contactsData
.
length
&&
contac
tsData
.
length
>
0
){
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
contac
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
contact
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
listaccounts
=
listaccoun
tsData
;
masterData
.
contacts
=
contac
tsData
;
let
contac
tsData
:
any
=
[];
let
listaccoun
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contac
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listaccoun
ts'
),
'undefined'
)){
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contac
ts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccoun
ts'
)
as
any
);
if
(
contactsData
&&
contactsData
.
length
&&
contac
tsData
.
length
>
0
){
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccoun
tsData
.
length
>
0
){
contac
tsData
.
forEach
((
item
:
any
)
=>
{
listaccoun
tsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
contact
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
contacts
=
contac
tsData
;
masterData
.
listaccounts
=
listaccoun
tsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/contact/contact-service-base.ts
浏览文件 @
0de5c374
...
@@ -66,36 +66,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -66,36 +66,36 @@ export default class ContactServiceBase extends EntityService {
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
true
){
if
(
context
.
account
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -120,42 +120,42 @@ export default class ContactServiceBase extends EntityService {
...
@@ -120,42 +120,42 @@ export default class ContactServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -180,8 +180,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -180,8 +180,8 @@ export default class ContactServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
@@ -198,36 +198,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -198,36 +198,36 @@ export default class ContactServiceBase extends EntityService {
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService {
...
@@ -245,42 +245,42 @@ export default class ContactServiceBase extends EntityService {
masterData
.
listcontacts
=
listcontactsData
;
masterData
.
listcontacts
=
listcontactsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -298,8 +298,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
listcontacts
=
listcontactsData
;
masterData
.
listcontacts
=
listcontactsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
@@ -332,14 +332,14 @@ export default class ContactServiceBase extends EntityService {
...
@@ -332,14 +332,14 @@ export default class ContactServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
@@ -357,15 +357,15 @@ export default class ContactServiceBase extends EntityService {
...
@@ -357,15 +357,15 @@ export default class ContactServiceBase extends EntityService {
if
(
context
.
account
&&
true
){
if
(
context
.
account
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/getdraft`
,
isloading
);
res
.
data
.
contact
=
data
.
contact
;
res
.
data
.
contact
=
data
.
contact
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/getdraft`
,
isloading
);
res
.
data
.
contact
=
data
.
contact
;
res
.
data
.
contact
=
data
.
contact
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
@@ -382,36 +382,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -382,36 +382,36 @@ export default class ContactServiceBase extends EntityService {
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -429,8 +429,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
listcontacts
=
listcontactsData
;
masterData
.
listcontacts
=
listcontactsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
@@ -449,36 +449,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -449,36 +449,36 @@ export default class ContactServiceBase extends EntityService {
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -496,42 +496,42 @@ export default class ContactServiceBase extends EntityService {
...
@@ -496,42 +496,42 @@ export default class ContactServiceBase extends EntityService {
masterData
.
listcontacts
=
listcontactsData
;
masterData
.
listcontacts
=
listcontactsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -549,8 +549,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
listcontacts
=
listcontactsData
;
masterData
.
listcontacts
=
listcontactsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
@@ -567,36 +567,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -567,36 +567,36 @@ export default class ContactServiceBase extends EntityService {
public
async
SetPrimary
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
SetPrimary
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunitie
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
lead
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunity
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
leads
=
lead
sData
;
let
lead
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
lead
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
listcontactsData
:
any
=
[];
let
listcontactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontacts'
)
as
any
);
...
@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -614,8 +614,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
listcontacts
=
listcontactsData
;
masterData
.
listcontacts
=
listcontactsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/setprimary`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/setprimary`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
0de5c374
...
@@ -69,21 +69,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -69,21 +69,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
true
){
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -99,21 +99,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -99,21 +99,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -123,28 +123,28 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -123,28 +123,28 @@ export default class OpportunityServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
true
){
if
(
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -160,21 +160,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -160,21 +160,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -184,27 +184,27 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -184,27 +184,27 @@ export default class OpportunityServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -220,21 +220,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -220,21 +220,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -244,9 +244,9 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -244,9 +244,9 @@ export default class OpportunityServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
...
@@ -262,21 +262,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -262,21 +262,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -292,45 +292,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -292,45 +292,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -346,44 +346,44 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -346,44 +346,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -399,26 +399,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -399,26 +399,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
...
@@ -453,22 +453,22 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -453,22 +453,22 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
...
@@ -485,24 +485,24 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -485,24 +485,24 @@ export default class OpportunityServiceBase extends EntityService {
if
(
context
.
account
&&
context
.
contact
&&
true
){
if
(
context
.
account
&&
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
true
){
if
(
context
.
contact
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
res
.
data
.
opportunity
=
data
.
opportunity
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
...
@@ -518,21 +518,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -518,21 +518,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -548,45 +548,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -548,45 +548,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -602,26 +602,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -602,26 +602,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
...
@@ -639,21 +639,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -639,21 +639,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Lose
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Lose
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -669,45 +669,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -669,45 +669,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -723,26 +723,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -723,26 +723,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/lose`
,
data
,
isloading
);
...
@@ -760,21 +760,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -760,21 +760,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -790,45 +790,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -790,45 +790,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -844,44 +844,44 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -844,44 +844,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -897,26 +897,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -897,26 +897,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
...
@@ -932,21 +932,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -932,21 +932,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Win
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Win
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -962,45 +962,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -962,45 +962,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
opportunity
product
sData
:
any
=
[];
let
opportunity
competitor
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
opportunityproduct
id
=
null
;
item
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
products
=
opportunityproduct
sData
;
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
let
quotesData
:
any
=
[];
let
quotesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotes'
)
as
any
);
...
@@ -1016,26 +1016,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -1016,26 +1016,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
quotes
=
quotesData
;
masterData
.
quotes
=
quotesData
;
let
opportunity
competitor
sData
:
any
=
[];
let
opportunity
product
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitor
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
product
s'
),
'undefined'
)){
opportunity
competitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitor
s'
)
as
any
);
opportunity
productsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
opportunity
competitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunitycompetitor
sData
.
length
>
0
){
if
(
opportunity
productsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
opportunity
competitor
sData
.
forEach
((
item
:
any
)
=>
{
opportunity
product
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationships
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunity
competitors
=
opportunitycompetitor
sData
;
masterData
.
opportunity
products
=
opportunityproduct
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/win`
,
data
,
isloading
);
...
...
app_CRM/src/service/product/product-service-base.ts
浏览文件 @
0de5c374
...
@@ -77,36 +77,36 @@ export default class ProductServiceBase extends EntityService {
...
@@ -77,36 +77,36 @@ export default class ProductServiceBase extends EntityService {
}
}
}
}
masterData
.
productassociations
=
productassociationsData
;
masterData
.
productassociations
=
productassociationsData
;
let
product
pricelevel
sData
:
any
=
[];
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
pricelevel
id
=
null
;
item
.
product
substitute
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
product
pricelevels
=
productpricelevel
sData
;
masterData
.
product
substitutes
=
productsubstitute
sData
;
let
product
substitute
sData
:
any
=
[];
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
substitute
id
=
null
;
item
.
product
pricelevel
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
product
substitutes
=
productsubstitute
sData
;
masterData
.
product
pricelevels
=
productpricelevel
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -117,8 +117,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -117,8 +117,8 @@ export default class ProductServiceBase extends EntityService {
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
return
res
;
return
res
;
}
}
...
@@ -148,41 +148,41 @@ export default class ProductServiceBase extends EntityService {
...
@@ -148,41 +148,41 @@ export default class ProductServiceBase extends EntityService {
}
}
}
}
masterData
.
productassociations
=
productassociationsData
;
masterData
.
productassociations
=
productassociationsData
;
let
product
pricelevel
sData
:
any
=
[];
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
pricelevel
id
=
null
;
item
.
product
substitute
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
product
pricelevels
=
productpricelevel
sData
;
masterData
.
product
substitutes
=
productsubstitute
sData
;
let
product
substitute
sData
:
any
=
[];
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
substitute
id
=
null
;
item
.
product
pricelevel
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
product
substitutes
=
productsubstitute
sData
;
masterData
.
product
pricelevels
=
productpricelevel
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/products/
${
context
.
product
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/products/
${
context
.
product
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
return
res
;
return
res
;
}
}
...
@@ -211,8 +211,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -211,8 +211,8 @@ export default class ProductServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/
${
context
.
product
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/
${
context
.
product
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
return
res
;
return
res
;
}
}
...
@@ -229,8 +229,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -229,8 +229,8 @@ export default class ProductServiceBase extends EntityService {
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/getdraft`
,
isloading
);
res
.
data
.
product
=
data
.
product
;
res
.
data
.
product
=
data
.
product
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
return
res
;
return
res
;
}
}
...
@@ -273,41 +273,41 @@ export default class ProductServiceBase extends EntityService {
...
@@ -273,41 +273,41 @@ export default class ProductServiceBase extends EntityService {
}
}
}
}
masterData
.
productassociations
=
productassociationsData
;
masterData
.
productassociations
=
productassociationsData
;
let
product
pricelevel
sData
:
any
=
[];
let
product
substitute
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
pricelevel
id
=
null
;
item
.
product
substitute
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
product
pricelevels
=
productpricelevel
sData
;
masterData
.
product
substitutes
=
productsubstitute
sData
;
let
product
substitute
sData
:
any
=
[];
let
product
pricelevel
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
substitute
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
pricelevel
s'
),
'undefined'
)){
product
substitutesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsubstitute
s'
)
as
any
);
product
pricelevelsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productpricelevel
s'
)
as
any
);
if
(
product
substitutesData
&&
productsubstitutesData
.
length
&&
productsubstitute
sData
.
length
>
0
){
if
(
product
pricelevelsData
&&
productpricelevelsData
.
length
&&
productpricelevel
sData
.
length
>
0
){
product
substitute
sData
.
forEach
((
item
:
any
)
=>
{
product
pricelevel
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
product
substitute
id
=
null
;
item
.
product
pricelevel
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
product
substitutes
=
productsubstitute
sData
;
masterData
.
product
pricelevels
=
productpricelevel
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products/
${
context
.
product
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products/
${
context
.
product
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/sales-literature/sales-literature-service-base.ts
浏览文件 @
0de5c374
...
@@ -62,11 +62,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -62,11 +62,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
product
salesliteraturesData
:
any
=
[];
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -76,7 +76,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -76,7 +76,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
let
salesliteratureitemsData
:
any
=
[];
let
salesliteratureitemsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
),
'undefined'
)){
salesliteratureitemsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
)
as
any
);
salesliteratureitemsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
)
as
any
);
...
@@ -92,11 +92,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -92,11 +92,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitor
salesliteraturesData
:
any
=
[];
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -106,7 +106,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -133,11 +133,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -133,11 +133,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
product
salesliteraturesData
:
any
=
[];
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -147,7 +147,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -147,7 +147,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
let
salesliteratureitemsData
:
any
=
[];
let
salesliteratureitemsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
),
'undefined'
)){
salesliteratureitemsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
)
as
any
);
salesliteratureitemsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
)
as
any
);
...
@@ -163,11 +163,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -163,11 +163,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitor
salesliteraturesData
:
any
=
[];
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -177,12 +177,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/getdraft`
,
isloading
);
res
.
data
.
salesliterature
=
data
.
salesliterature
;
res
.
data
.
salesliterature
=
data
.
salesliterature
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -258,11 +258,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -258,11 +258,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
product
salesliteraturesData
:
any
=
[];
let
competitor
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -272,7 +272,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -272,7 +272,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
let
salesliteratureitemsData
:
any
=
[];
let
salesliteratureitemsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
),
'undefined'
)){
salesliteratureitemsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
)
as
any
);
salesliteratureitemsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
)
as
any
);
...
@@ -288,11 +288,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -288,11 +288,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitor
salesliteraturesData
:
any
=
[];
let
product
salesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
competitor
salesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
product
salesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitor
salesliteratures'
)
as
any
);
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_product
salesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitor
salesliteraturesData
.
length
>
0
){
if
(
productsalesliteraturesData
&&
productsalesliteraturesData
.
length
&&
product
salesliteraturesData
.
length
>
0
){
competitor
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
product
salesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -302,12 +302,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
competitorsalesliteratures
=
competitor
salesliteraturesData
;
masterData
.
productsalesliteratures
=
product
salesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures/
${
context
.
salesliterature
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures/
${
context
.
salesliterature
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
return
res
;
return
res
;
}
}
...
...
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
0de5c374
...
@@ -4558,7 +4558,7 @@
...
@@ -4558,7 +4558,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-account-3
67
-55"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-account-3
70
-55"
>
<createTable
tableName=
"ACCOUNT"
>
<createTable
tableName=
"ACCOUNT"
>
<column
name=
"ADDRESS1_PRIMARYCONTACTNAME"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"ADDRESS1_PRIMARYCONTACTNAME"
remarks=
""
type=
"VARCHAR(100)"
>
</column>
</column>
...
@@ -8582,7 +8582,7 @@
...
@@ -8582,7 +8582,7 @@
<!--输出实体[SALESORDER]数据结构 -->
<!--输出实体[SALESORDER]数据结构 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-salesorder-5
0
-96"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-salesorder-5
2
-96"
>
<createTable
tableName=
"SALESORDER"
>
<createTable
tableName=
"SALESORDER"
>
<column
name=
"ENTITYIMAGE"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"ENTITYIMAGE"
remarks=
""
type=
"VARCHAR(100)"
>
</column>
</column>
...
@@ -11199,31 +11199,31 @@
...
@@ -11199,31 +11199,31 @@
<addForeignKeyConstraint
baseColumnNames=
"METRICID"
baseTableName=
"GOAL"
constraintName=
"DER1N_GOAL__METRIC__METRICID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"METRICID"
referencedTableName=
"METRIC"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"METRICID"
baseTableName=
"GOAL"
constraintName=
"DER1N_GOAL__METRIC__METRICID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"METRICID"
referencedTableName=
"METRIC"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
<!--输出实体[ACCOUNT]外键关系 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-259"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-259"
>
<addForeignKeyConstraint
baseColumnNames=
"PARENTACCOUNTID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__ACCOUNT__PARENT"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ACCOUNTID"
referencedTableName=
"ACCOUNT"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"PARENTACCOUNTID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__ACCOUNT__PARENT"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"ACCOUNTID"
referencedTableName=
"ACCOUNT"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-260"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-260"
>
<addForeignKeyConstraint
baseColumnNames=
"PRIMARYCONTACTID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__CONTACT__PRIMAR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CONTACTID"
referencedTableName=
"CONTACT"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"PRIMARYCONTACTID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__CONTACT__PRIMAR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CONTACTID"
referencedTableName=
"CONTACT"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-261"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-261"
>
<addForeignKeyConstraint
baseColumnNames=
"PREFERREDEQUIPMENTID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__EQUIPMENT__PREF"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"EQUIPMENTID"
referencedTableName=
"EQUIPMENT"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"PREFERREDEQUIPMENTID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__EQUIPMENT__PREF"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"EQUIPMENTID"
referencedTableName=
"EQUIPMENT"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-262"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-262"
>
<addForeignKeyConstraint
baseColumnNames=
"ORIGINATINGLEADID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__LEAD__ORIGINATI"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"LEADID"
referencedTableName=
"LEAD"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"ORIGINATINGLEADID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__LEAD__ORIGINATI"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"LEADID"
referencedTableName=
"LEAD"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-263"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-263"
>
<addForeignKeyConstraint
baseColumnNames=
"DEFAULTPRICELEVELID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__PRICELEVEL__DEF"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"PRICELEVELID"
referencedTableName=
"PRICELEVEL"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"DEFAULTPRICELEVELID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__PRICELEVEL__DEF"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"PRICELEVELID"
referencedTableName=
"PRICELEVEL"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-264"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-264"
>
<addForeignKeyConstraint
baseColumnNames=
"PREFERREDSERVICEID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__SERVICE__PREFER"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SERVICEID"
referencedTableName=
"SERVICE"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"PREFERREDSERVICEID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__SERVICE__PREFER"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SERVICEID"
referencedTableName=
"SERVICE"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-265"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-265"
>
<addForeignKeyConstraint
baseColumnNames=
"SLAID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__SLA__SLAID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SLAID"
referencedTableName=
"SLA"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"SLAID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__SLA__SLAID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SLAID"
referencedTableName=
"SLA"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-266"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-266"
>
<addForeignKeyConstraint
baseColumnNames=
"TERRITORYID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__TERRITORY__TERR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TERRITORYID"
referencedTableName=
"TERRITORY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"TERRITORYID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__TERRITORY__TERR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TERRITORYID"
referencedTableName=
"TERRITORY"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
67
-267"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-3
70
-267"
>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__TRANSACTIONCURR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__TRANSACTIONCURR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[KNOWLEDGEARTICLEVIEWS]外键关系 -->
<!--输出实体[KNOWLEDGEARTICLEVIEWS]外键关系 -->
...
@@ -11522,22 +11522,22 @@
...
@@ -11522,22 +11522,22 @@
<addForeignKeyConstraint
baseColumnNames=
"RESOURCECATEGORY"
baseTableName=
"BOOKABLERESCATEGORYASSN"
constraintName=
"DER1N_BOOKABLERESCATEGORYASSN_"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"BOOKABLERESCATEGORYID"
referencedTableName=
"BOOKABLERESCATEGORY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"RESOURCECATEGORY"
baseTableName=
"BOOKABLERESCATEGORYASSN"
constraintName=
"DER1N_BOOKABLERESCATEGORYASSN_"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"BOOKABLERESCATEGORYID"
referencedTableName=
"BOOKABLERESCATEGORY"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[SALESORDER]外键关系 -->
<!--输出实体[SALESORDER]外键关系 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
0
-364"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
2
-364"
>
<addForeignKeyConstraint
baseColumnNames=
"CAMPAIGNID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__CAMPAIGN__CA"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CAMPAIGNID"
referencedTableName=
"CAMPAIGN"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"CAMPAIGNID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__CAMPAIGN__CA"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"CAMPAIGNID"
referencedTableName=
"CAMPAIGN"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
0
-365"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
2
-365"
>
<addForeignKeyConstraint
baseColumnNames=
"OPPORTUNITYID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__OPPORTUNITY_"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"OPPORTUNITYID"
referencedTableName=
"OPPORTUNITY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"OPPORTUNITYID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__OPPORTUNITY_"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"OPPORTUNITYID"
referencedTableName=
"OPPORTUNITY"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
0
-366"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
2
-366"
>
<addForeignKeyConstraint
baseColumnNames=
"PRICELEVELID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__PRICELEVEL__"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"PRICELEVELID"
referencedTableName=
"PRICELEVEL"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"PRICELEVELID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__PRICELEVEL__"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"PRICELEVELID"
referencedTableName=
"PRICELEVEL"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
0
-367"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
2
-367"
>
<addForeignKeyConstraint
baseColumnNames=
"QUOTEID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__QUOTE__QUOTE"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"QUOTEID"
referencedTableName=
"QUOTE"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"QUOTEID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__QUOTE__QUOTE"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"QUOTEID"
referencedTableName=
"QUOTE"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
0
-368"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
2
-368"
>
<addForeignKeyConstraint
baseColumnNames=
"SLAID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__SLA__SLAID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SLAID"
referencedTableName=
"SLA"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"SLAID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__SLA__SLAID"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"SLAID"
referencedTableName=
"SLA"
validate=
"true"
/>
</changeSet>
</changeSet>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
0
-369"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-salesorder-5
2
-369"
>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__TRANSACTIONC"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"SALESORDER"
constraintName=
"DER1N_SALESORDER__TRANSACTIONC"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[LEADADDRESS]外键关系 -->
<!--输出实体[LEADADDRESS]外键关系 -->
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录