index.js 7.05 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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import Utils from "~/utils/index";
export default {
	mixins: [commonFunctions],
	methods: {
    // 事件 -- 结售汇性质
    waitypChange() {
      // 结汇
      if (this.model.jsdgrp.rec.maimpz == '4') {
        if (this.model.jsdgrp.rec.waityp == '1') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['110'];
        }
        if (this.model.jsdgrp.rec.waityp == '2') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['121', '122', '123', '124', '125', '126'];
        }
        if (this.model.jsdgrp.rec.waityp == '3') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['131', '132', '133'];
        }
        if (this.model.jsdgrp.rec.waityp == '5') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['210'];
        }
        if (this.model.jsdgrp.rec.waityp == '6') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['220', '221', '222', '223'];
        }
        if (this.model.jsdgrp.rec.waityp == '7') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['231', '232'];
        }
        if (this.model.jsdgrp.rec.waityp == '8') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['241', '250'];
        }
        if (this.model.jsdgrp.rec.waityp == '9') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['240', '270'];
        }
      }
      // 售汇
      if (this.model.jsdgrp.rec.maimpz == '5') {
        if (this.model.jsdgrp.rec.waityp == '1') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['310'];
        }
        if (this.model.jsdgrp.rec.waityp == '2') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['321', '322', '323', '324', '325', '326'];
        }
        if (this.model.jsdgrp.rec.waityp == '3') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['331', '332', '333'];
        }
        if (this.model.jsdgrp.rec.waityp == '5') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['410'];
        }
        if (this.model.jsdgrp.rec.waityp == '6') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['420', '421', '422', '423'];
        }
        if (this.model.jsdgrp.rec.waityp == '7') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['431', '432'];
        }
        if (this.model.jsdgrp.rec.waityp == '8') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['441', '450'];
        }
        if (this.model.jsdgrp.rec.waityp == '9') {
          // 码表 - 结售汇统计代码 
          this.waitjmFilterKey = ['440', '470'];
        }
      }
      this.model.jsdgrp.rec.waitjm = '';
      this.model.jsdgrp.rec.txcode = '';
      this.model.jsdgrp.rec.regno = '';
    },
    // 事件 -- 结售汇统计代码
    async waitjmChange() {
      let dirTemp = "I";
      if (this.model.jsdgrp.rec.maimpz == '4') {
        dirTemp = 'I';
      }
      if (this.model.jsdgrp.rec.maimpz == '5') {
        dirTemp = 'O';
      }
      let params = {
        dir: dirTemp,
        waitjm: this.model.jsdgrp.rec.waitjm,
      }
      const loading = this.loading();
      let res = await Api.post(`/${this.moduleRouter()}/jstopt/getBopcodListByWaitjm`, params);
      loading.close();
      if (res.respCode === SUCCESS) {
        // 码表 - 国际收支申报交易编码
        this.model.gjszcdList = res.data;
      }
      //this.model.jsdgrp.rec.txcode = '';
      this.model.jsdgrp.rec.regno = '';
    },
    txcodeChange(){
      if((this.model.jsdgrp.rec.waitjm == '131' && this.model.jsdgrp.rec.txcode == '321000') 
      || (this.model.jsdgrp.rec.waitjm == '331' && this.model.jsdgrp.rec.txcode == '321000')){
        this.regnoRequired = 'Y';
        this.model.jsdgrp.rec.regno = 'N/A';
      } else if((this.model.jsdgrp.rec.waitjm == '123' && this.model.jsdgrp.rec.txcode == '226000') 
      || (this.model.jsdgrp.rec.waitjm == '132' && this.model.jsdgrp.rec.txcode != '922010') 
      || (this.model.jsdgrp.rec.waitjm == '250' && this.model.jsdgrp.rec.txcode == '924030')
      || (this.model.jsdgrp.rec.waitjm == '240' && this.model.jsdgrp.rec.txcode != '929040')
      || this.model.jsdgrp.rec.waitjm == '210' || this.model.jsdgrp.rec.waitjm == '220' || this.model.jsdgrp.rec.waitjm == '221'
      || this.model.jsdgrp.rec.waitjm == '222' || this.model.jsdgrp.rec.waitjm == '223' || this.model.jsdgrp.rec.waitjm == '231'
      || this.model.jsdgrp.rec.waitjm == '232' || this.model.jsdgrp.rec.waitjm == '241'){
        this.regnoRequired = 'Y';
        this.$notify.warning("请填写外汇局批件号或备案表号或业务编号或N/A,如遇问题请咨询银行工作人员。");
      } else if((this.model.jsdgrp.rec.waitjm == '323' && this.model.jsdgrp.rec.txcode == '226000')
      || (this.model.jsdgrp.rec.waitjm == '450' && this.model.jsdgrp.rec.txcode == '924030')
      || (this.model.jsdgrp.rec.waitjm == '440' && this.model.jsdgrp.rec.txcode != '929040')
      || this.model.jsdgrp.rec.waitjm == '332' || this.model.jsdgrp.rec.waitjm == '410' || this.model.jsdgrp.rec.waitjm == '420'
      || this.model.jsdgrp.rec.waitjm == '422' || this.model.jsdgrp.rec.waitjm == '421' || this.model.jsdgrp.rec.waitjm == '423'
      || this.model.jsdgrp.rec.waitjm == '431' || this.model.jsdgrp.rec.waitjm == '432' || this.model.jsdgrp.rec.waitjm == '441'){
        this.regnoRequired = 'Y';
        this.$notify.warning("请填写外汇局批件号或备案表号或业务编号或N/A,如遇问题请咨询银行工作人员。");
      } else {
        this.regnoRequired = '';
        this.model.jsdgrp.rec.regno = '';
      }
    },
    // 格式化数据
    formatLabel(item) {
      return item.cod + ' - ' + item.txt
    },
    // 事件 -- 获取账号具体信息
    async getCoreAccountInfo(actVal,curVal) {
      if (actVal === '') {
        this.$alert('请先获取账号!', '提示', {
          confirmButtonText: '确定'
        });
        return;
			}
      let request = {
        account: actVal
      }
      let loading = this.loading('正在获取详情信息中...');
      let rtnmsg = await Api.post(`/${this.moduleRouter()}/jsd/getCoreAcctInfo`, request);
			if (rtnmsg.respCode === SUCCESS) {
          if (rtnmsg.data.errorMsg !== '' && rtnmsg.data.errorMsg !== null) {
            this.$alert(rtnmsg.data.errorMsg, '提示', {
              confirmButtonText: '确定'
            });
          } else {
            var acccode = rtnmsg.data.acctCode;
            var accountBalance = rtnmsg.data.acctBalance;
            this.$alert('账号:'+actVal+'<br/>账户科目号为:'+acccode+'<br/>账户余额为:'+curVal+this.moneyFormat(accountBalance,curVal)+'<br/>账户状态为:'+rtnmsg.data.jiluzt, '提示', {
              confirmButtonText: '确定',
              dangerouslyUseHTMLString: true
            });
          }
      }
      loading.close();
    },
	}
}