Commit 987c9c41 by chenwenbin

// 表外记账,费用账务,会计分录前后端联调

parent 4a1e42a7
import Api from '~/service/Api'; import Api from '~/service/Api';
import SetfegRequest from '../model/SetfegRequest.js'; import buildFn from '~/business/gitopn/event/buildCommons.js'
import SetglgRequest from '../model/SetglgRequest.js';
export default { 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;
},
// Setfeg关于Listopn的处理
buildSetfegLitopn () {
let setfegRequest = new SetfegRequest().data;
let rec = {};
let cbsMap = {};
rec.objtyp = 'LID';
rec.ownref = this.model.lidgrp.rec.ownref;
rec.opndat = this.model.lidgrp.rec.opndat;
rec.expdat = this.model.lidgrp.rec.expdat;
rec.branchInr = this.model.lidgrp.rec.branchinr;
setfegRequest.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,
};
setfegRequest.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));
}
setfegRequest.ptsList = ptsptaList;
return setfegRequest
},
// Setfeg关于Gitopn的处理
buildSetfegGitopn () {
let setfegRequest = new SetfegRequest().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;
setfegRequest.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;
setfegRequest.cbsMap = cbsMap;
let ptsptaList = []; async processSetpan(setfegRequest, fn) {
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));
}
setfegRequest.ptsList = ptsptaList;
return setfegRequest
},
// 处理Setfeg数据
buildSetfegRequest() {
let setfegRequest = new SetfegRequest().data;
switch (this.trnName) {
case 'litopn':
setfegRequest = this.buildSetfegLitopn()
setfegRequest.liaall = this.model.liaall;
setfegRequest.liaccv = this.model.liaccv;
break
case 'gitopn':
setfegRequest = this.buildSetfegGitopn()
setfegRequest.liaall = this.model.liaall;
setfegRequest.liaccv = this.model.liaccv;
break
default:
return
}
setfegRequest.doceot = this.model.trnmod.trndoc.doceot;
setfegRequest.transName = this.trnName;
let userId = window.sessionStorage.userId
setfegRequest.userId = !!userId ? userId : 'ZL'
return setfegRequest;
},
// 处理setglg数据
buildSetglgRequest() {
let setglgRequest = new SetglgRequest().data;
switch (this.trnName) {
case 'litopn':
setglgRequest = this.buildSetfegLitopn()
break
case 'gitopn':
setglgRequest = this.buildSetfegGitopn()
break
default:
return
}
setglgRequest.setfeg = this.model.setmod.setfeg;
setglgRequest.transName = this.trnName;
let userId = window.sessionStorage.userId
setglgRequest.userId = !!userId ? userId : 'ZL'
return setglgRequest;
},
async processSetpan() {
//组数据,发post请求
let loading = this.loading('正在请求试算费用'); let loading = this.loading('正在请求试算费用');
let rulePath = '/service/gid/setmod/calcSettleDetail'; let objtyp = setfegRequest.rec.objtyp;
let setfegRequest = this.buildSetfegRequest(); let rtnmsg = await Api.post(`/service/${ objtyp.toLowerCase() }/setmod/calcSettleDetail`, setfegRequest);
let rtnmsg = await Api.post(rulePath, setfegRequest); if (rtnmsg.respCode === SUCCESS) {
if (rtnmsg.respCode == SUCCESS) {
this.model.setmod.setfeg = rtnmsg.data.setfeg; this.model.setmod.setfeg = rtnmsg.data.setfeg;
this.model.setmod.ref = rtnmsg.data.ref; this.model.setmod.ref = rtnmsg.data.ref;
this.model.setmod.doccur = rtnmsg.data.doccur; this.model.setmod.doccur = rtnmsg.data.doccur;
this.model.setmod.docamt = rtnmsg.data.docamt; this.model.setmod.docamt = rtnmsg.data.docamt;
// 试算账务
if (this.model.setmod.setfeg.setfel.length > 0) { if (this.model.setmod.setfeg.setfel.length > 0) {
loading = this.loading('正在请求试算账务'); loading = this.loading('正在请求试算账务');
rulePath = '/service/gid/setmod/calcPayDetail'; let setglgRequestParams = fn()
let setglgRequest = this.buildSetglgRequest(); let res = await Api.post(`/service/${ objtyp.toLowerCase() }/setmod/calcPayDetail`, setglgRequestParams);
rtnmsg = await Api.post(rulePath, setglgRequest); if (res.respCode == SUCCESS) {
if (rtnmsg.respCode == SUCCESS) { this.model.setmod.setglg = res.data.setglg;
this.model.setmod.setglg = rtnmsg.data.setglg;
} }
} }
} }
...@@ -184,7 +29,7 @@ export default { ...@@ -184,7 +29,7 @@ export default {
let loading = this.loading('正在请求试算账务'); let loading = this.loading('正在请求试算账务');
let rulePath = '/service/gid/setmod/calcPayDetail'; let rulePath = '/service/gid/setmod/calcPayDetail';
let setglgRequest = this.buildSetglgRequest(); let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
let rtnmsg = await Api.post(rulePath, setglgRequest); let rtnmsg = await Api.post(rulePath, setglgRequest);
if (rtnmsg.respCode == SUCCESS) { if (rtnmsg.respCode == SUCCESS) {
this.model.setmod.setglg = rtnmsg.data.setglg; this.model.setmod.setglg = rtnmsg.data.setglg;
...@@ -196,12 +41,12 @@ export default { ...@@ -196,12 +41,12 @@ export default {
this.model.setmod.setglg.setgll = setgll; this.model.setmod.setglg.setgll = setgll;
let rulePath = '/service/gid/setmod/setgll/' + index + '/accts'; let rulePath = '/service/gid/setmod/setgll/' + index + '/accts';
let setglgRequest = this.buildSetglgRequest(); let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
setglgRequest.setglg.setgll = setgll; setglgRequest.setglg = {setgll: setgll};
let rtnmsg = await Api.post(rulePath, setglgRequest); let rtnmsg = await Api.post(rulePath, setglgRequest);
if (rtnmsg.respCode == SUCCESS) { if (rtnmsg.respCode == SUCCESS) {
this.model.setmod = rtnmsg.data; this.model.setmod.setglg = rtnmsg.data.setglg;
} }
} }
......
...@@ -156,9 +156,6 @@ export default { ...@@ -156,9 +156,6 @@ export default {
} }
} }
}, },
async calcPayDetailPro() {
this.calcPayDetail();
},
/** /**
* Tabs切换事件 * Tabs切换事件
* @param {VM} tab * @param {VM} tab
......
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