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

xignzi006 发布系统代码

上级 b25422fa
......@@ -289,6 +289,31 @@ export default {
title: "联系人信息",
},
},
quickcreate_form: {
details: {
group1: "联系人基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "联系人",
srfmajortext: "全名",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
fullname: "全名",
jobtitle: "职务",
customername: "客户",
emailaddress1: "电子邮件",
telephone1: "商务电话",
mobilephone: "移动电话",
fax: "传真",
customerid: "客户",
contactid: "联系人",
},
uiactions: {
},
},
abstractinfo_form: {
details: {
group1: "联系人基本信息",
......@@ -431,31 +456,6 @@ export default {
contact_edit_datapanel: "编辑头部信息",
},
},
quickcreate_form: {
details: {
group1: "联系人基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "联系人",
srfmajortext: "全名",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
fullname: "全名",
jobtitle: "职务",
customername: "客户",
emailaddress1: "电子邮件",
telephone1: "商务电话",
mobilephone: "移动电话",
fax: "传真",
customerid: "客户",
contactid: "联系人",
},
uiactions: {
},
},
abstractedit_form: {
details: {
group1: "联系人基本信息",
......@@ -658,26 +658,26 @@ export default {
uiactions: {
},
},
main_grid: {
byaccount_grid: {
columns: {
fullname: "全名",
emailaddress1: "电子邮件",
parentcustomerid: "公司名称",
telephone1: "商务电话",
uagridcolumn1: "设置主联系人",
},
uiactions: {
contact_setprimary: "设置为主要联系人",
},
},
byaccount_grid: {
main_grid: {
columns: {
fullname: "全名",
emailaddress1: "电子邮件",
parentcustomerid: "公司名称",
telephone1: "商务电话",
uagridcolumn1: "设置主联系人",
},
uiactions: {
contact_setprimary: "设置为主要联系人",
},
},
default_searchform: {
......@@ -690,6 +690,48 @@ export default {
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
},
editviewtoolbar_toolbar: {
tbitem12: {
caption: "关闭",
......@@ -742,48 +784,6 @@ export default {
tip: "关闭",
},
},
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
},
usablegridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
......
......@@ -288,6 +288,31 @@ export default {
title: "联系人信息",
},
},
quickcreate_form: {
details: {
group1: "联系人基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "联系人",
srfmajortext: "全名",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
fullname: "全名",
jobtitle: "职务",
customername: "客户",
emailaddress1: "电子邮件",
telephone1: "商务电话",
mobilephone: "移动电话",
fax: "传真",
customerid: "客户",
contactid: "联系人",
},
uiactions: {
},
},
abstractinfo_form: {
details: {
group1: "联系人基本信息",
......@@ -430,31 +455,6 @@ export default {
contact_edit_datapanel: "编辑头部信息",
},
},
quickcreate_form: {
details: {
group1: "联系人基本信息",
formpage1: "基本信息",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "联系人",
srfmajortext: "全名",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
fullname: "全名",
jobtitle: "职务",
customername: "客户",
emailaddress1: "电子邮件",
telephone1: "商务电话",
mobilephone: "移动电话",
fax: "传真",
customerid: "客户",
contactid: "联系人",
},
uiactions: {
},
},
abstractedit_form: {
details: {
group1: "联系人基本信息",
......@@ -657,26 +657,26 @@ export default {
uiactions: {
},
},
main_grid: {
byaccount_grid: {
columns: {
fullname: "全名",
emailaddress1: "电子邮件",
parentcustomerid: "公司名称",
telephone1: "商务电话",
uagridcolumn1: "设置主联系人",
},
uiactions: {
contact_setprimary: "设置为主要联系人",
},
},
byaccount_grid: {
main_grid: {
columns: {
fullname: "全名",
emailaddress1: "电子邮件",
parentcustomerid: "公司名称",
telephone1: "商务电话",
uagridcolumn1: "设置主联系人",
},
uiactions: {
contact_setprimary: "设置为主要联系人",
},
},
default_searchform: {
......@@ -689,6 +689,48 @@ export default {
uiactions: {
},
},
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "过滤",
tip: "过滤",
},
},
editviewtoolbar_toolbar: {
tbitem12: {
caption: "关闭",
......@@ -741,48 +783,6 @@ export default {
tip: "关闭",
},
},
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
},
tbitem2: {
caption: "-",
tip: "",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "过滤",
tip: "过滤",
},
},
usablegridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
......
......@@ -201,6 +201,7 @@ export default {
billto_stateorprovince: "省/市/自治区",
billto_city: "市/县",
billto_line1: "街道",
opportunityid: "商机",
invoiceid: "发票",
},
uiactions: {
......
......@@ -200,6 +200,7 @@ export default {
billto_stateorprovince: "省/市/自治区",
billto_city: "市/县",
billto_line1: "街道",
opportunityid: "商机",
invoiceid: "发票",
},
uiactions: {
......
......@@ -518,7 +518,7 @@ export default {
tip: "关闭",
},
},
conleadgridviewtoolbar_toolbar: {
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
......@@ -560,7 +560,7 @@ export default {
tip: "Filter",
},
},
gridviewtoolbar_toolbar: {
conleadgridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
......
......@@ -517,7 +517,7 @@ export default {
tip: "关闭",
},
},
conleadgridviewtoolbar_toolbar: {
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
......@@ -559,7 +559,7 @@ export default {
tip: "过滤",
},
},
gridviewtoolbar_toolbar: {
conleadgridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
tip: "新建",
......
......@@ -151,30 +151,6 @@ export default {
title: "报价单状态分页视图",
},
},
main_form: {
details: {
group1: "quote基本信息",
formpage1: "基本信息",
group2: "操作信息",
formpage2: "其它",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "报价单",
srfmajortext: "报价名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
quotename: "报价名称",
createman: "建立人",
createdate: "建立时间",
updateman: "更新人",
updatedate: "更新时间",
quoteid: "报价单",
},
uiactions: {
},
},
quickcreate_form: {
details: {
group1: "报价单基本信息",
......@@ -233,6 +209,7 @@ export default {
shippingmethodcode: "送货方式",
shipto_postalcode: "送货地的邮政编码",
willcall: "送货地址",
opportunityid: "商机",
quoteid: "报价单",
},
uiactions: {
......@@ -283,6 +260,30 @@ export default {
quote_edit_datapanel: "编辑头部信息",
},
},
main_form: {
details: {
group1: "quote基本信息",
formpage1: "基本信息",
group2: "操作信息",
formpage2: "其它",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "报价单",
srfmajortext: "报价名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
quotename: "报价名称",
createman: "建立人",
createdate: "建立时间",
updateman: "更新人",
updatedate: "更新时间",
quoteid: "报价单",
},
uiactions: {
},
},
main_grid: {
columns: {
quotename: "报价名称",
......@@ -300,82 +301,6 @@ export default {
uiactions: {
},
},
oppquagridviewtoolbar_toolbar: {
tbitem3: {
caption: "New",
tip: "New",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem4: {
caption: "Save And New",
tip: "Save And New",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem7: {
caption: "Remove And Close",
tip: "Remove And Close Window",
},
tbitem8: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "New",
tip: "New",
},
tbitem13: {
caption: "-",
tip: "",
},
tbitem14: {
caption: "Copy",
tip: "Copy {0}",
},
},
infotoolbar_toolbar: {
tbitem17_active: {
caption: "激活报价单",
......@@ -452,6 +377,82 @@ export default {
tip: "Filter",
},
},
oppquagridviewtoolbar_toolbar: {
tbitem3: {
caption: "New",
tip: "New",
},
tbitem4: {
caption: "Edit",
tip: "Edit {0}",
},
tbitem6: {
caption: "Copy",
tip: "Copy {0}",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "Remove",
tip: "Remove {0}",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "Export",
tip: "Export {0} Data To Excel",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "Filter",
tip: "Filter",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "Save",
tip: "Save",
},
tbitem4: {
caption: "Save And New",
tip: "Save And New",
},
tbitem5: {
caption: "Save And Close",
tip: "Save And Close Window",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem7: {
caption: "Remove And Close",
tip: "Remove And Close Window",
},
tbitem8: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "New",
tip: "New",
},
tbitem13: {
caption: "-",
tip: "",
},
tbitem14: {
caption: "Copy",
tip: "Copy {0}",
},
},
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
......
......@@ -150,30 +150,6 @@ export default {
title: "报价单状态分页视图",
},
},
main_form: {
details: {
group1: "quote基本信息",
formpage1: "基本信息",
group2: "操作信息",
formpage2: "其它",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "报价单",
srfmajortext: "报价名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
quotename: "报价名称",
createman: "建立人",
createdate: "建立时间",
updateman: "更新人",
updatedate: "更新时间",
quoteid: "报价单",
},
uiactions: {
},
},
quickcreate_form: {
details: {
group1: "报价单基本信息",
......@@ -232,6 +208,7 @@ export default {
shippingmethodcode: "送货方式",
shipto_postalcode: "送货地的邮政编码",
willcall: "送货地址",
opportunityid: "商机",
quoteid: "报价单",
},
uiactions: {
......@@ -282,6 +259,30 @@ export default {
quote_edit_datapanel: "编辑头部信息",
},
},
main_form: {
details: {
group1: "quote基本信息",
formpage1: "基本信息",
group2: "操作信息",
formpage2: "其它",
srfupdatedate: "更新时间",
srforikey: "",
srfkey: "报价单",
srfmajortext: "报价名称",
srftempmode: "",
srfuf: "",
srfdeid: "",
srfsourcekey: "",
quotename: "报价名称",
createman: "建立人",
createdate: "建立时间",
updateman: "更新人",
updatedate: "更新时间",
quoteid: "报价单",
},
uiactions: {
},
},
main_grid: {
columns: {
quotename: "报价名称",
......@@ -299,82 +300,6 @@ export default {
uiactions: {
},
},
oppquagridviewtoolbar_toolbar: {
tbitem3: {
caption: "新建",
tip: "新建",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "过滤",
tip: "过滤",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: "保存并新建",
tip: "保存并新建",
},
tbitem5: {
caption: "保存并关闭",
tip: "保存并关闭",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem7: {
caption: "删除并关闭",
tip: "删除并关闭",
},
tbitem8: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "新建",
tip: "新建",
},
tbitem13: {
caption: "-",
tip: "",
},
tbitem14: {
caption: "拷贝",
tip: "拷贝",
},
},
infotoolbar_toolbar: {
tbitem17_active: {
caption: "激活报价单",
......@@ -451,6 +376,82 @@ export default {
tip: "过滤",
},
},
oppquagridviewtoolbar_toolbar: {
tbitem3: {
caption: "新建",
tip: "新建",
},
tbitem4: {
caption: "编辑",
tip: "编辑",
},
tbitem6: {
caption: "拷贝",
tip: "拷贝",
},
tbitem7: {
caption: "-",
tip: "",
},
tbitem8: {
caption: "删除",
tip: "删除",
},
tbitem9: {
caption: "-",
tip: "",
},
tbitem13: {
caption: "导出",
tip: "导出",
},
tbitem10: {
caption: "-",
tip: "",
},
tbitem19: {
caption: "过滤",
tip: "过滤",
},
},
editviewtoolbar_toolbar: {
tbitem3: {
caption: "保存",
tip: "保存",
},
tbitem4: {
caption: "保存并新建",
tip: "保存并新建",
},
tbitem5: {
caption: "保存并关闭",
tip: "保存并关闭",
},
tbitem6: {
caption: "-",
tip: "",
},
tbitem7: {
caption: "删除并关闭",
tip: "删除并关闭",
},
tbitem8: {
caption: "-",
tip: "",
},
tbitem12: {
caption: "新建",
tip: "新建",
},
tbitem13: {
caption: "-",
tip: "",
},
tbitem14: {
caption: "拷贝",
tip: "拷贝",
},
},
gridviewtoolbar_toolbar: {
tbitem1_quickcreate: {
caption: "新建",
......
......@@ -225,6 +225,7 @@ export default {
billto_line1: "街道",
billto_postalcode: "邮政编码",
salesorderid: "订单",
opportunityid: "商机",
},
uiactions: {
},
......
......@@ -224,6 +224,7 @@ export default {
billto_line1: "街道",
billto_postalcode: "邮政编码",
salesorderid: "订单",
opportunityid: "商机",
},
uiactions: {
},
......
......@@ -80,6 +80,21 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -110,21 +125,6 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -135,9 +135,9 @@ export default class AccountServiceBase extends EntityService {
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));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
......@@ -167,6 +167,21 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -197,27 +212,12 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
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+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
......@@ -246,9 +246,9 @@ export default class AccountServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
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+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
......@@ -265,9 +265,9 @@ export default class AccountServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/accounts/getdraft`,isloading);
res.data.account = data.account;
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+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
......@@ -353,6 +353,21 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.leads = leadsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -383,27 +398,12 @@ export default class AccountServiceBase extends EntityService {
}
}
masterData.contacts = contactsData;
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
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+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
return res;
}
......
......@@ -62,21 +62,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -107,6 +92,21 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -116,9 +116,9 @@ export default class CompetitorServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
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+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -133,21 +133,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -178,11 +163,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
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+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -210,9 +210,9 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -228,9 +228,9 @@ export default class CompetitorServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading);
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+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......@@ -258,21 +258,6 @@ export default class CompetitorServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
......@@ -303,11 +288,26 @@ export default class CompetitorServiceBase extends EntityService {
}
}
masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leadcompetitors = leadcompetitorsData;
Object.assign(data,masterData);
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+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
return res;
}
......
......@@ -78,21 +78,6 @@ export default class QuoteServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && true){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -108,21 +93,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -138,6 +108,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -153,21 +138,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -183,6 +153,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -198,21 +183,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -228,6 +198,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -243,20 +228,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -272,6 +243,20 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -287,6 +272,21 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -296,8 +296,8 @@ export default class QuoteServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -313,21 +313,6 @@ export default class QuoteServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -343,14 +328,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -366,6 +343,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -381,14 +366,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -404,6 +381,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -419,14 +404,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -442,6 +419,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -457,13 +442,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -479,6 +457,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -494,10 +479,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -538,31 +538,31 @@ export default class QuoteServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 res:any = await Http.getInstance().get(`/quotes/${context.quote}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -579,35 +579,35 @@ export default class QuoteServiceBase extends EntityService {
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);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
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 res:any = await Http.getInstance().get(`/quotes/getdraft`,isloading);
res.data.quote = data.quote;
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
this.tempStorage.setItem(context.srfsessionkey+'_quotedetails',JSON.stringify(res.data.quotedetails));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......@@ -638,21 +638,6 @@ export default class QuoteServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -668,14 +653,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -691,6 +668,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -706,14 +691,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -729,6 +706,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -744,14 +729,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -767,6 +744,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -782,10 +767,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/checkkey`,data,isloading);
......@@ -818,21 +818,6 @@ export default class QuoteServiceBase extends EntityService {
public async GenSalesOrder(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -848,14 +833,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -871,6 +848,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -886,14 +871,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -909,6 +886,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -924,14 +909,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -947,6 +924,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -962,10 +947,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
return Http.getInstance().post(`/quotes/${context.quote}/gensalesorder`,data,isloading);
......@@ -983,21 +983,6 @@ export default class QuoteServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote){
let masterData:any = {};
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -1013,14 +998,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1036,6 +1013,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1051,14 +1036,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1074,6 +1051,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1089,14 +1074,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1112,6 +1089,14 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1127,13 +1112,6 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
......@@ -1149,6 +1127,13 @@ export default class QuoteServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails'),'undefined')){
quotedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotedetails') as any);
......@@ -1164,10 +1149,25 @@ export default class QuoteServiceBase extends EntityService {
}
}
masterData.quotedetails = quotedetailsData;
let salesordersData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorders'),'undefined')){
salesordersData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorders') as any);
if(salesordersData && salesordersData.length && salesordersData.length > 0){
salesordersData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorders = salesordersData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorders',JSON.stringify(res.data.salesorders));
return res;
}
......
......@@ -62,11 +62,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item: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;
......@@ -76,12 +76,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
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) => {
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -91,7 +91,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
masterData.productsalesliteratures = productsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
......@@ -116,8 +116,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/salesliteratures`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
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+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -133,11 +133,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item: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;
......@@ -147,12 +147,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
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) => {
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -162,7 +162,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
masterData.productsalesliteratures = productsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
......@@ -180,8 +180,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/salesliteratures/${context.salesliterature}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -210,8 +210,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/${context.salesliterature}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
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+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -228,8 +228,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/salesliteratures/getdraft`,isloading);
res.data.salesliterature = data.salesliterature;
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
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+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......@@ -258,11 +258,11 @@ export default class SalesLiteratureServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item: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;
......@@ -272,12 +272,12 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData.productsalesliteratures = productsalesliteraturesData;
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) => {
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
let productsalesliteraturesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures'),'undefined')){
productsalesliteraturesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsalesliteratures') as any);
if(productsalesliteraturesData && productsalesliteraturesData.length && productsalesliteraturesData.length > 0){
productsalesliteraturesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
......@@ -287,7 +287,7 @@ export default class SalesLiteratureServiceBase extends EntityService {
});
}
}
masterData.competitorsalesliteratures = competitorsalesliteraturesData;
masterData.productsalesliteratures = productsalesliteraturesData;
let salesliteratureitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems'),'undefined')){
salesliteratureitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesliteratureitems') as any);
......@@ -305,8 +305,8 @@ export default class SalesLiteratureServiceBase extends EntityService {
masterData.salesliteratureitems = salesliteratureitemsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/salesliteratures/${context.salesliterature}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_competitorsalesliteratures',JSON.stringify(res.data.competitorsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_productsalesliteratures',JSON.stringify(res.data.productsalesliteratures));
this.tempStorage.setItem(context.srfsessionkey+'_salesliteratureitems',JSON.stringify(res.data.salesliteratureitems));
return res;
}
......
......@@ -80,21 +80,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && true){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -110,21 +95,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -140,6 +110,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -155,21 +140,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -185,6 +155,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -200,21 +185,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -230,6 +200,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -245,21 +230,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -275,6 +245,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -290,20 +275,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -319,6 +290,20 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -334,6 +319,21 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null;
......@@ -343,8 +343,8 @@ export default class SalesOrderServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(tempContext.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -360,21 +360,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -390,14 +375,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -413,6 +390,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -428,14 +413,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -451,6 +428,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -466,14 +451,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -489,6 +466,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -504,14 +489,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -527,6 +504,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -542,13 +527,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -564,6 +542,13 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -579,10 +564,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -626,37 +626,37 @@ export default class SalesOrderServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
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);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 res:any = await Http.getInstance().get(`/salesorders/${context.salesorder}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -673,42 +673,42 @@ export default class SalesOrderServiceBase extends EntityService {
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);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 && true){
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 && true){
let res:any = await Http.getInstance().get(`/quotes/${context.quote}/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
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 res:any = await Http.getInstance().get(`/salesorders/getdraft`,isloading);
res.data.salesorder = data.salesorder;
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
this.tempStorage.setItem(context.srfsessionkey+'_invoices',JSON.stringify(res.data.invoices));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......@@ -739,21 +739,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -769,14 +754,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -792,6 +769,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -807,14 +792,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -830,6 +807,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -845,14 +830,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -868,6 +845,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -883,14 +868,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -906,6 +883,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -921,10 +906,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/checkkey`,data,isloading);
......@@ -957,21 +957,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async GenInvoice(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -987,14 +972,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1010,6 +987,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1025,14 +1010,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1048,6 +1025,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1063,14 +1048,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1086,6 +1063,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1101,14 +1086,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1124,6 +1101,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1139,10 +1124,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
return Http.getInstance().post(`/salesorders/${context.salesorder}/geninvoice`,data,isloading);
......@@ -1160,21 +1160,6 @@ export default class SalesOrderServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity && context.quote && context.salesorder){
let masterData:any = {};
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
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);
......@@ -1190,14 +1175,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1213,6 +1190,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1228,14 +1213,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1251,6 +1228,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1266,14 +1251,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1289,6 +1266,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1304,14 +1289,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1327,6 +1304,14 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1342,13 +1327,6 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
......@@ -1364,6 +1342,13 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
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 = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_invoices'),'undefined')){
invoicesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_invoices') as any);
......@@ -1379,10 +1364,25 @@ export default class SalesOrderServiceBase extends EntityService {
}
}
masterData.invoices = invoicesData;
let salesorderdetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails'),'undefined')){
salesorderdetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_salesorderdetails') as any);
if(salesorderdetailsData && salesorderdetailsData.length && salesorderdetailsData.length > 0){
salesorderdetailsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.salesorderdetailid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.salesorderdetails = salesorderdetailsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/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));
this.tempStorage.setItem(context.srfsessionkey+'_salesorderdetails',JSON.stringify(res.data.salesorderdetails));
return res;
}
......
......@@ -844,6 +844,7 @@ export const viewstate: any = {
viewaction: '',
viewdatachange: false,
refviews: [
'8bfcd7acdd1f36afc1714f1071671f2c',
],
},
{
......@@ -2606,6 +2607,7 @@ export const viewstate: any = {
viewaction: '',
viewdatachange: false,
refviews: [
'8bfcd7acdd1f36afc1714f1071671f2c',
],
},
{
......@@ -2663,6 +2665,7 @@ export const viewstate: any = {
viewaction: '',
viewdatachange: false,
refviews: [
'8bfcd7acdd1f36afc1714f1071671f2c',
],
},
{
......
......@@ -96,6 +96,7 @@ export class InfoEditFormBase extends EditFormControlBase {
billto_stateorprovince: null,
billto_city: null,
billto_line1: null,
opportunityid: null,
invoiceid: null,
invoice:null,
};
......@@ -188,6 +189,8 @@ export class InfoEditFormBase extends EditFormControlBase {
billto_line1: new FormItemModel({ caption: '街道', detailType: 'FORMITEM', name: 'billto_line1', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
opportunityid: new FormItemModel({ caption: '商机', detailType: 'FORMITEM', name: 'opportunityid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
invoiceid: new FormItemModel({ caption: '发票', detailType: 'FORMITEM', name: 'invoiceid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
......
......@@ -165,6 +165,11 @@ export default class InfoModel {
prop: 'billto_line1',
dataType: 'TEXT',
},
{
name: 'opportunityid',
prop: 'opportunityid',
dataType: 'PICKUP',
},
{
name: 'invoiceid',
prop: 'invoiceid',
......
......@@ -2,6 +2,7 @@ import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import InvoiceService from '@/service/invoice/invoice-service';
import InfoModel from './info-form-model';
import OpportunityService from '@/service/opportunity/opportunity-service';
/**
......@@ -41,6 +42,14 @@ export default class InfoService extends ControlService {
this.model = new InfoModel();
}
/**
* 商机服务对象
*
* @type {OpportunityService}
* @memberof InfoService
*/
public opportunityService: OpportunityService = new OpportunityService();
/**
* 处理数据
*
......@@ -80,6 +89,9 @@ export default class InfoService extends ControlService {
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'OpportunityService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.opportunityService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'opportunityid', 'opportunity');
}
return Promise.reject([])
}
......
......@@ -141,7 +141,24 @@
<i-col v-show="detailsModel.opportunityname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='opportunityname' :itemRules="this.rules.opportunityname" class='' :caption="$t('entities.invoice.info_form.details.opportunityname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.opportunityname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='opportunityname' :value="data.opportunityname" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.opportunityname.disabled"
name='opportunityname'
deMajorField='opportunityname'
deKeyField='opportunity'
valueitem='opportunityid'
:value="data.opportunityname"
editortype="linkonly"
:linkview="{ viewname: 'OpportunityInfo', title: $t('entities.opportunity.views.info.title'), deResParameters: [{ pathName: 'accounts', parameterName: 'account' }, ], parameters: [{ pathName: 'opportunities', parameterName: 'opportunity' }, { pathName: 'info', parameterName: 'info' } ], width: 0, height: 0, placement: '', isRedirectView: false }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
......
......@@ -31,7 +31,15 @@
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.entityname}}</span>
<app-column-link deKeyField='opportunity' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'opportunity-info', height: 0,width: 0,title: $t('entities.opportunity.views.info.title'),placement: '', isRedirectView: false,deResParameters: [
{ pathName: 'accounts', parameterName: 'account' },
]
,parameters: [
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'info', parameterName: 'info' }
]}" valueitem="entityid">
<span>{{row.entityname}}</span>
</app-column-link >
</template>
</el-table-column>
</template>
......
......@@ -31,7 +31,15 @@
</span>
</template>
<template v-slot="{row,column,$index}">
<span>{{row.opportunityname}}</span>
<app-column-link deKeyField='opportunity' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'opportunity-info', height: 0,width: 0,title: $t('entities.opportunity.views.info.title'),placement: '', isRedirectView: false,deResParameters: [
{ pathName: 'accounts', parameterName: 'account' },
]
,parameters: [
{ pathName: 'opportunities', parameterName: 'opportunity' },
{ pathName: 'info', parameterName: 'info' }
]}" valueitem="srfkey">
<span>{{row.opportunityname}}</span>
</app-column-link >
</template>
</el-table-column>
</template>
......
......@@ -93,6 +93,7 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
shippingmethodcode: null,
shipto_postalcode: null,
willcall: null,
opportunityid: null,
quoteid: null,
quote:null,
};
......@@ -173,6 +174,8 @@ export class AbstractInfoEditFormBase extends EditFormControlBase {
willcall: new FormItemModel({ caption: '送货地址', detailType: 'FORMITEM', name: 'willcall', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
opportunityid: new FormItemModel({ caption: '商机', detailType: 'FORMITEM', name: 'opportunityid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
quoteid: new FormItemModel({ caption: '报价单', detailType: 'FORMITEM', name: 'quoteid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
......
......@@ -148,6 +148,11 @@ export default class AbstractInfoModel {
prop: 'willcall',
dataType: 'YESNO',
},
{
name: 'opportunityid',
prop: 'opportunityid',
dataType: 'PICKUP',
},
{
name: 'quoteid',
prop: 'quoteid',
......
......@@ -2,6 +2,7 @@ import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import QuoteService from '@/service/quote/quote-service';
import AbstractInfoModel from './abstract-info-form-model';
import OpportunityService from '@/service/opportunity/opportunity-service';
/**
......@@ -41,6 +42,14 @@ export default class AbstractInfoService extends ControlService {
this.model = new AbstractInfoModel();
}
/**
* 商机服务对象
*
* @type {OpportunityService}
* @memberof AbstractInfoService
*/
public opportunityService: OpportunityService = new OpportunityService();
/**
* 处理数据
*
......@@ -80,6 +89,9 @@ export default class AbstractInfoService extends ControlService {
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'OpportunityService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.opportunityService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'opportunityid', 'opportunity');
}
return Promise.reject([])
}
......
......@@ -30,7 +30,24 @@
<i-col v-show="detailsModel.opportunityname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='opportunityname' :itemRules="this.rules.opportunityname" class='' :caption="$t('entities.quote.abstractinfo_form.details.opportunityname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.opportunityname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='opportunityname' :value="data.opportunityname" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.opportunityname.disabled"
name='opportunityname'
deMajorField='opportunityname'
deKeyField='opportunity'
valueitem='opportunityid'
:value="data.opportunityname"
editortype="linkonly"
:linkview="{ viewname: 'OpportunityInfo', title: $t('entities.opportunity.views.info.title'), deResParameters: [{ pathName: 'accounts', parameterName: 'account' }, ], parameters: [{ pathName: 'opportunities', parameterName: 'opportunity' }, { pathName: 'info', parameterName: 'info' } ], width: 0, height: 0, placement: '', isRedirectView: false }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
......
......@@ -98,6 +98,7 @@ export class InfoEditFormBase extends EditFormControlBase {
billto_line1: null,
billto_postalcode: null,
salesorderid: null,
opportunityid: null,
salesorder:null,
};
......@@ -193,5 +194,7 @@ export class InfoEditFormBase extends EditFormControlBase {
salesorderid: new FormItemModel({ caption: '订单', detailType: 'FORMITEM', name: 'salesorderid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
opportunityid: new FormItemModel({ caption: '商机', detailType: 'FORMITEM', name: 'opportunityid', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
};
}
\ No newline at end of file
......@@ -175,6 +175,11 @@ export default class InfoModel {
prop: 'salesorderid',
dataType: 'GUID',
},
{
name: 'opportunityid',
prop: 'opportunityid',
dataType: 'PICKUP',
},
{
name: 'salesorder',
prop: 'salesorderid',
......
......@@ -2,6 +2,7 @@ import { Http,Util,Errorlog } from '@/utils';
import ControlService from '@/widgets/control-service';
import SalesOrderService from '@/service/sales-order/sales-order-service';
import InfoModel from './info-form-model';
import OpportunityService from '@/service/opportunity/opportunity-service';
/**
......@@ -41,6 +42,14 @@ export default class InfoService extends ControlService {
this.model = new InfoModel();
}
/**
* 商机服务对象
*
* @type {OpportunityService}
* @memberof InfoService
*/
public opportunityService: OpportunityService = new OpportunityService();
/**
* 处理数据
*
......@@ -80,6 +89,9 @@ export default class InfoService extends ControlService {
*/
@Errorlog
public getItems(serviceName: string, interfaceName: string, context: any = {}, data: any, isloading?: boolean): Promise<any[]> {
if (Object.is(serviceName, 'OpportunityService') && Object.is(interfaceName, 'FetchDefault')) {
return this.doItems(this.opportunityService.FetchDefault(JSON.parse(JSON.stringify(context)),data, isloading), 'opportunityid', 'opportunity');
}
return Promise.reject([])
}
......
......@@ -141,7 +141,24 @@
<i-col v-show="detailsModel.opportunityname.visible" :style="{}" :md="{ span: 12, offset: 0 }" :lg="{ span: 8, offset: 0 }" :xl="{ span: 6, offset: 0 }">
<app-form-item name='opportunityname' :itemRules="this.rules.opportunityname" class='' :caption="$t('entities.salesorder.info_form.details.opportunityname')" uiStyle="DEFAULT" :labelWidth="130" :isShowCaption="true" :error="detailsModel.opportunityname.error" :isEmptyCaption="false" labelPos="LEFT">
<app-span name='opportunityname' :value="data.opportunityname" :data="data" :context="context" :viewparams="viewparams" :localContext ='{ }' :localParam ='{ }' style=""></app-span>
<app-picker
:formState="formState"
:data="data"
:context="context"
:viewparams="viewparams"
:localContext ='{ }'
:localParam ='{ }'
:disabled="detailsModel.opportunityname.disabled"
name='opportunityname'
deMajorField='opportunityname'
deKeyField='opportunity'
valueitem='opportunityid'
:value="data.opportunityname"
editortype="linkonly"
:linkview="{ viewname: 'OpportunityInfo', title: $t('entities.opportunity.views.info.title'), deResParameters: [{ pathName: 'accounts', parameterName: 'account' }, ], parameters: [{ pathName: 'opportunities', parameterName: 'opportunity' }, { pathName: 'info', parameterName: 'info' } ], width: 0, height: 0, placement: '', isRedirectView: false }"
style=""
@formitemvaluechange="onFormItemValueChange">
</app-picker>
</app-form-item>
</i-col>
......
......@@ -4,7 +4,7 @@
<!--输出实体[ACCOUNT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-account-612-1">
<changeSet author="a_LAB01_e85d8801c" id="tab-account-613-1">
<createTable tableName="ACCOUNT">
<column name="ADDRESS1_PRIMARYCONTACTNAME" remarks="" type="VARCHAR(100)">
</column>
......@@ -2595,7 +2595,7 @@
<!--输出实体[CONNECTION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-connection-32-35">
<changeSet author="a_LAB01_e85d8801c" id="tab-connection-34-35">
<createTable tableName="CONNECTION">
<column name="RECORD2OBJECTTYPECODE" remarks="" type="VARCHAR(30)">
</column>
......@@ -2757,7 +2757,7 @@
<!--输出实体[CONTACT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-contact-350-38">
<changeSet author="a_LAB01_e85d8801c" id="tab-contact-352-38">
<createTable tableName="CONTACT">
<column name="ADDRESS1_FREIGHTTERMSCODE" remarks="" type="VARCHAR(30)">
</column>
......@@ -10987,31 +10987,31 @@
</changeSet>
<!--输出实体[ACCOUNT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-135">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-136">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-137">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-138">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-139">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-140">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-141">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-142">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-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"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-account-612-143">
<changeSet author="a_LAB01_e85d8801c" id="fk-account-613-143">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="ACCOUNT" constraintName="DER1N_ACCOUNT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[ACTIVITYMIMEATTACHMENT]外键关系 -->
......@@ -11174,10 +11174,10 @@
<addForeignKeyConstraint baseColumnNames="ENTITYID" baseTableName="RELATIONSHIPS" constraintName="DER1N_COMPETITORSALESLITERATUR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="COMPETITORID" referencedTableName="COMPETITOR" validate="true"/>
</changeSet>
<!--输出实体[CONNECTION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-connection-32-195">
<changeSet author="a_LAB01_e85d8801c" id="fk-connection-34-195">
<addForeignKeyConstraint baseColumnNames="RECORD1ROLEID" baseTableName="CONNECTION" constraintName="DER1N_CONNECTION__CONNECTIONRO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="CONNECTIONROLEID" referencedTableName="CONNECTIONROLE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-connection-32-197">
<changeSet author="a_LAB01_e85d8801c" id="fk-connection-34-197">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="CONNECTION" constraintName="DER1N_CONNECTION__TRANSACTIONC" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[CONNECTIONROLE]外键关系 -->
......@@ -11186,25 +11186,25 @@
<addForeignKeyConstraint baseColumnNames="BUSINESSUNITID" baseTableName="CONSTRAINTBASEDGROUP" constraintName="DER1N_CONSTRAINTBASEDGROUP__BU" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="BUSINESSUNITID" referencedTableName="BUSINESSUNIT" validate="true"/>
</changeSet>
<!--输出实体[CONTACT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-199">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-199">
<addForeignKeyConstraint baseColumnNames="CUSTOMERID" baseTableName="CONTACT" constraintName="DER1N_CONTACT_ACCOUNT_CUSTOMER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ACCOUNTID" referencedTableName="ACCOUNT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-200">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-200">
<addForeignKeyConstraint baseColumnNames="PREFERREDEQUIPMENTID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__EQUIPMENT__PREF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EQUIPMENTID" referencedTableName="EQUIPMENT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-201">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-201">
<addForeignKeyConstraint baseColumnNames="ORIGINATINGLEADID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__LEAD__ORIGINATI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="LEADID" referencedTableName="LEAD" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-202">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-202">
<addForeignKeyConstraint baseColumnNames="DEFAULTPRICELEVELID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__PRICELEVEL__DEF" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRICELEVELID" referencedTableName="PRICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-203">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-203">
<addForeignKeyConstraint baseColumnNames="PREFERREDSERVICEID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__SERVICE__PREFER" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SERVICEID" referencedTableName="SERVICE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-204">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-204">
<addForeignKeyConstraint baseColumnNames="SLAID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__SLA__SLAID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="SLAID" referencedTableName="SLA" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-350-205">
<changeSet author="a_LAB01_e85d8801c" id="fk-contact-352-205">
<addForeignKeyConstraint baseColumnNames="TRANSACTIONCURRENCYID" baseTableName="CONTACT" constraintName="DER1N_CONTACT__TRANSACTIONCURR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="TRANSACTIONCURRENCYID" referencedTableName="TRANSACTIONCURRENCY" validate="true"/>
</changeSet>
<!--输出实体[CONTRACT]外键关系 -->
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册