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

wwwwww 部署微服务应用

上级 a001bdf7
...@@ -62,40 +62,40 @@ export default class EMACClassServiceBase extends EntityService { ...@@ -62,40 +62,40 @@ export default class EMACClassServiceBase 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 emplantemplsData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emplansData && emplansData.length && emplansData.length > 0){
emplantemplsData.forEach((item:any) => { emplansData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emplanid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emplans = emplansData;
let emplansData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplansData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emplantempls = emplantemplsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emacclasses/${context.emacclass}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emacclasses/${context.emacclass}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
return res; return res;
} }
...@@ -111,8 +111,8 @@ export default class EMACClassServiceBase extends EntityService { ...@@ -111,8 +111,8 @@ export default class EMACClassServiceBase 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(`/emacclasses/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emacclasses/getdraft`,isloading);
res.data.emacclass = data.emacclass; res.data.emacclass = data.emacclass;
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
return res; return res;
} }
...@@ -127,36 +127,36 @@ export default class EMACClassServiceBase extends EntityService { ...@@ -127,36 +127,36 @@ export default class EMACClassServiceBase 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 emplantemplsData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emplansData && emplansData.length && emplansData.length > 0){
emplantemplsData.forEach((item:any) => { emplansData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emplanid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emplans = emplansData;
let emplansData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplansData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emplantempls = emplantemplsData;
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;
...@@ -166,8 +166,8 @@ export default class EMACClassServiceBase extends EntityService { ...@@ -166,8 +166,8 @@ export default class EMACClassServiceBase 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(`/emacclasses`,data,isloading); let res:any = await Http.getInstance().post(`/emacclasses`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
return res; return res;
} }
...@@ -182,8 +182,8 @@ export default class EMACClassServiceBase extends EntityService { ...@@ -182,8 +182,8 @@ export default class EMACClassServiceBase 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(`/emacclasses/${context.emacclass}`,isloading); let res:any = await Http.getInstance().get(`/emacclasses/${context.emacclass}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
return res; return res;
} }
...@@ -226,40 +226,40 @@ export default class EMACClassServiceBase extends EntityService { ...@@ -226,40 +226,40 @@ export default class EMACClassServiceBase 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 emplantemplsData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emplansData && emplansData.length && emplansData.length > 0){
emplantemplsData.forEach((item:any) => { emplansData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emplanid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emplans = emplansData;
let emplansData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplansData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emplantempls = emplantemplsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emacclasses/${context.emacclass}`,data,isloading); let res:any = await Http.getInstance().put(`/emacclasses/${context.emacclass}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
return res; return res;
} }
......
...@@ -62,40 +62,40 @@ export default class EMEQSpareServiceBase extends EntityService { ...@@ -62,40 +62,40 @@ export default class EMEQSpareServiceBase 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 emeqsparemapsData:any = []; let emeqsparedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){
emeqsparemapsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps') as any); emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any);
if(emeqsparemapsData && emeqsparemapsData.length && emeqsparemapsData.length > 0){ if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){
emeqsparemapsData.forEach((item:any) => { emeqsparedetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparemapid = null; item.emeqsparedetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparemaps = emeqsparemapsData; masterData.emeqsparedetails = emeqsparedetailsData;
let emeqsparedetailsData:any = []; let emeqsparemapsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps'),'undefined')){
emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any); emeqsparemapsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps') as any);
if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){ if(emeqsparemapsData && emeqsparemapsData.length && emeqsparemapsData.length > 0){
emeqsparedetailsData.forEach((item:any) => { emeqsparemapsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparedetailid = null; item.emeqsparemapid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparedetails = emeqsparedetailsData; masterData.emeqsparemaps = emeqsparemapsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emeqspares/${context.emeqspare}`,data,isloading); let res:any = await Http.getInstance().put(`/emeqspares/${context.emeqspare}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
return res; return res;
} }
...@@ -137,36 +137,36 @@ export default class EMEQSpareServiceBase extends EntityService { ...@@ -137,36 +137,36 @@ export default class EMEQSpareServiceBase 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 emeqsparemapsData:any = []; let emeqsparedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){
emeqsparemapsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps') as any); emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any);
if(emeqsparemapsData && emeqsparemapsData.length && emeqsparemapsData.length > 0){ if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){
emeqsparemapsData.forEach((item:any) => { emeqsparedetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparemapid = null; item.emeqsparedetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparemaps = emeqsparemapsData; masterData.emeqsparedetails = emeqsparedetailsData;
let emeqsparedetailsData:any = []; let emeqsparemapsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps'),'undefined')){
emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any); emeqsparemapsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps') as any);
if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){ if(emeqsparemapsData && emeqsparemapsData.length && emeqsparemapsData.length > 0){
emeqsparedetailsData.forEach((item:any) => { emeqsparemapsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparedetailid = null; item.emeqsparemapid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparedetails = emeqsparedetailsData; masterData.emeqsparemaps = emeqsparemapsData;
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;
...@@ -176,8 +176,8 @@ export default class EMEQSpareServiceBase extends EntityService { ...@@ -176,8 +176,8 @@ export default class EMEQSpareServiceBase 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(`/emeqspares`,data,isloading); let res:any = await Http.getInstance().post(`/emeqspares`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
return res; return res;
} }
...@@ -192,40 +192,40 @@ export default class EMEQSpareServiceBase extends EntityService { ...@@ -192,40 +192,40 @@ export default class EMEQSpareServiceBase 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 emeqsparemapsData:any = []; let emeqsparedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){
emeqsparemapsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps') as any); emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any);
if(emeqsparemapsData && emeqsparemapsData.length && emeqsparemapsData.length > 0){ if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){
emeqsparemapsData.forEach((item:any) => { emeqsparedetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparemapid = null; item.emeqsparedetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparemaps = emeqsparemapsData; masterData.emeqsparedetails = emeqsparedetailsData;
let emeqsparedetailsData:any = []; let emeqsparemapsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps'),'undefined')){
emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any); emeqsparemapsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparemaps') as any);
if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){ if(emeqsparemapsData && emeqsparemapsData.length && emeqsparemapsData.length > 0){
emeqsparedetailsData.forEach((item:any) => { emeqsparemapsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparedetailid = null; item.emeqsparemapid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparedetails = emeqsparedetailsData; masterData.emeqsparemaps = emeqsparemapsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emeqspares/${context.emeqspare}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emeqspares/${context.emeqspare}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
return res; return res;
} }
...@@ -241,8 +241,8 @@ export default class EMEQSpareServiceBase extends EntityService { ...@@ -241,8 +241,8 @@ export default class EMEQSpareServiceBase 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(`/emeqspares/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emeqspares/getdraft`,isloading);
res.data.emeqspare = data.emeqspare; res.data.emeqspare = data.emeqspare;
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
return res; return res;
} }
...@@ -257,8 +257,8 @@ export default class EMEQSpareServiceBase extends EntityService { ...@@ -257,8 +257,8 @@ export default class EMEQSpareServiceBase 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(`/emeqspares/${context.emeqspare}`,isloading); let res:any = await Http.getInstance().get(`/emeqspares/${context.emeqspare}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparemaps',JSON.stringify(res.data.emeqsparemaps));
return res; return res;
} }
......
...@@ -76,40 +76,40 @@ export default class EMEQTypeServiceBase extends EntityService { ...@@ -76,40 +76,40 @@ export default class EMEQTypeServiceBase 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 emequipsData:any = []; let emeqtypesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes'),'undefined')){
emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any); emeqtypesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes') as any);
if(emequipsData && emequipsData.length && emequipsData.length > 0){ if(emeqtypesData && emeqtypesData.length && emeqtypesData.length > 0){
emequipsData.forEach((item:any) => { emeqtypesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emequipid = null; item.emeqtypeid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emequips = emequipsData; masterData.emeqtypes = emeqtypesData;
let emeqtypesData:any = []; let emequipsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){
emeqtypesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes') as any); emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any);
if(emeqtypesData && emeqtypesData.length && emeqtypesData.length > 0){ if(emequipsData && emequipsData.length && emequipsData.length > 0){
emeqtypesData.forEach((item:any) => { emequipsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqtypeid = null; item.emequipid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqtypes = emeqtypesData; masterData.emequips = emequipsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emeqtypes/${context.emeqtype}`,data,isloading); let res:any = await Http.getInstance().put(`/emeqtypes/${context.emeqtype}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes)); this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
return res; return res;
} }
...@@ -125,8 +125,8 @@ export default class EMEQTypeServiceBase extends EntityService { ...@@ -125,8 +125,8 @@ export default class EMEQTypeServiceBase 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(`/emeqtypes/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emeqtypes/getdraft`,isloading);
res.data.emeqtype = data.emeqtype; res.data.emeqtype = data.emeqtype;
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes)); this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
return res; return res;
} }
...@@ -141,8 +141,8 @@ export default class EMEQTypeServiceBase extends EntityService { ...@@ -141,8 +141,8 @@ export default class EMEQTypeServiceBase 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(`/emeqtypes/${context.emeqtype}`,isloading); let res:any = await Http.getInstance().get(`/emeqtypes/${context.emeqtype}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes)); this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
return res; return res;
} }
...@@ -158,36 +158,36 @@ export default class EMEQTypeServiceBase extends EntityService { ...@@ -158,36 +158,36 @@ export default class EMEQTypeServiceBase 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 emequipsData:any = []; let emeqtypesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes'),'undefined')){
emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any); emeqtypesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes') as any);
if(emequipsData && emequipsData.length && emequipsData.length > 0){ if(emeqtypesData && emeqtypesData.length && emeqtypesData.length > 0){
emequipsData.forEach((item:any) => { emeqtypesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emequipid = null; item.emeqtypeid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emequips = emequipsData; masterData.emeqtypes = emeqtypesData;
let emeqtypesData:any = []; let emequipsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){
emeqtypesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes') as any); emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any);
if(emeqtypesData && emeqtypesData.length && emeqtypesData.length > 0){ if(emequipsData && emequipsData.length && emequipsData.length > 0){
emeqtypesData.forEach((item:any) => { emequipsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqtypeid = null; item.emequipid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqtypes = emeqtypesData; masterData.emequips = emequipsData;
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;
...@@ -197,8 +197,8 @@ export default class EMEQTypeServiceBase extends EntityService { ...@@ -197,8 +197,8 @@ export default class EMEQTypeServiceBase 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(`/emeqtypes`,data,isloading); let res:any = await Http.getInstance().post(`/emeqtypes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
return res; return res;
} }
...@@ -226,40 +226,40 @@ export default class EMEQTypeServiceBase extends EntityService { ...@@ -226,40 +226,40 @@ export default class EMEQTypeServiceBase 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 emequipsData:any = []; let emeqtypesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes'),'undefined')){
emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any); emeqtypesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes') as any);
if(emequipsData && emequipsData.length && emequipsData.length > 0){ if(emeqtypesData && emeqtypesData.length && emeqtypesData.length > 0){
emequipsData.forEach((item:any) => { emeqtypesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emequipid = null; item.emeqtypeid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emequips = emequipsData; masterData.emeqtypes = emeqtypesData;
let emeqtypesData:any = []; let emequipsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){
emeqtypesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqtypes') as any); emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any);
if(emeqtypesData && emeqtypesData.length && emeqtypesData.length > 0){ if(emequipsData && emequipsData.length && emequipsData.length > 0){
emeqtypesData.forEach((item:any) => { emequipsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqtypeid = null; item.emequipid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqtypes = emeqtypesData; masterData.emequips = emequipsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emeqtypes/${context.emeqtype}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emeqtypes/${context.emeqtype}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes)); this.tempStorage.setItem(context.srfsessionkey+'_emeqtypes',JSON.stringify(res.data.emeqtypes));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
return res; return res;
} }
......
...@@ -74,6 +74,36 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -74,6 +74,36 @@ export default class EMEquipServiceBase extends EntityService {
return Http.getInstance().put(`/emeqtypes/${context.emeqtype}/emequips/${context.emequip}`,data,isloading); return Http.getInstance().put(`/emeqtypes/${context.emeqtype}/emequips/${context.emequip}`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emplansData && emplansData.length && emplansData.length > 0){
emplansData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplanid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplans = emplansData;
let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitempusesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emitempuses = emitempusesData;
let emeqsetupsData:any = []; let emeqsetupsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups'),'undefined')){
emeqsetupsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups') as any); emeqsetupsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups') as any);
...@@ -89,6 +119,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -89,6 +119,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emeqsetups = emeqsetupsData; masterData.emeqsetups = emeqsetupsData;
let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_dps = emwo_dpsData;
let emeqdebugsData:any = []; let emeqdebugsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs'),'undefined')){
emeqdebugsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs') as any); emeqdebugsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs') as any);
...@@ -104,6 +149,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -104,6 +149,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emeqdebugs = emeqdebugsData; masterData.emeqdebugs = emeqdebugsData;
let emwo_ensData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens'),'undefined')){
emwo_ensData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens') as any);
if(emwo_ensData && emwo_ensData.length && emwo_ensData.length > 0){
emwo_ensData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_enid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_ens = emwo_ensData;
let emeqchecksData:any = []; let emeqchecksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks'),'undefined')){
emeqchecksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks') as any); emeqchecksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks') as any);
...@@ -149,51 +209,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -149,51 +209,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emwo_inners = emwo_innersData; masterData.emwo_inners = emwo_innersData;
let emitempusesData:any = []; let emappliesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emapplies'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emappliesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emapplies') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emappliesData && emappliesData.length && emappliesData.length > 0){
emitempusesData.forEach((item:any) => { emappliesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emitempuses = emitempusesData;
let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
if(emenconsumsData && emenconsumsData.length && emenconsumsData.length > 0){
emenconsumsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emenconsumid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emenconsums = emenconsumsData;
let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emapplyid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emapplies = emappliesData;
let emwo_oscsData:any = []; let emwo_oscsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs'),'undefined')){
emwo_oscsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs') as any); emwo_oscsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs') as any);
...@@ -224,98 +254,68 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -224,98 +254,68 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emwos = emwosData; masterData.emwos = emwosData;
let emeqahsData:any = []; let emeqmaintancesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances'),'undefined')){
emeqahsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs') as any); emeqmaintancesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances') as any);
if(emeqahsData && emeqahsData.length && emeqahsData.length > 0){ if(emeqmaintancesData && emeqmaintancesData.length && emeqmaintancesData.length > 0){
emeqahsData.forEach((item:any) => { emeqmaintancesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emeqahid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emeqahs = emeqahsData;
let emwo_ensData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens'),'undefined')){
emwo_ensData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens') as any);
if(emwo_ensData && emwo_ensData.length && emwo_ensData.length > 0){
emwo_ensData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_enid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_ens = emwo_ensData;
let emappliesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emapplies'),'undefined')){
emappliesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emapplies') as any);
if(emappliesData && emappliesData.length && emappliesData.length > 0){
emappliesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emapplyid = null; item.emeqmaintanceid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emapplies = emappliesData; masterData.emeqmaintances = emeqmaintancesData;
let emeqmaintancesData:any = []; let emeqahsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs'),'undefined')){
emeqmaintancesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances') as any); emeqahsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs') as any);
if(emeqmaintancesData && emeqmaintancesData.length && emeqmaintancesData.length > 0){ if(emeqahsData && emeqahsData.length && emeqahsData.length > 0){
emeqmaintancesData.forEach((item:any) => { emeqahsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqmaintanceid = null; item.emeqahid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqmaintances = emeqmaintancesData; masterData.emeqahs = emeqahsData;
let emplansData:any = []; let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emenconsumsData && emenconsumsData.length && emenconsumsData.length > 0){
emplansData.forEach((item:any) => { emenconsumsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emenconsumid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emenconsums = emenconsumsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emequips/${context.emequip}`,data,isloading); let res:any = await Http.getInstance().put(`/emequips/${context.emequip}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs)); this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks)); this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps)); this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs));
this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos)); this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos));
this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances)); this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
return res; return res;
} }
...@@ -348,6 +348,36 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -348,6 +348,36 @@ export default class EMEquipServiceBase extends EntityService {
return Http.getInstance().post(`/emeqtypes/${context.emeqtype}/emequips`,data,isloading); return Http.getInstance().post(`/emeqtypes/${context.emeqtype}/emequips`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emplansData && emplansData.length && emplansData.length > 0){
emplansData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplanid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplans = emplansData;
let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitempusesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emitempuses = emitempusesData;
let emeqsetupsData:any = []; let emeqsetupsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups'),'undefined')){
emeqsetupsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups') as any); emeqsetupsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups') as any);
...@@ -363,6 +393,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -363,6 +393,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emeqsetups = emeqsetupsData; masterData.emeqsetups = emeqsetupsData;
let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_dps = emwo_dpsData;
let emeqdebugsData:any = []; let emeqdebugsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs'),'undefined')){
emeqdebugsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs') as any); emeqdebugsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs') as any);
...@@ -378,6 +423,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -378,6 +423,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emeqdebugs = emeqdebugsData; masterData.emeqdebugs = emeqdebugsData;
let emwo_ensData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens'),'undefined')){
emwo_ensData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens') as any);
if(emwo_ensData && emwo_ensData.length && emwo_ensData.length > 0){
emwo_ensData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_enid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_ens = emwo_ensData;
let emeqchecksData:any = []; let emeqchecksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks'),'undefined')){
emeqchecksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks') as any); emeqchecksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks') as any);
...@@ -423,51 +483,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -423,51 +483,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emwo_inners = emwo_innersData; masterData.emwo_inners = emwo_innersData;
let emitempusesData:any = []; let emappliesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emapplies'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emappliesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emapplies') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emappliesData && emappliesData.length && emappliesData.length > 0){
emitempusesData.forEach((item:any) => { emappliesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emitempuses = emitempusesData;
let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
if(emenconsumsData && emenconsumsData.length && emenconsumsData.length > 0){
emenconsumsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emenconsumid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emenconsums = emenconsumsData;
let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emapplyid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emapplies = emappliesData;
let emwo_oscsData:any = []; let emwo_oscsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs'),'undefined')){
emwo_oscsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs') as any); emwo_oscsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs') as any);
...@@ -498,81 +528,51 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -498,81 +528,51 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emwos = emwosData; masterData.emwos = emwosData;
let emeqahsData:any = []; let emeqmaintancesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances'),'undefined')){
emeqahsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs') as any); emeqmaintancesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances') as any);
if(emeqahsData && emeqahsData.length && emeqahsData.length > 0){ if(emeqmaintancesData && emeqmaintancesData.length && emeqmaintancesData.length > 0){
emeqahsData.forEach((item:any) => { emeqmaintancesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emeqahid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emeqahs = emeqahsData;
let emwo_ensData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens'),'undefined')){
emwo_ensData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens') as any);
if(emwo_ensData && emwo_ensData.length && emwo_ensData.length > 0){
emwo_ensData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_enid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_ens = emwo_ensData;
let emappliesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emapplies'),'undefined')){
emappliesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emapplies') as any);
if(emappliesData && emappliesData.length && emappliesData.length > 0){
emappliesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emapplyid = null; item.emeqmaintanceid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emapplies = emappliesData; masterData.emeqmaintances = emeqmaintancesData;
let emeqmaintancesData:any = []; let emeqahsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs'),'undefined')){
emeqmaintancesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances') as any); emeqahsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs') as any);
if(emeqmaintancesData && emeqmaintancesData.length && emeqmaintancesData.length > 0){ if(emeqahsData && emeqahsData.length && emeqahsData.length > 0){
emeqmaintancesData.forEach((item:any) => { emeqahsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqmaintanceid = null; item.emeqahid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqmaintances = emeqmaintancesData; masterData.emeqahs = emeqahsData;
let emplansData:any = []; let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emenconsumsData && emenconsumsData.length && emenconsumsData.length > 0){
emplansData.forEach((item:any) => { emenconsumsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emenconsumid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emenconsums = emenconsumsData;
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;
...@@ -582,21 +582,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -582,21 +582,21 @@ export default class EMEquipServiceBase 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(`/emequips`,data,isloading); let res:any = await Http.getInstance().post(`/emequips`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
return res; return res;
} }
...@@ -636,21 +636,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -636,21 +636,21 @@ export default class EMEquipServiceBase extends EntityService {
return Http.getInstance().get(`/emeqtypes/${context.emeqtype}/emequips/${context.emequip}`,isloading); return Http.getInstance().get(`/emeqtypes/${context.emeqtype}/emequips/${context.emequip}`,isloading);
} }
let res:any = await Http.getInstance().get(`/emequips/${context.emequip}`,isloading); let res:any = await Http.getInstance().get(`/emequips/${context.emequip}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs)); this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks)); this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps)); this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs));
this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos)); this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos));
this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances)); this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
return res; return res;
} }
...@@ -672,6 +672,36 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -672,6 +672,36 @@ export default class EMEquipServiceBase extends EntityService {
return Http.getInstance().post(`/emeqtypes/${context.emeqtype}/emequips/${context.emequip}/save`,data,isloading); return Http.getInstance().post(`/emeqtypes/${context.emeqtype}/emequips/${context.emequip}/save`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emplansData && emplansData.length && emplansData.length > 0){
emplansData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplanid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplans = emplansData;
let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitempusesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emitempuses = emitempusesData;
let emeqsetupsData:any = []; let emeqsetupsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups'),'undefined')){
emeqsetupsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups') as any); emeqsetupsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsetups') as any);
...@@ -687,6 +717,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -687,6 +717,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emeqsetups = emeqsetupsData; masterData.emeqsetups = emeqsetupsData;
let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_dps = emwo_dpsData;
let emeqdebugsData:any = []; let emeqdebugsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs'),'undefined')){
emeqdebugsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs') as any); emeqdebugsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqdebugs') as any);
...@@ -702,6 +747,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -702,6 +747,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emeqdebugs = emeqdebugsData; masterData.emeqdebugs = emeqdebugsData;
let emwo_ensData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens'),'undefined')){
emwo_ensData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens') as any);
if(emwo_ensData && emwo_ensData.length && emwo_ensData.length > 0){
emwo_ensData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_enid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_ens = emwo_ensData;
let emeqchecksData:any = []; let emeqchecksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks'),'undefined')){
emeqchecksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks') as any); emeqchecksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqchecks') as any);
...@@ -747,51 +807,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -747,51 +807,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emwo_inners = emwo_innersData; masterData.emwo_inners = emwo_innersData;
let emitempusesData:any = []; let emappliesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emapplies'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emappliesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emapplies') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emappliesData && emappliesData.length && emappliesData.length > 0){
emitempusesData.forEach((item:any) => { emappliesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emitempuses = emitempusesData;
let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
if(emenconsumsData && emenconsumsData.length && emenconsumsData.length > 0){
emenconsumsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emenconsumid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emenconsums = emenconsumsData;
let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emapplyid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emapplies = emappliesData;
let emwo_oscsData:any = []; let emwo_oscsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs'),'undefined')){
emwo_oscsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs') as any); emwo_oscsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_oscs') as any);
...@@ -822,98 +852,68 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -822,98 +852,68 @@ export default class EMEquipServiceBase extends EntityService {
} }
} }
masterData.emwos = emwosData; masterData.emwos = emwosData;
let emeqahsData:any = []; let emeqmaintancesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances'),'undefined')){
emeqahsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs') as any); emeqmaintancesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances') as any);
if(emeqahsData && emeqahsData.length && emeqahsData.length > 0){ if(emeqmaintancesData && emeqmaintancesData.length && emeqmaintancesData.length > 0){
emeqahsData.forEach((item:any) => { emeqmaintancesData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emeqahid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emeqahs = emeqahsData;
let emwo_ensData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens'),'undefined')){
emwo_ensData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_ens') as any);
if(emwo_ensData && emwo_ensData.length && emwo_ensData.length > 0){
emwo_ensData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_enid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_ens = emwo_ensData;
let emappliesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emapplies'),'undefined')){
emappliesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emapplies') as any);
if(emappliesData && emappliesData.length && emappliesData.length > 0){
emappliesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emapplyid = null; item.emeqmaintanceid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emapplies = emappliesData; masterData.emeqmaintances = emeqmaintancesData;
let emeqmaintancesData:any = []; let emeqahsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs'),'undefined')){
emeqmaintancesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqmaintances') as any); emeqahsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqahs') as any);
if(emeqmaintancesData && emeqmaintancesData.length && emeqmaintancesData.length > 0){ if(emeqahsData && emeqahsData.length && emeqahsData.length > 0){
emeqmaintancesData.forEach((item:any) => { emeqahsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqmaintanceid = null; item.emeqahid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqmaintances = emeqmaintancesData; masterData.emeqahs = emeqahsData;
let emplansData:any = []; let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emenconsumsData && emenconsumsData.length && emenconsumsData.length > 0){
emplansData.forEach((item:any) => { emenconsumsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emenconsumid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emenconsums = emenconsumsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emequips/${context.emequip}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emequips/${context.emequip}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs)); this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks)); this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps)); this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs));
this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos)); this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos));
this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances)); this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
return res; return res;
} }
...@@ -955,21 +955,21 @@ export default class EMEquipServiceBase extends EntityService { ...@@ -955,21 +955,21 @@ export default class EMEquipServiceBase extends EntityService {
} }
let res:any = await Http.getInstance().get(`/emequips/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emequips/getdraft`,isloading);
res.data.emequip = data.emequip; res.data.emequip = data.emequip;
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsetups',JSON.stringify(res.data.emeqsetups));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs)); this.tempStorage.setItem(context.srfsessionkey+'_emeqdebugs',JSON.stringify(res.data.emeqdebugs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks)); this.tempStorage.setItem(context.srfsessionkey+'_emeqchecks',JSON.stringify(res.data.emeqchecks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps)); this.tempStorage.setItem(context.srfsessionkey+'_emeqkeeps',JSON.stringify(res.data.emeqkeeps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_inners',JSON.stringify(res.data.emwo_inners));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs)); this.tempStorage.setItem(context.srfsessionkey+'_emwo_oscs',JSON.stringify(res.data.emwo_oscs));
this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos)); this.tempStorage.setItem(context.srfsessionkey+'_emwos',JSON.stringify(res.data.emwos));
this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_ens',JSON.stringify(res.data.emwo_ens));
this.tempStorage.setItem(context.srfsessionkey+'_emapplies',JSON.stringify(res.data.emapplies));
this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances)); this.tempStorage.setItem(context.srfsessionkey+'_emeqmaintances',JSON.stringify(res.data.emeqmaintances));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emeqahs',JSON.stringify(res.data.emeqahs));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
return res; return res;
} }
......
...@@ -130,17 +130,17 @@ export default class EMItemServiceBase extends EntityService { ...@@ -130,17 +130,17 @@ export default class EMItemServiceBase extends EntityService {
return Http.getInstance().get(`/emservices/${context.emservice}/emitems/${context.emitem}`,isloading); return Http.getInstance().get(`/emservices/${context.emservice}/emitems/${context.emitem}`,isloading);
} }
let res:any = await Http.getInstance().get(`/emitems/${context.emitem}`,isloading); let res:any = await Http.getInstance().get(`/emitems/${context.emitem}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades)); this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades));
this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists)); this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists));
this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns)); this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails)); this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts));
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
return res; return res;
} }
...@@ -174,6 +174,21 @@ export default class EMItemServiceBase extends EntityService { ...@@ -174,6 +174,21 @@ export default class EMItemServiceBase extends EntityService {
return Http.getInstance().post(`/emservices/${context.emservice}/emitems/${context.emitem}/save`,data,isloading); return Http.getInstance().post(`/emservices/${context.emservice}/emitems/${context.emitem}/save`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emwplistcostsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts'),'undefined')){
emwplistcostsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts') as any);
if(emwplistcostsData && emwplistcostsData.length && emwplistcostsData.length > 0){
emwplistcostsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwplistcostid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwplistcosts = emwplistcostsData;
let emitemtradesData:any = []; let emitemtradesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades'),'undefined')){
emitemtradesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades') as any); emitemtradesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades') as any);
...@@ -219,36 +234,36 @@ export default class EMItemServiceBase extends EntityService { ...@@ -219,36 +234,36 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emitemprtns = emitemprtnsData; masterData.emitemprtns = emitemprtnsData;
let emstocksData:any = []; let emeqsparedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){
emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any); emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any);
if(emstocksData && emstocksData.length && emstocksData.length > 0){ if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){
emstocksData.forEach((item:any) => { emeqsparedetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emstockid = null; item.emeqsparedetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emstocks = emstocksData; masterData.emeqsparedetails = emeqsparedetailsData;
let emeqsparedetailsData:any = []; let emitemrinsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins'),'undefined')){
emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any); emitemrinsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins') as any);
if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){ if(emitemrinsData && emitemrinsData.length && emitemrinsData.length > 0){
emeqsparedetailsData.forEach((item:any) => { emitemrinsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparedetailid = null; item.emitemrinid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparedetails = emeqsparedetailsData; masterData.emitemrins = emitemrinsData;
let emenData:any = []; let emenData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emen'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emen'),'undefined')){
emenData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emen') as any); emenData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emen') as any);
...@@ -264,51 +279,51 @@ export default class EMItemServiceBase extends EntityService { ...@@ -264,51 +279,51 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emen = emenData; masterData.emen = emenData;
let emitempusesData:any = []; let empodetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_empodetails'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); empodetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_empodetails') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(empodetailsData && empodetailsData.length && empodetailsData.length > 0){
emitempusesData.forEach((item:any) => { empodetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.empodetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.empodetails = empodetailsData;
let emitemrinsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitemrinsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitemrinsData && emitemrinsData.length && emitemrinsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitemrinsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitemrinid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitemrins = emitemrinsData; masterData.emitempuses = emitempusesData;
let empodetailsData:any = []; let emstocksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_empodetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){
empodetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_empodetails') as any); emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any);
if(empodetailsData && empodetailsData.length && empodetailsData.length > 0){ if(emstocksData && emstocksData.length && emstocksData.length > 0){
empodetailsData.forEach((item:any) => { emstocksData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.empodetailid = null; item.emstockid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.empodetails = empodetailsData; masterData.emstocks = emstocksData;
let emitemroutsData:any = []; let emitemroutsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts'),'undefined')){
emitemroutsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts') as any); emitemroutsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts') as any);
...@@ -324,34 +339,19 @@ export default class EMItemServiceBase extends EntityService { ...@@ -324,34 +339,19 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emitemrouts = emitemroutsData; masterData.emitemrouts = emitemroutsData;
let emwplistcostsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts'),'undefined')){
emwplistcostsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts') as any);
if(emwplistcostsData && emwplistcostsData.length && emwplistcostsData.length > 0){
emwplistcostsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwplistcostid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwplistcosts = emwplistcostsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emitems/${context.emitem}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emitems/${context.emitem}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades)); this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades));
this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists)); this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists));
this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns)); this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails)); this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts));
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
return res; return res;
} }
...@@ -385,17 +385,17 @@ export default class EMItemServiceBase extends EntityService { ...@@ -385,17 +385,17 @@ export default class EMItemServiceBase extends EntityService {
} }
let res:any = await Http.getInstance().get(`/emitems/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emitems/getdraft`,isloading);
res.data.emitem = data.emitem; res.data.emitem = data.emitem;
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades)); this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades));
this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists)); this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists));
this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns)); this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails)); this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts));
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
return res; return res;
} }
...@@ -428,6 +428,21 @@ export default class EMItemServiceBase extends EntityService { ...@@ -428,6 +428,21 @@ export default class EMItemServiceBase extends EntityService {
return Http.getInstance().put(`/emservices/${context.emservice}/emitems/${context.emitem}`,data,isloading); return Http.getInstance().put(`/emservices/${context.emservice}/emitems/${context.emitem}`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emwplistcostsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts'),'undefined')){
emwplistcostsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts') as any);
if(emwplistcostsData && emwplistcostsData.length && emwplistcostsData.length > 0){
emwplistcostsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwplistcostid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwplistcosts = emwplistcostsData;
let emitemtradesData:any = []; let emitemtradesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades'),'undefined')){
emitemtradesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades') as any); emitemtradesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades') as any);
...@@ -473,36 +488,36 @@ export default class EMItemServiceBase extends EntityService { ...@@ -473,36 +488,36 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emitemprtns = emitemprtnsData; masterData.emitemprtns = emitemprtnsData;
let emstocksData:any = []; let emeqsparedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){
emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any); emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any);
if(emstocksData && emstocksData.length && emstocksData.length > 0){ if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){
emstocksData.forEach((item:any) => { emeqsparedetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emstockid = null; item.emeqsparedetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emstocks = emstocksData; masterData.emeqsparedetails = emeqsparedetailsData;
let emeqsparedetailsData:any = []; let emitemrinsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins'),'undefined')){
emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any); emitemrinsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins') as any);
if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){ if(emitemrinsData && emitemrinsData.length && emitemrinsData.length > 0){
emeqsparedetailsData.forEach((item:any) => { emitemrinsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparedetailid = null; item.emitemrinid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparedetails = emeqsparedetailsData; masterData.emitemrins = emitemrinsData;
let emenData:any = []; let emenData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emen'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emen'),'undefined')){
emenData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emen') as any); emenData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emen') as any);
...@@ -518,51 +533,51 @@ export default class EMItemServiceBase extends EntityService { ...@@ -518,51 +533,51 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emen = emenData; masterData.emen = emenData;
let emitempusesData:any = []; let empodetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_empodetails'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); empodetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_empodetails') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(empodetailsData && empodetailsData.length && empodetailsData.length > 0){
emitempusesData.forEach((item:any) => { empodetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.empodetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.empodetails = empodetailsData;
let emitemrinsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitemrinsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitemrinsData && emitemrinsData.length && emitemrinsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitemrinsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitemrinid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitemrins = emitemrinsData; masterData.emitempuses = emitempusesData;
let empodetailsData:any = []; let emstocksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_empodetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){
empodetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_empodetails') as any); emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any);
if(empodetailsData && empodetailsData.length && empodetailsData.length > 0){ if(emstocksData && emstocksData.length && emstocksData.length > 0){
empodetailsData.forEach((item:any) => { emstocksData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.empodetailid = null; item.emstockid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.empodetails = empodetailsData; masterData.emstocks = emstocksData;
let emitemroutsData:any = []; let emitemroutsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts'),'undefined')){
emitemroutsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts') as any); emitemroutsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts') as any);
...@@ -578,34 +593,19 @@ export default class EMItemServiceBase extends EntityService { ...@@ -578,34 +593,19 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emitemrouts = emitemroutsData; masterData.emitemrouts = emitemroutsData;
let emwplistcostsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts'),'undefined')){
emwplistcostsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts') as any);
if(emwplistcostsData && emwplistcostsData.length && emwplistcostsData.length > 0){
emwplistcostsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwplistcostid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwplistcosts = emwplistcostsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emitems/${context.emitem}`,data,isloading); let res:any = await Http.getInstance().put(`/emitems/${context.emitem}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades)); this.tempStorage.setItem(context.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades));
this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists)); this.tempStorage.setItem(context.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists));
this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns)); this.tempStorage.setItem(context.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(context.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins));
this.tempStorage.setItem(context.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails)); this.tempStorage.setItem(context.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts)); this.tempStorage.setItem(context.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts));
this.tempStorage.setItem(context.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
return res; return res;
} }
...@@ -674,6 +674,21 @@ export default class EMItemServiceBase extends EntityService { ...@@ -674,6 +674,21 @@ export default class EMItemServiceBase extends EntityService {
return Http.getInstance().post(`/emservices/${context.emservice}/emitems`,data,isloading); return Http.getInstance().post(`/emservices/${context.emservice}/emitems`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emwplistcostsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts'),'undefined')){
emwplistcostsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts') as any);
if(emwplistcostsData && emwplistcostsData.length && emwplistcostsData.length > 0){
emwplistcostsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwplistcostid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwplistcosts = emwplistcostsData;
let emitemtradesData:any = []; let emitemtradesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades'),'undefined')){
emitemtradesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades') as any); emitemtradesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemtrades') as any);
...@@ -719,36 +734,36 @@ export default class EMItemServiceBase extends EntityService { ...@@ -719,36 +734,36 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emitemprtns = emitemprtnsData; masterData.emitemprtns = emitemprtnsData;
let emstocksData:any = []; let emeqsparedetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){
emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any); emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any);
if(emstocksData && emstocksData.length && emstocksData.length > 0){ if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){
emstocksData.forEach((item:any) => { emeqsparedetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emstockid = null; item.emeqsparedetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emstocks = emstocksData; masterData.emeqsparedetails = emeqsparedetailsData;
let emeqsparedetailsData:any = []; let emitemrinsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins'),'undefined')){
emeqsparedetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emeqsparedetails') as any); emitemrinsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins') as any);
if(emeqsparedetailsData && emeqsparedetailsData.length && emeqsparedetailsData.length > 0){ if(emitemrinsData && emitemrinsData.length && emitemrinsData.length > 0){
emeqsparedetailsData.forEach((item:any) => { emitemrinsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emeqsparedetailid = null; item.emitemrinid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emeqsparedetails = emeqsparedetailsData; masterData.emitemrins = emitemrinsData;
let emenData:any = []; let emenData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emen'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emen'),'undefined')){
emenData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emen') as any); emenData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emen') as any);
...@@ -764,51 +779,51 @@ export default class EMItemServiceBase extends EntityService { ...@@ -764,51 +779,51 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emen = emenData; masterData.emen = emenData;
let emitempusesData:any = []; let empodetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_empodetails'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); empodetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_empodetails') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(empodetailsData && empodetailsData.length && empodetailsData.length > 0){
emitempusesData.forEach((item:any) => { empodetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.empodetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.empodetails = empodetailsData;
let emitemrinsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitemrinsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrins') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitemrinsData && emitemrinsData.length && emitemrinsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitemrinsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitemrinid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitemrins = emitemrinsData; masterData.emitempuses = emitempusesData;
let empodetailsData:any = []; let emstocksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_empodetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){
empodetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_empodetails') as any); emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any);
if(empodetailsData && empodetailsData.length && empodetailsData.length > 0){ if(emstocksData && emstocksData.length && emstocksData.length > 0){
empodetailsData.forEach((item:any) => { emstocksData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.empodetailid = null; item.emstockid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.empodetails = empodetailsData; masterData.emstocks = emstocksData;
let emitemroutsData:any = []; let emitemroutsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts'),'undefined')){
emitemroutsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts') as any); emitemroutsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitemrouts') as any);
...@@ -824,21 +839,6 @@ export default class EMItemServiceBase extends EntityService { ...@@ -824,21 +839,6 @@ export default class EMItemServiceBase extends EntityService {
} }
} }
masterData.emitemrouts = emitemroutsData; masterData.emitemrouts = emitemroutsData;
let emwplistcostsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts'),'undefined')){
emwplistcostsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwplistcosts') as any);
if(emwplistcostsData && emwplistcostsData.length && emwplistcostsData.length > 0){
emwplistcostsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwplistcostid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwplistcosts = emwplistcostsData;
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;
...@@ -848,17 +848,17 @@ export default class EMItemServiceBase extends EntityService { ...@@ -848,17 +848,17 @@ export default class EMItemServiceBase 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(`/emitems`,data,isloading); let res:any = await Http.getInstance().post(`/emitems`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemtrades',JSON.stringify(res.data.emitemtrades));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emwplists',JSON.stringify(res.data.emwplists));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemprtns',JSON.stringify(res.data.emitemprtns));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emeqsparedetails',JSON.stringify(res.data.emeqsparedetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemrins',JSON.stringify(res.data.emitemrins));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emen',JSON.stringify(res.data.emen));
this.tempStorage.setItem(tempContext.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails)); this.tempStorage.setItem(tempContext.srfsessionkey+'_empodetails',JSON.stringify(res.data.empodetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitemrouts',JSON.stringify(res.data.emitemrouts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwplistcosts',JSON.stringify(res.data.emwplistcosts));
return res; return res;
} }
......
...@@ -230,36 +230,36 @@ export default class EMPlanServiceBase extends EntityService { ...@@ -230,36 +230,36 @@ export default class EMPlanServiceBase extends EntityService {
return Http.getInstance().post(`/emacclasses/${context.emacclass}/emplans`,data,isloading); return Http.getInstance().post(`/emacclasses/${context.emacclass}/emplans`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emplandetailsData:any = []; let emplancdtsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts'),'undefined')){
emplandetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails') as any); emplancdtsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts') as any);
if(emplandetailsData && emplandetailsData.length && emplandetailsData.length > 0){ if(emplancdtsData && emplancdtsData.length && emplancdtsData.length > 0){
emplandetailsData.forEach((item:any) => { emplancdtsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplandetailid = null; item.emplancdtid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplandetails = emplandetailsData; masterData.emplancdts = emplancdtsData;
let emplancdtsData:any = []; let emplandetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails'),'undefined')){
emplancdtsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts') as any); emplandetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails') as any);
if(emplancdtsData && emplancdtsData.length && emplancdtsData.length > 0){ if(emplandetailsData && emplandetailsData.length && emplandetailsData.length > 0){
emplancdtsData.forEach((item:any) => { emplandetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplancdtid = null; item.emplandetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplancdts = emplancdtsData; masterData.emplandetails = emplandetailsData;
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;
...@@ -269,8 +269,8 @@ export default class EMPlanServiceBase extends EntityService { ...@@ -269,8 +269,8 @@ export default class EMPlanServiceBase 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(`/emplans`,data,isloading); let res:any = await Http.getInstance().post(`/emplans`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
return res; return res;
} }
...@@ -327,40 +327,40 @@ export default class EMPlanServiceBase extends EntityService { ...@@ -327,40 +327,40 @@ export default class EMPlanServiceBase extends EntityService {
return Http.getInstance().put(`/emacclasses/${context.emacclass}/emplans/${context.emplan}`,data,isloading); return Http.getInstance().put(`/emacclasses/${context.emacclass}/emplans/${context.emplan}`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emplandetailsData:any = []; let emplancdtsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts'),'undefined')){
emplandetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails') as any); emplancdtsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts') as any);
if(emplandetailsData && emplandetailsData.length && emplandetailsData.length > 0){ if(emplancdtsData && emplancdtsData.length && emplancdtsData.length > 0){
emplandetailsData.forEach((item:any) => { emplancdtsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplandetailid = null; item.emplancdtid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplandetails = emplandetailsData; masterData.emplancdts = emplancdtsData;
let emplancdtsData:any = []; let emplandetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails'),'undefined')){
emplancdtsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts') as any); emplandetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails') as any);
if(emplancdtsData && emplancdtsData.length && emplancdtsData.length > 0){ if(emplandetailsData && emplandetailsData.length && emplandetailsData.length > 0){
emplancdtsData.forEach((item:any) => { emplandetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplancdtid = null; item.emplandetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplancdts = emplancdtsData; masterData.emplandetails = emplandetailsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emplans/${context.emplan}`,data,isloading); let res:any = await Http.getInstance().put(`/emplans/${context.emplan}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts)); this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts));
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
return res; return res;
} }
...@@ -417,8 +417,8 @@ export default class EMPlanServiceBase extends EntityService { ...@@ -417,8 +417,8 @@ export default class EMPlanServiceBase extends EntityService {
return Http.getInstance().get(`/emacclasses/${context.emacclass}/emplans/${context.emplan}`,isloading); return Http.getInstance().get(`/emacclasses/${context.emacclass}/emplans/${context.emplan}`,isloading);
} }
let res:any = await Http.getInstance().get(`/emplans/${context.emplan}`,isloading); let res:any = await Http.getInstance().get(`/emplans/${context.emplan}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts)); this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts));
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
return res; return res;
} }
...@@ -533,8 +533,8 @@ export default class EMPlanServiceBase extends EntityService { ...@@ -533,8 +533,8 @@ export default class EMPlanServiceBase extends EntityService {
} }
let res:any = await Http.getInstance().get(`/emplans/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emplans/getdraft`,isloading);
res.data.emplan = data.emplan; res.data.emplan = data.emplan;
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts)); this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts));
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
return res; return res;
} }
...@@ -646,40 +646,40 @@ export default class EMPlanServiceBase extends EntityService { ...@@ -646,40 +646,40 @@ export default class EMPlanServiceBase extends EntityService {
return Http.getInstance().post(`/emacclasses/${context.emacclass}/emplans/${context.emplan}/save`,data,isloading); return Http.getInstance().post(`/emacclasses/${context.emacclass}/emplans/${context.emplan}/save`,data,isloading);
} }
let masterData:any = {}; let masterData:any = {};
let emplandetailsData:any = []; let emplancdtsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts'),'undefined')){
emplandetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails') as any); emplancdtsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts') as any);
if(emplandetailsData && emplandetailsData.length && emplandetailsData.length > 0){ if(emplancdtsData && emplancdtsData.length && emplancdtsData.length > 0){
emplandetailsData.forEach((item:any) => { emplancdtsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplandetailid = null; item.emplancdtid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplandetails = emplandetailsData; masterData.emplancdts = emplancdtsData;
let emplancdtsData:any = []; let emplandetailsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails'),'undefined')){
emplancdtsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplancdts') as any); emplandetailsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplandetails') as any);
if(emplancdtsData && emplancdtsData.length && emplancdtsData.length > 0){ if(emplandetailsData && emplandetailsData.length && emplandetailsData.length > 0){
emplancdtsData.forEach((item:any) => { emplandetailsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplancdtid = null; item.emplandetailid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplancdts = emplancdtsData; masterData.emplandetails = emplandetailsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emplans/${context.emplan}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emplans/${context.emplan}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts)); this.tempStorage.setItem(context.srfsessionkey+'_emplancdts',JSON.stringify(res.data.emplancdts));
this.tempStorage.setItem(context.srfsessionkey+'_emplandetails',JSON.stringify(res.data.emplandetails));
return res; return res;
} }
......
...@@ -75,21 +75,21 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -75,21 +75,21 @@ export default class EMRFODEServiceBase 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 emrfomosData:any = []; let emrfocasData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas'),'undefined')){
emrfomosData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos') as any); emrfocasData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas') as any);
if(emrfomosData && emrfomosData.length && emrfomosData.length > 0){ if(emrfocasData && emrfocasData.length && emrfocasData.length > 0){
emrfomosData.forEach((item:any) => { emrfocasData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emrfomoid = null; item.emrfocaid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emrfomos = emrfomosData; masterData.emrfocas = emrfocasData;
let emrfoacsData:any = []; let emrfoacsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs'),'undefined')){
emrfoacsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs') as any); emrfoacsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs') as any);
...@@ -105,26 +105,26 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -105,26 +105,26 @@ export default class EMRFODEServiceBase extends EntityService {
} }
} }
masterData.emrfoacs = emrfoacsData; masterData.emrfoacs = emrfoacsData;
let emrfocasData:any = []; let emrfomosData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos'),'undefined')){
emrfocasData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas') as any); emrfomosData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos') as any);
if(emrfocasData && emrfocasData.length && emrfocasData.length > 0){ if(emrfomosData && emrfomosData.length && emrfomosData.length > 0){
emrfocasData.forEach((item:any) => { emrfomosData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emrfocaid = null; item.emrfomoid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emrfocas = emrfocasData; masterData.emrfomos = emrfomosData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emrfodes/${context.emrfode}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emrfodes/${context.emrfode}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas)); this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
return res; return res;
} }
...@@ -139,21 +139,21 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -139,21 +139,21 @@ export default class EMRFODEServiceBase 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 emrfomosData:any = []; let emrfocasData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas'),'undefined')){
emrfomosData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos') as any); emrfocasData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas') as any);
if(emrfomosData && emrfomosData.length && emrfomosData.length > 0){ if(emrfocasData && emrfocasData.length && emrfocasData.length > 0){
emrfomosData.forEach((item:any) => { emrfocasData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emrfomoid = null; item.emrfocaid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emrfomos = emrfomosData; masterData.emrfocas = emrfocasData;
let emrfoacsData:any = []; let emrfoacsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs'),'undefined')){
emrfoacsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs') as any); emrfoacsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs') as any);
...@@ -169,26 +169,26 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -169,26 +169,26 @@ export default class EMRFODEServiceBase extends EntityService {
} }
} }
masterData.emrfoacs = emrfoacsData; masterData.emrfoacs = emrfoacsData;
let emrfocasData:any = []; let emrfomosData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos'),'undefined')){
emrfocasData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas') as any); emrfomosData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos') as any);
if(emrfocasData && emrfocasData.length && emrfocasData.length > 0){ if(emrfomosData && emrfomosData.length && emrfomosData.length > 0){
emrfocasData.forEach((item:any) => { emrfomosData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emrfocaid = null; item.emrfomoid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emrfocas = emrfocasData; masterData.emrfomos = emrfomosData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emrfodes/${context.emrfode}`,data,isloading); let res:any = await Http.getInstance().put(`/emrfodes/${context.emrfode}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas)); this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
return res; return res;
} }
...@@ -217,21 +217,21 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -217,21 +217,21 @@ export default class EMRFODEServiceBase 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 emrfomosData:any = []; let emrfocasData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas'),'undefined')){
emrfomosData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos') as any); emrfocasData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas') as any);
if(emrfomosData && emrfomosData.length && emrfomosData.length > 0){ if(emrfocasData && emrfocasData.length && emrfocasData.length > 0){
emrfomosData.forEach((item:any) => { emrfocasData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emrfomoid = null; item.emrfocaid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emrfomos = emrfomosData; masterData.emrfocas = emrfocasData;
let emrfoacsData:any = []; let emrfoacsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs'),'undefined')){
emrfoacsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs') as any); emrfoacsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfoacs') as any);
...@@ -247,21 +247,21 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -247,21 +247,21 @@ export default class EMRFODEServiceBase extends EntityService {
} }
} }
masterData.emrfoacs = emrfoacsData; masterData.emrfoacs = emrfoacsData;
let emrfocasData:any = []; let emrfomosData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos'),'undefined')){
emrfocasData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfocas') as any); emrfomosData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emrfomos') as any);
if(emrfocasData && emrfocasData.length && emrfocasData.length > 0){ if(emrfomosData && emrfomosData.length && emrfomosData.length > 0){
emrfocasData.forEach((item:any) => { emrfomosData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emrfocaid = null; item.emrfomoid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emrfocas = emrfocasData; masterData.emrfomos = emrfomosData;
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;
...@@ -271,9 +271,9 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -271,9 +271,9 @@ export default class EMRFODEServiceBase 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(`/emrfodes`,data,isloading); let res:any = await Http.getInstance().post(`/emrfodes`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
return res; return res;
} }
...@@ -288,9 +288,9 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -288,9 +288,9 @@ export default class EMRFODEServiceBase 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(`/emrfodes/${context.emrfode}`,isloading); let res:any = await Http.getInstance().get(`/emrfodes/${context.emrfode}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas)); this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
return res; return res;
} }
...@@ -307,9 +307,9 @@ export default class EMRFODEServiceBase extends EntityService { ...@@ -307,9 +307,9 @@ export default class EMRFODEServiceBase 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(`/emrfodes/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emrfodes/getdraft`,isloading);
res.data.emrfode = data.emrfode; res.data.emrfode = data.emrfode;
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas)); this.tempStorage.setItem(context.srfsessionkey+'_emrfocas',JSON.stringify(res.data.emrfocas));
this.tempStorage.setItem(context.srfsessionkey+'_emrfoacs',JSON.stringify(res.data.emrfoacs));
this.tempStorage.setItem(context.srfsessionkey+'_emrfomos',JSON.stringify(res.data.emrfomos));
return res; return res;
} }
......
...@@ -63,10 +63,10 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -63,10 +63,10 @@ export default class EMServiceServiceBase 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(`/emservices/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emservices/getdraft`,isloading);
res.data.emservice = data.emservice; res.data.emservice = data.emservice;
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems)); this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -81,21 +81,21 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -81,21 +81,21 @@ export default class EMServiceServiceBase 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 emitempusesData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emitempusesData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emplantempls = emplantemplsData;
let emitemsData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
...@@ -126,27 +126,27 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -126,27 +126,27 @@ export default class EMServiceServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emplantemplsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emplantemplsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emitempuses = emitempusesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emservices/${context.emservice}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emservices/${context.emservice}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems)); this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -161,21 +161,21 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -161,21 +161,21 @@ export default class EMServiceServiceBase 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 emitempusesData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emitempusesData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emplantempls = emplantemplsData;
let emitemsData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
...@@ -206,21 +206,21 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -206,21 +206,21 @@ export default class EMServiceServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emplantemplsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emplantemplsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emitempuses = emitempusesData;
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;
...@@ -230,10 +230,10 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -230,10 +230,10 @@ export default class EMServiceServiceBase 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(`/emservices`,data,isloading); let res:any = await Http.getInstance().post(`/emservices`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -248,21 +248,21 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -248,21 +248,21 @@ export default class EMServiceServiceBase 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 emitempusesData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emitempusesData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emplantempls = emplantemplsData;
let emitemsData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
...@@ -293,27 +293,27 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -293,27 +293,27 @@ export default class EMServiceServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emplantemplsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emplantemplsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emitempuses = emitempusesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emservices/${context.emservice}`,data,isloading); let res:any = await Http.getInstance().put(`/emservices/${context.emservice}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems)); this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -328,10 +328,10 @@ export default class EMServiceServiceBase extends EntityService { ...@@ -328,10 +328,10 @@ export default class EMServiceServiceBase 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(`/emservices/${context.emservice}`,isloading); let res:any = await Http.getInstance().get(`/emservices/${context.emservice}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems)); this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
......
...@@ -77,21 +77,21 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -77,21 +77,21 @@ export default class EMStoreServiceBase extends EntityService {
} }
} }
masterData.emstoreparts = emstorepartsData; masterData.emstoreparts = emstorepartsData;
let emitempusesData:any = []; let emstocksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emstocksData && emstocksData.length && emstocksData.length > 0){
emitempusesData.forEach((item:any) => { emstocksData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emstockid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emstocks = emstocksData;
let emitemsData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
...@@ -107,27 +107,27 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -107,27 +107,27 @@ export default class EMStoreServiceBase extends EntityService {
} }
} }
masterData.emitems = emitemsData; masterData.emitems = emitemsData;
let emstocksData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emstocksData && emstocksData.length && emstocksData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emstocksData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emstockid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emstocks = emstocksData; masterData.emitempuses = emitempusesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/emstores/${context.emstore}`,data,isloading); let res:any = await Http.getInstance().put(`/emstores/${context.emstore}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts)); this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks)); this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -144,9 +144,9 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -144,9 +144,9 @@ export default class EMStoreServiceBase extends EntityService {
let res:any = await Http.getInstance().get(`/emstores/getdraft`,isloading); let res:any = await Http.getInstance().get(`/emstores/getdraft`,isloading);
res.data.emstore = data.emstore; res.data.emstore = data.emstore;
this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts)); this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks)); this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -175,9 +175,9 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -175,9 +175,9 @@ export default class EMStoreServiceBase 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(`/emstores/${context.emstore}`,isloading); let res:any = await Http.getInstance().get(`/emstores/${context.emstore}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts)); this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks)); this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -208,21 +208,21 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -208,21 +208,21 @@ export default class EMStoreServiceBase extends EntityService {
} }
} }
masterData.emstoreparts = emstorepartsData; masterData.emstoreparts = emstorepartsData;
let emitempusesData:any = []; let emstocksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emstocksData && emstocksData.length && emstocksData.length > 0){
emitempusesData.forEach((item:any) => { emstocksData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emstockid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emstocks = emstocksData;
let emitemsData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
...@@ -238,21 +238,21 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -238,21 +238,21 @@ export default class EMStoreServiceBase extends EntityService {
} }
} }
masterData.emitems = emitemsData; masterData.emitems = emitemsData;
let emstocksData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emstocksData && emstocksData.length && emstocksData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emstocksData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emstockid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emstocks = emstocksData; masterData.emitempuses = emitempusesData;
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;
...@@ -263,9 +263,9 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -263,9 +263,9 @@ export default class EMStoreServiceBase 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(`/emstores`,data,isloading); let res:any = await Http.getInstance().post(`/emstores`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -295,21 +295,21 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -295,21 +295,21 @@ export default class EMStoreServiceBase extends EntityService {
} }
} }
masterData.emstoreparts = emstorepartsData; masterData.emstoreparts = emstorepartsData;
let emitempusesData:any = []; let emstocksData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emstocksData && emstocksData.length && emstocksData.length > 0){
emitempusesData.forEach((item:any) => { emstocksData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emstockid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emstocks = emstocksData;
let emitemsData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
...@@ -325,27 +325,27 @@ export default class EMStoreServiceBase extends EntityService { ...@@ -325,27 +325,27 @@ export default class EMStoreServiceBase extends EntityService {
} }
} }
masterData.emitems = emitemsData; masterData.emitems = emitemsData;
let emstocksData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emstocks'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emstocksData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emstocks') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emstocksData && emstocksData.length && emstocksData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emstocksData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emstockid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emstocks = emstocksData; masterData.emitempuses = emitempusesData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/emstores/${context.emstore}/save`,data,isloading); let res:any = await Http.getInstance().post(`/emstores/${context.emstore}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts)); this.tempStorage.setItem(context.srfsessionkey+'_emstoreparts',JSON.stringify(res.data.emstoreparts));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks)); this.tempStorage.setItem(context.srfsessionkey+'_emstocks',JSON.stringify(res.data.emstocks));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
......
...@@ -62,6 +62,21 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -62,6 +62,21 @@ export default class PFDeptServiceBase 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 emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_dps = emwo_dpsData;
let emenconsumsData:any = []; let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any); emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
...@@ -92,21 +107,21 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -92,21 +107,21 @@ export default class PFDeptServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emwo_dpsData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emwo_dpsData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emplantempls = emplantemplsData;
let emitempusesData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
...@@ -122,28 +137,13 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -122,28 +137,13 @@ export default class PFDeptServiceBase extends EntityService {
} }
} }
masterData.emitempuses = emitempusesData; masterData.emitempuses = emitempusesData;
let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/pfdepts/${context.pfdept}/save`,data,isloading); let res:any = await Http.getInstance().post(`/pfdepts/${context.pfdept}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums)); this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -172,6 +172,21 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -172,6 +172,21 @@ export default class PFDeptServiceBase 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 emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_dps = emwo_dpsData;
let emenconsumsData:any = []; let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any); emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
...@@ -202,21 +217,21 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -202,21 +217,21 @@ export default class PFDeptServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emwo_dpsData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emwo_dpsData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emplantempls = emplantemplsData;
let emitempusesData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
...@@ -232,21 +247,6 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -232,21 +247,6 @@ export default class PFDeptServiceBase extends EntityService {
} }
} }
masterData.emitempuses = emitempusesData; masterData.emitempuses = emitempusesData;
let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
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;
...@@ -256,11 +256,11 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -256,11 +256,11 @@ export default class PFDeptServiceBase 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(`/pfdepts`,data,isloading); let res:any = await Http.getInstance().post(`/pfdepts`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -276,11 +276,11 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -276,11 +276,11 @@ export default class PFDeptServiceBase 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(`/pfdepts/getdraft`,isloading); let res:any = await Http.getInstance().get(`/pfdepts/getdraft`,isloading);
res.data.pfdept = data.pfdept; res.data.pfdept = data.pfdept;
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums)); this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -295,11 +295,11 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -295,11 +295,11 @@ export default class PFDeptServiceBase 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(`/pfdepts/${context.pfdept}`,isloading); let res:any = await Http.getInstance().get(`/pfdepts/${context.pfdept}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums)); this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
...@@ -315,6 +315,21 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -315,6 +315,21 @@ export default class PFDeptServiceBase 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 emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emwo_dps = emwo_dpsData;
let emenconsumsData:any = []; let emenconsumsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums'),'undefined')){
emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any); emenconsumsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emenconsums') as any);
...@@ -345,21 +360,21 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -345,21 +360,21 @@ export default class PFDeptServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emwo_dpsData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emwo_dpsData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emplantempls = emplantemplsData;
let emitempusesData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
...@@ -375,28 +390,13 @@ export default class PFDeptServiceBase extends EntityService { ...@@ -375,28 +390,13 @@ export default class PFDeptServiceBase extends EntityService {
} }
} }
masterData.emitempuses = emitempusesData; masterData.emitempuses = emitempusesData;
let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/pfdepts/${context.pfdept}`,data,isloading); let res:any = await Http.getInstance().put(`/pfdepts/${context.pfdept}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums)); this.tempStorage.setItem(context.srfsessionkey+'_emenconsums',JSON.stringify(res.data.emenconsums));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
return res; return res;
} }
......
...@@ -62,81 +62,81 @@ export default class PFEmpServiceBase extends EntityService { ...@@ -62,81 +62,81 @@ export default class PFEmpServiceBase 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 emitemsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitemsData && emitemsData.length && emitemsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitemsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitemid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitems = emitemsData; masterData.emitempuses = emitempusesData;
let emplantemplsData:any = []; let emdrwgsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emdrwgsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emdrwgsData && emdrwgsData.length && emdrwgsData.length > 0){
emplantemplsData.forEach((item:any) => { emdrwgsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emdrwgid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emdrwgs = emdrwgsData;
let emdrwgsData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emdrwgsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emdrwgsData && emdrwgsData.length && emdrwgsData.length > 0){ if(emplansData && emplansData.length && emplansData.length > 0){
emdrwgsData.forEach((item:any) => { emplansData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emdrwgid = null; item.emplanid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emdrwgs = emdrwgsData; masterData.emplans = emplansData;
let emitempusesData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emitempusesData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emplantempls = emplantemplsData;
let emplansData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emitemsData && emitemsData.length && emitemsData.length > 0){
emplansData.forEach((item:any) => { emitemsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emitemid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emitems = emitemsData;
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;
...@@ -146,11 +146,11 @@ export default class PFEmpServiceBase extends EntityService { ...@@ -146,11 +146,11 @@ export default class PFEmpServiceBase 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(`/pfemps`,data,isloading); let res:any = await Http.getInstance().post(`/pfemps`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
return res; return res;
} }
...@@ -165,11 +165,11 @@ export default class PFEmpServiceBase extends EntityService { ...@@ -165,11 +165,11 @@ export default class PFEmpServiceBase 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(`/pfemps/${context.pfemp}`,isloading); let res:any = await Http.getInstance().get(`/pfemps/${context.pfemp}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
return res; return res;
} }
...@@ -185,88 +185,88 @@ export default class PFEmpServiceBase extends EntityService { ...@@ -185,88 +185,88 @@ export default class PFEmpServiceBase 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 emitemsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitemsData && emitemsData.length && emitemsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitemsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitemid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitems = emitemsData; masterData.emitempuses = emitempusesData;
let emplantemplsData:any = []; let emdrwgsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emdrwgsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emdrwgsData && emdrwgsData.length && emdrwgsData.length > 0){
emplantemplsData.forEach((item:any) => { emdrwgsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emdrwgid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emdrwgs = emdrwgsData;
let emdrwgsData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emdrwgsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emdrwgsData && emdrwgsData.length && emdrwgsData.length > 0){ if(emplansData && emplansData.length && emplansData.length > 0){
emdrwgsData.forEach((item:any) => { emplansData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emdrwgid = null; item.emplanid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emdrwgs = emdrwgsData; masterData.emplans = emplansData;
let emitempusesData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emitempusesData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emplantempls = emplantemplsData;
let emplansData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emitemsData && emitemsData.length && emitemsData.length > 0){
emplansData.forEach((item:any) => { emitemsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emitemid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emitems = emitemsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/pfemps/${context.pfemp}`,data,isloading); let res:any = await Http.getInstance().put(`/pfemps/${context.pfemp}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
return res; return res;
} }
...@@ -281,88 +281,88 @@ export default class PFEmpServiceBase extends EntityService { ...@@ -281,88 +281,88 @@ export default class PFEmpServiceBase 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 emitemsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitemsData && emitemsData.length && emitemsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitemsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitemid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitems = emitemsData; masterData.emitempuses = emitempusesData;
let emplantemplsData:any = []; let emdrwgsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emdrwgsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emdrwgsData && emdrwgsData.length && emdrwgsData.length > 0){
emplantemplsData.forEach((item:any) => { emdrwgsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null; item.emdrwgid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplantempls = emplantemplsData; masterData.emdrwgs = emdrwgsData;
let emdrwgsData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emdrwgsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emdrwgs') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
if(emdrwgsData && emdrwgsData.length && emdrwgsData.length > 0){ if(emplansData && emplansData.length && emplansData.length > 0){
emdrwgsData.forEach((item:any) => { emplansData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emdrwgid = null; item.emplanid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emdrwgs = emdrwgsData; masterData.emplans = emplansData;
let emitempusesData:any = []; let emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any); emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){ if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emitempusesData.forEach((item:any) => { emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emplantemplid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emplantempls = emplantemplsData;
let emplansData:any = []; let emitemsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitems'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emitemsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitems') as any);
if(emplansData && emplansData.length && emplansData.length > 0){ if(emitemsData && emitemsData.length && emitemsData.length > 0){
emplansData.forEach((item:any) => { emitemsData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emplanid = null; item.emitemid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emplans = emplansData; masterData.emitems = emitemsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/pfemps/${context.pfemp}/save`,data,isloading); let res:any = await Http.getInstance().post(`/pfemps/${context.pfemp}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
return res; return res;
} }
...@@ -391,11 +391,11 @@ export default class PFEmpServiceBase extends EntityService { ...@@ -391,11 +391,11 @@ export default class PFEmpServiceBase 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(`/pfemps/getdraft`,isloading); let res:any = await Http.getInstance().get(`/pfemps/getdraft`,isloading);
res.data.pfemp = data.pfemp; res.data.pfemp = data.pfemp;
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emdrwgs',JSON.stringify(res.data.emdrwgs));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans)); this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emitems',JSON.stringify(res.data.emitems));
return res; return res;
} }
......
...@@ -77,11 +77,11 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -77,11 +77,11 @@ export default class PFTeamServiceBase 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(`/pfteams/getdraft`,isloading); let res:any = await Http.getInstance().get(`/pfteams/getdraft`,isloading);
res.data.pfteam = data.pfteam; res.data.pfteam = data.pfteam;
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
return res; return res;
} }
...@@ -96,6 +96,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -96,6 +96,21 @@ export default class PFTeamServiceBase 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 emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
let emequipsData:any = []; let emequipsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){
emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any); emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any);
...@@ -111,21 +126,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -111,21 +126,21 @@ export default class PFTeamServiceBase extends EntityService {
} }
} }
masterData.emequips = emequipsData; masterData.emequips = emequipsData;
let emwo_dpsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emwo_dpsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emitempuses = emitempusesData;
let emplansData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
...@@ -141,43 +156,28 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -141,43 +156,28 @@ export default class PFTeamServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emplantemplsData:any = []; let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emplantemplsData.forEach((item:any) => { emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emwo_dpid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emwo_dps = emwo_dpsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().post(`/pfteams/${context.pfteam}/save`,data,isloading); let res:any = await Http.getInstance().post(`/pfteams/${context.pfteam}/save`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
return res; return res;
} }
...@@ -192,6 +192,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -192,6 +192,21 @@ export default class PFTeamServiceBase 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 emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
let emequipsData:any = []; let emequipsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){
emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any); emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any);
...@@ -207,21 +222,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -207,21 +222,21 @@ export default class PFTeamServiceBase extends EntityService {
} }
} }
masterData.emequips = emequipsData; masterData.emequips = emequipsData;
let emwo_dpsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emwo_dpsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emitempuses = emitempusesData;
let emplansData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
...@@ -237,36 +252,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -237,36 +252,21 @@ export default class PFTeamServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emplantemplsData:any = []; let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emplantemplsData.forEach((item:any) => { emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emwo_dpid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emwo_dps = emwo_dpsData;
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;
...@@ -276,11 +276,11 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -276,11 +276,11 @@ export default class PFTeamServiceBase 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(`/pfteams`,data,isloading); let res:any = await Http.getInstance().post(`/pfteams`,data,isloading);
this.tempStorage.setItem(tempContext.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(tempContext.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(tempContext.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
return res; return res;
} }
...@@ -308,6 +308,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -308,6 +308,21 @@ export default class PFTeamServiceBase 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 emplantemplsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){
emplantemplsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
let emequipsData:any = []; let emequipsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emequips'),'undefined')){
emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any); emequipsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emequips') as any);
...@@ -323,21 +338,21 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -323,21 +338,21 @@ export default class PFTeamServiceBase extends EntityService {
} }
} }
masterData.emequips = emequipsData; masterData.emequips = emequipsData;
let emwo_dpsData:any = []; let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any); emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){ if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emwo_dpsData.forEach((item:any) => { emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emwo_dpid = null; item.emitempuseid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emwo_dps = emwo_dpsData; masterData.emitempuses = emitempusesData;
let emplansData:any = []; let emplansData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplans'),'undefined')){
emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any); emplansData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplans') as any);
...@@ -353,43 +368,28 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -353,43 +368,28 @@ export default class PFTeamServiceBase extends EntityService {
} }
} }
masterData.emplans = emplansData; masterData.emplans = emplansData;
let emplantemplsData:any = []; let emwo_dpsData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls'),'undefined')){ if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps'),'undefined')){
emplantemplsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emplantempls') as any); emwo_dpsData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emwo_dps') as any);
if(emplantemplsData && emplantemplsData.length && emplantemplsData.length > 0){ if(emwo_dpsData && emwo_dpsData.length && emwo_dpsData.length > 0){
emplantemplsData.forEach((item:any) => { emwo_dpsData.forEach((item:any) => {
if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){
item.emplantemplid = null;
}
delete item.srffrontuf;
}
});
}
}
masterData.emplantempls = emplantemplsData;
let emitempusesData:any = [];
if(!Object.is(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses'),'undefined')){
emitempusesData = JSON.parse(this.tempStorage.getItem(context.srfsessionkey+'_emitempuses') as any);
if(emitempusesData && emitempusesData.length && emitempusesData.length > 0){
emitempusesData.forEach((item:any) => {
if(item.srffrontuf){ if(item.srffrontuf){
if(Object.is(item.srffrontuf,"0")){ if(Object.is(item.srffrontuf,"0")){
item.emitempuseid = null; item.emwo_dpid = null;
} }
delete item.srffrontuf; delete item.srffrontuf;
} }
}); });
} }
} }
masterData.emitempuses = emitempusesData; masterData.emwo_dps = emwo_dpsData;
Object.assign(data,masterData); Object.assign(data,masterData);
let res:any = await Http.getInstance().put(`/pfteams/${context.pfteam}`,data,isloading); let res:any = await Http.getInstance().put(`/pfteams/${context.pfteam}`,data,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
return res; return res;
} }
...@@ -404,11 +404,11 @@ export default class PFTeamServiceBase extends EntityService { ...@@ -404,11 +404,11 @@ export default class PFTeamServiceBase 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(`/pfteams/${context.pfteam}`,isloading); let res:any = await Http.getInstance().get(`/pfteams/${context.pfteam}`,isloading);
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls)); this.tempStorage.setItem(context.srfsessionkey+'_emplantempls',JSON.stringify(res.data.emplantempls));
this.tempStorage.setItem(context.srfsessionkey+'_emequips',JSON.stringify(res.data.emequips));
this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses)); this.tempStorage.setItem(context.srfsessionkey+'_emitempuses',JSON.stringify(res.data.emitempuses));
this.tempStorage.setItem(context.srfsessionkey+'_emplans',JSON.stringify(res.data.emplans));
this.tempStorage.setItem(context.srfsessionkey+'_emwo_dps',JSON.stringify(res.data.emwo_dps));
return res; return res;
} }
......
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
git clone -b master $para2 eam_practice04/ git clone -b master $para2 eam_practice04/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd eam_practice04/ cd eam_practice04/
mvn clean package -Pwebapi mvn clean package -Peamweb
cd eam-provider/eam-provider-webapi cd eam-app/eam-app-eamweb
mvn -Pwebapi docker:build mvn -Peamweb docker:build
mvn -Pwebapi docker:push mvn -Peamweb docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/eam-provider-webapi.yaml iBizPractice --with-registry-auth docker -H $para1 stack deploy --compose-file=src/main/docker/eam-app-eamweb.yaml iBizPractice --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \ ...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \ sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /eam-app-eamweb.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /eam-app-eamweb.jar
EXPOSE 8080 EXPOSE 30009
ADD eam-app-eamweb.jar /eam-app-eamweb.jar ADD eam-app-eamweb.jar /eam-app-eamweb.jar
...@@ -3,9 +3,21 @@ services: ...@@ -3,9 +3,21 @@ services:
eam-app-eamweb: eam-app-eamweb:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/eam-app-eamweb:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/eam-app-eamweb:latest
ports: ports:
- "8080:8080" - "30009:30009"
networks: networks:
- agent_network - agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=practice.ibizlab.cn
- SERVER_PORT=30009
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_30c03252a
- SPRING_DATASOURCE_PASSWORD=@7@dd7d0
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_30c03252a?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_30c03252a
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1
......
...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \ ...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \ sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /eam-provider-webapi.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /eam-provider-webapi.jar
EXPOSE 20009 EXPOSE 8081
ADD eam-provider-webapi.jar /eam-provider-webapi.jar ADD eam-provider-webapi.jar /eam-provider-webapi.jar
...@@ -3,21 +3,9 @@ services: ...@@ -3,21 +3,9 @@ services:
eam-provider-webapi: eam-provider-webapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/eam-provider-webapi:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/eam-provider-webapi:latest
ports: ports:
- "20009:20009" - "8081:8081"
networks: networks:
- agent_network - agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=practice.ibizlab.cn
- SERVER_PORT=20009
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.102.211:8848
- SPRING_REDIS_HOST=172.16.100.243
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_30c03252a
- SPRING_DATASOURCE_PASSWORD=@7@dd7d0
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_30c03252a?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_30c03252a
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册