index.js 2.45 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 Utils from "~/utils";
import Pts from '~/components/business/commonModel/Pts';
export default {
	mixins: [commonFunctions],
	methods: {
		//索赔编号
		queryOwnref () {
			let params = this.model.ncdgrp.rec
			if (!this.model.ncdgrp.ben.pts.ptainr) {
				return
			}
			let ptainr = this.model.ncdgrp.ben.pts.ptainr;
			const loading = this.loading();
			Api.post(`/business/ref/ncd?ptaInr=${ptainr}`, params).then(res => {
				loading.close();
				if (res.respCode == SUCCESS) {
					this.model.ncdgrp.rec.ownref = res.data;
				}
			}).catch(() => {
				loading.close();
			});
		},
		clearPresentdet() {
			if (this.model.ncdgrp.rec.demstat != "INCP") {
				this.model.ncdgrp.blk.presentdet = "";
			}
		},
		changeMaxamt(){
			if(this.model.ncdgrp.cbs.max.amt=='' || this.model.ncdgrp.cbs.max.amt=='0'){
				this.model.ncdgrp.cbs.max.amt = this.model.nidgrp.cbs.max.amt;
			}
			this.calcName();
		},
		//向索人--"ncdgrp.rec.payrol"
		calcOth() {
			switch (this.model.ncdgrp.rec.payrol) {
				case "APL":
					Utils.copyValueFromVoData(this.model.ncdgrp.oth.pts, this.model.nidgrp.apl.pts);
					this.model.ncdgrp.oth.pts.rol = "OTH";
					break;
				case "ADA":
					Utils.copyValueFromVoData(this.model.ncdgrp.oth.pts, this.model.nidgrp.ada.pts);
					this.model.ncdgrp.oth.pts.rol = "OTH";
					break;
				case "ISS":
					Utils.copyValueFromVoData(this.model.ncdgrp.oth.pts, this.model.ncdgrp.iss.pts);
					this.model.ncdgrp.oth.pts.rol = "OTH";
					break;
				case "OTH":
					this.model.ncdgrp.oth.pts = new Pts().data;
					this.model.ncdgrp.oth.pts.rol = "OTH";
					break;
			}
		},
		//索赔当事人--"ncdgrp.rec.docprbrol"
		calcPrb() {
			console.log("this.model.ncdgrp.rec.docprbrol-->" + this.model.ncdgrp.rec.docprbrol);
			switch (this.model.ncdgrp.rec.docprbrol) {
				case "BEN":
					Utils.copyValueFromVoData(this.model.ncdgrp.prb.pts, this.model.nidgrp.ben.pts);
					this.model.ncdgrp.prb.pts.rol = "PRB";
					break;
				case "ATB":
					Utils.copyValueFromVoData(this.model.ncdgrp.prb.pts, this.model.nidgrp.atb.pts);
					this.model.ncdgrp.prb.pts.rol = "PRB";
					break;
				case "AT2":
					Utils.copyValueFromVoData(this.model.ncdgrp.prb.pts, this.model.nidgrp.at2.pts);
					this.model.ncdgrp.prb.pts.rol = "PRB";
					break;
				default:
					this.model.ncdgrp.prb.pts = new Pts().data;
					this.model.ncdgrp.prb.pts.rol = "PRB";
					break;
			}
		},
	},
};