default.js 8.13 KB
import commonFunctions from '~/mixin/commonFunctions.js';
import Api from '~/service/Api';
import Utils from '~/utils';
import moment from "moment";
export default {
  mixins: [commonFunctions],
  methods: {
    //初始化调用
    getRolList () {
      let docprbrolList = [];
      if (this.model.nidgrp.ben.pts.ptainr != "") {
        var benobj = {};
        benobj.label = "受益人(BEN)";
        benobj.value = this.model.nidgrp.ben.pts.rol;
        docprbrolList.push(benobj);
      }
      if (this.model.nidgrp.atb.pts.ptainr != "") {
        var atbobj = {};
        atbobj.label = "1st Adv. thr. Bank(ATB)";
        atbobj.value = this.model.nidgrp.atb.pts.rol;
        docprbrolList.push(atbobj);
      }
      if (this.model.nidgrp.at2.pts.ptainr != "") {
        var at2obj = {};
        at2obj.label = "1st Adv. thr. Bank(AT2)";
        at2obj.value = this.model.nidgrp.at2.pts.rol;
        docprbrolList.push(at2obj);
      }
      if (this.model.nidgrp.adv.pts.ptainr != "") {
        var advobj = {};
        advobj.label = "通知行(ADV)";
        advobj.value = this.model.nidgrp.adv.pts.rol;
        docprbrolList.push(advobj);
      }
      if (this.model.nidgrp.iss.pts.ptainr != "" && this.model.nidgrp.rec.hndtyp == "OC") {
        var issobj = {};
        issobj.label = "转开行(ISS)";
        issobj.value = this.model.nidgrp.iss.pts.rol;
        docprbrolList.push(issobj);
      }
      var prbobj = {};
      prbobj.label = "其他交单人(PRB)";
      prbobj.value = "PRB";
      docprbrolList.push(prbobj);
      this.$set(this.codes, 'docprbrolList', docprbrolList);
      if (this.model.ncdgrp.rec.docprbrol == "") {
        if (this.model.nidgrp.iss.pts.ptainr != "") {
          this.model.ncdgrp.rec.docprbrol = "ISS";
        }
        else if (this.model.nidgrp.adv.pts.ptainr != "") {
          this.model.ncdgrp.rec.docprbrol = "ADV";
        }
        else if (this.model.nidgrp.atb.pts.ptainr != "") {
          this.model.ncdgrp.rec.docprbrol = "ATB";
        }
        else if (this.model.nidgrp.ben.pts.ptainr != "") {
          this.model.ncdgrp.rec.docprbrol = "BEN";
        }
        this.calcPrb();
      }

      //------------payrolList-------------------
      //----BEN 、ISS、ATB、AT2、OWN 除外---
      // if (this.model.nidgrp.ada.pts.ptainr != "") {
      // 	var adaobj = new Object();
      // 	adaobj.label = "Adv.Bank APL Side(ADA)";
      // 	adaobj.value = this.model.nidgrp.ada.pts.rol;
      // 	payrolList.push(adaobj);
      // }
      // if (this.model.nidgrp.adv.pts.ptainr != "") {
      // 	var advobj2 = new Object();
      // 	advobj2.label = "通知行(ADV)";
      // 	advobj2.value = this.model.nidgrp.adv.pts.rol;
      // 	payrolList.push(advobj2);
      // }
      let payrolList = [];
      if (this.model.nidgrp.apl.pts.ptainr != "") {
        var aplobj = {};
        aplobj.label = "申请人(APL)";
        aplobj.value = this.model.nidgrp.apl.pts.rol;
        payrolList.push(aplobj);
      }
      if (this.model.nidgrp.iss.pts.ptainr != "" && this.model.nidgrp.rec.hndtyp == "OT") {
        var issobj = {};
        issobj.label = "反担保行(ISS)";
        issobj.value = this.model.nidgrp.iss.pts.rol;
        payrolList.push(issobj);
      }
      var othobj = {};
      othobj.label = "其他赔付人(OTH)";
      othobj.value = "OTH";
      payrolList.push(othobj);
      this.$set(this.codes, 'payrolList', payrolList);
      if (this.model.ncdgrp.rec.payrol == "") {
        if (this.model.nidgrp.iss.pts.ptainr != "" && this.model.nidgrp.rec.hndtyp == "OT") {
          this.model.ncdgrp.rec.payrol = "ISS";
        }
        if (this.model.nidgrp.ada.pts.ptainr != "") {
          this.model.ncdgrp.rec.payrol = "ADA";
        }
        else if (this.model.nidgrp.apl.pts.ptainr != "") {
          this.model.ncdgrp.rec.payrol = "APL";
        }
        this.calcOth();
      }


    },
    ncdgrpOthRefBlur () {
      if (this.model.ncdgrp.rec.payrol == "APL") {
        this.model.ncdgrp.apl.pts.ref = this.model.ncdgrp.oth.pts.ref;
      }
    },
    changeRmbflg () {
      if (this.isInDisplay) {
        return;
      }
      //2111 控制
      if (this.model.spt.inr) {
      } else {
        if (this.model.nidgrp.cbs.max.cur == "CNY") {
          if (this.model.nidgrp.rec.fingua == "Y") {
            this.model.rmbbop.rmb2111.rmbflg = "1";
          } else {
            //          if(!this.model.rmbbop.rmb2111.modifySet.includes('rmbflg')) {
            this.model.rmbbop.rmb2111.rmbflg = "2";
            //          }
          }
        }
        //        else if(this.model.nidgrp.cbs.max.cur != "" && this.model.nidgrp.cbs.max.cur != "CNY") {
        //         if(this.model.nidgrp.rec.fingua == "Y") {
        //           this.model.rmbbop.rmb2111.rmbflg = "";
        //         } else {
        // //          if(!this.model.rmbbop.rmb2111.modifySet.includes('rmbflg')) {
        //           this.model.rmbbop.rmb2111.rmbflg = "2";
        // //          }
        //         }
        //       }
        else {
          this.model.rmbbop.rmb2111.rmbflg = "2";
        }
      }

      if (this.model.spt.inr) {
      } else {
        //2123 控制
        let cfatyp = this.model.nidgrp.rec.cfaguatyp;
        if (cfatyp != null && cfatyp != "") {
          cfatyp = cfatyp.slice(0, 2);
        }
        if (this.model.nidgrp.cbs.max.cur == "CNY") {
          if (this.model.nidgrp.rec.opndat < moment("2022-09-01")) {
            this.model.rmbbop.rmb2123.rmbflg = "2";
          } else if (this.model.nidgrp.rec.fingua == "Y") {
            this.model.rmbbop.rmb2123.rmbflg = "1";
          } else {
            this.model.rmbbop.rmb2123.rmbflg = "2";
          }
        } else if (this.model.nidgrp.cbs.max.cur != "" && this.model.nidgrp.cbs.max.cur != "CNY") {
          if (this.model.nidgrp.rec.opndat < moment("2022-09-01")) {
            this.model.rmbbop.rmb2123.rmbflg = "2";
          } else if (this.model.nidgrp.rec.fingua == "Y" && cfatyp == '11') {
            this.model.rmbbop.rmb2123.rmbflg = "1";
          } else {
            this.model.rmbbop.rmb2123.rmbflg = "2";
          }
        } else {
          this.model.rmbbop.rmb2123.rmbflg = "2";
        }
      }
    },
    ClsflgDefault () {
      if (this.$route.query.businessInr) {
        return;
      }
      if (((this.model.setmod.docamt == this.model.ncdgrp.cbs.opn1.amt + this.model.ncdgrp.cbs.opn2.amt) || (this.model.paypsb == ""))
        && Number(this.model.ncdgrp.cbs.opn1.amt) == Number(this.model.ncdgrp.cbs.max.amt)) {
        this.model.clsflg = "C"
      } else {
        this.model.clsflg = "O"
      }
    },
    transOrderDefault () {
      //this.model.transOrderVo.kfr = "国结系统结算款项";
      this.model.transOrderVo.qxr = new Date();
    },
    async defaultCipmod () {
      let bchswf = '';
      let bchnam = '';
      let lhanum = '';
      let lhanam = '';
      const loading = this.loading();
      let params = {
        transName: "nitset",
        userId: window.sessionStorage.userId ? window.sessionStorage.userId : '742549',
        branchinr: this.model.nidgrp.rec.branchinr
      };
      let res = await Api.post('/business/gitset/getCipmodBranch', params);
      loading.close();
      if (res.respCode === SUCCESS) {
        let data = res.data;
        if (data != null) {
          bchswf = data.bchswf;
          bchnam = data.bchnam;
          lhanum = data.lhanum;
          lhanam = data.lhanam;
        }
      }
      this.model.cipmodVo.staonebch = "EVERCNBJXXX";
      this.model.cipmodVo.staonebchnam = "中国光大银行股份有限公司";
      this.model.cipmodVo.dafnmc = "国结系统结算款项";
      this.model.cipmodVo.fkrkhh = bchswf;
      this.model.cipmodVo.fukrhm = bchnam;
      this.model.cipmodVo.fkhkhh = bchswf;
      this.model.cipmodVo.fkkhmc = bchnam;
      this.model.cipmodVo.dddbsh = this.model.nidgrp.rec.ownref;
      //this.model.cipmodVo.fkkhzh = this.model.cipmodVo.dafnzh
      this.model.transOrderVo.fkhnam = lhanam;
      this.model.transOrderVo.fkhnum = lhanum;
      this.model.cipmodVo.ddbhao = 'NA';
      this.model.cipmodVo.ddmisu = 'NA'
    },

    calActualMax () {
      this.model.actualMax = Number(this.model.ncdgrp.cbs.opn1.amt)
    },
  }

}
//你可以添加自动default处理