index.js 4.41 KB
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import Utils from "~/utils/index";
export default {
  mixins: [commonFunctions],
  methods: {
    // 获取业务编号
    async getOwnref(){
      if (this.model.cpdgrp.rec.cptrou == "") {
        this.$notify.error({ title: '错误', message: '请先选择邮路!' });
				return;
      }
      if (this.model.cpdgrp.pye.pts.ptainr == "") {
        this.$notify.error({ title: '错误', message: '请先选择收款人!' });
				return;
      }
      let params = {
        ownref: this.model.cpdgrp.rec.ownref,
        ptainr: this.model.cpdgrp.pye.pts.ptainr,
			}
			const loading = this.loading();
      let res = await Api.post(`/${this.moduleRouter()}/zptadv/getRef`, params);
      loading.close();
			if (res.respCode === SUCCESS) {
				this.model.cpdgrp.rec.ownref = res.data;
			} else {
        this.$message.error(res.respMsg);
      }
    },
    change2112(e) {
      if (e === undefined) {
        return
      }
      this.model.rmbbop.rmb2112.rmbflg = this.model.rmbbop.rmb2101.rmbflg;
    },
    changeIskjxdrz(e) {
      if (e === undefined) {
        return
      }
      this.model.rmbbop.rmb2108.rmbflg = this.model.rmbbop.rmb2108.iskjxdrz != 'X' ? '2' : '1';
    },
    getUetr() {
      if (this.model.cptp.openuetr == 'Y') {
        let sysno = this.model.cpdgrp.rec.sysno;
        let swftyp = this.model.cpdgrp.rec.swftyp;
        let isoType = this.model.cptp.isomsgtyp;
        if (!this.model.cpdgrp.rec.sysno||!this.model.cpdgrp.rec.swftyp) {
          this.$notify.error({ title: '错误', message: '请先填写清算编号、报文类型!' });
          return
        }
        const loading = this.loading();
        Api.post(`/${this.moduleRouter()}/zptadv/uetr?sysno=${sysno}&swftyp=${swftyp}&isoType=${isoType}`).then(res => {
          loading.close();
          if (res.respCode == SUCCESS) {
            if(res.data){
              this.model.cpdgrp.rec.uetr = res.data;
              this.model.cptp.uetr = res.data;
            }
          } else {
            this.$notify({
              title: "失败",
              message: "获取失败。" + res.respMsg,
              type: "error",
            });
          }
        }).catch(() => {
          loading.close();
        });
      } else {
        this.$notify({
          title: "失败",
          message: "接口未开",
          type: "error",
        });
      }
    },
    swftypChange(){
      this.model.cptp.uetr = "";
    },
    feetypChange(){
      // this.model.cpdgrp.rec.curf33b = "";
      // this.model.cpdgrp.rec.amtf33b = "";
      // this.model.cpdgrp.rec.cur71f = "";
      // this.model.cpdgrp.rec.amt71f = "";
      // this.model.cpdgrp.rec.f36 = "";
      if(this.model.cpdgrp.rec.detchgcod!= '' && (this.model.cpdgrp.rec.detchgcod=='OUR'||this.model.cpdgrp.rec.detchgcod=='DEBT')){
        this.model.cpdgrp.rec.chato = 'B';
      }else{
        this.model.cpdgrp.rec.chato = 'U';
      }
    },
    jnwbSwftyp(){
      this.model.attp.ywlxdm = "";
      this.model.attp.bustyp = "";
    },
    // 事件 -- 汇款人常驻国家/地区代码
    draweecountcodeChange() {
      if (this.model.cptp.draweecountcode != '') {
        this.model.cpdgrp.rec.orcctycod = this.model.cptp.draweecountcode;
      }
    },
    manbodChange(){
      if(this.model.cpdgrp.rec.cptrou == 'HNHZ' && this.model.cpdgrp.rec.manbod =="0" && this.model.cpdgrp.cbs.nom1.cur == 'CNY'){
        this.model.cpdgrp.cbs.nom1.cur = '';
        this.model.cpdgrp.cbs.nom1.amt = '';
      }
    },
    // Pyeact输入框失焦
		// handlePyeactBlur (e) {
		// 	let pyeact = this.model.cpdgrp.rec.pyeact;
		// 	if (pyeact && pyeact !== this.markPyeact) {
		// 		this.searchPyeact()
		// 	}
		// },
    // searchPyeact(){
    //   let pyeact = this.model.cpdgrp.rec.pyeact;
    //   const loading = this.loading();
    //     Api.post(`/${this.moduleRouter()}/zptadv/searchPtyByAct?actExtkey=${pyeact}`).then(res => {
    //       loading.close();
    //       if (res.respCode == SUCCESS) {
    //         this.markPyeact = res.data;
    //         this.model.cpdgrp.rec.apl.pts.extkey;
    //       } else {
    //         this.$notify({
    //           title: "失败",
    //           message: "没有查找到收款人账号对应的客户信息!",
    //           type: "error",
    //         });
    //       }
    //     }).catch(() => {
    //       loading.close();
    //     });
    // },
  }
}