index.js 1.36 KB
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import Utils from "~/utils/index";
import Pts from '~/components/business/commonModel/Pts';
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;
				default:
					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;
			}
		},
		invamtChange(){
			this.root.$refs["modelForm"].validateField([`bddgrp.cbs.max.amt`]);
		},
		maxamtChange() {
			this.root.$refs["modelForm"].validateField([`bddgrp.rec.invamt`]);
		},
	}
}