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

chitanda 发布系统代码,表单受控内容支持

上级 c11b070b
.app-form-group { .app-form-group {
.show-more {
margin-top: 5px;
}
>.ivu-card-head { >.ivu-card-head {
>p { >p {
...@@ -16,6 +20,10 @@ ...@@ -16,6 +20,10 @@
.item { .item {
margin-left: 12px; margin-left: 12px;
.caption {
padding-left: 5px;
}
} }
} }
} }
......
import { Vue, Component, Prop } from 'vue-property-decorator';
import './app-form-group.less'
/**
* 表单分组
*
* @export
* @class AppFormGroup
* @extends {Vue}
*/
@Component({})
export default class AppFormGroup extends Vue {
/**
* 表单分组模型
*
* @type {*}
* @memberof AppFormGroup
*/
@Prop({ default: () => { } })
public model: any;
/**
* 标题
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop() public caption?: string;
/**
* 内置界面样式
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop({ default: 'DEFAULT' }) public uiStyle!: string;
/**
* 布局模式
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop() public layoutType?: string;
/**
* 标题样式
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop() public titleStyle?: string;
/**
* 分组图标
*
* @type {string}
* @memberof AppFormGroup
*/
@Prop() public iconInfo?: any;
/**
* 是否显示标题
*
* @type {boolean}
* @memberof AppFormGroup
*/
@Prop({ default: true }) public isShowCaption!: boolean;
/**
* 信息面板模式
*
* @type {boolean}
* @memberof AppFormGroup
*/
@Prop({ default: false }) public isInfoGroupMode!: boolean;
/**
* 界面行为组
*
* @type {*}
* @memberof AppFormGroup
*/
@Prop() public uiActionGroup?: any;
/**
* 标题栏关闭模式
* 0: 不支持关闭
* 1: 默认打开
* 2: 默认关闭
*
* @type {(number | 0 | 1 | 2)}
* @memberof AppFormGroup
*/
@Prop({ default: 0 }) public titleBarCloseMode!: number | 0 | 1 | 2;
/**
* 收缩内容
*
* @type {boolean}
* @memberof AppFormGroup
*/
public collapseContant: boolean = false;
/**
* 计算样式
*
* @readonly
* @type {string[]}
* @memberof AppFormGroup
*/
get classes(): string[] {
return [
'app-form-group',
this.isShowCaption && this.collapseContant ? 'app-group-collapse-contant' : '',
this.isInfoGroupMode ? 'app-info-group-mode' : '',
Object.is(this.layoutType, 'FLEX') ? 'app-group-flex' : '',
this.uiStyle.toLowerCase()
];
}
/**
* 标题样式
*
* @readonly
* @type {string}
* @memberof AppFormGroup
*/
get titleClass(): string {
return this.titleStyle ? this.titleStyle : '';
}
/**
* vue 生命周期
*
* @memberof AppFormGroup
*/
public created() {
this.collapseContant = this.titleBarCloseMode === 2 ? true : false;
}
/**
* 触发收缩
*
* @memberof AppFormGroup
*/
public clickCollapse(): void {
this.collapseContant = !this.collapseContant;
}
/**
* 执行界面行
*
* @param {*} $event
* @memberof AppFormGroup
*/
public doUIAction($event: any, item: any): void {
this.$emit('groupuiactionclick', { event: $event, item: item });
}
/**
* 计算行为项图标
*
* @protected
* @param {*} detail
* @returns {*}
* @memberof AppFormGroup
*/
protected getIcon(detail: any): any {
if (detail.isShowIcon) {
if (isExistAndNotEmpty(detail.icon)) {
return <i class={detail.icon} />;
} else if (isExistAndNotEmpty(detail.img)) {
return <img src="detail.img" />;
}
}
}
/**
* 计算行为项标题
*
* @protected
* @param {*} detail
* @returns {*}
* @memberof AppFormGroup
*/
protected getCaption(detail: any): any {
if (detail.isShowCaption) {
if (isExistAndNotEmpty(detail.uiactiontag) && isExistAndNotEmpty(this.uiActionGroup.langbase)) {
return this.$t(`${this.uiActionGroup.langbase}.uiactions.${detail.uiactiontag}`);
}
return detail.caption;
}
}
/**
* 绘制样式4模式分组
*
* @protected
* @returns {*}
* @memberof AppFormGroup
*/
protected renderStyle4(): any {
return <app-form-group4 caption={this.caption} uiStyle={this.uiStyle} layoutType={this.layoutType} isShowCaption={this.isShowCaption} isInfoGroupMode={this.isInfoGroupMode} uiActionGroup={this.uiActionGroup} titleBarCloseMode={this.titleBarCloseMode}>
{this.$slots.default}
</app-form-group4>;
}
/**
* 绘制样式2模式分组
*
* @protected
* @returns {*}
* @memberof AppFormGroup
*/
protected renderStyle2(): any {
return <app-form-group2 caption={this.caption} uiStyle={this.uiStyle} layoutType={this.layoutType} isShowCaption={this.isShowCaption} isInfoGroupMode={this.isInfoGroupMode} uiActionGroup={this.uiActionGroup} titleBarCloseMode={this.titleBarCloseMode}>
{this.$slots.default}
</app-form-group2>;
}
/**
* 绘制行为组
*
* @protected
* @returns {*}
* @memberof AppFormGroup
*/
protected renderActionGroup(): any {
if (this.uiActionGroup) {
let content: any;
if (this.uiActionGroup.extractMode && Object.is(this.uiActionGroup.extractMode, 'ITEMS')) {
content = <dropdown transfer={true} trigger='click'>
<a href='javascript:void(0)'>
{this.uiActionGroup.caption}
</a>
<dropdown-menu slot='list'>
{this.uiActionGroup.details.map((detail: any, i: number) => {
return <dropdown-item key={i} name={detail.name}>
<span class='item' on-click={(e: any) => this.doUIAction(e, detail)}>
{this.getIcon(detail)}
<span class="caption">{this.getCaption(detail)}</span>
</span>;
</dropdown-item>;
})}
</dropdown-menu>
</dropdown >;
} else {
content = <span class='item-extract-mode'>
{this.uiActionGroup.details.map((detail: any, i: number) => {
return <span key={i} class='item' on-click={(e: any) => this.doUIAction(e, detail)}>
{this.getIcon(detail)}
<span class="caption">{this.getCaption(detail)}</span>
</span>;
})}
</span >;
}
return <a slot='extra'>{content}</a>;
}
}
/**
* 绘制默认内容
*
* @protected
* @returns {*}
* @memberof AppFormGroup
*/
protected renderContent(): any {
if (this.isShowCaption === false) {
return this.$slots.default;
}
return <card bordered={false} dis-hover={true} class={this.classes}>
<p slot='title'>
{this.titleBarCloseMode !== 0 ? <icon type={this.collapseContant ? 'ios-arrow-dropright-circle' : 'ios-arrow-dropdown-circle'} on-click={() => this.clickCollapse()}></icon> : null}
<span class={this.titleClass}>{this.caption}</span>
</p>
{this.renderActionGroup()}
{Object.is(this.layoutType, 'FLEX') ? this.$slots.default : <row gutter={10}>{this.$slots.default}</row>}
<div class="show-more" v-show={this.model.showMoreMode === 2}>
<i-button on-click={() => this.model.changeShowMore()} size="small">
{this.model?.showMore ? '隐藏更多' : '显示更多'}
</i-button>
</div>
</card>;
}
/**
* 绘制内容
*
* @returns {*}
* @memberof AppFormGroup
*/
public render(): any {
let content: any;
if (this.uiStyle === 'STYLE4') {
content = this.renderStyle4();
} else if (this.uiStyle === 'STYLE2') {
content = this.renderStyle2();
} else {
content = this.renderContent();
}
return <div class={this.classes}>{content}</div>;
}
}
\ No newline at end of file
...@@ -72,13 +72,13 @@ export default class FilterMode extends Vue { ...@@ -72,13 +72,13 @@ export default class FilterMode extends Vue {
// { name: 'AND', value: '$and' }, // { name: 'AND', value: '$and' },
// { name: 'OR', value: '$or' }, // { name: 'OR', value: '$or' },
{ 'zh-CN': '等于(=)', 'en-US': 'EQ', value: '$eq' }, { 'zh-CN': '等于(=)', 'en-US': 'EQ', value: '$eq' },
{ 'zh-CN': '不等于(<>)', 'en-US': 'NE', value: '$ne' }, { 'zh-CN': '不等于(<>)', 'en-US': 'NOTEQ', value: '$ne' },
{ 'zh-CN': '大于(>)', 'en-US': 'GT', value: '$gt' }, { 'zh-CN': '大于(>)', 'en-US': 'GT', value: '$gt' },
{ 'zh-CN': '大于等于(>=)', 'en-US': 'GE', value: '$gte' }, { 'zh-CN': '大于等于(>=)', 'en-US': 'GTANDEQ', value: '$gte' },
{ 'zh-CN': '小于(<)', 'en-US': 'LT', value: '$lt' }, { 'zh-CN': '小于(<)', 'en-US': 'LT', value: '$lt' },
{ 'zh-CN': '小于(<=)', 'en-US': 'LE', value: '$lte' }, { 'zh-CN': '小于等于(<=)', 'en-US': 'LTANDEQ', value: '$lte' },
{ 'zh-CN': '值为空(Nil)', 'en-US': 'IS_NULL', value: '$null' }, { 'zh-CN': '值为空(Nil)', 'en-US': 'ISNULL', value: '$null' },
{ 'zh-CN': '值不为空(NotNil)', 'en-US': 'IS_NOT_NULL', value: '$notNull' }, { 'zh-CN': '值不为空(NotNil)', 'en-US': 'ISNOTNULL', value: '$notNull' },
{ 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' }, { 'zh-CN': '值在范围中(In)', 'en-US': 'IN', value: '$in' },
{ 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' }, { 'zh-CN': '值不在范围中(NotIn)', 'en-US': 'NOTIN', value: '$notIn' },
{ 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' }, { 'zh-CN': '文本包含(%)', 'en-US': 'LIKE', value: '$like' },
......
...@@ -6,6 +6,22 @@ ...@@ -6,6 +6,22 @@
*/ */
export class FormDetailModel { export class FormDetailModel {
/**
* 参数
*
* @type {*}
* @memberof FormDetailModel
*/
public opts: any = {};
/**
* 父
*
* @type {*}
* @memberof FormDetailModel
*/
public parent: any = null;
/** /**
* 成员标题 * 成员标题
* *
...@@ -44,7 +60,18 @@ export class FormDetailModel { ...@@ -44,7 +60,18 @@ export class FormDetailModel {
* @type {boolean} * @type {boolean}
* @memberof FormDetailModel * @memberof FormDetailModel
*/ */
public visible: boolean = true; protected $visible: boolean;
/**
* 成员是否隐藏
*
* @readonly
* @type {boolean}
* @memberof FormDetailModel
*/
public get visible(): boolean {
return (this.isShowMore && this.$visible);
}
/** /**
* 成员是否显示标题 * 成员是否显示标题
...@@ -52,7 +79,23 @@ export class FormDetailModel { ...@@ -52,7 +79,23 @@ export class FormDetailModel {
* @type {boolean} * @type {boolean}
* @memberof FormDetailModel * @memberof FormDetailModel
*/ */
public isShowCaption: boolean = true; public isShowCaption: boolean;
/**
* 表单项受控模式,
*
* @type {(0 | 1 | 2)}
* @memberof FormDetailModel
*/
public showMoreMode: 0 | 1 | 2 = 0;
/**
* 受控项是否显示
*
* @type {boolean}
* @memberof FormGroupPanelModel
*/
public isShowMore: boolean;
/** /**
* Creates an instance of FormDetailModel. * Creates an instance of FormDetailModel.
...@@ -62,12 +105,19 @@ export class FormDetailModel { ...@@ -62,12 +105,19 @@ export class FormDetailModel {
* @memberof FormDetailModel * @memberof FormDetailModel
*/ */
constructor(opts: any = {}) { constructor(opts: any = {}) {
this.opts = opts;
this.caption = !Object.is(opts.caption, '') ? opts.caption : ''; this.caption = !Object.is(opts.caption, '') ? opts.caption : '';
this.detailType = !Object.is(opts.detailType, '') ? opts.detailType : ''; this.detailType = !Object.is(opts.detailType, '') ? opts.detailType : '';
this.form = opts.form ? opts.form : {}; this.form = opts.form ? opts.form : {};
this.name = !Object.is(opts.name, '') ? opts.name : ''; this.name = !Object.is(opts.name, '') ? opts.name : '';
this.visible = opts.visible ? true : false; this.$visible = opts.visible ? true : false;
this.isShowCaption = opts.isShowCaption ? true : false; this.isShowCaption = opts.isShowCaption ? true : false;
this.showMoreMode = opts.showMoreMode;
if (this.showMoreMode === 1) {
this.isShowMore = false;
} else {
this.isShowMore = true;
}
} }
/** /**
...@@ -77,7 +127,21 @@ export class FormDetailModel { ...@@ -77,7 +127,21 @@ export class FormDetailModel {
* @memberof FormDetailModel * @memberof FormDetailModel
*/ */
public setVisible(state: boolean): void { public setVisible(state: boolean): void {
this.visible = state; this.$visible = state;
}
/**
* 改变显示更多受控项状态
*
* @param {boolean} bol
* @memberof FormDetailModel
*/
public setShowMore(bol: boolean): void {
if (isExist(bol)) {
this.isShowMore = bol;
} else {
this.isShowMore = !this.isShowMore;
}
} }
/** /**
......
...@@ -17,6 +17,30 @@ export class FormGroupPanelModel extends FormDetailModel { ...@@ -17,6 +17,30 @@ export class FormGroupPanelModel extends FormDetailModel {
*/ */
public uiActionGroup: any = {}; public uiActionGroup: any = {};
/**
* 所有锚点项
*
* @type {any[]}
* @memberof FormGroupPanelModel
*/
public anchorPoints: any = {};
/**
* 所有受控项
*
* @type {*}
* @memberof FormGroupPanelModel
*/
public controlledItems: any = {};
/**
* 表单分组控制子是否显示更多
*
* @type {boolean}
* @memberof FormGroupPanelModel
*/
public showMore: boolean = false;
/** /**
* Creates an instance of FormGroupPanelModel. * Creates an instance of FormGroupPanelModel.
* 创建 FormGroupPanelModel 实例 * 创建 FormGroupPanelModel 实例
...@@ -28,4 +52,25 @@ export class FormGroupPanelModel extends FormDetailModel { ...@@ -28,4 +52,25 @@ export class FormGroupPanelModel extends FormDetailModel {
super(opts); super(opts);
Object.assign(this.uiActionGroup, opts.uiActionGroup); Object.assign(this.uiActionGroup, opts.uiActionGroup);
} }
/**
* 改变显示更多受控项状态
*
* @param {boolean} bol
* @memberof FormDetailModel
*/
public changeShowMore(bol: boolean): void {
if (isExist(bol)) {
this.isShowMore = bol;
} else {
this.showMore = !this.showMore;
}
for (const key in this.controlledItems) {
if (this.controlledItems.hasOwnProperty(key)) {
const item = this.controlledItems[key];
item.setShowMore(this.showMore);
}
}
}
} }
\ No newline at end of file
...@@ -29,7 +29,7 @@ export class FormTabPageModel extends FormDetailModel { ...@@ -29,7 +29,7 @@ export class FormTabPageModel extends FormDetailModel {
* @memberof FormTabPageModel * @memberof FormTabPageModel
*/ */
public setVisible(state: boolean): void { public setVisible(state: boolean): void {
this.visible = state; super.setVisible(state);
const tabPanel = this.getTabPanelModel(); const tabPanel = this.getTabPanelModel();
if (tabPanel) { if (tabPanel) {
tabPanel.setActiviePage(); tabPanel.setActiviePage();
......
...@@ -62,21 +62,6 @@ export default class CampaignServiceBase extends EntityService { ...@@ -62,21 +62,6 @@ export default class CampaignServiceBase extends EntityService {
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let campaignlistsData:any = []; let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any); campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
...@@ -107,6 +92,21 @@ export default class CampaignServiceBase extends EntityService { ...@@ -107,6 +92,21 @@ export default class CampaignServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService { ...@@ -116,9 +116,9 @@ export default class CampaignServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/campaigns`,data,isloading); let res:any = await Http.getInstance().post(`/campaigns`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists)); this.tempStorage.setItem(tempContext.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res; return res;
} }
...@@ -133,21 +133,6 @@ export default class CampaignServiceBase extends EntityService { ...@@ -133,21 +133,6 @@ export default class CampaignServiceBase extends EntityService {
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let campaignlistsData:any = []; let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any); campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
...@@ -178,11 +163,26 @@ export default class CampaignServiceBase extends EntityService { ...@@ -178,11 +163,26 @@ export default class CampaignServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading); let res:any = await Http.getInstance().put(`/campaigns/${context.campaign}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists)); this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res; return res;
} }
...@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService { ...@@ -210,9 +210,9 @@ export default class CampaignServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading); let res:any = await Http.getInstance().get(`/campaigns/${context.campaign}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists)); this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res; return res;
} }
...@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService { ...@@ -228,9 +228,9 @@ export default class CampaignServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading); let res:any = await Http.getInstance().get(`/campaigns/getdraft`,isloading);
res.data.campaign = data.campaign; res.data.campaign = data.campaign;
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists)); this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res; return res;
} }
...@@ -258,21 +258,6 @@ export default class CampaignServiceBase extends EntityService { ...@@ -258,21 +258,6 @@ export default class CampaignServiceBase extends EntityService {
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
let campaignlistsData:any = []; let campaignlistsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists'),'undefined')){
campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any); campaignlistsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaignlists') as any);
...@@ -303,11 +288,26 @@ export default class CampaignServiceBase extends EntityService { ...@@ -303,11 +288,26 @@ export default class CampaignServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
let campaigncampaignsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns'),'undefined')){
campaigncampaignsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_campaigncampaigns') as any);
if(campaigncampaignsData && campaigncampaignsData.length && campaigncampaignsData.length > 0){
campaigncampaignsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.campaigncampaigns = campaigncampaignsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading); let res:any = await Http.getInstance().post(`/campaigns/${context.campaign}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists)); this.tempStorage.setItem(context.srfsessionkey+'_campaignlists',JSON.stringify(res.data.campaignlists));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads)); this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_campaigncampaigns',JSON.stringify(res.data.campaigncampaigns));
return res; return res;
} }
......
...@@ -62,11 +62,11 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -62,11 +62,11 @@ export default class CompetitorServiceBase extends EntityService {
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let opportunitycompetitorsData:any = []; let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -76,7 +76,7 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -76,7 +76,7 @@ export default class CompetitorServiceBase extends EntityService {
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = []; let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any); competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
...@@ -92,11 +92,11 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -92,11 +92,11 @@ export default class CompetitorServiceBase extends EntityService {
} }
} }
masterData.competitorproducts = competitorproductsData; masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -106,7 +106,7 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -106,7 +106,7 @@ export default class CompetitorServiceBase extends EntityService {
}); });
} }
} }
masterData.leadcompetitors = leadcompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -116,9 +116,9 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -116,9 +116,9 @@ export default class CompetitorServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/competitors`,data,isloading); let res:any = await Http.getInstance().post(`/competitors`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_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)); this.tempStorage.setItem(tempContext.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -133,11 +133,11 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -133,11 +133,11 @@ export default class CompetitorServiceBase extends EntityService {
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let opportunitycompetitorsData:any = []; let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -147,7 +147,7 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -147,7 +147,7 @@ export default class CompetitorServiceBase extends EntityService {
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = []; let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any); competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
...@@ -163,11 +163,11 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -163,11 +163,11 @@ export default class CompetitorServiceBase extends EntityService {
} }
} }
masterData.competitorproducts = competitorproductsData; masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -177,12 +177,12 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -177,12 +177,12 @@ export default class CompetitorServiceBase extends EntityService {
}); });
} }
} }
masterData.leadcompetitors = leadcompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading); let res:any = await Http.getInstance().put(`/competitors/${context.competitor}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -210,9 +210,9 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -210,9 +210,9 @@ export default class CompetitorServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/${context.competitor}`,isloading); let res:any = await Http.getInstance().get(`/competitors/${context.competitor}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -228,9 +228,9 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -228,9 +228,9 @@ export default class CompetitorServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading); let res:any = await Http.getInstance().get(`/competitors/getdraft`,isloading);
res.data.competitor = data.competitor; res.data.competitor = data.competitor;
this.tempStorage.setItem(context.srfsessionkey+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
...@@ -258,11 +258,11 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -258,11 +258,11 @@ export default class CompetitorServiceBase extends EntityService {
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let opportunitycompetitorsData:any = []; let leadcompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){
opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any); leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any);
if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){ if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){
opportunitycompetitorsData.forEach((item:any) => { leadcompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -272,7 +272,7 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -272,7 +272,7 @@ export default class CompetitorServiceBase extends EntityService {
}); });
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.leadcompetitors = leadcompetitorsData;
let competitorproductsData:any = []; let competitorproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts'),'undefined')){
competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any); competitorproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_competitorproducts') as any);
...@@ -288,11 +288,11 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -288,11 +288,11 @@ export default class CompetitorServiceBase extends EntityService {
} }
} }
masterData.competitorproducts = competitorproductsData; masterData.competitorproducts = competitorproductsData;
let leadcompetitorsData:any = []; let opportunitycompetitorsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors'),'undefined')){
leadcompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leadcompetitors') as any); opportunitycompetitorsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunitycompetitors') as any);
if(leadcompetitorsData && leadcompetitorsData.length && leadcompetitorsData.length > 0){ if(opportunitycompetitorsData && opportunitycompetitorsData.length && opportunitycompetitorsData.length > 0){
leadcompetitorsData.forEach((item:any) => { opportunitycompetitorsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.relationshipsid = null; item.relationshipsid = null;
...@@ -302,12 +302,12 @@ export default class CompetitorServiceBase extends EntityService { ...@@ -302,12 +302,12 @@ export default class CompetitorServiceBase extends EntityService {
}); });
} }
} }
masterData.leadcompetitors = leadcompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading); let res:any = await Http.getInstance().post(`/competitors/${context.competitor}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_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)); this.tempStorage.setItem(context.srfsessionkey+'_leadcompetitors',JSON.stringify(res.data.leadcompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_competitorproducts',JSON.stringify(res.data.competitorproducts));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res; return res;
} }
......
...@@ -68,21 +68,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -68,21 +68,6 @@ export default class ContactServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && true){ if(context.account && true){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -113,21 +98,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -113,21 +98,6 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
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`,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+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
...@@ -143,6 +113,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -143,6 +113,21 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -173,6 +158,21 @@ export default class ContactServiceBase extends EntityService { ...@@ -173,6 +158,21 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService { ...@@ -182,9 +182,9 @@ export default class ContactServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts`,data,isloading); let res:any = await Http.getInstance().post(`/contacts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -200,21 +200,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -200,21 +200,6 @@ export default class ContactServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -245,14 +230,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -245,14 +230,6 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
...@@ -268,6 +245,14 @@ export default class ContactServiceBase extends EntityService { ...@@ -268,6 +245,14 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -298,11 +283,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -298,11 +283,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading); let res:any = await Http.getInstance().put(`/contacts/${context.contact}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService { ...@@ -334,15 +334,15 @@ export default class ContactServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService { ...@@ -359,16 +359,16 @@ export default class ContactServiceBase extends EntityService {
if(context.account && true){ if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/getdraft`,isloading);
res.data.contact = data.contact; res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/contacts/getdraft`,isloading);
res.data.contact = data.contact; res.data.contact = data.contact;
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -399,21 +399,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -399,21 +399,6 @@ export default class ContactServiceBase extends EntityService {
public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async AddList(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -444,11 +429,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -444,11 +429,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/addlist`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading); return Http.getInstance().post(`/contacts/${context.contact}/addlist`,data,isloading);
...@@ -466,21 +466,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -466,21 +466,6 @@ export default class ContactServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -511,11 +496,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -511,11 +496,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading); return Http.getInstance().post(`/contacts/${context.contact}/checkkey`,data,isloading);
...@@ -548,21 +548,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -548,21 +548,6 @@ export default class ContactServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -593,14 +578,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -593,14 +578,6 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
return res;
}
let masterData:any = {};
let leadsData:any = []; let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any); leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
...@@ -616,6 +593,14 @@ export default class ContactServiceBase extends EntityService { ...@@ -616,6 +593,14 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.leads = leadsData; masterData.leads = leadsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res;
}
let masterData:any = {};
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -646,11 +631,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -646,11 +631,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
...@@ -666,21 +666,6 @@ export default class ContactServiceBase extends EntityService { ...@@ -666,21 +666,6 @@ export default class ContactServiceBase extends EntityService {
public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async SetPrimary(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact){ if(context.account && context.contact){
let masterData:any = {}; let masterData:any = {};
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
let opportunitiesData:any = []; let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any); opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
...@@ -711,11 +696,26 @@ export default class ContactServiceBase extends EntityService { ...@@ -711,11 +696,26 @@ export default class ContactServiceBase extends EntityService {
} }
} }
masterData.listcontacts = listcontactsData; masterData.listcontacts = listcontactsData;
let leadsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_leads'),'undefined')){
leadsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_leads') as any);
if(leadsData && leadsData.length && leadsData.length > 0){
leadsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.leadid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.leads = leadsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/setprimary`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities)); this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts)); this.tempStorage.setItem(context.srfsessionkey+'_listcontacts',JSON.stringify(res.data.listcontacts));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
return res; return res;
} }
return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading); return Http.getInstance().post(`/contacts/${context.contact}/setprimary`,data,isloading);
......
...@@ -74,6 +74,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -74,6 +74,21 @@ export default class OpportunityServiceBase extends EntityService {
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && true){ if(context.account && context.contact && true){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -104,21 +119,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -104,21 +119,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -128,13 +128,28 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -128,13 +128,28 @@ export default class OpportunityServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && true){ if(context.contact && true){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -165,21 +180,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -165,21 +180,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -189,13 +189,28 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -189,13 +189,28 @@ export default class OpportunityServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading); let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.account && true){ if(context.account && true){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -226,6 +241,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -226,6 +241,21 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -241,21 +271,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -241,21 +271,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
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`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -286,21 +301,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -286,21 +301,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -310,9 +310,9 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -310,9 +310,9 @@ export default class OpportunityServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/opportunities`,data,isloading); let res:any = await Http.getInstance().post(`/opportunities`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -328,6 +328,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -328,6 +328,21 @@ export default class OpportunityServiceBase extends EntityService {
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -358,6 +373,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -358,6 +373,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -373,15 +397,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -373,15 +397,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -412,6 +427,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -412,6 +427,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -427,15 +451,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -427,15 +451,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/contacts/${context.contact}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -466,6 +481,14 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -466,6 +481,14 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -481,14 +504,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -481,14 +504,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -519,26 +534,11 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -519,26 +534,11 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading); let res:any = await Http.getInstance().put(`/opportunities/${context.opportunity}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -576,29 +576,29 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -576,29 +576,29 @@ export default class OpportunityServiceBase extends EntityService {
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && context.opportunity){ if(context.contact && context.opportunity){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.account && context.opportunity){ if(context.account && context.opportunity){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading); let res:any = await Http.getInstance().get(`/opportunities/${context.opportunity}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -615,32 +615,32 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -615,32 +615,32 @@ export default class OpportunityServiceBase extends EntityService {
if(context.account && context.contact && true){ if(context.account && context.contact && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.contact && true){ if(context.contact && true){
let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/contacts/${context.contact}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
if(context.account && true){ if(context.account && true){
let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/accounts/${context.account}/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading); let res:any = await Http.getInstance().get(`/opportunities/getdraft`,isloading);
res.data.opportunity = data.opportunity; res.data.opportunity = data.opportunity;
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
...@@ -656,6 +656,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -656,6 +656,21 @@ export default class OpportunityServiceBase extends EntityService {
public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Active(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -686,6 +701,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -686,6 +701,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -701,15 +725,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -701,15 +725,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -740,6 +755,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -740,6 +755,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -755,15 +779,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -755,15 +779,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -794,26 +809,11 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -794,26 +809,11 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/active`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/active`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/active`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/active`,data,isloading);
...@@ -831,6 +831,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -831,6 +831,21 @@ export default class OpportunityServiceBase extends EntityService {
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -861,6 +876,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -861,6 +876,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -876,15 +900,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -876,15 +900,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -915,6 +930,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -915,6 +930,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -930,15 +954,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -930,15 +954,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -969,26 +984,11 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -969,26 +984,11 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/checkkey`,data,isloading); let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/checkkey`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading); return Http.getInstance().post(`/opportunities/${context.opportunity}/checkkey`,data,isloading);
...@@ -1021,6 +1021,21 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1021,6 +1021,21 @@ export default class OpportunityServiceBase extends EntityService {
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
if(context.account && context.contact && context.opportunity){ if(context.account && context.contact && context.opportunity){
let masterData:any = {}; let masterData:any = {};
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -1051,6 +1066,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1051,6 +1066,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -1066,15 +1090,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1066,15 +1090,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.contact && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -1105,6 +1120,15 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1105,6 +1120,15 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -1120,15 +1144,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1120,15 +1144,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/contacts/${context.contact}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
if(context.account && context.opportunity){
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -1159,6 +1174,14 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1159,6 +1174,14 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
return res;
}
let masterData:any = {};
let opportunityproductsData:any = []; let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any); opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
...@@ -1174,14 +1197,6 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1174,14 +1197,6 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunityproducts = opportunityproductsData; masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res;
}
let masterData:any = {};
let quotesData:any = []; let quotesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_quotes'),'undefined')){
quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any); quotesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_quotes') as any);
...@@ -1212,26 +1227,11 @@ export default class OpportunityServiceBase extends EntityService { ...@@ -1212,26 +1227,11 @@ export default class OpportunityServiceBase extends EntityService {
} }
} }
masterData.opportunitycompetitors = opportunitycompetitorsData; masterData.opportunitycompetitors = opportunitycompetitorsData;
let opportunityproductsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts'),'undefined')){
opportunityproductsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunityproducts') as any);
if(opportunityproductsData && opportunityproductsData.length && opportunityproductsData.length > 0){
opportunityproductsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityproductid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunityproducts = opportunityproductsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading); let res:any = await Http.getInstance().post(`/opportunities/${context.opportunity}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes)); this.tempStorage.setItem(context.srfsessionkey+'_quotes',JSON.stringify(res.data.quotes));
this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors)); this.tempStorage.setItem(context.srfsessionkey+'_opportunitycompetitors',JSON.stringify(res.data.opportunitycompetitors));
this.tempStorage.setItem(context.srfsessionkey+'_opportunityproducts',JSON.stringify(res.data.opportunityproducts));
return res; return res;
} }
......
...@@ -62,6 +62,21 @@ export default class ProductServiceBase extends EntityService { ...@@ -62,6 +62,21 @@ export default class ProductServiceBase extends EntityService {
*/ */
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
...@@ -92,21 +107,6 @@ export default class ProductServiceBase extends EntityService { ...@@ -92,21 +107,6 @@ export default class ProductServiceBase extends EntityService {
} }
} }
masterData.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
Object.assign(data,masterData); Object.assign(data,masterData);
if(!data.srffrontuf || data.srffrontuf !== "1"){ if(!data.srffrontuf || data.srffrontuf !== "1"){
data[this.APPDEKEY] = null; data[this.APPDEKEY] = null;
...@@ -116,9 +116,9 @@ export default class ProductServiceBase extends EntityService { ...@@ -116,9 +116,9 @@ export default class ProductServiceBase extends EntityService {
} }
let tempContext:any = JSON.parse(JSON.stringify(context)); let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/products`,data,isloading); let res:any = await Http.getInstance().post(`/products`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(tempContext.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(tempContext.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res; return res;
} }
...@@ -133,6 +133,21 @@ export default class ProductServiceBase extends EntityService { ...@@ -133,6 +133,21 @@ export default class ProductServiceBase extends EntityService {
*/ */
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
...@@ -163,26 +178,11 @@ export default class ProductServiceBase extends EntityService { ...@@ -163,26 +178,11 @@ export default class ProductServiceBase extends EntityService {
} }
} }
masterData.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading); let res:any = await Http.getInstance().put(`/products/${context.product}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res; return res;
} }
...@@ -210,9 +210,9 @@ export default class ProductServiceBase extends EntityService { ...@@ -210,9 +210,9 @@ export default class ProductServiceBase extends EntityService {
*/ */
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading); let res:any = await Http.getInstance().get(`/products/${context.product}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res; return res;
} }
...@@ -228,9 +228,9 @@ export default class ProductServiceBase extends EntityService { ...@@ -228,9 +228,9 @@ export default class ProductServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/products/getdraft`,isloading); let res:any = await Http.getInstance().get(`/products/getdraft`,isloading);
res.data.product = data.product; res.data.product = data.product;
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res; return res;
} }
...@@ -258,6 +258,21 @@ export default class ProductServiceBase extends EntityService { ...@@ -258,6 +258,21 @@ export default class ProductServiceBase extends EntityService {
*/ */
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> { public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {}; let masterData:any = {};
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
let productsubstitutesData:any = []; let productsubstitutesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes'),'undefined')){
productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any); productsubstitutesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productsubstitutes') as any);
...@@ -288,26 +303,11 @@ export default class ProductServiceBase extends EntityService { ...@@ -288,26 +303,11 @@ export default class ProductServiceBase extends EntityService {
} }
} }
masterData.productassociations = productassociationsData; masterData.productassociations = productassociationsData;
let productpricelevelsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels'),'undefined')){
productpricelevelsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_productpricelevels') as any);
if(productpricelevelsData && productpricelevelsData.length && productpricelevelsData.length > 0){
productpricelevelsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.productpricelevelid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.productpricelevels = productpricelevelsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading); let res:any = await Http.getInstance().post(`/products/${context.product}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes)); this.tempStorage.setItem(context.srfsessionkey+'_productsubstitutes',JSON.stringify(res.data.productsubstitutes));
this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations)); this.tempStorage.setItem(context.srfsessionkey+'_productassociations',JSON.stringify(res.data.productassociations));
this.tempStorage.setItem(context.srfsessionkey+'_productpricelevels',JSON.stringify(res.data.productpricelevels));
return res; return res;
} }
......
...@@ -139,6 +139,38 @@ export class EditFormControlBase extends FormControlBase { ...@@ -139,6 +139,38 @@ export class EditFormControlBase extends FormControlBase {
} }
} }
}, 'update', this.appDeName.toUpperCase())); }, 'update', this.appDeName.toUpperCase()));
this.fillDetailModels();
}
/**
* 填充表单模型
*
* @protected
* @memberof EditFormControlBase
*/
protected fillDetailModels(): void {
for (const key in this.detailsModel) {
if (this.detailsModel.hasOwnProperty(key)) {
const item = this.detailsModel[key];
if (item.detailType === 'GROUPPANEL') {
if (item.opts.anchorPoints) {
item.opts.anchorPoints.forEach((str: string) => {
if (this.detailsModel[str]) {
item.anchorPoints[str] = this.detailsModel[str];
}
});
}
if (item.opts.controlledItems) {
console.log(item.opts.name, '2');
item.opts.controlledItems.forEach((str: string) => {
if (this.detailsModel[str]) {
item.controlledItems[str] = this.detailsModel[str];
}
});
}
}
}
}
} }
/** /**
......
...@@ -211,8 +211,12 @@ export class Info_AllEditFormBase extends EditFormControlBase { ...@@ -211,8 +211,12 @@ export class Info_AllEditFormBase extends EditFormControlBase {
public detailsModel: any = { public detailsModel: any = {
group1: new FormGroupPanelModel({ caption: '账户信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, showMoreMode: 2, anchorPoints: ['sic', 'tickersymbol', 'ownershipcode', ], controlledItems: [ group1: new FormGroupPanelModel({ caption: '账户信息', detailType: 'GROUPPANEL', name: 'group1', visible: true, isShowCaption: true, form: this, showMoreMode: 2, anchorPoints: ['sic', 'tickersymbol', 'ownershipcode', ], controlledItems: [
'sic', 'sic',
'fax',
'websiteurl',
'parentaccountname',
'tickersymbol', 'tickersymbol',
'ownershipcode', 'ownershipcode',
'defaultpricelevelname',
], uiActionGroup: { caption: '编辑_账户信息', langbase: 'entities.account.info_all_form', extractMode: 'ITEM', details: [{ name: 'group1_uc040f39', caption: '编辑', uiactiontag: 'account_edit_accountinfo', icon: 'fa fa-pencil',isShowCaption:false,isShowIcon:true }] } }), ], uiActionGroup: { caption: '编辑_账户信息', langbase: 'entities.account.info_all_form', extractMode: 'ITEM', details: [{ name: 'group1_uc040f39', caption: '编辑', uiactiontag: 'account_edit_accountinfo', icon: 'fa fa-pencil',isShowCaption:false,isShowIcon:true }] } }),
grouppanel1: new FormGroupPanelModel({ caption: '地址信息', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, showMoreMode: 0, uiActionGroup: { caption: '编辑_地址信息', langbase: 'entities.account.info_all_form', extractMode: 'ITEM', details: [{ name: 'grouppanel1_u2ccbfc9', caption: '编辑', uiactiontag: 'account_edit_address', icon: 'fa fa-pencil',isShowCaption:false,isShowIcon:true }] } }), grouppanel1: new FormGroupPanelModel({ caption: '地址信息', detailType: 'GROUPPANEL', name: 'grouppanel1', visible: true, isShowCaption: true, form: this, showMoreMode: 0, uiActionGroup: { caption: '编辑_地址信息', langbase: 'entities.account.info_all_form', extractMode: 'ITEM', details: [{ name: 'grouppanel1_u2ccbfc9', caption: '编辑', uiactiontag: 'account_edit_address', icon: 'fa fa-pencil',isShowCaption:false,isShowIcon:true }] } }),
...@@ -251,17 +255,17 @@ export class Info_AllEditFormBase extends EditFormControlBase { ...@@ -251,17 +255,17 @@ export class Info_AllEditFormBase extends EditFormControlBase {
sic: new FormItemModel({ caption: '行业编码', detailType: 'FORMITEM', name: 'sic', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }), sic: new FormItemModel({ caption: '行业编码', detailType: 'FORMITEM', name: 'sic', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
fax: new FormItemModel({ caption: '传真', detailType: 'FORMITEM', name: 'fax', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }), fax: new FormItemModel({ caption: '传真', detailType: 'FORMITEM', name: 'fax', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
websiteurl: new FormItemModel({ caption: '网站', detailType: 'FORMITEM', name: 'websiteurl', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }), websiteurl: new FormItemModel({ caption: '网站', detailType: 'FORMITEM', name: 'websiteurl', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
parentaccountname: new FormItemModel({ caption: '上级客户', detailType: 'FORMITEM', name: 'parentaccountname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }), parentaccountname: new FormItemModel({ caption: '上级客户', detailType: 'FORMITEM', name: 'parentaccountname', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
tickersymbol: new FormItemModel({ caption: '股票代号', detailType: 'FORMITEM', name: 'tickersymbol', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }), tickersymbol: new FormItemModel({ caption: '股票代号', detailType: 'FORMITEM', name: 'tickersymbol', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
ownershipcode: new FormItemModel({ caption: '所有权', detailType: 'FORMITEM', name: 'ownershipcode', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }), ownershipcode: new FormItemModel({ caption: '所有权', detailType: 'FORMITEM', name: 'ownershipcode', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
defaultpricelevelname: new FormItemModel({ caption: '价目表', detailType: 'FORMITEM', name: 'defaultpricelevelname', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }), defaultpricelevelname: new FormItemModel({ caption: '价目表', detailType: 'FORMITEM', name: 'defaultpricelevelname', visible: true, isShowCaption: true, form: this, showMoreMode: 1, disabled: false, enableCond: 3 }),
description: new FormItemModel({ caption: '说明', detailType: 'FORMITEM', name: 'description', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }), description: new FormItemModel({ caption: '说明', detailType: 'FORMITEM', name: 'description', visible: true, isShowCaption: true, form: this, showMoreMode: 0, disabled: false, enableCond: 3 }),
......
...@@ -108,6 +108,10 @@ export default class InnerPickipModel { ...@@ -108,6 +108,10 @@ export default class InnerPickipModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -154,6 +154,10 @@ export default class MainModel { ...@@ -154,6 +154,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -109,6 +109,10 @@ export default class MainModel { ...@@ -109,6 +109,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -64,6 +64,10 @@ export default class MainModel { ...@@ -64,6 +64,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -79,6 +79,10 @@ export default class MainModel { ...@@ -79,6 +79,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -109,6 +109,10 @@ export default class MainModel { ...@@ -109,6 +109,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -79,6 +79,10 @@ export default class MainModel { ...@@ -79,6 +79,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class SalLitCompGridModel { ...@@ -74,6 +74,10 @@ export default class SalLitCompGridModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -69,6 +69,10 @@ export default class MainModel { ...@@ -69,6 +69,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -89,6 +89,10 @@ export default class MainModel { ...@@ -89,6 +89,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -94,6 +94,10 @@ export default class MainModel { ...@@ -94,6 +94,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -108,6 +108,10 @@ export default class ByAccountModel { ...@@ -108,6 +108,10 @@ export default class ByAccountModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -124,6 +124,10 @@ export default class MainModel { ...@@ -124,6 +124,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -84,6 +84,10 @@ export default class MainModel { ...@@ -84,6 +84,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -129,6 +129,10 @@ export default class MainModel { ...@@ -129,6 +129,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -84,6 +84,10 @@ export default class MainModel { ...@@ -84,6 +84,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -154,6 +154,10 @@ export default class MainModel { ...@@ -154,6 +154,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -109,6 +109,10 @@ export default class InvoiceProductGridModel { ...@@ -109,6 +109,10 @@ export default class InvoiceProductGridModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -99,6 +99,10 @@ export default class MainModel { ...@@ -99,6 +99,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -79,6 +79,10 @@ export default class MainModel { ...@@ -79,6 +79,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -99,6 +99,10 @@ export default class MainModel { ...@@ -99,6 +99,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -124,6 +124,10 @@ export default class MainModel { ...@@ -124,6 +124,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -84,6 +84,10 @@ export default class MainModel { ...@@ -84,6 +84,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -88,6 +88,10 @@ export default class InnerModel { ...@@ -88,6 +88,10 @@ export default class InnerModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -89,6 +89,10 @@ export default class MainModel { ...@@ -89,6 +89,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -83,6 +83,10 @@ export default class MainModel { ...@@ -83,6 +83,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -69,6 +69,10 @@ export default class MainModel { ...@@ -69,6 +69,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -84,6 +84,10 @@ export default class MainModel { ...@@ -84,6 +84,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -94,6 +94,10 @@ export default class MainModel { ...@@ -94,6 +94,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -94,6 +94,10 @@ export default class MainModel { ...@@ -94,6 +94,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -124,6 +124,10 @@ export default class MainModel { ...@@ -124,6 +124,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -89,6 +89,10 @@ export default class MainModel { ...@@ -89,6 +89,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -104,6 +104,10 @@ export default class MainModel { ...@@ -104,6 +104,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class SalLitProGridModel { ...@@ -74,6 +74,10 @@ export default class SalLitProGridModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -84,6 +84,10 @@ export default class MainModel { ...@@ -84,6 +84,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -104,6 +104,10 @@ export default class MainModel { ...@@ -104,6 +104,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -99,6 +99,10 @@ export default class MainModel { ...@@ -99,6 +99,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -99,6 +99,10 @@ export default class MainModel { ...@@ -99,6 +99,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -79,6 +79,10 @@ export default class MainModel { ...@@ -79,6 +79,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -109,6 +109,10 @@ export default class SOProductModel { ...@@ -109,6 +109,10 @@ export default class SOProductModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -104,6 +104,10 @@ export default class MainModel { ...@@ -104,6 +104,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -74,6 +74,10 @@ export default class MainModel { ...@@ -74,6 +74,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -69,6 +69,10 @@ export default class MainModel { ...@@ -69,6 +69,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
...@@ -79,6 +79,10 @@ export default class MainModel { ...@@ -79,6 +79,10 @@ export default class MainModel {
name:'query', name:'query',
prop:'query' prop:'query'
}, },
{
name:'filter',
prop:'filter'
},
{ {
name:'page', name:'page',
prop:'page' prop:'page'
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册