import Api from '~/service/Api'; import commonFunctions from '~/mixin/commonFunctions.js'; import Pts from '~/components/business/commonModel/Pts'; import Utils from "~/utils/index"; import BigNumber from "bignumber.js"; export default { mixins: [commonFunctions], methods: { calcPrb() { let ptsref = this.model.bddgrp.prb.pts.ref; switch (this.model.bddgrp.rec.docprbrol) { case "ADV": Utils.copyValueFromVoData(this.model.bddgrp.prb.pts, this.model.didgrp.adv.pts); this.model.bddgrp.prb.pts.rol = "PRB"; break; case "BEN": Utils.copyValueFromVoData(this.model.bddgrp.prb.pts, this.model.didgrp.ben.pts); this.model.bddgrp.prb.pts.rol = "PRB"; this.model.bddgrp.prb.pts.bankno = this.model.didgrp.beb.pts.bankno; this.model.bddgrp.prb.pts.jigomc = this.model.didgrp.beb.pts.jigomc; this.model.bddgrp.prb.pts.dizhii = this.model.didgrp.beb.pts.dizhii; break; case "PRB": this.model.bddgrp.prb.pts = new Pts().data; this.model.bddgrp.prb.pts.rol = "PRB"; break; } if(ptsref!=""){ this.model.bddgrp.prb.pts.ref = ptsref; } }, frepayflgChange(){ if(this.model.bddgrp.rec.frepayflg=="X"){ this.model.setmod.redamt = this.model.setmod.docamt; this.model.paypsb=""; } else{ this.model.setmod.redamt =0; } this.setamtDefault(); }, clrmtdChange(){ if(this.model.bddgrp.rec.clrmtd=="ONLN"){ this.model.fkfs=""; } }, clsflgDefault(){ if(new BigNumber(this.model.bddgrp.cbs.max.amt).minus(new BigNumber(this.model.setmod.docamt))==0){ if(this.model.paypsb!="X"){ this.model.clsflg="X"; //this.getDidclsflg(); } }else{ this.model.clsflg=""; } }, docamtChange(){ if(this.model.bddgrp.rec.frepayflg=="X"){ this.model.setmod.setamt =0; this.model.setmod.redamt = new BigNumber(this.model.setmod.docamt); } else{ this.model.setmod.setamt = new BigNumber(this.model.setmod.docamt).minus(new BigNumber(this.model.setmod.redamt)); } this.cdwfamtDefault(); this.clsflgDefault(); }, redamtChange(){ this.setamtDefault(); }, didclsflgChange(){ if(this.model.didclsflg==""){ this.model.rejhnd=""; this.model.byinst=""; this.model.strinf=""; this.model.didgrp.blk.canrsn=""; } } } }