Commit ef3be540 by 李少勇

公共组件内的方法整理

parent c403c11c
import TrndocRequest from "../model/TrndocRequest.js";
import Api from "~/service/Api";
import Utils from "~/utils";
import TrndocRequest from '../model/TrndocRequest.js';
import Api from '~/service/Api';
import Utils from '~/utils';
export default {
buildPtspta(ptsptaObj) {
let ptspta = {};
let pts = ptsptaObj.pts;
let adr = ptsptaObj.adr;
ptspta.rol=pts.rol;
ptspta.name=pts.nam;
ptspta.ptyinr=pts.ptyinr;
ptspta.ptainr=pts.ptainr;
ptspta.extkey=pts.extkey;
ptspta.dftdsp=pts.dftdsp;
ptspta.dftcur=pts.dftcur;
ptspta.dftact=pts.dftact;
ptspta.dftfeecur=pts.dftfeecur;
ptspta.dftactptainr=pts.dftactptainr;
ptspta.glggrpflg=pts.glggrpflg;
ptspta.adrblk=pts.adrblk;
return ptspta;
},
buildTrndocRequest() {
let trndocRequest = new TrndocRequest().data;
let rec = {};
let cbsMap = {};
if (this.trnName === "litopn") {
rec.objtyp = "LID";
rec.ownref = this.model.lidgrp.rec.ownref;
rec.opndat = this.model.lidgrp.rec.opndat;
rec.branchInr = this.model.lidgrp.rec.branchinr;
trndocRequest.rec = rec;
buildPtspta(ptsptaObj) {
let ptspta = {};
let pts = ptsptaObj.pts;
ptspta.rol = pts.rol;
ptspta.name = pts.nam;
ptspta.ptyinr = pts.ptyinr;
ptspta.ptainr = pts.ptainr;
ptspta.extkey = pts.extkey;
ptspta.dftdsp = pts.dftdsp;
ptspta.dftcur = pts.dftcur;
ptspta.dftact = pts.dftact;
ptspta.dftfeecur = pts.dftfeecur;
ptspta.dftactptainr = pts.dftactptainr;
ptspta.glggrpflg = pts.glggrpflg;
ptspta.adrblk = pts.adrblk;
return ptspta;
},
// 处理Litopn数据
buildTrndocLitopn () {
let trndocRequest = new TrndocRequest().data;
let rec = {};
let cbsMap = {};
rec.objtyp = 'LID';
rec.ownref = this.model.lidgrp.rec.ownref;
rec.opndat = this.model.lidgrp.rec.opndat;
rec.branchInr = this.model.lidgrp.rec.branchinr;
trndocRequest.rec = rec;
cbsMap.NOM1 = {
"cur":this.model.lidgrp.cbs.nom1.cur,
"amt":this.model.lidgrp.cbs.nom1.amt,
};
cbsMap.NOM1 = {
'cur':this.model.lidgrp.cbs.nom1.cur,
'amt':this.model.lidgrp.cbs.nom1.amt,
};
let ptsptaList = [];
if (this.model.lidgrp.apl.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.apl));
}
if (this.model.lidgrp.adv.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.adv));
}
if (this.model.lidgrp.ben.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.ben));
}
trndocRequest.ptsList = ptsptaList;
} else if (this.trnName === "gitopn") {
rec.objtyp = "GID";
rec.ownref = this.model.gidgrp.rec.ownref;
rec.opndat = this.model.gidgrp.rec.opndat;
rec.expdat = this.model.gidgrp.rec.expdat;
rec.branchInr = this.model.gidgrp.rec.branchinr;
rec.hndtyp = this.model.gidgrp.rec.hndtyp;
rec.gartyp = this.model.gidgrp.rec.gartyp;
rec.fingua = this.model.gidgrp.rec.fingua;
rec.segtyp = this.model.gidgrp.ghd.segtyp;
rec.fromflg = this.model.gidgrp.rec.fromflg;
rec.othersno= this.model.gidgrp.rec.othersno;
rec.sndto = this.model.gidgrp.rec.sndto;
rec.swiftflg = this.model.gitp.swiftflg;
rec.giduil = this.model.gidgrp.rec.giduil;
rec.purpos = this.model.gidgrp.rec.purpos;
rec.revflg = this.model.gidgrp.rec.revflg;
rec.cnfsta = this.model.gidgrp.rec.cnfsta;
trndocRequest.rec = rec;
let ptsptaList = [];
if (this.model.lidgrp.apl.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.apl));
}
if (this.model.lidgrp.adv.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.adv));
}
if (this.model.lidgrp.ben.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.ben));
}
trndocRequest.ptsList = ptsptaList;
return trndocRequest
},
// 处理Gitopn数据
buildTrndocGitopn () {
let trndocRequest = new TrndocRequest().data;
let rec = {};
rec.objtyp = 'GID';
rec.ownref = this.model.gidgrp.rec.ownref;
rec.opndat = this.model.gidgrp.rec.opndat;
rec.expdat = this.model.gidgrp.rec.expdat;
rec.branchInr = this.model.gidgrp.rec.branchinr;
rec.hndtyp = this.model.gidgrp.rec.hndtyp;
rec.gartyp = this.model.gidgrp.rec.gartyp;
rec.fingua = this.model.gidgrp.rec.fingua;
rec.segtyp = this.model.gidgrp.ghd.segtyp;
rec.fromflg = this.model.gidgrp.rec.fromflg;
rec.othersno= this.model.gidgrp.rec.othersno;
rec.sndto = this.model.gidgrp.rec.sndto;
rec.swiftflg = this.model.gitp.swiftflg;
rec.giduil = this.model.gidgrp.rec.giduil;
rec.purpos = this.model.gidgrp.rec.purpos;
rec.revflg = this.model.gidgrp.rec.revflg;
rec.cnfsta = this.model.gidgrp.rec.cnfsta;
trndocRequest.rec = rec;
let ptsptaList = [];
if (this.model.gidgrp.apl.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.apl));
}
if (this.model.gidgrp.adv.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.adv));
}
if (this.model.gidgrp.ben.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.ben));
}
trndocRequest.ptsList = ptsptaList;
}
trndocRequest.transName = this.trnName;
if (!!window.sessionStorage.userId) {
trndocRequest.userId = window.sessionStorage.userId;
} else {
trndocRequest.userId = "ZL";
}
return trndocRequest;
},
let ptsptaList = [];
if (this.model.gidgrp.apl.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.apl));
}
if (this.model.gidgrp.adv.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.adv));
}
if (this.model.gidgrp.ben.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.ben));
}
trndocRequest.ptsList = ptsptaList;
return trndocRequest
},
// 整合各交易的数据
buildTrndocRequest() {
let trndocRequest = new TrndocRequest().data;
switch (this.trnName) {
case 'litopn':
trndocRequest = this.buildTrndocLitopn()
break
case 'gitopn':
trndocRequest = this.buildTrndocGitopn()
break
default:
return
}
trndocRequest.transName = this.trnName;
let userId = window.sessionStorage.userId
trndocRequest.userId = !!userId ? userId : 'ZL'
return trndocRequest;
},
async processTrndoc() {
//组数据,发post请求
const loading = this.loading("正在请求数据")
let rulePath = "/service/docpan/assertTrndoc";
let trndocRequest = this.buildTrndocRequest();
let rtnmsg = await Api.post(rulePath, trndocRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.docpan, rtnmsg.data);
}
loading.close();
async processTrndoc() {
//组数据,发post请求
const loading = this.loading('正在请求数据')
let rulePath = '/service/docpan/assertTrndoc';
let trndocRequest = this.buildTrndocRequest();
let rtnmsg = await Api.post(rulePath, trndocRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.docpan, rtnmsg.data);
}
loading.close();
}
}
\ No newline at end of file
import LiaallRequest from "../model/LiaallRequest.js";
import Api from "~/service/Api";
import Utils from "~/utils";
import LiaallRequest from '../model/LiaallRequest.js';
import Api from '~/service/Api';
import Utils from '~/utils';
export default {
buildPtspta(ptsptaObj) {
let ptspta = {};
let pts = ptsptaObj.pts;
let adr = ptsptaObj.adr;
ptspta.rol=pts.rol;
ptspta.name=pts.nam;
ptspta.ptyinr=pts.ptyinr;
ptspta.ptainr=pts.ptainr;
ptspta.extkey=pts.extkey;
ptspta.dftdsp=pts.dftdsp;
ptspta.dftcur=pts.dftcur;
ptspta.dftact=pts.dftact;
ptspta.dftfeecur=pts.dftfeecur;
ptspta.dftactptainr=pts.dftactptainr;
ptspta.glggrpflg=pts.glggrpflg;
ptspta.adrblk=pts.adrblk;
return ptspta;
},
buildLiaallRequest() {
let liaallRequest = new LiaallRequest().data;
let rec = {};
let cbsMap = {};
if (this.trnName === "litopn") {
rec.objtyp = "LID";
rec.ownref = this.model.lidgrp.rec.ownref;
rec.opndat = this.model.lidgrp.rec.opndat;
rec.branchInr = this.model.lidgrp.rec.branchinr;
liaallRequest.rec = rec;
buildPtspta(ptsptaObj) {
let ptspta = {};
let pts = ptsptaObj.pts;
ptspta.rol = pts.rol;
ptspta.name = pts.nam;
ptspta.ptyinr = pts.ptyinr;
ptspta.ptainr = pts.ptainr;
ptspta.extkey = pts.extkey;
ptspta.dftdsp = pts.dftdsp;
ptspta.dftcur = pts.dftcur;
ptspta.dftact = pts.dftact;
ptspta.dftfeecur = pts.dftfeecur;
ptspta.dftactptainr = pts.dftactptainr;
ptspta.glggrpflg = pts.glggrpflg;
ptspta.adrblk = pts.adrblk;
return ptspta;
},
// 处理Litopn数据
buildLiaccvLitopn () {
let liaallRequest = new LiaallRequest().data;
let rec = {};
let cbsMap = {};
rec.objtyp = 'LID';
rec.ownref = this.model.lidgrp.rec.ownref;
rec.opndat = this.model.lidgrp.rec.opndat;
rec.branchInr = this.model.lidgrp.rec.branchinr;
liaallRequest.rec = rec;
cbsMap.NOM1 = {
"cur":this.model.lidgrp.cbs.nom1.cur,
"amt":this.model.lidgrp.cbs.nom1.amt,
};
cbsMap.NOM1 = {
'cur':this.model.lidgrp.cbs.nom1.cur,
'amt':this.model.lidgrp.cbs.nom1.amt,
};
cbsMap.OPN1 = {};
cbsMap.OPN2 = {
"cur":this.model.lidgrp.cbs.opn2.cur,
"amt":this.model.lidgrp.cbs.opn2.amt,
};
cbsMap.OPN1 = {};
cbsMap.OPN2 = {
'cur':this.model.lidgrp.cbs.opn2.cur,
'amt':this.model.lidgrp.cbs.opn2.amt,
};
cbsMap.MAX = {
"cur":this.model.lidgrp.cbs.max.cur,
"amt":this.model.lidgrp.cbs.max.amt,
};
cbsMap.MAX = {
'cur':this.model.lidgrp.cbs.max.cur,
'amt':this.model.lidgrp.cbs.max.amt,
};
cbsMap.MAX2 = {
"cur":this.model.lidgrp.cbs.max2.cur,
"amt":this.model.lidgrp.cbs.max2.amt,
};
cbsMap.MAX2 = {
'cur':this.model.lidgrp.cbs.max2.cur,
'amt':this.model.lidgrp.cbs.max2.amt,
};
liaallRequest.cbsMap = cbsMap;
liaallRequest.cbsMap = cbsMap;
let ptsptaList = [];
if (this.model.lidgrp.apl.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.apl));
}
if (this.model.lidgrp.adv.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.adv));
}
if (this.model.lidgrp.ben.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.ben));
}
liaallRequest.ptsList = ptsptaList;
} else if (this.trnName === "gitopn") {
rec.objtyp = "GID";
rec.ownref = this.model.gidgrp.rec.ownref;
rec.opndat = this.model.gidgrp.rec.opndat;
rec.expdat = this.model.gidgrp.rec.expdat;
rec.branchInr = this.model.gidgrp.rec.branchinr;
rec.hndtyp = this.model.gidgrp.rec.hndtyp;
rec.gartyp = this.model.gidgrp.rec.gartyp;
rec.fingua = this.model.gidgrp.rec.fingua;
rec.segtyp = this.model.gidgrp.ghd.segtyp;
rec.fromflg = this.model.gidgrp.rec.fromflg;
rec.othersno= this.model.gidgrp.rec.othersno;
rec.sndto = this.model.gidgrp.rec.sndto;
rec.swiftflg = this.model.gitp.swiftflg;
rec.giduil = this.model.gidgrp.rec.giduil;
rec.purpos = this.model.gidgrp.rec.purpos;
rec.revflg = this.model.gidgrp.rec.revflg;
rec.cnfsta = this.model.gidgrp.rec.cnfsta;
liaallRequest.rec = rec;
cbsMap.MAX = this.model.gidgrp.cbs.max;
cbsMap.OPN1 = this.model.gidgrp.cbs.opn1;
cbsMap.MAC = this.model.gidgrp.cbs.mac;
cbsMap.MAC2 = this.model.gidgrp.cbs.mac2;
cbsMap.OPC2 = this.model.gidgrp.cbs.opc2;
cbsMap.CNF = this.model.gidgrp.cbs.cnf;
liaallRequest.cbsMap = cbsMap;
let ptsptaList = [];
if (this.model.lidgrp.apl.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.apl));
}
if (this.model.lidgrp.adv.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.adv));
}
if (this.model.lidgrp.ben.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.lidgrp.ben));
}
liaallRequest.ptsList = ptsptaList;
return liaallRequest;
},
// 处理Gitopn数据
buildLiaccvGitopn () {
let liaallRequest = new LiaallRequest().data;
let rec = {};
let cbsMap = {};
rec.objtyp = 'GID';
rec.ownref = this.model.gidgrp.rec.ownref;
rec.opndat = this.model.gidgrp.rec.opndat;
rec.expdat = this.model.gidgrp.rec.expdat;
rec.branchInr = this.model.gidgrp.rec.branchinr;
rec.hndtyp = this.model.gidgrp.rec.hndtyp;
rec.gartyp = this.model.gidgrp.rec.gartyp;
rec.fingua = this.model.gidgrp.rec.fingua;
rec.segtyp = this.model.gidgrp.ghd.segtyp;
rec.fromflg = this.model.gidgrp.rec.fromflg;
rec.othersno= this.model.gidgrp.rec.othersno;
rec.sndto = this.model.gidgrp.rec.sndto;
rec.swiftflg = this.model.gitp.swiftflg;
rec.giduil = this.model.gidgrp.rec.giduil;
rec.purpos = this.model.gidgrp.rec.purpos;
rec.revflg = this.model.gidgrp.rec.revflg;
rec.cnfsta = this.model.gidgrp.rec.cnfsta;
liaallRequest.rec = rec;
let ptsptaList = [];
if (this.model.gidgrp.apl.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.apl));
}
if (this.model.gidgrp.adv.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.adv));
}
if (this.model.gidgrp.ben.pts.extkey !== "") {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.ben));
}
liaallRequest.ptsList = ptsptaList;
}
liaallRequest.transName = this.trnName;
if (!!window.sessionStorage.userId) {
liaallRequest.userId = window.sessionStorage.userId;
} else {
liaallRequest.userId = "ZL";
}
liaallRequest.liaallg = this.model.liaall.liaallg;
return liaallRequest;
},
cbsMap.MAX = this.model.gidgrp.cbs.max;
cbsMap.OPN1 = this.model.gidgrp.cbs.opn1;
cbsMap.MAC = this.model.gidgrp.cbs.mac;
cbsMap.MAC2 = this.model.gidgrp.cbs.mac2;
cbsMap.OPC2 = this.model.gidgrp.cbs.opc2;
cbsMap.CNF = this.model.gidgrp.cbs.cnf;
liaallRequest.cbsMap = cbsMap;
async processLiaall() {
//组数据,发post请求
const loading = this.loading("正在请求数据")
let rulePath = "/service/liaall/assertLiaall";
let liaallRequest = this.buildLiaallRequest();
let rtnmsg = await Api.post(rulePath, liaallRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.liaall, rtnmsg.data);
}
loading.close();
let ptsptaList = [];
if (this.model.gidgrp.apl.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.apl));
}
if (this.model.gidgrp.adv.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.adv));
}
if (this.model.gidgrp.ben.pts.extkey !== '') {
ptsptaList.push(this.buildPtspta(this.model.gidgrp.ben));
}
liaallRequest.ptsList = ptsptaList;
return liaallRequest
},
// 整合各交易的数据
buildLiaallRequest() {
let liaallRequest = new LiaallRequest().data;
switch (this.trnName) {
case 'litopn':
liaallRequest = this.buildLiaccvLitopn()
break
case 'gitopn':
liaallRequest = this.buildLiaccvGitopn()
break
default:
return
}
liaallRequest.liaallg = this.model.liaall.liaallg;
liaallRequest.transName = this.trnName;
let userId = window.sessionStorage.userId
liaallRequest.userId = !!userId ? userId : 'ZL'
return liaallRequest;
},
async processLiaall() {
//组数据,发post请求
const loading = this.loading('正在请求数据')
let rulePath = '/service/liaall/assertLiaall';
let liaallRequest = this.buildLiaallRequest();
let rtnmsg = await Api.post(rulePath, liaallRequest);
if (rtnmsg.respCode == SUCCESS) {
Utils.copyValueFromVO(this.model.liaall, rtnmsg.data);
}
loading.close();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment