Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz企业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz企业套件
iBiz企业中心
提交
d0227967
提交
d0227967
编写于
7月 10, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lab_gzf 发布系统代码
上级
7df5dc25
变更
14
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
1409 行增加
和
1394 行删除
+1409
-1394
data-dictionary.json
app_CRM/public/assets/json/data-dictionary.json
+9
-9
codelist.ts
app_CRM/src/mock/codelist/codelist.ts
+9
-9
account-service-base.ts
app_CRM/src/service/account/account-service-base.ts
+93
-93
campaign-service-base.ts
app_CRM/src/service/campaign/campaign-service-base.ts
+52
-52
competitor-service-base.ts
app_CRM/src/service/competitor/competitor-service-base.ts
+41
-41
contact-service-base.ts
app_CRM/src/service/contact/contact-service-base.ts
+139
-139
ibiz-list-service-base.ts
app_CRM/src/service/ibiz-list/ibiz-list-service-base.ts
+64
-64
opportunity-service-base.ts
app_CRM/src/service/opportunity/opportunity-service-base.ts
+304
-304
product-service-base.ts
app_CRM/src/service/product/product-service-base.ts
+47
-47
quote-service-base.ts
app_CRM/src/service/quote/quote-service-base.ts
+259
-259
sales-literature-service-base.ts
...service/sales-literature/sales-literature-service-base.ts
+50
-50
sales-order-service-base.ts
app_CRM/src/service/sales-order/sales-order-service-base.ts
+308
-308
competitor-ui-service-base.ts
...RM/src/uiservice/competitor/competitor-ui-service-base.ts
+22
-7
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+12
-12
未找到文件。
app_CRM/public/assets/json/data-dictionary.json
浏览文件 @
d0227967
...
@@ -144,7 +144,7 @@
...
@@ -144,7 +144,7 @@
"text"
:
"已关闭"
,
"text"
:
"已关闭"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_3"
,
"codename"
:
"Item_3"
,
"value"
:
"3"
,
"value"
:
3
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
"text"
:
"有效"
,
"text"
:
"有效"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_1"
,
"codename"
:
"Item_1"
,
"value"
:
"1"
,
"value"
:
1
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -164,7 +164,7 @@
...
@@ -164,7 +164,7 @@
"text"
:
"草稿"
,
"text"
:
"草稿"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_0"
,
"codename"
:
"Item_0"
,
"value"
:
"0"
,
"value"
:
0
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -174,7 +174,7 @@
...
@@ -174,7 +174,7 @@
"text"
:
"赢单"
,
"text"
:
"赢单"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_2"
,
"codename"
:
"Item_2"
,
"value"
:
"2"
,
"value"
:
2
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -191,7 +191,7 @@
...
@@ -191,7 +191,7 @@
"text"
:
"已取消"
,
"text"
:
"已取消"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_2"
,
"codename"
:
"Item_2"
,
"value"
:
"2"
,
"value"
:
2
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
"text"
:
"已完成"
,
"text"
:
"已完成"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_3"
,
"codename"
:
"Item_3"
,
"value"
:
"3"
,
"value"
:
3
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -211,7 +211,7 @@
...
@@ -211,7 +211,7 @@
"text"
:
"已开发票"
,
"text"
:
"已开发票"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_4"
,
"codename"
:
"Item_4"
,
"value"
:
"4"
,
"value"
:
4
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -221,7 +221,7 @@
...
@@ -221,7 +221,7 @@
"text"
:
"已提交"
,
"text"
:
"已提交"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_1"
,
"codename"
:
"Item_1"
,
"value"
:
"1"
,
"value"
:
1
,
"disabled"
:
false
"disabled"
:
false
}
}
...
@@ -231,7 +231,7 @@
...
@@ -231,7 +231,7 @@
"text"
:
"有效"
,
"text"
:
"有效"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_0"
,
"codename"
:
"Item_0"
,
"value"
:
"0"
,
"value"
:
0
,
"disabled"
:
false
"disabled"
:
false
}
}
...
...
app_CRM/src/mock/codelist/codelist.ts
浏览文件 @
d0227967
...
@@ -152,7 +152,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -152,7 +152,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"已关闭"
,
text
:
"已关闭"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_3"
,
"codename"
:
"Item_3"
,
value
:
"3"
,
value
:
3
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -162,7 +162,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -162,7 +162,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"有效"
,
text
:
"有效"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_1"
,
"codename"
:
"Item_1"
,
value
:
"1"
,
value
:
1
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -172,7 +172,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -172,7 +172,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"草稿"
,
text
:
"草稿"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_0"
,
"codename"
:
"Item_0"
,
value
:
"0"
,
value
:
0
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -182,7 +182,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -182,7 +182,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"赢单"
,
text
:
"赢单"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_2"
,
"codename"
:
"Item_2"
,
value
:
"2"
,
value
:
2
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -199,7 +199,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -199,7 +199,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"已取消"
,
text
:
"已取消"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_2"
,
"codename"
:
"Item_2"
,
value
:
"2"
,
value
:
2
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -209,7 +209,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -209,7 +209,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"已完成"
,
text
:
"已完成"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_3"
,
"codename"
:
"Item_3"
,
value
:
"3"
,
value
:
3
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -219,7 +219,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -219,7 +219,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"已开发票"
,
text
:
"已开发票"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_4"
,
"codename"
:
"Item_4"
,
value
:
"4"
,
value
:
4
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -229,7 +229,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -229,7 +229,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"已提交"
,
text
:
"已提交"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_1"
,
"codename"
:
"Item_1"
,
value
:
"1"
,
value
:
1
,
disabled
:
false
,
disabled
:
false
,
},
},
...
@@ -239,7 +239,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
...
@@ -239,7 +239,7 @@ mock.onGet('./assets/json/data-dictionary.json').reply((config: any) => {
text
:
"有效"
,
text
:
"有效"
,
"data"
:
""
,
"data"
:
""
,
"codename"
:
"Item_0"
,
"codename"
:
"Item_0"
,
value
:
"0"
,
value
:
0
,
disabled
:
false
,
disabled
:
false
,
},
},
...
...
app_CRM/src/service/account/account-service-base.ts
浏览文件 @
d0227967
...
@@ -64,36 +64,6 @@ export default class AccountServiceBase extends EntityService {
...
@@ -64,36 +64,6 @@ export default class AccountServiceBase extends EntityService {
*/
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccountsData
.
length
>
0
){
listaccountsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
listaccounts
=
listaccountsData
;
let
contactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contacts'
),
'undefined'
)){
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contacts'
)
as
any
);
if
(
contactsData
&&
contactsData
.
length
&&
contactsData
.
length
>
0
){
contactsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
contactid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
contacts
=
contactsData
;
let
leadsData
:
any
=
[];
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
...
@@ -124,33 +94,6 @@ export default class AccountServiceBase extends EntityService {
...
@@ -124,33 +94,6 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts`
,
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
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -181,6 +124,33 @@ export default class AccountServiceBase extends EntityService {
...
@@ -181,6 +124,33 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
contacts
=
contactsData
;
masterData
.
contacts
=
contactsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts`
,
data
,
isloading
);
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
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof AccountServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
leadsData
:
any
=
[];
let
leadsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_leads'
)
as
any
);
...
@@ -211,12 +181,42 @@ export default class AccountServiceBase extends EntityService {
...
@@ -211,12 +181,42 @@ export default class AccountServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
if
(
listaccountsData
&&
listaccountsData
.
length
&&
listaccountsData
.
length
>
0
){
listaccountsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
listaccounts
=
listaccountsData
;
let
contactsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contacts'
),
'undefined'
)){
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contacts'
)
as
any
);
if
(
contactsData
&&
contactsData
.
length
&&
contactsData
.
length
>
0
){
contactsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
contactid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
contacts
=
contactsData
;
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
+
'_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
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
return
res
;
return
res
;
}
}
...
@@ -244,10 +244,10 @@ export default class AccountServiceBase extends EntityService {
...
@@ -244,10 +244,10 @@ 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
+
'_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
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
return
res
;
return
res
;
}
}
...
@@ -263,10 +263,10 @@ export default class AccountServiceBase extends EntityService {
...
@@ -263,10 +263,10 @@ 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
+
'_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
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
return
res
;
return
res
;
}
}
...
@@ -337,72 +337,72 @@ export default class AccountServiceBase extends EntityService {
...
@@ -337,72 +337,72 @@ 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
l
istaccount
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istaccount
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccount
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istaccountsData
&&
listaccountsData
.
length
&&
listaccount
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istaccount
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istaccounts
=
listaccount
sData
;
masterData
.
l
eads
=
lead
sData
;
let
contact
sData
:
any
=
[];
let
opportunitie
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contact
s'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
if
(
contactsData
&&
contactsData
.
length
&&
contact
sData
.
length
>
0
){
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
contact
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
.
contact
id
=
null
;
item
.
opportunity
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
contacts
=
contact
sData
;
masterData
.
opportunities
=
opportunitie
sData
;
let
l
ead
sData
:
any
=
[];
let
l
istaccount
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istaccount
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccount
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istaccountsData
&&
listaccountsData
.
length
&&
listaccount
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istaccount
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istaccounts
=
listaccount
sData
;
let
opportunitie
sData
:
any
=
[];
let
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunitie
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
contact
s'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitie
s'
)
as
any
);
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_contact
s'
)
as
any
);
if
(
opportunitiesData
&&
opportunitiesData
.
length
&&
opportunitie
sData
.
length
>
0
){
if
(
contactsData
&&
contactsData
.
length
&&
contact
sData
.
length
>
0
){
opportunitie
sData
.
forEach
((
item
:
any
)
=>
{
contact
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
.
contact
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunities
=
opportunitie
sData
;
masterData
.
contacts
=
contact
sData
;
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
+
'_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
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_contacts'
,
JSON
.
stringify
(
res
.
data
.
contacts
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/campaign/campaign-service-base.ts
浏览文件 @
d0227967
...
@@ -62,21 +62,21 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -62,21 +62,21 @@ export default class CampaignServiceBase extends EntityService {
*/
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
lead
sData
:
any
=
[];
let
campaignlist
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
campaignlist
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
campaignlists
=
campaignlist
sData
;
let
campaigncampaignsData
:
any
=
[];
let
campaigncampaignsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
...
@@ -92,21 +92,21 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -92,21 +92,21 @@ export default class CampaignServiceBase extends EntityService {
}
}
}
}
masterData
.
campaigncampaigns
=
campaigncampaignsData
;
masterData
.
campaigncampaigns
=
campaigncampaignsData
;
let
campaignlist
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
campaignlist
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
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
campaignlists
=
campaignlist
sData
;
masterData
.
leads
=
lead
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
;
...
@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -133,21 +133,21 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -133,21 +133,21 @@ export default class CampaignServiceBase extends EntityService {
*/
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
lead
sData
:
any
=
[];
let
campaignlist
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
campaignlist
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
campaignlists
=
campaignlist
sData
;
let
campaigncampaignsData
:
any
=
[];
let
campaigncampaignsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
...
@@ -163,26 +163,26 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -163,26 +163,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
}
}
masterData
.
campaigncampaigns
=
campaigncampaignsData
;
masterData
.
campaigncampaigns
=
campaigncampaignsData
;
let
campaignlist
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
campaignlist
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
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
campaignlists
=
campaignlist
sData
;
masterData
.
leads
=
lead
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/campaigns/
${
context
.
campaign
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
*/
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/
${
context
.
campaign
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/campaigns/getdraft`
,
isloading
);
res
.
data
.
campaign
=
data
.
campaign
;
res
.
data
.
campaign
=
data
.
campaign
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
@@ -258,21 +258,21 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -258,21 +258,21 @@ export default class CampaignServiceBase extends EntityService {
*/
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
lead
sData
:
any
=
[];
let
campaignlist
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
lead
sData
.
forEach
((
item
:
any
)
=>
{
campaignlist
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
leads
=
lead
sData
;
masterData
.
campaignlists
=
campaignlist
sData
;
let
campaigncampaignsData
:
any
=
[];
let
campaigncampaignsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
),
'undefined'
)){
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
campaigncampaignsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
)
as
any
);
...
@@ -288,26 +288,26 @@ export default class CampaignServiceBase extends EntityService {
...
@@ -288,26 +288,26 @@ export default class CampaignServiceBase extends EntityService {
}
}
}
}
masterData
.
campaigncampaigns
=
campaigncampaignsData
;
masterData
.
campaigncampaigns
=
campaigncampaignsData
;
let
campaignlist
sData
:
any
=
[];
let
lead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
s'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
if
(
leadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
campaignlist
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
.
relationships
id
=
null
;
item
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
campaignlists
=
campaignlist
sData
;
masterData
.
leads
=
lead
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/campaigns/
${
context
.
campaign
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaigncampaigns'
,
JSON
.
stringify
(
res
.
data
.
campaigncampaigns
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/competitor/competitor-service-base.ts
浏览文件 @
d0227967
...
@@ -62,11 +62,11 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -62,11 +62,11 @@ export default class CompetitorServiceBase 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
lead
competitorsData
:
any
=
[];
let
opportunity
competitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
competitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunity
competitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
competitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
lead
competitorsData
.
length
>
0
){
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunity
competitorsData
.
length
>
0
){
lead
competitorsData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitorsData
.
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,12 +76,12 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -76,12 +76,12 @@ export default class CompetitorServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
leadcompetitors
=
lead
competitorsData
;
masterData
.
opportunitycompetitors
=
opportunity
competitorsData
;
let
opportunity
competitorsData
:
any
=
[];
let
lead
competitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunity
competitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
competitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitors'
)
as
any
);
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
competitors'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunity
competitorsData
.
length
>
0
){
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
lead
competitorsData
.
length
>
0
){
opportunity
competitorsData
.
forEach
((
item
:
any
)
=>
{
lead
competitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -91,7 +91,7 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -91,7 +91,7 @@ export default class CompetitorServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunity
competitorsData
;
masterData
.
leadcompetitors
=
lead
competitorsData
;
let
competitorproductsData
:
any
=
[];
let
competitorproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
)
as
any
);
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
)
as
any
);
...
@@ -116,8 +116,8 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -116,8 +116,8 @@ export default class CompetitorServiceBase 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
(
`/competitors`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/competitors`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
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
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
return
res
;
}
}
...
@@ -133,11 +133,11 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -133,11 +133,11 @@ export default class CompetitorServiceBase 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
lead
competitorsData
:
any
=
[];
let
opportunity
competitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
competitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunity
competitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
competitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
lead
competitorsData
.
length
>
0
){
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunity
competitorsData
.
length
>
0
){
lead
competitorsData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitorsData
.
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,12 +147,12 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -147,12 +147,12 @@ export default class CompetitorServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
leadcompetitors
=
lead
competitorsData
;
masterData
.
opportunitycompetitors
=
opportunity
competitorsData
;
let
opportunity
competitorsData
:
any
=
[];
let
lead
competitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunity
competitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
competitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitors'
)
as
any
);
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
competitors'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunity
competitorsData
.
length
>
0
){
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
lead
competitorsData
.
length
>
0
){
opportunity
competitorsData
.
forEach
((
item
:
any
)
=>
{
lead
competitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -162,7 +162,7 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -162,7 +162,7 @@ export default class CompetitorServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunity
competitorsData
;
masterData
.
leadcompetitors
=
lead
competitorsData
;
let
competitorproductsData
:
any
=
[];
let
competitorproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
)
as
any
);
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
)
as
any
);
...
@@ -180,8 +180,8 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -180,8 +180,8 @@ export default class CompetitorServiceBase extends EntityService {
masterData
.
competitorproducts
=
competitorproductsData
;
masterData
.
competitorproducts
=
competitorproductsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/competitors/
${
context
.
competitor
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/competitors/
${
context
.
competitor
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
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
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
return
res
;
}
}
...
@@ -210,8 +210,8 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -210,8 +210,8 @@ export default class CompetitorServiceBase 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
(
`/competitors/
${
context
.
competitor
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/competitors/
${
context
.
competitor
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
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
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
return
res
;
}
}
...
@@ -228,8 +228,8 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -228,8 +228,8 @@ export default class CompetitorServiceBase 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
(
`/competitors/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/competitors/getdraft`
,
isloading
);
res
.
data
.
competitor
=
data
.
competitor
;
res
.
data
.
competitor
=
data
.
competitor
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
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
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
return
res
;
}
}
...
@@ -258,11 +258,11 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -258,11 +258,11 @@ export default class CompetitorServiceBase 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
lead
competitorsData
:
any
=
[];
let
opportunity
competitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
competitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunity
competitors'
),
'undefined'
)){
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
competitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitors'
)
as
any
);
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
lead
competitorsData
.
length
>
0
){
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunity
competitorsData
.
length
>
0
){
lead
competitorsData
.
forEach
((
item
:
any
)
=>
{
opportunity
competitorsData
.
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,12 +272,12 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -272,12 +272,12 @@ export default class CompetitorServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
leadcompetitors
=
lead
competitorsData
;
masterData
.
opportunitycompetitors
=
opportunity
competitorsData
;
let
opportunity
competitorsData
:
any
=
[];
let
lead
competitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunity
competitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
lead
competitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunity
competitors'
)
as
any
);
leadcompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
competitors'
)
as
any
);
if
(
opportunitycompetitorsData
&&
opportunitycompetitorsData
.
length
&&
opportunity
competitorsData
.
length
>
0
){
if
(
leadcompetitorsData
&&
leadcompetitorsData
.
length
&&
lead
competitorsData
.
length
>
0
){
opportunity
competitorsData
.
forEach
((
item
:
any
)
=>
{
lead
competitorsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
item
.
relationshipsid
=
null
;
...
@@ -287,7 +287,7 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -287,7 +287,7 @@ export default class CompetitorServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunity
competitorsData
;
masterData
.
leadcompetitors
=
lead
competitorsData
;
let
competitorproductsData
:
any
=
[];
let
competitorproductsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
),
'undefined'
)){
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
)
as
any
);
competitorproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorproducts'
)
as
any
);
...
@@ -305,8 +305,8 @@ export default class CompetitorServiceBase extends EntityService {
...
@@ -305,8 +305,8 @@ export default class CompetitorServiceBase extends EntityService {
masterData
.
competitorproducts
=
competitorproductsData
;
masterData
.
competitorproducts
=
competitorproductsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/competitors/
${
context
.
competitor
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/competitors/
${
context
.
competitor
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
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
+
'_leadcompetitors'
,
JSON
.
stringify
(
res
.
data
.
leadcompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorproducts'
,
JSON
.
stringify
(
res
.
data
.
competitorproducts
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/contact/contact-service-base.ts
浏览文件 @
d0227967
...
@@ -68,36 +68,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -68,36 +68,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
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -122,42 +122,42 @@ export default class ContactServiceBase extends EntityService {
...
@@ -122,42 +122,42 @@ export default class ContactServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -182,8 +182,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -182,8 +182,8 @@ export default class ContactServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -200,36 +200,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -200,36 +200,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
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -247,42 +247,42 @@ export default class ContactServiceBase extends EntityService {
...
@@ -247,42 +247,42 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -300,8 +300,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -300,8 +300,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -334,14 +334,14 @@ export default class ContactServiceBase extends EntityService {
...
@@ -334,14 +334,14 @@ export default class ContactServiceBase extends EntityService {
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -359,15 +359,15 @@ export default class ContactServiceBase extends EntityService {
...
@@ -359,15 +359,15 @@ export default class ContactServiceBase extends EntityService {
if
(
context
.
account
&&
true
){
if
(
context
.
account
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/getdraft`
,
isloading
);
res
.
data
.
contact
=
data
.
contact
;
res
.
data
.
contact
=
data
.
contact
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/getdraft`
,
isloading
);
res
.
data
.
contact
=
data
.
contact
;
res
.
data
.
contact
=
data
.
contact
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -399,36 +399,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -399,36 +399,36 @@ export default class ContactServiceBase extends EntityService {
public
async
AddList
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
AddList
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
){
if
(
context
.
account
&&
context
.
contact
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -446,8 +446,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -446,8 +446,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/addlist`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/addlist`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -466,36 +466,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -466,36 +466,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
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -513,8 +513,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -513,8 +513,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -548,36 +548,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -548,36 +548,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
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -595,42 +595,42 @@ export default class ContactServiceBase extends EntityService {
...
@@ -595,42 +595,42 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -648,8 +648,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -648,8 +648,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
@@ -666,36 +666,36 @@ export default class ContactServiceBase extends EntityService {
...
@@ -666,36 +666,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
l
ead
sData
:
any
=
[];
let
l
istcontact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
l
ead
sData
.
forEach
((
item
:
any
)
=>
{
l
istcontact
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
.
relationships
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
eads
=
lead
sData
;
masterData
.
l
istcontacts
=
listcontact
sData
;
let
l
istcontact
sData
:
any
=
[];
let
l
ead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
istcontact
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_l
ead
s'
),
'undefined'
)){
l
istcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
l
eadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_lead
s'
)
as
any
);
if
(
l
istcontactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
if
(
l
eadsData
&&
leadsData
.
length
&&
lead
sData
.
length
>
0
){
l
istcontact
sData
.
forEach
((
item
:
any
)
=>
{
l
ead
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
.
lead
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
l
istcontacts
=
listcontact
sData
;
masterData
.
l
eads
=
lead
sData
;
let
opportunitiesData
:
any
=
[];
let
opportunitiesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
),
'undefined'
)){
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
opportunitiesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunities'
)
as
any
);
...
@@ -713,8 +713,8 @@ export default class ContactServiceBase extends EntityService {
...
@@ -713,8 +713,8 @@ export default class ContactServiceBase extends EntityService {
masterData
.
opportunities
=
opportunitiesData
;
masterData
.
opportunities
=
opportunitiesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/setprimary`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/setprimary`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_leads'
,
JSON
.
stringify
(
res
.
data
.
leads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunities'
,
JSON
.
stringify
(
res
.
data
.
opportunities
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/ibiz-list/ibiz-list-service-base.ts
浏览文件 @
d0227967
...
@@ -62,11 +62,11 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -62,11 +62,11 @@ export default class IBizListServiceBase 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
listcontac
tsData
:
any
=
[];
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listcontac
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontac
ts'
)
as
any
);
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
listcontactsData
&&
listcontactsData
.
length
&&
listcontac
tsData
.
length
>
0
){
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
listcontac
tsData
.
forEach
((
item
:
any
)
=>
{
campaignlis
tsData
.
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 IBizListServiceBase extends EntityService {
...
@@ -76,7 +76,7 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
listcontacts
=
listcontac
tsData
;
masterData
.
campaignlists
=
campaignlis
tsData
;
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -92,11 +92,11 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -92,11 +92,11 @@ export default class IBizListServiceBase extends EntityService {
}
}
}
}
masterData
.
listaccounts
=
listaccountsData
;
masterData
.
listaccounts
=
listaccountsData
;
let
list
lead
sData
:
any
=
[];
let
list
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
contact
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
list
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
if
(
list
contactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
list
contact
sData
.
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,12 +106,12 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -106,12 +106,12 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
list
leads
=
listlead
sData
;
masterData
.
list
contacts
=
listcontact
sData
;
let
campaignlist
sData
:
any
=
[];
let
listlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listlead
s'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
if
(
listleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
campaignlist
sData
.
forEach
((
item
:
any
)
=>
{
listlead
sData
.
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
;
...
@@ -121,7 +121,7 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -121,7 +121,7 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
campaignlists
=
campaignlist
sData
;
masterData
.
listleads
=
listlead
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
;
...
@@ -131,10 +131,10 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -131,10 +131,10 @@ export default class IBizListServiceBase 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
(
`/ibizlists`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ibizlists`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_
listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontac
ts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_
campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlis
ts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
return
res
;
}
}
...
@@ -149,11 +149,11 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -149,11 +149,11 @@ export default class IBizListServiceBase 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
listcontac
tsData
:
any
=
[];
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listcontac
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontac
ts'
)
as
any
);
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
listcontactsData
&&
listcontactsData
.
length
&&
listcontac
tsData
.
length
>
0
){
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
listcontac
tsData
.
forEach
((
item
:
any
)
=>
{
campaignlis
tsData
.
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
;
...
@@ -163,7 +163,7 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -163,7 +163,7 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
listcontacts
=
listcontac
tsData
;
masterData
.
campaignlists
=
campaignlis
tsData
;
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -179,11 +179,11 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -179,11 +179,11 @@ export default class IBizListServiceBase extends EntityService {
}
}
}
}
masterData
.
listaccounts
=
listaccountsData
;
masterData
.
listaccounts
=
listaccountsData
;
let
list
lead
sData
:
any
=
[];
let
list
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
contact
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
list
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
if
(
list
contactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
list
contact
sData
.
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
;
...
@@ -193,12 +193,12 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -193,12 +193,12 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
list
leads
=
listlead
sData
;
masterData
.
list
contacts
=
listcontact
sData
;
let
campaignlist
sData
:
any
=
[];
let
listlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listlead
s'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
if
(
listleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
campaignlist
sData
.
forEach
((
item
:
any
)
=>
{
listlead
sData
.
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
;
...
@@ -208,13 +208,13 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -208,13 +208,13 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
campaignlists
=
campaignlist
sData
;
masterData
.
listleads
=
listlead
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/ibizlists/
${
context
.
ibizlist
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/ibizlists/
${
context
.
ibizlist
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontac
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlis
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
return
res
;
}
}
...
@@ -242,10 +242,10 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -242,10 +242,10 @@ export default class IBizListServiceBase 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
(
`/ibizlists/
${
context
.
ibizlist
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/ibizlists/
${
context
.
ibizlist
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontac
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlis
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
return
res
;
}
}
...
@@ -261,10 +261,10 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -261,10 +261,10 @@ export default class IBizListServiceBase 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
(
`/ibizlists/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/ibizlists/getdraft`
,
isloading
);
res
.
data
.
ibizlist
=
data
.
ibizlist
;
res
.
data
.
ibizlist
=
data
.
ibizlist
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontac
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlis
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
return
res
;
}
}
...
@@ -292,11 +292,11 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -292,11 +292,11 @@ export default class IBizListServiceBase 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
listcontac
tsData
:
any
=
[];
let
campaignlis
tsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listcontac
ts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlis
ts'
),
'undefined'
)){
listcontactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontac
ts'
)
as
any
);
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlis
ts'
)
as
any
);
if
(
listcontactsData
&&
listcontactsData
.
length
&&
listcontac
tsData
.
length
>
0
){
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlis
tsData
.
length
>
0
){
listcontac
tsData
.
forEach
((
item
:
any
)
=>
{
campaignlis
tsData
.
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
;
...
@@ -306,7 +306,7 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -306,7 +306,7 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
listcontacts
=
listcontac
tsData
;
masterData
.
campaignlists
=
campaignlis
tsData
;
let
listaccountsData
:
any
=
[];
let
listaccountsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
),
'undefined'
)){
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
listaccountsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listaccounts'
)
as
any
);
...
@@ -322,11 +322,11 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -322,11 +322,11 @@ export default class IBizListServiceBase extends EntityService {
}
}
}
}
masterData
.
listaccounts
=
listaccountsData
;
masterData
.
listaccounts
=
listaccountsData
;
let
list
lead
sData
:
any
=
[];
let
list
contact
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
lead
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_list
contact
s'
),
'undefined'
)){
list
leadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
list
contactsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listcontact
s'
)
as
any
);
if
(
list
leadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
if
(
list
contactsData
&&
listcontactsData
.
length
&&
listcontact
sData
.
length
>
0
){
list
lead
sData
.
forEach
((
item
:
any
)
=>
{
list
contact
sData
.
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
;
...
@@ -336,12 +336,12 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -336,12 +336,12 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
list
leads
=
listlead
sData
;
masterData
.
list
contacts
=
listcontact
sData
;
let
campaignlist
sData
:
any
=
[];
let
listlead
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
campaignlist
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
listlead
s'
),
'undefined'
)){
campaignlistsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_campaignlist
s'
)
as
any
);
listleadsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_listlead
s'
)
as
any
);
if
(
campaignlistsData
&&
campaignlistsData
.
length
&&
campaignlist
sData
.
length
>
0
){
if
(
listleadsData
&&
listleadsData
.
length
&&
listlead
sData
.
length
>
0
){
campaignlist
sData
.
forEach
((
item
:
any
)
=>
{
listlead
sData
.
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
;
...
@@ -351,13 +351,13 @@ export default class IBizListServiceBase extends EntityService {
...
@@ -351,13 +351,13 @@ export default class IBizListServiceBase extends EntityService {
});
});
}
}
}
}
masterData
.
campaignlists
=
campaignlist
sData
;
masterData
.
listleads
=
listlead
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ibizlists/
${
context
.
ibizlist
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/ibizlists/
${
context
.
ibizlist
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontac
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_
campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlis
ts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listaccounts'
,
JSON
.
stringify
(
res
.
data
.
listaccounts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listcontacts'
,
JSON
.
stringify
(
res
.
data
.
listcontacts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_listleads'
,
JSON
.
stringify
(
res
.
data
.
listleads
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_campaignlists'
,
JSON
.
stringify
(
res
.
data
.
campaignlists
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/opportunity/opportunity-service-base.ts
浏览文件 @
d0227967
...
@@ -74,21 +74,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -74,21 +74,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
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -104,21 +104,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -104,21 +104,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
;
...
@@ -128,28 +128,28 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -128,28 +128,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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
true
){
if
(
context
.
contact
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -165,21 +165,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -165,21 +165,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
;
...
@@ -189,28 +189,28 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -189,28 +189,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
(
`/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
true
){
if
(
context
.
account
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -226,21 +226,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -226,21 +226,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
;
...
@@ -250,27 +250,27 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -250,27 +250,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
(
`/accounts/
${
context
.
account
}
/opportunities`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -286,21 +286,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -286,21 +286,21 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
;
...
@@ -310,9 +310,9 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -310,9 +310,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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
...
@@ -328,21 +328,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -328,21 +328,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
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -358,45 +358,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -358,45 +358,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -412,45 +412,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -412,45 +412,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -466,44 +466,44 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -466,44 +466,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -519,26 +519,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -519,26 +519,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
...
@@ -576,29 +576,29 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -576,29 +576,29 @@ 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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
opportunity
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
`
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
...
@@ -615,32 +615,32 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -615,32 +615,32 @@ 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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
true
){
if
(
context
.
account
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/getdraft`
,
isloading
);
res
.
data
.
opportunity
=
data
.
opportunity
;
res
.
data
.
opportunity
=
data
.
opportunity
;
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
...
@@ -656,21 +656,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -656,21 +656,21 @@ export default class OpportunityServiceBase extends EntityService {
public
async
Active
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Active
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -686,45 +686,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -686,45 +686,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
}
/active`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -740,45 +740,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -740,45 +740,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -794,26 +794,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -794,26 +794,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/active`
,
data
,
isloading
);
...
@@ -831,21 +831,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -831,21 +831,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
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -861,45 +861,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -861,45 +861,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -915,45 +915,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -915,45 +915,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -969,26 +969,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -969,26 +969,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/checkkey`
,
data
,
isloading
);
...
@@ -1021,21 +1021,21 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -1021,21 +1021,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
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -1051,45 +1051,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -1051,45 +1051,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
){
if
(
context
.
contact
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -1105,45 +1105,45 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -1105,45 +1105,45 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
){
if
(
context
.
account
&&
context
.
opportunity
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -1159,44 +1159,44 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -1159,44 +1159,44 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
sData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/save`
,
data
,
isloading
);
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
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quote
sData
:
any
=
[];
let
opportunityproduct
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
quote
sData
.
forEach
((
item
:
any
)
=>
{
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quote
id
=
null
;
item
.
opportunityproduct
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
quotes
=
quote
sData
;
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
let
opportunitycompetitorsData
:
any
=
[];
let
opportunitycompetitorsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
),
'undefined'
)){
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
opportunitycompetitorsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
)
as
any
);
...
@@ -1212,26 +1212,26 @@ export default class OpportunityServiceBase extends EntityService {
...
@@ -1212,26 +1212,26 @@ export default class OpportunityServiceBase extends EntityService {
}
}
}
}
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
masterData
.
opportunitycompetitors
=
opportunitycompetitorsData
;
let
opportunityproduct
sData
:
any
=
[];
let
quote
sData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
opportunityproduct
s'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_
quote
s'
),
'undefined'
)){
opportunityproductsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_opportunityproduct
s'
)
as
any
);
quotesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quote
s'
)
as
any
);
if
(
opportunityproductsData
&&
opportunityproductsData
.
length
&&
opportunityproduct
sData
.
length
>
0
){
if
(
quotesData
&&
quotesData
.
length
&&
quote
sData
.
length
>
0
){
opportunityproduct
sData
.
forEach
((
item
:
any
)
=>
{
quote
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
.
quote
id
=
null
;
}
}
delete
item
.
srffrontuf
;
delete
item
.
srffrontuf
;
}
}
});
});
}
}
}
}
masterData
.
opportunityproducts
=
opportunityproduct
sData
;
masterData
.
quotes
=
quote
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
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunityproducts'
,
JSON
.
stringify
(
res
.
data
.
opportunityproducts
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_opportunitycompetitors'
,
JSON
.
stringify
(
res
.
data
.
opportunitycompetitors
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotes'
,
JSON
.
stringify
(
res
.
data
.
quotes
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/product/product-service-base.ts
浏览文件 @
d0227967
...
@@ -62,36 +62,36 @@ export default class ProductServiceBase extends EntityService {
...
@@ -62,36 +62,36 @@ export default class ProductServiceBase extends EntityService {
*/
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
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
;
let
productassociationsData
:
any
=
[];
let
productassociationsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
...
@@ -116,8 +116,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -116,8 +116,8 @@ export default class ProductServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
return
res
;
return
res
;
}
}
...
@@ -133,36 +133,36 @@ export default class ProductServiceBase extends EntityService {
...
@@ -133,36 +133,36 @@ export default class ProductServiceBase extends EntityService {
*/
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
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
;
let
productassociationsData
:
any
=
[];
let
productassociationsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
...
@@ -180,8 +180,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -180,8 +180,8 @@ export default class ProductServiceBase extends EntityService {
masterData
.
productassociations
=
productassociationsData
;
masterData
.
productassociations
=
productassociationsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/products/
${
context
.
product
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/products/
${
context
.
product
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
return
res
;
return
res
;
}
}
...
@@ -210,8 +210,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -210,8 +210,8 @@ export default class ProductServiceBase extends EntityService {
*/
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/
${
context
.
product
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/
${
context
.
product
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
return
res
;
return
res
;
}
}
...
@@ -228,8 +228,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -228,8 +228,8 @@ export default class ProductServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/products/getdraft`
,
isloading
);
res
.
data
.
product
=
data
.
product
;
res
.
data
.
product
=
data
.
product
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
return
res
;
return
res
;
}
}
...
@@ -258,36 +258,36 @@ export default class ProductServiceBase extends EntityService {
...
@@ -258,36 +258,36 @@ export default class ProductServiceBase extends EntityService {
*/
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
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
;
let
productassociationsData
:
any
=
[];
let
productassociationsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
),
'undefined'
)){
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
productassociationsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productassociations'
)
as
any
);
...
@@ -305,8 +305,8 @@ export default class ProductServiceBase extends EntityService {
...
@@ -305,8 +305,8 @@ export default class ProductServiceBase extends EntityService {
masterData
.
productassociations
=
productassociationsData
;
masterData
.
productassociations
=
productassociationsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products/
${
context
.
product
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/products/
${
context
.
product
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsubstitutes'
,
JSON
.
stringify
(
res
.
data
.
productsubstitutes
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productpricelevels'
,
JSON
.
stringify
(
res
.
data
.
productpricelevels
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productassociations'
,
JSON
.
stringify
(
res
.
data
.
productassociations
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/quote/quote-service-base.ts
浏览文件 @
d0227967
...
@@ -78,21 +78,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -78,21 +78,6 @@ export default class QuoteServiceBase 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
&&
context
.
opportunity
&&
true
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -108,21 +93,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -108,21 +93,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -138,6 +108,21 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -138,6 +108,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -153,21 +138,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -153,21 +138,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -183,6 +153,21 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -183,6 +153,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -198,21 +183,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -198,21 +183,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -228,6 +198,21 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -228,6 +198,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
opportunity
&&
true
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -243,20 +228,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -243,20 +228,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -272,6 +243,20 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -272,6 +243,20 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -287,6 +272,21 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -287,6 +272,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
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
;
...
@@ -296,8 +296,8 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -296,8 +296,8 @@ export default class QuoteServiceBase 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
(
`/quotes`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
...
@@ -313,21 +313,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -313,21 +313,6 @@ export default class QuoteServiceBase 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
&&
context
.
quote
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -343,14 +328,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -343,14 +328,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -366,6 +343,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -366,6 +343,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -381,14 +366,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -381,14 +366,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -404,6 +381,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -404,6 +381,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -419,14 +404,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -419,14 +404,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -442,6 +419,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -442,6 +419,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -457,13 +442,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -457,13 +442,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -479,6 +457,13 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -479,6 +457,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -494,10 +479,25 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -494,10 +479,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/quotes/
${
context
.
quote
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
...
@@ -538,31 +538,31 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -538,31 +538,31 @@ export default class QuoteServiceBase 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
&&
context
.
quote
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
if
(
context
.
opportunity
&&
context
.
quote
){
if
(
context
.
opportunity
&&
context
.
quote
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/
${
context
.
quote
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/
${
context
.
quote
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
...
@@ -579,35 +579,35 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -579,35 +579,35 @@ export default class QuoteServiceBase extends EntityService {
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
true
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
res
.
data
.
quote
=
data
.
quote
;
res
.
data
.
quote
=
data
.
quote
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
&&
true
){
if
(
context
.
contact
&&
context
.
opportunity
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
res
.
data
.
quote
=
data
.
quote
;
res
.
data
.
quote
=
data
.
quote
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
&&
true
){
if
(
context
.
account
&&
context
.
opportunity
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
res
.
data
.
quote
=
data
.
quote
;
res
.
data
.
quote
=
data
.
quote
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
if
(
context
.
opportunity
&&
true
){
if
(
context
.
opportunity
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/getdraft`
,
isloading
);
res
.
data
.
quote
=
data
.
quote
;
res
.
data
.
quote
=
data
.
quote
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/getdraft`
,
isloading
);
res
.
data
.
quote
=
data
.
quote
;
res
.
data
.
quote
=
data
.
quote
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
...
@@ -638,21 +638,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -638,21 +638,6 @@ export default class QuoteServiceBase 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
&&
context
.
quote
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -668,14 +653,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -668,14 +653,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -691,6 +668,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -691,6 +668,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -706,14 +691,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -706,14 +691,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -729,6 +706,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -729,6 +706,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -744,14 +729,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -744,14 +729,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -767,6 +744,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -767,6 +744,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -782,10 +767,25 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -782,10 +767,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/checkkey`
,
data
,
isloading
);
...
@@ -818,21 +818,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -818,21 +818,6 @@ export default class QuoteServiceBase extends EntityService {
public
async
GenSalesOrder
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GenSalesOrder
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -848,14 +833,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -848,14 +833,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -871,6 +848,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -871,6 +848,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -886,14 +871,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -886,14 +871,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -909,6 +886,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -909,6 +886,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -924,14 +909,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -924,14 +909,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -947,6 +924,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -947,6 +924,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -962,10 +947,25 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -962,10 +947,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/gensalesorder`
,
data
,
isloading
);
...
@@ -983,21 +983,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -983,21 +983,6 @@ export default class QuoteServiceBase 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
&&
context
.
quote
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -1013,14 +998,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1013,14 +998,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -1036,6 +1013,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1036,6 +1013,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -1051,14 +1036,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1051,14 +1036,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -1074,6 +1051,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1074,6 +1051,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -1089,14 +1074,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1089,14 +1074,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -1112,6 +1089,14 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1112,6 +1089,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
){
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -1127,13 +1112,6 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1127,13 +1112,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
return
res
;
}
let
masterData
:
any
=
{};
let
quotedetailsData
:
any
=
[];
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
...
@@ -1149,6 +1127,13 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1149,6 +1127,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
quotedetails
=
quotedetailsData
;
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
}
let
masterData
:
any
=
{};
let
salesordersData
:
any
=
[];
let
salesordersData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
),
'undefined'
)){
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
salesordersData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorders'
)
as
any
);
...
@@ -1164,10 +1149,25 @@ export default class QuoteServiceBase extends EntityService {
...
@@ -1164,10 +1149,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorders
=
salesordersData
;
masterData
.
salesorders
=
salesordersData
;
let
quotedetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
),
'undefined'
)){
quotedetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_quotedetails'
)
as
any
);
if
(
quotedetailsData
&&
quotedetailsData
.
length
&&
quotedetailsData
.
length
>
0
){
quotedetailsData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
quotedetailid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
quotedetails
=
quotedetailsData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorders'
,
JSON
.
stringify
(
res
.
data
.
salesorders
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_quotedetails'
,
JSON
.
stringify
(
res
.
data
.
quotedetails
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/sales-literature/sales-literature-service-base.ts
浏览文件 @
d0227967
...
@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -62,21 +62,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
competitorsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitorsalesliteraturesData
.
length
>
0
){
competitorsalesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
competitorsalesliteratures
=
competitorsalesliteraturesData
;
let
productsalesliteraturesData
:
any
=
[];
let
productsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
)
as
any
);
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
)
as
any
);
...
@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -107,6 +92,21 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitorsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitorsalesliteraturesData
.
length
>
0
){
competitorsalesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
competitorsalesliteratures
=
competitorsalesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
data
[
this
.
APPDEKEY
]
=
null
;
...
@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -116,9 +116,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
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
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -133,21 +133,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
competitorsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitorsalesliteraturesData
.
length
>
0
){
competitorsalesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
competitorsalesliteratures
=
competitorsalesliteraturesData
;
let
productsalesliteraturesData
:
any
=
[];
let
productsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
)
as
any
);
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
)
as
any
);
...
@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -178,11 +163,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitorsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitorsalesliteraturesData
.
length
>
0
){
competitorsalesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
competitorsalesliteratures
=
competitorsalesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
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
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -210,9 +210,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/
${
context
.
salesliterature
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
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
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -228,9 +228,9 @@ export default class SalesLiteratureServiceBase extends EntityService {
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesliteratures/getdraft`
,
isloading
);
res
.
data
.
salesliterature
=
data
.
salesliterature
;
res
.
data
.
salesliterature
=
data
.
salesliterature
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
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
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
return
res
;
}
}
...
@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -258,21 +258,6 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
competitorsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitorsalesliteraturesData
.
length
>
0
){
competitorsalesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
competitorsalesliteratures
=
competitorsalesliteraturesData
;
let
productsalesliteraturesData
:
any
=
[];
let
productsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
),
'undefined'
)){
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
)
as
any
);
productsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
)
as
any
);
...
@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
...
@@ -303,11 +288,26 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
}
}
}
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
masterData
.
salesliteratureitems
=
salesliteratureitemsData
;
let
competitorsalesliteraturesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
),
'undefined'
)){
competitorsalesliteraturesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
)
as
any
);
if
(
competitorsalesliteraturesData
&&
competitorsalesliteraturesData
.
length
&&
competitorsalesliteraturesData
.
length
>
0
){
competitorsalesliteraturesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
relationshipsid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
competitorsalesliteratures
=
competitorsalesliteraturesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures/
${
context
.
salesliterature
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesliteratures/
${
context
.
salesliterature
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_productsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
productsalesliteratures
));
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
+
'_salesliteratureitems'
,
JSON
.
stringify
(
res
.
data
.
salesliteratureitems
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_competitorsalesliteratures'
,
JSON
.
stringify
(
res
.
data
.
competitorsalesliteratures
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/service/sales-order/sales-order-service-base.ts
浏览文件 @
d0227967
...
@@ -80,21 +80,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -80,21 +80,6 @@ export default class SalesOrderServiceBase 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
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -110,21 +95,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -110,21 +95,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -140,6 +110,21 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -140,6 +110,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -155,21 +140,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -155,21 +140,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -185,6 +155,21 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -185,6 +155,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -200,21 +185,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -200,21 +185,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -230,6 +200,21 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -230,6 +200,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -245,21 +230,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -245,21 +230,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -275,6 +245,21 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -275,6 +245,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
quote
&&
true
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -290,20 +275,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -290,20 +275,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -319,6 +290,20 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -319,6 +290,20 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -334,6 +319,21 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -334,6 +319,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
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
;
...
@@ -343,8 +343,8 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -343,8 +343,8 @@ export default class SalesOrderServiceBase 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
(
`/salesorders`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesorders`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
tempContext
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
...
@@ -360,21 +360,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -360,21 +360,6 @@ export default class SalesOrderServiceBase 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
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -390,14 +375,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -390,14 +375,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -413,6 +390,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -413,6 +390,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -428,14 +413,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -428,14 +413,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -451,6 +428,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -451,6 +428,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -466,14 +451,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -466,14 +451,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -489,6 +466,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -489,6 +466,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -504,14 +489,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -504,14 +489,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -527,6 +504,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -527,6 +504,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -542,13 +527,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -542,13 +527,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -564,6 +542,13 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -564,6 +542,13 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -579,10 +564,25 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -579,10 +564,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/salesorders/
${
context
.
salesorder
}
`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
...
@@ -626,37 +626,37 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -626,37 +626,37 @@ export default class SalesOrderServiceBase 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
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
quote
&&
context
.
salesorder
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesorders/
${
context
.
salesorder
}
`
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
...
@@ -673,42 +673,42 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -673,42 +673,42 @@ export default class SalesOrderServiceBase extends EntityService {
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
res
.
data
.
salesorder
=
data
.
salesorder
;
res
.
data
.
salesorder
=
data
.
salesorder
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
res
.
data
.
salesorder
=
data
.
salesorder
;
res
.
data
.
salesorder
=
data
.
salesorder
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
res
.
data
.
salesorder
=
data
.
salesorder
;
res
.
data
.
salesorder
=
data
.
salesorder
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
opportunity
&&
context
.
quote
&&
true
){
if
(
context
.
opportunity
&&
context
.
quote
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
res
.
data
.
salesorder
=
data
.
salesorder
;
res
.
data
.
salesorder
=
data
.
salesorder
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
if
(
context
.
quote
&&
true
){
if
(
context
.
quote
&&
true
){
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/quotes/
${
context
.
quote
}
/salesorders/getdraft`
,
isloading
);
res
.
data
.
salesorder
=
data
.
salesorder
;
res
.
data
.
salesorder
=
data
.
salesorder
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesorders/getdraft`
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/salesorders/getdraft`
,
isloading
);
res
.
data
.
salesorder
=
data
.
salesorder
;
res
.
data
.
salesorder
=
data
.
salesorder
;
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
...
@@ -739,21 +739,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -739,21 +739,6 @@ export default class SalesOrderServiceBase 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
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -769,14 +754,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -769,14 +754,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -792,6 +769,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -792,6 +769,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -807,14 +792,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -807,14 +792,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -830,6 +807,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -830,6 +807,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -845,14 +830,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -845,14 +830,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -868,6 +845,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -868,6 +845,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -883,14 +868,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -883,14 +868,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -906,6 +883,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -906,6 +883,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -921,10 +906,25 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -921,10 +906,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/salesorders/
${
context
.
salesorder
}
/checkkey`
,
data
,
isloading
);
...
@@ -957,21 +957,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -957,21 +957,6 @@ export default class SalesOrderServiceBase extends EntityService {
public
async
GenInvoice
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
GenInvoice
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -987,14 +972,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -987,14 +972,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1010,6 +987,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1010,6 +987,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1025,14 +1010,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1025,14 +1010,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1048,6 +1025,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1048,6 +1025,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1063,14 +1048,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1063,14 +1048,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1086,6 +1063,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1086,6 +1063,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1101,14 +1086,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1101,14 +1086,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1124,6 +1101,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1124,6 +1101,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1139,10 +1124,25 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1139,10 +1124,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
return
Http
.
getInstance
().
post
(
`/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
return
Http
.
getInstance
().
post
(
`/salesorders/
${
context
.
salesorder
}
/geninvoice`
,
data
,
isloading
);
...
@@ -1160,21 +1160,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1160,21 +1160,6 @@ export default class SalesOrderServiceBase 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
&&
context
.
quote
&&
context
.
salesorder
){
if
(
context
.
account
&&
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1190,14 +1175,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1190,14 +1175,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1213,6 +1190,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1213,6 +1190,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
contact
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1228,14 +1213,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1228,14 +1213,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1251,6 +1228,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1251,6 +1228,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/contacts/
${
context
.
contact
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
account
&&
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1266,14 +1251,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1266,14 +1251,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1289,6 +1266,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1289,6 +1266,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/accounts/
${
context
.
account
}
/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
opportunity
&&
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1304,14 +1289,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1304,14 +1289,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1327,6 +1304,14 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1327,6 +1304,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/opportunities/
${
context
.
opportunity
}
/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
if
(
context
.
quote
&&
context
.
salesorder
){
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1342,13 +1327,6 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1342,13 +1327,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
return
res
;
}
let
masterData
:
any
=
{};
let
invoicesData
:
any
=
[];
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
...
@@ -1364,6 +1342,13 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1364,6 +1342,13 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
invoices
=
invoicesData
;
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/quotes/
${
context
.
quote
}
/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
}
let
masterData
:
any
=
{};
let
salesorderdetailsData
:
any
=
[];
let
salesorderdetailsData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
),
'undefined'
)){
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
salesorderdetailsData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
)
as
any
);
...
@@ -1379,10 +1364,25 @@ export default class SalesOrderServiceBase extends EntityService {
...
@@ -1379,10 +1364,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
}
}
masterData
.
salesorderdetails
=
salesorderdetailsData
;
masterData
.
salesorderdetails
=
salesorderdetailsData
;
let
invoicesData
:
any
=
[];
if
(
!
Object
.
is
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
),
'undefined'
)){
invoicesData
=
JSON
.
parse
(
this
.
tempStorage
.
getItem
(
context
.
srfsessionkey
+
'_invoices'
)
as
any
);
if
(
invoicesData
&&
invoicesData
.
length
&&
invoicesData
.
length
>
0
){
invoicesData
.
forEach
((
item
:
any
)
=>
{
if
(
item
.
srffrontuf
){
if
(
Object
.
is
(
item
.
srffrontuf
,
"0"
)){
item
.
invoiceid
=
null
;
}
delete
item
.
srffrontuf
;
}
});
}
}
masterData
.
invoices
=
invoicesData
;
Object
.
assign
(
data
,
masterData
);
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/salesorders/
${
context
.
salesorder
}
/save`
,
data
,
isloading
);
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_salesorderdetails'
,
JSON
.
stringify
(
res
.
data
.
salesorderdetails
));
this
.
tempStorage
.
setItem
(
context
.
srfsessionkey
+
'_invoices'
,
JSON
.
stringify
(
res
.
data
.
invoices
));
return
res
;
return
res
;
}
}
...
...
app_CRM/src/uiservice/competitor/competitor-ui-service-base.ts
浏览文件 @
d0227967
...
@@ -251,14 +251,29 @@ export default class CompetitorUIServiceBase extends UIService {
...
@@ -251,14 +251,29 @@ export default class CompetitorUIServiceBase extends UIService {
let
deResParameters
:
any
[]
=
[];
let
deResParameters
:
any
[]
=
[];
const
parameters
:
any
[]
=
[
const
parameters
:
any
[]
=
[
{
pathName
:
'competitors'
,
parameterName
:
'competitor'
},
{
pathName
:
'competitors'
,
parameterName
:
'competitor'
},
{
pathName
:
'edit_datapanelview'
,
parameterName
:
'edit_datapanelview'
},
];
];
const
openIndexViewTab
=
(
data
:
any
)
=>
{
const
openPopOver
=
(
view
:
any
,
data
:
any
)
=>
{
const
routePath
=
actionContext
.
$viewTool
.
buildUpRoutePath
(
actionContext
.
$route
,
context
,
deResParameters
,
parameters
,
_args
,
data
);
let
container
:
Subject
<
any
>
=
actionContext
.
$apppopover
.
openPop
(
$event
,
view
,
context
,
data
);
actionContext
.
$router
.
push
(
routePath
);
container
.
subscribe
((
result
:
any
)
=>
{
return
null
;
if
(
!
result
||
!
Object
.
is
(
result
.
ret
,
'OK'
))
{
}
return
;
openIndexViewTab
(
data
);
}
const
_this
:
any
=
actionContext
;
if
(
window
.
opener
){
window
.
opener
.
postMessage
({
status
:
'OK'
,
identification
:
'WF'
},
Environment
.
uniteAddress
);
window
.
close
();
}
return
result
.
datas
;
});
}
const
view
:
any
=
{
viewname
:
'competitor-edit-data-panel-view'
,
height
:
300
,
width
:
300
,
title
:
actionContext
.
$t
(
'entities.competitor.views.edit_datapanelview.title'
),
placement
:
'POPOVER'
,
};
openPopOver
(
view
,
data
);
}
}
...
...
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
d0227967
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-account-59
4
-1"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-account-59
6
-1"
>
<createTable
tableName=
"ACCOUNT"
>
<createTable
tableName=
"ACCOUNT"
>
<column
name=
"ADDRESS1_PRIMARYCONTACTNAME"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"ADDRESS1_PRIMARYCONTACTNAME"
remarks=
""
type=
"VARCHAR(100)"
>
</column>
</column>
...
@@ -2419,7 +2419,7 @@
...
@@ -2419,7 +2419,7 @@
<!--输出实体[COMPETITOR]数据结构 -->
<!--输出实体[COMPETITOR]数据结构 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-competitor-7
2
-32"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"tab-competitor-7
4
-32"
>
<createTable
tableName=
"COMPETITOR"
>
<createTable
tableName=
"COMPETITOR"
>
<column
name=
"ENTITYIMAGE"
remarks=
""
type=
"VARCHAR(100)"
>
<column
name=
"ENTITYIMAGE"
remarks=
""
type=
"VARCHAR(100)"
>
</column>
</column>
...
@@ -10987,31 +10987,31 @@
...
@@ -10987,31 +10987,31 @@
</changeSet>
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
<!--输出实体[ACCOUNT]外键关系 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
4
-135"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-135"
>
<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-59
4
-136"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-136"
>
<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-59
4
-137"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-137"
>
<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-59
4
-138"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-138"
>
<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-59
4
-139"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-139"
>
<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-59
4
-140"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-140"
>
<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-59
4
-141"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-141"
>
<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-59
4
-142"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-142"
>
<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-59
4
-143"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-account-59
6
-143"
>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__TRANSACTIONCURR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"ACCOUNT"
constraintName=
"DER1N_ACCOUNT__TRANSACTIONCURR"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[ACTIVITYMIMEATTACHMENT]外键关系 -->
<!--输出实体[ACTIVITYMIMEATTACHMENT]外键关系 -->
...
@@ -11159,7 +11159,7 @@
...
@@ -11159,7 +11159,7 @@
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"CHARACTERISTIC"
constraintName=
"DER1N_CHARACTERISTIC__TRANSACT"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"CHARACTERISTIC"
constraintName=
"DER1N_CHARACTERISTIC__TRANSACT"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[COMPETITOR]外键关系 -->
<!--输出实体[COMPETITOR]外键关系 -->
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-competitor-7
2
-190"
>
<changeSet
author=
"a_LAB01_e85d8801c"
id=
"fk-competitor-7
4
-190"
>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"COMPETITOR"
constraintName=
"DER1N_COMPETITOR__TRANSACTIONC"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
<addForeignKeyConstraint
baseColumnNames=
"TRANSACTIONCURRENCYID"
baseTableName=
"COMPETITOR"
constraintName=
"DER1N_COMPETITOR__TRANSACTIONC"
deferrable=
"false"
initiallyDeferred=
"false"
onDelete=
"RESTRICT"
onUpdate=
"RESTRICT"
referencedColumnNames=
"TRANSACTIONCURRENCYID"
referencedTableName=
"TRANSACTIONCURRENCY"
validate=
"true"
/>
</changeSet>
</changeSet>
<!--输出实体[COMPETITORPRODUCT]外键关系 -->
<!--输出实体[COMPETITORPRODUCT]外键关系 -->
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录