index.js 2.2 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
import commonFunctions from '~/mixin/commonFunctions.js';
import moment from 'moment';
import Utils from "~/utils/index";
import Pts from '~/components/business/commonModel/Pts';
import Api from "~/service/Api";
export default {
	mixins: [commonFunctions],
	methods: {
        //获取卖方信用证单据编号
        async onBftpButgetref() {
          let CR = "\n";
          let ptainr = this.model.dedgrp.ben.pts.ptainr;
          let ownref = this.model.bfdgrp.rec.ownref;
          let trnName = "BFTSND"
          const loading = this.loading();
          let res = await Api.post(`/Domlc/ref/bfd?ptaInr=${ptainr}&ownref=${ownref}&trnName=${trnName}`);
          loading.close();
          if (res.respCode == SUCCESS) {
            this.model.bfdgrp.rec.ownref = res.data;
            this.model.bfdgrp.blk.setinsbe = this.model.bfdgrp.blk.setinsbe + CR + "        我行业务编号:" + this.model.bfdgrp.rec.ownref +"  " + "国内信用证收汇";
          } else {
            this.$message.error(res.respMsg);
          }
        },
        calcPrb() {
          let ptsref = this.model.bfdgrp.prb.pts.ref;
          switch (this.model.bfdgrp.rec.docprbrol) {
            case "BEN":
              Utils.copyValueFromVoData(this.model.bfdgrp.prb.pts, this.model.dedgrp.ben.pts);
              this.model.bfdgrp.prb.rol = "PRB";
              this.model.bfdgrp.prb.pts.rol = "PRB";
              this.model.bfdgrp.prb.pts.extkey = this.model.dedgrp.ben.pts.extkey;
              this.model.bfdgrp.prb.pts.cnnam = this.model.dedgrp.ben.pts.cnnam;
              this.model.bfdgrp.prb.pts.cnadr = this.model.dedgrp.ben.pts.cnadr;
              break;
            case "PRB":
              this.model.bfdgrp.prb.pts = new Pts().data;
              this.model.bfdgrp.prb.rol = "PRB";
              this.model.bfdgrp.prb.pts.rol = "PRB";
              break;
          }
          if(ptsref!=""){
            this.model.bfdgrp.prb.pts.ref = ptsref;
          }
        },
        Defaultopn1(){
					this.model.bfdgrp.cbs.opn1.amt = this.model.bfdgrp.cbs.max.amt;
					this.model.imgInvmod.docamt = this.model.bfdgrp.cbs.max.amt
        },
        Onorddat(){
          this.model.bfdgrp.rec.predat =this.model.bfdgrp.rec.orddat;
        }
	}
}