import GlentryRequest from '../model/GlentryRequest.js'; import Api from '~/service/Api'; export default { 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数据 buildGlentryLitopn () { let glentryRequest = new GlentryRequest().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; glentryRequest.rec = rec; 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.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, }; glentryRequest.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)); } glentryRequest.ptsList = ptsptaList; return glentryRequest; }, // 处理Gitopn数据 buildGlentryGitopn () { let glentryRequest = new GlentryRequest().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; glentryRequest.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; glentryRequest.cbsMap = cbsMap; 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)); } glentryRequest.ptsList = ptsptaList; return glentryRequest }, // 整合各交易的数据 buildGlentryRequest() { let glentryRequest = new GlentryRequest().data; switch (this.trnName) { case 'litopn': glentryRequest = this.buildGlentryLitopn() break case 'gitopn': glentryRequest = this.buildGlentryGitopn() break default: return } glentryRequest.liaallg = this.model.liaall.liaallg; glentryRequest.setfog = this.model.setmod.setfog; glentryRequest.setfeg = this.model.setmod.setfeg; glentryRequest.setglg = this.model.setmod.setglg; glentryRequest.transName = this.trnName; let userId = window.sessionStorage.userId glentryRequest.userId = !!userId ? userId : 'ZL' return glentryRequest; }, async processGlentry() { //组数据,发post请求 const loading = this.loading('正在请求数据') let rulePath = '/service/gle/assertGle'; let glentryRequest = this.buildGlentryRequest(); let rtnmsg = await Api.post(rulePath, glentryRequest); if (rtnmsg.respCode == SUCCESS) { this.model.setmod.glemod.gleshwstm = rtnmsg.data.gleshwstm; } loading.close(); } }