default.js 2.03 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
import commonFunctions from '~/mixin/commonFunctions.js';
import Api from '~/service/Api';
import moment from 'moment';
import commonDepend from "~/mixin/commonDepend";
export default {
	mixins: [commonFunctions, commonDepend],
	methods: {
		getDocprbrolList() {
			let docprbrolList = []
			if (this.model.didgrp.ben.pts.ptainr != "") {
				var benobj = new Object();
				benobj.label = "Beneficiary";
				benobj.value = this.model.didgrp.ben.pts.rol;
				docprbrolList.push(benobj);
			}
			if (this.model.didgrp.adv.pts.bankno != "") {
				var advobj = new Object();
				advobj.label = "Advising Bank";
				advobj.value = this.model.didgrp.adv.pts.rol;
				docprbrolList.push(advobj);
			}
			var prbobj = new Object();
			prbobj.label = "Presenter(PRB)";
			prbobj.value = "PRB";
			docprbrolList.push(prbobj);
			this.$set(this.codes, 'docprbrolList', docprbrolList)
			if (this.model.bddgrp.rec.docprbrol == "") {
				if (this.model.didgrp.adv.pts.bankno != "") {
					this.model.bddgrp.rec.docprbrol = "PRB";
				} else{
					this.model.bddgrp.rec.docprbrol = "BEN";
				}
				if(this.model.spt&&this.model.spt.channel=="ELC"){
					if(this.model.bddgrp.prb.pts.bankno==""){
						this.calcPrb();
					}
				}
				else{
					this.calcPrb();
				}
			}
		},
		rcvdatDefault(){
			if(this.model.bddgrp.rec.rcvdat==""||this.model.bddgrp.rec.rcvdat==null){
				this.model.bddgrp.rec.rcvdat=moment(new Date()).format("YYYY-MM-DD");
			}
		},
		orimsgtypDefault(){
			let orimsgtypList = [{label:"elcs.201.001.02 寄单索款通知报文",value:"elcs.201.001.02"}]
			this.$set(this.codes, 'orimsgtypList', orimsgtypList);
		},
		matdatDefault(){
			if(this.model.bddgrp.rec.tenmaxday==""){
				this.model.bddgrp.rec.tenmaxday=0;
			}
			if(this.model.bddgrp.rec.matdat!=""&&this.model.bddgrp.rec.matdat!=null){
				this.model.bddgrp.rec.stadat = moment(this.model.bddgrp.rec.matdat).subtract(this.model.bddgrp.rec.tenmaxday, 'days').format('YYYY-MM-DD');
			}
		},
		//初始化发票核验
		invchk(){
			this.model.imgInvmod.docamt = this.model.bddgrp.cbs.max.amt
		}
	},
}