Commit ef3be540 by 李少勇

公共组件内的方法整理

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