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

xignzi006 发布系统代码

上级 4b7e4e35
......@@ -478,9 +478,9 @@ export class LeadConLeadGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......@@ -529,9 +529,9 @@ export class LeadConLeadGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......
......@@ -478,9 +478,9 @@ export class LeadExcludedGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......@@ -529,9 +529,9 @@ export class LeadExcludedGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......
......@@ -478,9 +478,9 @@ export class LeadGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......@@ -529,9 +529,9 @@ export class LeadGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......
......@@ -618,9 +618,9 @@ export class LeadOnGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......@@ -669,9 +669,9 @@ export class LeadOnGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.campaign && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'campaigns', parameterName: 'campaign' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......
......@@ -443,9 +443,9 @@ export class OpportunityConOppGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.contact && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......@@ -494,9 +494,9 @@ export class OpportunityConOppGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.contact && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......
......@@ -478,9 +478,9 @@ export class OpportunityGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.contact && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......@@ -529,9 +529,9 @@ export class OpportunityGridViewBase extends GridViewBase {
Object.assign(tempContext,args[0]);
}
let deResParameters: any[] = [];
if(tempContext.contact && true){
if(tempContext.account && true){
deResParameters = [
{ pathName: 'contacts', parameterName: 'contact' },
{ pathName: 'accounts', parameterName: 'account' },
]
}
const parameters: any[] = [
......
<studio-view-style2 viewName="opportunitygridview" viewTitle="商机信息" class='degridview opportunity-grid-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" search @on-search="onSearch($event)"/>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
......
<studio-view-style2 viewName="salesordergridview" viewTitle="订单信息" class='degridview sales-order-grid-view'>
<template slot='title'>
<span class='caption-info'>{{$t(model.srfTitle)}}</span>
</template>
<i-input slot="quickSearch" v-show="!isExpandSearchForm" v-model="query" search @on-search="onSearch($event)"/>
<template slot="toolbar">
<view-toolbar mode="STYLE2" :model="toolBarModels" @item-click="toolbar_click($event)"/> </template>
......
......@@ -64,6 +64,36 @@ export default class AccountServiceBase extends EntityService {
*/
public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let 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 listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -103,6 +133,8 @@ export default class AccountServiceBase extends EntityService {
}
let tempContext:any = JSON.parse(JSON.stringify(context));
let res:any = await Http.getInstance().post(`/accounts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(tempContext.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(tempContext.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
......@@ -119,6 +151,36 @@ export default class AccountServiceBase extends EntityService {
*/
public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let 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 listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -151,6 +213,8 @@ export default class AccountServiceBase extends EntityService {
masterData.contacts = contactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/accounts/${context.account}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
......@@ -180,6 +244,8 @@ export default class AccountServiceBase extends EntityService {
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/${context.account}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
......@@ -197,6 +263,8 @@ export default class AccountServiceBase extends EntityService {
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/accounts/getdraft`,isloading);
res.data.account = data.account;
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
......@@ -269,6 +337,36 @@ export default class AccountServiceBase extends EntityService {
*/
public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let masterData:any = {};
let opportunitiesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_opportunities'),'undefined')){
opportunitiesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_opportunities') as any);
if(opportunitiesData && opportunitiesData.length && opportunitiesData.length > 0){
opportunitiesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.opportunityid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.opportunities = opportunitiesData;
let 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 listaccountsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts'),'undefined')){
listaccountsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_listaccounts') as any);
......@@ -301,6 +399,8 @@ export default class AccountServiceBase extends EntityService {
masterData.contacts = contactsData;
Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/accounts/${context.account}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_opportunities',JSON.stringify(res.data.opportunities));
this.tempStorage.setItem(context.srfsessionkey+'_leads',JSON.stringify(res.data.leads));
this.tempStorage.setItem(context.srfsessionkey+'_listaccounts',JSON.stringify(res.data.listaccounts));
this.tempStorage.setItem(context.srfsessionkey+'_contacts',JSON.stringify(res.data.contacts));
return res;
......
......@@ -24,7 +24,7 @@
valueitem='originatingleadid'
:value="data.originatingleadname"
editortype=""
:pickupView="{ viewname: 'lead-pickup-view', title: $t('entities.lead.views.pickupview.title'), deResParameters: [{ pathName: 'campaigns', parameterName: 'campaign' }, ], parameters: [{ pathName: 'leads', parameterName: 'lead' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
:pickupView="{ viewname: 'lead-pickup-view', title: $t('entities.lead.views.pickupview.title'), deResParameters: [{ pathName: 'accounts', parameterName: 'account' }, ], parameters: [{ pathName: 'leads', parameterName: 'lead' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
......
......@@ -24,7 +24,7 @@
valueitem='entity2id'
:value="data.entity2name"
editortype=""
:pickupView="{ viewname: 'lead-pickup-view', title: $t('entities.lead.views.pickupview.title'), deResParameters: [{ pathName: 'campaigns', parameterName: 'campaign' }, ], parameters: [{ pathName: 'leads', parameterName: 'lead' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
:pickupView="{ viewname: 'lead-pickup-view', title: $t('entities.lead.views.pickupview.title'), deResParameters: [{ pathName: 'accounts', parameterName: 'account' }, ], parameters: [{ pathName: 'leads', parameterName: 'lead' }, { pathName: 'pickupview', parameterName: 'pickupview' } ], placement:'' }"
style=""
@formitemvaluechange="onFormItemValueChange($event)">
</app-picker>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册