index.js 21.6 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 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import moment from 'moment';
import { cloneDeep } from "lodash";
import Utils from "~/utils"


export default {
	mixins: [commonFunctions],
	methods: {
    buildTrtcre() {
      let params = {
        ...this.model.trtcre.buildParams,
        trtcre: this.model.trtcre,
        liaccvg: this.model.liaccv?this.model.liaccv.liaccvg:[]
      }
      return params;
    },
    async processTrtcre(requestParams) {
      if(requestParams){
        this.model.trtcre.buildParams = cloneDeep(requestParams)
        delete this.model.trtcre.buildParams.rec.trtcreVo
        //融资不需要代付,可以删掉
        if (this.model.trtcre.buildParams.rec.dftcreVo){
          delete this.model.trtcre.buildParams.rec.dftcreVo
        }
      }
      const loading = this.loading('正在计算融资数据')
      let trtcreRequest = this.buildTrtcre()
      let objtyp = trtcreRequest.rec.objtyp;
      let rtnmsg = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/assertTrtcre`, trtcreRequest);
      if (rtnmsg.respCode == SUCCESS) {
        Utils.copyValueFromVoData(this.model.trtcre.trdgrp, rtnmsg.data.trtcre.trdgrp);
        Utils.copyValueFromVoData(this.model.trtcre.trtp, rtnmsg.data.trtcre.trtp);
        Utils.copyValueFromVoData(this.model.trtcre.finmod, rtnmsg.data.trtcre.finmod);
        this.$set(this.model.trtcre.finmod, 'ptsptaList', rtnmsg.data.trtcre.finmod.ptsptaList || [])
        Utils.copyValueFromVoData(this.model.trtcre.financ, rtnmsg.data.trtcre.financ);
        this.model.trtcre.oricur = rtnmsg.data.trtcre.oricur;
        this.model.trtcre.oriamt = rtnmsg.data.trtcre.oriamt;
        this.model.trtcre.pctoriamt = rtnmsg.data.trtcre.pctoriamt;
        this.model.trtcre.extrat = rtnmsg.data.trtcre.extrat;
        this.model.trtcre.crefinflg = rtnmsg.data.trtcre.crefinflg;
        this.model.trtcre.fiprol = rtnmsg.data.trtcre.fiprol;
        this.model.trtcre.idType = rtnmsg.data.trtcre.idType;
        this.model.trtcre.zmqflg = rtnmsg.data.trtcre.zmqflg;
      }
      loading.close();
      return rtnmsg;
    },
    async queryOwnref() {
			let data = {
				ownref: this.model.trtcre.trdgrp.rec.ownref,
				ptainr: this.model.trtcre.trdgrp.fip.pts.ptainr,
				fintyp: this.model.trtcre.trdgrp.rec.fintyp
      }
      let objtyp = this.model.trtcre.buildParams.rec.objtyp;
			const loading = this.loading();
			let res = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/getRef`, data);
			loading.close();
			if (res.respCode === SUCCESS) {
				this.model.trtcre.trdgrp.rec.ownref = res.data;
			} else {
				this.$message.error(res.respMsg);
			}
    },
    changeCur() {
      this.calcAmt('cur');
      this.model.trtcre.finmod.act1 = '';
      this.model.trtcre.finmod.act3 = '';
      this.model.trtcre.finmod.intact = '';
      this.model.trtcre.trdgrp.rec.intrat = 0;
      this.model.trtcre.finmod.intamt = 0;
      this.model.trtcre.trtp.wbdp.act = '';
      if (this.model.trtcre.oricur !== this.model.trtcre.trdgrp.cbs.max.cur && this.model.trtcre.finmod.intprd === '7') {
        this.model.trtcre.finmod.inttyp = '1';
      }
      this.computedWbdpVisiableFlag();
      this.getActSet('changeCur');
    },
    changeAmt() {
      this.calcAmt('amt');
      this.computedWbdpVisiableFlag();
    },
    changePctOriAmt(){
      this.calcAmt('pctamt');
      this.computedWbdpVisiableFlag();
    },
    changePctfin(){
      this.calcAmt('pct');
    },
    changeExtrat(){
      this.model.trtcre.rattxt = '';
      this.calcAmt('rat');
    },
    //获取实时牌价
    async queryExtrat(){
      let data = {
				oricur: this.model.trtcre.oricur,
        txncur: this.model.trtcre.trdgrp.cbs.max.cur,
        extrat: this.model.trtcre.extrat,
        ptyinr: this.model.trtcre.trdgrp.fip.pts.ptyinr,
      }
      let objtyp = this.model.trtcre.buildParams.rec.objtyp;
			const loading = this.loading();
			let res = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/queryExtrat`, data);
			loading.close();
			if (res.respCode === SUCCESS) {
        this.model.trtcre.extrat = res.data.extrat;
        this.model.trtcre.rattxt = res.data.rattxt;
        this.calcAmt('rat');
			}
    },
    async calcAmt(flag){
      let data = {
				oricur: this.model.trtcre.oricur,
        oriamt: this.model.trtcre.oriamt,
        pctoriamt: this.model.trtcre.pctoriamt,
        txncur: this.model.trtcre.trdgrp.cbs.max.cur,
        txnamt: this.model.trtcre.trdgrp.cbs.max.amt,
        pctfin: this.model.trtcre.trdgrp.rec.pctfin,
        extrat: this.model.trtcre.extrat,
        ptyinr: this.model.trtcre.trdgrp.fip.pts.ptyinr,
        modifyType: flag,
      }
      let objtyp = this.model.trtcre.buildParams.rec.objtyp;
			const loading = this.loading();
			let res = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/calcAmt`, data);
			loading.close();
			if (res.respCode === SUCCESS) {
        this.model.trtcre.trdgrp.cbs.max.cur = res.data.txncur;
        this.model.trtcre.trdgrp.cbs.max.amt = res.data.txnamt;
        this.model.trtcre.trdgrp.rec.pctfin = res.data.pctfin;
        this.model.trtcre.extrat = res.data.extrat;
        this.model.trtcre.pctoriamt =  res.data.pctoriamt;
        if (flag === 'cur') {
          this.model.trtcre.rattxt = res.data.rattxt;
        }
			}
    },
    async getActSet(type){
      let data = {
        ptyinr: this.model.trtcre.trdgrp.fip.pts.ptyinr,
        txncur: this.model.trtcre.trdgrp.cbs.max.cur,
        txnamt: this.model.trtcre.trdgrp.cbs.max.amt,
        actpro: this.model.trtcre.trtp.wbdp.actpro,
      }
      let objtyp = this.model.trtcre.buildParams.rec.objtyp;
			const loading = this.loading();
			let res = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/getActSet`, data);
			loading.close();
			if (res.respCode === SUCCESS) {
        if (type === 'changeCur') {
          this.model.trtcre.finmod.act1Set = res.data.act1Set;
          this.model.trtcre.finmod.intactSet = res.data.act1Set;
        }
        this.model.trtcre.trtp.wbdp.actSet = res.data.actSet;
			}
    },
    changeStttendat(){
      this.calcTenday();
      if (this.model.trtcre.finmod.intprd === '7') {
        this.model.trtcre.trdgrp.rec.intrat = 0;
        this.model.trtcre.finmod.intamt = 0;
      }
    },
    changeMatdat(){
      this.calcTenday();
      this.model.trtcre.trdgrp.rec.intrat = 0;
      if (this.model.trtcre.finmod.intprd === '7') {
        this.model.trtcre.finmod.intamt = 0;
      }
      this.model.trtcre.finmod.rec.matdat = matdat;
    },
    calcTenday(){
      let fromDate = this.model.trtcre.trdgrp.rec.stttendat;
      let toDate = this.model.trtcre.trdgrp.rec.matdat;
      if(fromDate == "" || fromDate == null || toDate == "" || toDate == null ){
        this.model.dftcre.dfdgrp.rec.tenday = 0;
        return;
      }
      let day1 = moment(toDate).format('YYYY-MM-DD');
      let day2 = moment(fromDate).format('YYYY-MM-DD');
      this.model.trtcre.trdgrp.rec.tenday = moment(day1).diff(day2, 'days');
    },
    changeTendat() {
      if (this.model.trtcre.trdgrp.rec.stttendat && this.model.trtcre.trdgrp.rec.tenday) {
        this.model.trtcre.trdgrp.rec.matdat = moment(this.model.trtcre.trdgrp.rec.stttendat).add(this.model.trtcre.trdgrp.rec.tenday, 'days').format('YYYY-MM-DD');
      }
      if (this.model.trtcre.finmod.intprd === '7') {
        this.model.trtcre.finmod.intamt = 0;
      }
    },
		async getIntrat() {
			this.model.trtcre.trdgrp.rec.intrat = 0;
			if (this.model.trtcre.trdgrp.cbs.max.cur == "") {
				this.$notify.error({ title: '错误', message: '请先选择币种!' });
				return;
			}
			if (this.model.trtcre.finmod.ratchgtyp == "") {
				this.$notify.error({ title: '错误', message: '请先选择利率调整方式!' });
				return;
			}
			if (this.model.trtcre.trdgrp.rec.matdat == null || this.model.trtcre.trdgrp.rec.matdat == "") {
				this.$notify.error({ title: '错误', message: '请先选择到期日!' });
				return;
			}
			if (['7', '8', '9'].includes(this.model.trtcre.finmod.ratchgtyp) && this.model.trtcre.finmod.ratchgprd == "") {
				this.$notify.error({ title: '错误', message: '请先选择利率调整周期!' });
				return;
			}
			if (this.model.trtcre.trdgrp.cbs.max.cur == "CNY" && this.model.trtcre.finmod.dinmod.jzllgz == "1" && this.model.trtcre.trdgrp.rec.lprtyp == "") {
				this.$notify.error({ title: '错误', message: "请选择LPR期限品种" });
				return;
      }
      //调用2571获取接口
      let objtyp = this.model.trtcre.buildParams.rec.objtyp;
      let request = {
        objtyp: "TRD",
        fintyp: this.model.trtcre.trdgrp.rec.fintyp,
        cur: this.model.trtcre.trdgrp.cbs.max.cur,
        opndat: this.model.trtcre.trdgrp.rec.stttendat,
        matdat: this.model.trtcre.trdgrp.rec.matdat,
        ratchgtyp: this.model.trtcre.finmod.ratchgtyp,
        ratchgprd: this.model.trtcre.finmod.ratchgprd,
        lpctyp: this.model.trtcre.trdgrp.rec.lprtyp,
        jzllgz: this.model.trtcre.finmod.dinmod.jzllgz
      }
      let loading = this.loading('正在请求2571接口');
      let rtnmsg = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/call2571`, request);
			if (rtnmsg.respCode === SUCCESS) {
          if (rtnmsg.data.errorMsg !== '' && rtnmsg.data.errorMsg !== null) {
            this.$alert(rtnmsg.data.errorMsg, '提示', {
              confirmButtonText: '确定'
            });
          } else {
            this.model.trtcre.trdgrp.rec.intrat = rtnmsg.data.intrat;
          }
      }
      loading.close();
    },
    changeActrat() {
			this.model.trtcre.finmod.intamt = 0;
    },
    onRatchgtyp() {
			if (!['7', '8', '9', 'G', 'H', 'I', 'J'].includes(this.model.trtcre.finmod.ratchgtyp)) {
				this.model.trtcre.finmod.ratchgprd = "";
			}
      this.model.trtcre.trdgrp.rec.intrat = 0;
      let transName = this.model.trtcre.buildParams ? this.model.trtcre.buildParams.transName : '';
      let modified = false;
      if (this.model.trtcre.finmod.modifySet && this.model.trtcre.finmod.modifySet.includes('ratchgdat')) {
        modified = true;
      }
      if (this.model.trtcre.finmod.ratchgtyp !== '6' && !modified && ['cptopn','cptato','brtset', 'bdtset'].includes(transName)) {
        this.model.trtcre.finmod.ratchgdat = '00';
      }
      if (!['3', '4', '5', '6'].includes(this.model.trtcre.finmod.ratchgtyp)) {
        this.model.trtcre.finmod.ratchgdat = '';
      }
    },
    changeRatchgprd() {
			this.model.trtcre.trdgrp.rec.intrat = 0;
    },
    changeFlttyp(){
      if (this.model.trtcre.finmod.flttyp === '0') {
        this.model.trtcre.finmod.fltval = 0;
      }
    },
    changeOvdinttyp(){
      if (this.model.trtcre.finmod.ovdinttyp === '0') {
        this.model.trtcre.finmod.ovdintrat = 0;
      }
    },
    changeIntprd(){
       if (this.model.trtcre.finmod.intprd !== '7') {
        this.model.trtcre.finmod.intamt = 0;
        this.model.trtcre.finmod.inttyp = '';
       }
       if (['1','2','3','4','5'].includes(this.model.trtcre.finmod.intprd)) {
         if (this.model.trtcre.finmod.intdat === ''){
          this.model.trtcre.finmod.intdat = '20';
         }
       } else {
        this.model.trtcre.finmod.intdat = '';
       }
    },
		async getIntamt() {
			this.model.trtcre.finmod.intamt = 0;
			if (this.model.trtcre.trdgrp.rec.matdat == null || this.model.trtcre.trdgrp.rec.matdat == "") {
				this.$notify.error({ title: '错误', message: '请先选择到期日!' });
				return;
			}
			if (this.model.trtcre.trdgrp.cbs.max.amt <= 0) {
				this.$notify.error({ title: '错误', message: '融资金额必须大于0!' });
				return;
			}
			if (this.model.trtcre.trdgrp.rec.actrat == "") {
				this.$notify.error({ title: '错误', message: '执行利率不能为空!' });
				return;
      }
      //调用6153接口获取预扣息金额
      let objtyp = this.model.trtcre.buildParams.rec.objtyp;
      let request = {
        ...this.fillFinmod(),
        ...this.model.trtcre.finmod
      }
      let loading = this.loading('正在请求6153接口');
      let rtnmsg = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/call6153`, request);
			if (rtnmsg.respCode === SUCCESS) {
          if (rtnmsg.data.errorMsg !== '' && rtnmsg.data.errorMsg !== null) {
            this.$alert(rtnmsg.data.errorMsg, '提示', {
              confirmButtonText: '确定'
            });
          } else {
            this.model.trtcre.finmod.intamt = rtnmsg.data.intamt;
          }
      }
      loading.close();
    },
    fillFinmod(){
      let obj = {
        rec : {
          crefinflg: this.model.trtcre.crefinflg,
          objtyp: 'TRD',
          objinr: this.model.trtcre.trdgrp.rec.inr,
          ownref: this.model.trtcre.trdgrp.rec.ownref,
          opndat: this.model.trtcre.trdgrp.rec.opndat,
          matdat: this.model.trtcre.trdgrp.rec.matdat,
          jzllgz: this.model.trtcre.trdgrp.rec.jzllgz,
          Fintyp: this.model.trtcre.trdgrp.rec.fintyp,
          stttendat: this.model.trtcre.trdgrp.rec.stttendat,
          intrat: this.model.trtcre.trdgrp.rec.intrat,
          actrat: this.model.trtcre.trdgrp.rec.actrat,
          lprtyp: this.model.trtcre.trdgrp.rec.lprtyp,
          ovdflg: this.model.trtcre.trdgrp.rec.ovdflg,
          finact: this.model.trtcre.trdgrp.rec.finact,
        },
        cbsMap: {
          MAX: this.model.trtcre.trdgrp.cbs.max,
					MAX2: this.model.trtcre.trdgrp.cbs.max2,
					OPN1: this.model.trtcre.trdgrp.cbs.opn1,
        }
      }
      return obj;
    },
    changeInttyp(){
       if (this.model.trtcre.finmod.inttyp === '1') {
          if (this.model.trtcre.finmod.acttyp === '0' || this.model.trtcre.finmod.acttyp === '2') {
            this.model.trtcre.finmod.intact = this.model.trtcre.finmod.act3;
          }
       } else {
         this.model.trtcre.finmod.intact = '';
       }
    },
    changeActtyp(){
      if (this.model.trtcre.finmod.acttyp === '') {
        this.model.trtcre.finmod.intact = '';
        this.model.trtcre.finmod.act3 = '';
      }
      if (this.model.trtcre.finmod.inttyp === '1') {
        if (this.model.trtcre.finmod.acttyp === '0' || this.model.trtcre.finmod.acttyp === '2') {
          this.model.trtcre.finmod.intact = this.model.trtcre.finmod.act3;
        }
      }
    },
    changeAct3(){
      if (this.model.trtcre.finmod.inttyp === '1') {
        if (this.model.trtcre.finmod.acttyp === '0' || this.model.trtcre.finmod.acttyp === '2') {
          this.model.trtcre.finmod.intact = this.model.trtcre.finmod.act3;
        }
      }
    },
    async getDin(){
      let opnflg = this.model.trtcre.finmod.opnflg;
      if (opnflg === 'Y') {
        //调用接口CPC3获取定价数据
        let objtyp = this.model.trtcre.buildParams.rec.objtyp;
        let request = {
          dinjdm: this.model.trtcre.finmod.dinjdm
        };
        let loading = this.loading('正在请求CPC3接口');
        let rtnmsg = await Api.post(`/${this.moduleRouter()}/${objtyp.toLowerCase()}/trtcre/callCPC3`, request);
        if (rtnmsg.respCode === SUCCESS) {
            if (rtnmsg.data.errorMsg !== '' && rtnmsg.data.errorMsg !== null) {
              this.$alert(rtnmsg.data.errorMsg, '提示', {
                confirmButtonText: '确定'
              });
            }
            this.model.trtcre.finmod.dinmod = cloneDeep(rtnmsg.data.dinmod);
            if (rtnmsg.data.dinSta === '1') {
               this.model.trtcre.trdgrp.rec.jzllgz = this.model.trtcre.finmod.dinmod.jzllgz;
               this.model.trtcre.trdgrp.rec.lprtyp = this.model.trtcre.finmod.dinmod.lprtyp;
               if (Number(this.model.trtcre.finmod.dinmod.shpjgh) !== 0) {
                this.model.trtcre.trdgrp.rec.actrat = this.model.trtcre.finmod.dinmod.shpjgh;
               }
               if (this.model.trtcre.finmod.dinmod.bizhog !== '') {
                if (this.model.trtcre.trdgrp.cbs.max.cur !== this.model.trtcre.finmod.dinmod.bizhog) {
                  this.customAddModify(this.model.trtcre.trdgrp.cbs.max, 'cur');
                  this.model.trtcre.trdgrp.cbs.max.cur = this.model.trtcre.finmod.dinmod.bizhog;
                  this.changeCur();
                }
               }
            }
            
        }
        loading.close();
      } else {
        this.$alert("定价审批CPC3接口已关闭", '提示', {
          confirmButtonText: '确定'
        });
      }
    },
    computedWbdpVisiableFlag(){
       let maxcur = this.model.trtcre.trdgrp.cbs.max.cur;
       let maxamt = this.model.trtcre.trdgrp.cbs.max.amt;
       let fintyp = this.model.trtcre.trdgrp.rec.fintyp;
       let ffactl = this.model.trtcre.trtp.wbdp.ffactl;
       if (ffactl === '' && Number(maxamt) > 0 && maxcur !== 'CNY' && maxcur !== '' && ['BRF','BCF','ECF'].includes(fintyp)) {
        this.model.trtcre.trtp.wbdp.visiableFlag = 'X';
       } else {
        this.model.trtcre.trtp.wbdp.visiableFlag = '';
        this.model.trtcre.trtp.wbdp.act='';
        this.model.trtcre.trtp.wbdp.actpro='';
       }
    },
    changeActpro(){
      this.model.trtcre.trtp.wbdp.act = '';
      this.getActSet('changeActpro');
    },
    changeRzkxp(type){
      if (type === '1') {
        if (this.model.trtcre.financ.rzkx1 === 'X') {
          this.model.trtcre.financ.rzkx2 = '';
          this.model.trtcre.financ.ref2='';
          this.model.trtcre.financ.rzkx3 = '';
          this.model.trtcre.financ.ref3='';
          this.model.trtcre.financ.rzkx4 = '';
          this.model.trtcre.financ.ref4='';
          this.model.trtcre.financ.rzkx5 = '';
          this.model.trtcre.financ.ref5='';
        }  
      }
      if (type === '2') {
        if (this.model.trtcre.financ.rzkx2 === 'X') {
          this.model.trtcre.financ.rzkx1 = '';
          this.model.trtcre.financ.acc='';
          this.model.trtcre.financ.rzkx3 = '';
          this.model.trtcre.financ.ref3='';
          this.model.trtcre.financ.rzkx4 = '';
          this.model.trtcre.financ.ref4='';
        }
      }
      if (type === '3') {
        if (this.model.trtcre.financ.rzkx3 === 'X') {
          this.model.trtcre.financ.rzkx1 = '';
          this.model.trtcre.financ.acc='';
          this.model.trtcre.financ.rzkx2 = '';
          this.model.trtcre.financ.ref2='';
          this.model.trtcre.financ.rzkx4 = '';
          this.model.trtcre.financ.ref4='';
        }
      }
      if (type === '4') {
        if (this.model.trtcre.financ.rzkx4 === 'X') {
          this.model.trtcre.financ.rzkx1 = '';
          this.model.trtcre.financ.acc='';
          this.model.trtcre.financ.rzkx2 = '';
          this.model.trtcre.financ.ref2='';
          this.model.trtcre.financ.rzkx3 = '';
          this.model.trtcre.financ.ref3='';
        }
      }
      if (type === '5') {
        if (this.model.trtcre.financ.rzkx5 === 'X') {
          this.model.trtcre.financ.rzkx1 = '';
          this.model.trtcre.financ.acc='';
        }
      }
      let transName = this.model.trtcre.buildParams ? this.model.trtcre.buildParams.transName : '';
      let pntref = this.model.trtcre.buildParams ? this.model.trtcre.buildParams.rec.ownref : '';
      if (transName === 'cptopn' || transName === 'cptato') {
         if (this.model.trtcre.financ.rzkx4 === 'X') {
          this.model.trtcre.financ.ref4 = pntref;
         }
      }
      if (transName === 'brtset') {
        if (this.model.trtcre.financ.rzkx2 === 'X') {
          pntref = this.model.trtcre.buildParams ? this.model.trtcre.buildParams.rec.pntref : '';
          this.model.trtcre.financ.ref2 = pntref;
         }
      }
      if (transName === 'bctset') {
        if (this.model.trtcre.financ.rzkx3 === 'X') {
          this.model.trtcre.financ.ref3 = pntref;
         }
      }
      if (transName === 'bdtset') {
        if (this.model.trtcre.financ.rzkx5 === 'X') {
          pntref = this.model.trtcre.buildParams ? this.model.trtcre.buildParams.rec.pntref : '';
          this.model.trtcre.financ.ref5 = pntref;
         }
      }
    },
    changeAvbby(){
      if (this.model.trtcre.trdgrp.rec.avbby === 'P') {
        this.model.trtcre.trdgrp.rec.tenorday = 0;
      }
    },
    async getBopcodList() {
			this.bopcodDialogTableVisible = true;
			this.tableList = [];
			let request = {
				typ: "I",
				trntyp: this.model.trtcre.trdgrp.rec.trntyp
			};
			let loading = this.loading("正在请求交易性质列表");
			let res = await Api.post(
				`/${this.moduleRouter()}/codetable/bopcod/list`,
				request
			);
			if (res.respCode === SUCCESS) {
				this.tableList = res.data;
			}
			loading.close();
    },
    changeAct1() {
      if (this.model.trtcre.zmqflg === 'X') {
        let act1 = this.model.trtcre.finmod.act1;
        let oppaccModified = false;
        if (this.model.trtcre.trdgrp.rec
            && this.model.trtcre.trdgrp.rec.modifySet
            && this.model.trtcre.trdgrp.rec.modifySet.includes('oppacc')) {
              oppaccModified = true;
        }
        if (!oppaccModified) {
          this.model.trtcre.trdgrp.rec.oppacc = act1;
        }
      }
    },
    async queryIntact() {
      let intact = this.model.trtcre.finmod.intact;
      if (intact !== '') {
        const loading = this.loading('正在调用8023接口获取账户信息');
        let rtnmsg = await Api.post(`/${this.moduleRouter()}/liaccv/getaccinfo`, intact);
        if (rtnmsg.respCode == SUCCESS) {
          if (rtnmsg.data.errorMsg !== '' && rtnmsg.data.errorMsg !== null) {
            this.$alert(rtnmsg.data.errorMsg, '提示', {
              confirmButtonText: '确定'
            });
          } else {
            this.$alert('账号:'+intact+'<br/>账户名称为:'+rtnmsg.data.zhuzwm+'<br/>账户余额为:'+rtnmsg.data.cur+this.moneyFormat(rtnmsg.data.zhhuye,rtnmsg.data.cur), '提示', {
              confirmButtonText: '确定',
              dangerouslyUseHTMLString: true
            });
          }
        }
        loading.close();
      }
    },
	},
};