index.js 2.27 KB
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
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="";
			}
		}
	}
}