index.vue 37.4 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 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938
<!-- 引用方法
import { resolve } from 'url';
import { Promise } from 'q';
<c-function-btn :handleSubmit="handleSubmit" :handleCheck="handleCheck" :handleStash="handleStash"
></c-function-btn>
-->
<template>
 <!-- v-if="!buttonHide && ((!isReview && !funcBtnHide) || showSetBtn)" -->
  <div :class= "isHistory ? '' : 'm-Btn-eContainer'">
    <div class="m-funcBtn-eContainer" v-if="!isReview && !buttonHide && !funcBtnHide && !isHistory">
      <!-- v-show="root.judgeVisiableInfo('mtabut.usrcon')" -->
      <!-- <el-button type="primary" size="small" @click="confirm" :loading="$store.state.Status.loading.confirm">{{ $t('buttons.确认') }}</el-button> -->
      <!-- v-show="root.judgeVisiableInfo('mtabut.sav')" -->
      <el-button type="primary" size="small" @click="start" :loading="$store.state.Status.loading.submit" :disabled="disabled">{{ $t('buttons.提交') }}</el-button>
      <!-- v-show="root.judgeVisiableInfo('mtabut.chk')" -->
      <el-button size="small" @click="check" :loading="$store.state.Status.loading.check">{{ $t('buttons.检核') }}</el-button>
      <el-button size="small" @click="save" :loading="$store.state.Status.loading.stash">{{ $t('buttons.暂存') }}</el-button>
      <el-button size="small" @click="handleCancel">{{ $t('buttons.退出') }}</el-button>
    </div>
    <div class="m-funcBtn-eContainer" v-if=" buttonHide">
        <el-button size="small" @click="handleDisplayExit">{{ $t('buttons.退出') }}</el-button>
    </div>
    <div class="m-zhanWei-forfuncBtn" v-if="!buttonHide && showSetBtn && (funcBtnHide || isReview) && !isHistory"></div>
    <div class="m-openleft" v-if="!buttonHide && showSetBtn && !isHistory">
      <el-button
        type="primary"
        icon="el-icon-arrow-left"
        size="mini"
        class="m-setting-btn"
        v-show="!openflag"
        @click="open"
        >
        {{ $t('buttons.展开') }}
        <i class="el-icon-setting" size="mini"></i>
      </el-button>
      <el-button
        type="primary"
        icon="el-icon-arrow-right"
        size="mini"
        class="m-setting-btn"
        v-show="openflag"
        @click="close"
        >
        {{ $t('buttons.收起') }}
        <i class="el-icon-setting" size="mini"></i>
      </el-button>
      <div class="m-openleft-item" v-show="openflag">
        <slot></slot>
      </div>
    </div>
		<!-- 业务交易右上角的操作栏 -->
		<div class="btn-group">
      <!-- <el-button size="mini" type="primary" :disabled="root.model.entmod && root.model.entmod.rtynum >= 3" v-if="root.model.entmod && root.model.entmod.visflg === 'X'" @click="handleEntmodShow" class="el-icon-picture-outline">
        <span style="margin-left: 5px;position: relative;">
          企业名录
          <div v-if="root.model.entmod.isShowErrorMsg" @click.stop style="width:15px;background: #fff;padding: 10px;border-radius: 3px;position: absolute;top: 23px;left: -25px;color: red;">
            请点击校验企业名录信息
          </div>
        </span>
      </el-button> -->
			<el-button size="mini" type="primary" @click="showForex" v-if="root.model.forexmod && (root.model.forexmod.riskLevel == '01' || root.model.forexmod.riskLevel == '02')">风险报送</el-button>
			<el-button size="mini" type="primary" @click="showDocData" v-if="root.model.imgInvmod" class="el-icon-s-order">发票报文</el-button>
			<el-button  size="mini" type="primary" @click="handleSunscanShow" class="el-icon-picture-outline"><span style="margin-left: 5px;">影像</span></el-button>
			<el-button  size="mini" type="primary" @click="handleDiaryShow" class="el-icon-edit-outline"><span  style="margin-left: 5px;">备忘录</span></el-button>
			<el-button size="mini" type="primary" v-if="root.model.trnInfo && root.model.trnInfo.sptMsgtyp && root.model.trnInfo.sptMsgtyp.trim()" @click="handleShowMessage" class="el-icon-files"><span style="margin-left: 5px;">报文展示</span></el-button>
      <el-button size="mini" type="primary" v-if="isView"  @click="handleShowWorkflow" class="el-icon-s-operation"><span style="margin-left: 5px;">工作流服务</span></el-button>
      <el-button size="mini" type="primary" v-if="isView"  @click="handleShowSignature" class="el-icon-edit"><span style="margin-left: 5px;">签名顺序</span></el-button>
      <Inftmp :modelStr="root.model" :codes="root.trnName" v-if="trnList.includes(root.trnName.toLowerCase()) && (!root.isInDisplay || isReleaseView)"></Inftmp>
      <el-button  size="mini" type="primary" @click="handleShowRemark" class="el-icon-document"><span style="margin-left: 5px;">备注</span></el-button>
			<el-badge class="item el-dropdown-link" :value="root.model.warnList ? root.model.warnList.length : 0" :max="99" :hidden="root.model.warnList && root.model.warnList.length == 0">
				<el-button size="mini" type="primary" @click="handleShowWarning" class="el-icon-warning-outline">
				<span style="margin-left: 5px;position: relative;">Warning   
					<div v-if="root.model.warnFlg == 'Y'" @click.stop style="width:15px;padding: 10px;border-radius: 3px;position: absolute;top: 15px;left: -84px;color: red;">
            警告信息有变化,请查看
          </div>
				</span>
			</el-button>
			</el-badge>
			
    </div>
		<el-dialog  v-dialogDrag title="Warning" :visible.sync="$store.state.warning.warningVisible" width="60%" 
			@close="handleCloseWarning" :modal-append-to-body="false" v-if="$store.state.warning.warningVisible">
			<div class="warning-wrap">
				<div class="warning-item" v-for="(item, index) in root.model.warnList" :key="index">
					<i :style="{color: colorObj[item.level]}" style="margin-right: 8px;font-size: 20px;" class="el-icon-warning"></i>
					<span style="font-size: 16px;" v-html="item.message"></span>
				</div>
			</div>
			<div slot="footer">
				<el-button v-if="!$store.state.warning.isSubmitBtn" size="mini" type="primary" @click="handleIknow">我知道了</el-button>
				<el-button v-if="$store.state.warning.isSubmitBtn" size="mini" type="primary" @click="handleCancelWarning">取消</el-button>
				<el-button v-if="$store.state.warning.isSubmitBtn" size="mini" type="primary" @click="handleSureWarning">确定</el-button>
			</div>
		</el-dialog>

    <!-- ruleMaps错误提示 -->
		<el-dialog v-dialogDrag title="错误" :visible.sync="$store.state.warning.errorRuleVisible" width="60%" 
			@close="handleCloseErrorRule" :modal-append-to-body="false" v-if="$store.state.warning.errorRuleVisible">
			<div class="warning-wrap">
				<div class="warning-item" v-for="(item, index) in $store.state.warning.errorRuleList" :key="index">
					<span style="font-size: 16px;padding-bottom: 8px;">{{ item.msg }}</span>
				</div>
			</div>
			<div slot="footer">
				<el-button size="mini" type="primary" @click="handleCloseErrorRule">我知道了</el-button>
			</div>
		</el-dialog>
		<!-- 发票报文展示 -->
		
		<invDialog ref="invImg"></invDialog>

    <imgListDialog ref="sunscanRef"
    v-if='showimgListDialogDialog'
			:visible.sync="showimgListDialogDialog"
			:tradeCode="reference"
			:imginr="root.model.trnInfo ? root.model.trnInfo.imginr : ''"
			:sdhflg="root.model.trnInfo && root.model.trnInfo.sdhflg == 'X' ? 'X' : ''"
			:smhinr="root.model.spt && root.model.spt.smhinr ? root.model.spt.smhinr : ''"
			:trnName="root.trnName"
			:limit="isTrancationDisplay"
			:model="root.model"
		></imgListDialog>
    <!-- 企业名录弹框 -->
		<!-- <EntmodDialog ref="entmodRef" :model="root.model"></EntmodDialog> -->
		<!-- 外汇展业弹框 -->
		<Forexmod ref="forexmodRef" :model="root.model" :trnName="root.trnName"></Forexmod>
		<!-- 备忘录弹框 -->
		<DiaryDialog ref="diaryRef" :model="root.model" @closeDiaryDialog="closeDiaryDialog"></DiaryDialog>
		<!-- 报文展示弹框 -->
		<MessageDialog  ref="message" @onClose="handleCloseMessage"></MessageDialog>

    <WorkflowDialog  ref="workflow" @onClose="handleCloseWorkflow"></WorkflowDialog>

     <SignatureDialog  ref="signature" @onClose="handleCloseSignature"></SignatureDialog>

     <RemarkDialog  ref="remark" :model="root.model" @onClose="handleCloseRemark"></RemarkDialog>
  </div>
</template>
<script>
import EntmodDialog from '../entmod/views/index.vue'
import DiaryDialog from '../diary/views/index.vue'
import MessageDialog from './MessageDialog'
import WorkflowDialog from './WorkflowDialog'
import SignatureDialog from './SignatureDialog'
import RemarkDialog from './RemarkDialog'
import imgListDialog from './image/imgListDialog.vue'
import Forexmod from '../Forexmod/views/forDialog.vue'
import invDialog from "./InvDialog.vue"
import Inftmp from "~/page/Statics/TdTmpl/inftmp.vue";
import Api from "~/service/Api";
import { mapMutations } from 'vuex'
import pendingMixin from "~/mixin/pendingMixin.js"
import { debug } from 'util';
import Utils from "~/utils";

export default {
	inject: ["root"],
	components:{EntmodDialog,DiaryDialog,Forexmod, MessageDialog,WorkflowDialog,SignatureDialog,imgListDialog, Inftmp,RemarkDialog,invDialog},
	mixins:[pendingMixin],
  // 如果需要制裁信息按钮则给组件传 showAml 方法,如果不需要则不传
	props: ["handleSubmit", "handleCheck", "handleStash", "handleExit", "hideFuncBtn", "handleConfirm",'disabled','isHistory'],
  data: function() {
    return {
      isReview: false,
      openflag: true,
			funcBtnHide: false,
			showDiaryDialog:false,
			colorObj: {
				'1': 'red',
				'2': 'yellow',
				'3': 'green'
			},
			showimgListDialogDialog: false,
			showDoc: false,
			docList: [],
      trnList:['gitopn','gitpop','nitopn','nitpop','hitpop','hitopn','ditopn','letopn','letnot','letrsv','letdrw', 'letdrw1', 'botdav','bctdav','botdav1','litopn','litopn1','cptadv','cptopn','lttopn','lttopn1']
    };
  },
  async created() {
    if (this.$route.path.indexOf("review") !== -1) {
      this.isReview = true;
    } else {
      this.isReview = false;
    }
    if (this.hideFuncBtn) {
      this.funcBtnHide = true;
		}
    //TODO,改为按钮弹出时获取imginr
		if(!this.root.model.trnInfo || !this.root.model.trnInfo.imginr){ 
      //不存在Imginr则请求新的imginr
      //await this.getImginr();
    }
    // console.log("functionbtn标志isReview:", this.isReview)
    // console.log("functionbtn标志funcBtnHide:", this.funcBtnHide)
    // console.log("functionbtn标志buttonHide:", this.buttonHide)
    // console.log("functionbtn标志showSetBtn:", this.showSetBtn)
    // console.log("functionbtn标志mode:", this.mode)
    // console.log("functionbtn标志zhanwei:", !this.buttonHide && this.showSetBtn && (this.funcBtnHide || this.isReview))
  },
  mounted() {
    window.addEventListener('message',(e)=>{
			let val =null
			if(Utils.typeOf(e.data) === 'Object' ){
				if(!e.data.invoiceLotNumber){
					val = e.data
				}
			}else{
				try {
					val= JSON.parse(e.data)
				} catch (err) {
					val = e.data
				}
			}
			console.log('测试',val)
      if (val.from == 'OCRSB') this.getDataFromTable(val)
    })
  },
  computed: {
    // 判断是否是复核
    isReleaseView () {
      return this.$route.path.startsWith("/review");
		},
		isHaveLevel(){
			if(this.root.model.warnList && this.root.model.warnList.length>0){
				let list = this.root.model.warnList 
				let flg = list.some(item =>{
						return item.level == '2' && item.readFlag == 'N'
					})
				if(flg){
					return true
				}else{
					return false
				}
			}else{
				return false
			}
			
			
		},
    isView () {
			return this.$route.query.type === 'view' || this.$route.query.type === 'rel'
		},
		isHistoryRecord() {
			return this.$route.path.indexOf("/HistoryRecord") > -1
		},
    showSetBtn() {
      return this.$slots.default !== undefined;
    },
    OcrRecognize () {
      return this.$store.state.Status.OcrRecognize
    },

    mode() {
      return this.$store.state.Status.mode;
    },
    buttonHide() {
      return this.$route.path.indexOf("display") !== -1;
		},
		reference(){
      let commonParams = this.root.buildCommonData(this.root.model, this.root.trnName);
      if (commonParams && commonParams.rec) {
          return commonParams.rec.ownref;
      }
      return '';
		},
		isTrancationDisplay(){
      return true
			// let ret = false;
			// let curRole = JSON.parse(window.sessionStorage.curRole).name;
			// let curOrgLevel = JSON.parse(window.sessionStorage.currentOrg).level;
			// let isDisplay = (curRole.indexOf("经办") !== -1);//是否经办
			// let isHead = (curOrgLevel == 0);//是否总行
			// //是否收单行交易
			// if(this.root.model.trnInfo && this.root.model.trnInfo.sdhflg){
			// 	if(!isHead && isDisplay) ret = true;
			// }else{
			// 	if(isDisplay) ret = true;
			// }
			// return ret;
		}
  },
  methods: {
    ...mapMutations(['updateWarningVisible', 'updateErrorRuleVisible']),
    handleEntmodShow(){
      this.root.model.entmod.isShowErrorMsg = false
      if (this.$store.state.Status.mode === "display") {
        if (this.root.model.entmod.errorMsg === '') {
          this.$refs.entmodRef.visible = true
        } else {
          this.$alert(this.root.model.entmod.errorMsg, '提示', {
            confirmButtonText: '确定'
          });
        }
        return;
      }
      //组数然后调用备忘录逻辑
			let commonParams = this.root.buildCommonData(this.root.model, this.root.trnName);
      this.$refs.entmodRef.initEntmod(commonParams);
		},
		handleDiaryShow(){
      this.$refs.diaryRef.visible = true
      if (this.$store.state.Status.mode === "display") {
        return;
      }
      //组数然后调用备忘录逻辑
			let commonParams = this.root.buildCommonData(this.root.model, this.root.trnName);
      this.$refs.diaryRef.initTrndia(commonParams);
		},
		closeDiaryDialog(){
			this.showDiaryDialog = false;
		},
		showForex(){
			this.$refs.forexmodRef.forVisible = true
		},
    async start() {
			if (this.$store.state.Status.loading.submit) {
				return;
			}
      this.handleSubmit && (await this.handleSubmit());
    },
    async check() {
			if (this.$store.state.Status.loading.check) {
				return;
			}
      this.handleCheck && (await this.handleCheck());
    },
    async save() {
			if (this.$store.state.Status.loading.stash) {
				return;
			}
			this.$store.commit('setLoadingStash', true)
			this.handleStash && (await this.handleStash());
    },
    async confirm() {
      this.handleConfirm && (await this.handleConfirm());
		},
		hasLiaccvgFun(){
			let ret = false;
			if (this.root.model.liaccv) {
				for(let it of this.root.model.liaccv.liaccvg) {
					if (it.fcdinr !== null && it.fcdinr !== '' && it.amt !== 0) {
						ret = true;
					}
				}
			}
			return ret;
		},
		cancelFun(){
      if(this.root.model.umdmod){
        if (this.root.model.umdmod.umdList) {
          let umdList = this.root.model.umdmod.umdList;
          for(let item of umdList){
            if(item.casecode!='100'){
              this.$message.error('已产生筛查记录,请点击暂存');
              return
            }
          }					
				}
      }
			this.$confirm("确认退出?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(res => {
				this.$store.commit('delTagsArry', this.$route.path)
				this.$router.back()
			}).catch(() => {});
		},
    handleCancel() {
			if (this.$store.state.common.btnLoading) {
				return;
			}
			let hasLiaccvg = this.hasLiaccvgFun();
      let isLevel= JSON.parse(window.sessionStorage.currentOrg).level //是否总行
			if(hasLiaccvg && isLevel !== 0){
				this.$confirm(
					"本次操作处理了保证金,不能退出,请执行Break操作",
					"提示",
					{
						confirmButtonText: "确认后退出",
						cancelButtonText: "取消",
						type: "warning"
					}
					)
					.then(async() => {
						await this.save();
						this.$store.commit('delTagsArry', this.$route.path)
						this.$router.back()
					})
					.catch(() => {});
			}else{
				this.cancelFun()
			}
    },
    handleDisplayExit(){
        this.$store.commit('delTagsArry', this.$route.path)
				this.$router.back()
    },
    open() {
      this.openflag = true;
    },
    close() {
      this.openflag = false;
    },
    async getDataFromTable(row){
        // 代表国际
				if(this.root.model.transName =='gitopn' || this.root.model.transName =='gitpop'){
          	// 项目名称
								this.root.model.gidgrp.rec.projnam = row.XMMC,
								// 国际2栏,拼接名址信息
								this.root.model.gidgrp.ben.pts.adrblk = row.SYRMC +'\n'+ row.SYRDZ
								// 受益人名称
							//	this.root.model.gidgrp.ben.pts.ennam = row.SYRMC,
								// 受益人地址
							//	this.root.model.gidgrp.ben.pts.enadr = row.SYRDZ
								// 有效期限
								if(this.root.model.gidgrp.rec.exptyp!='OPEN' && this.root.model.gidgrp.rec.exptyp!=''){
										this.root.model.gidgrp.rec.expdat = row.YXQX
											// 有效期限联动效期敞口
										this.root.model.gidgrp.rec.expflg = ''
								}
                // 保函金额
                if(row.BHJE) {
                  let moneyObj = await this.changeMoney(row.BHJE)
                  console.log(moneyObj , '我是处理过的金额')
                  this.root.model.gidgrp.cbs.max.cur = moneyObj.moneyType
                  this.root.model.gidgrp.cbs.max.amt = moneyObj.money
                  this.root.model.gidgrp.cbs.opn1.cur = moneyObj.moneyType
                  this.root.model.gidgrp.cbs.opn1.amt = moneyObj.money
                }
								// this.root.model.nidgrp.cbs.max.amt = item.BHJE
								// if(row.BHJE.length > 3 && /^[a-zA-Z]+$/.test(row.BHJE.substring(0,3))){
								// 	this.root.model.gidgrp.cbs.max.cur = row.BHJE.substring(0,3);
								// 	this.root.model.gidgrp.cbs.max.amt = row.BHJE.substring(3,row.BHJE.length)
								// 	// 保函余额联动保函金额
								// 	this.root.model.gidgrp.cbs.opn1.cur = row.BHJE.substring(0,3);
								//   this.root.model.gidgrp.cbs.opn1.amt = row.BHJE.substring(3,row.BHJE.length)
								// }
				}
				// 代表国内以及海关
				if(this.root.model.transName =='nitopn' || this.root.model.transName =='nitpop' || this.root.model.transName =='hitopn' || this.root.model.transName =='hitpop'){
           if(this.root.model.nidgrp.rec.fenlishi == '2'){
									// 被担保人名称
                 this.root.model.nidgrp.bdb.pts.cnnam = row.BBZRMC,
							    // 被担保人社会统一信用代码
								 this.root.model.nidgrp.rec.grtjuscod = row.TYSHXD
								}
								// 项目名称
								this.root.model.nidgrp.rec.projnam = row.XMMC,
								// 受益人名称
								this.root.model.nidgrp.ben.pts.cnnam = row.SYRMC,
								// 受益人地址
								this.root.model.nidgrp.ben.pts.cnadr = row.SYRDZ,
								// 有效期限
								this.root.model.nidgrp.rec.expdat = row.YXQX
								// 有效期限联动效期敞口
								if(row.YXQX){
               	this.root.model.nidgrp.rec.expflg = ''
								}
								// 保函金额
                // this.root.model.nidgrp.cbs.max.amt = item.BHJE
                if(row.BHJE) {
                  let moneyObj = await this.changeMoney(row.BHJE)
                  console.log(moneyObj , '我是处理过的金额')
                  this.root.model.nidgrp.cbs.max.cur = moneyObj.moneyType
                  this.root.model.nidgrp.cbs.max.amt = moneyObj.money
                  this.root.model.nidgrp.cbs.opn1.cur = moneyObj.moneyType
                  this.root.model.nidgrp.cbs.opn1.amt = moneyObj.money
                }
								// if(row.BHJE.length > 3 && /^[a-zA-Z]+$/.test(row.BHJE.substring(0,3))){
								// 	this.root.model.nidgrp.cbs.max.cur = row.BHJE.substring(0,3);
								// 	this.root.model.nidgrp.cbs.max.amt = row.BHJE.substring(3,row.BHJE.length)
								// 	// 保函余额联动保函金额
								// 	this.root.model.nidgrp.cbs.opn1.cur = row.BHJE.substring(0,3);
								//   this.root.model.nidgrp.cbs.opn1.amt = row.BHJE.substring(3,row.BHJE.length)
								// }
				}
				        this.showimgListDialogDialog = false;
    },
    // 数据处理,获取金额以及币种
    changeMoney (str) {
        let moneyObj ={
          money:'',
          moneyType:''
        }
        let regex = /\d/
        let l = str.length -1
        let FirstNumIndex = str.search(regex)
        let newStr = str.split('').reverse().join('')
        let LasttNumIndex = l - (newStr.search(regex))
        let moneyType = str.substring(0,FirstNumIndex)
        let money = str.substring(FirstNumIndex,LasttNumIndex -0  + 1)
        moneyObj.money = money.indexOf(',') != -1 ? money.replace(',','') : money
        //返回三位通用的缩写
        console.log(moneyType.substring(0,3) , moneyType.length , /^[a-zA-Z]+$/.test(moneyType.substring(0,3)) , '>>>>>>>>>>>>>')
        if(moneyType.length >=3 && /^[a-zA-Z]+$/.test(moneyType.substring(0,3))) {
          moneyType == 'RMB'? moneyObj.moneyType = 'CNY' : moneyObj.moneyType =moneyType.substring(0,3)
        }
        //单独处理人民币以及美元的识别结果
        if(moneyType.includes('人民币')) moneyObj.moneyType = 'CNY'
        if(moneyType.includes('¥')) moneyObj.moneyType = 'CNY'
        if(moneyType.includes('$')) moneyObj.moneyType = 'USD'
        if(moneyType.includes('美元')) moneyObj.moneyType = 'USD'
          return moneyObj
      },
		handleShowWarning () {
			this.updateWarningVisible(true)
    },
    handleShowWorkflow () {
			this.$refs.workflow.init();
    },
    handleShowSignature() {
			this.$refs.signature.init();
    },
    handleShowRemark() {
        this.$refs.remark.init();
		},
		handleIknow () {
      let curWarnList = this.root.model.warnList
      if (curWarnList && curWarnList.length > 0) {
        curWarnList = curWarnList.map((item) => {
          return {
            ...item,
            readFlag: 'Y'
          }
        })
			}
			this.$set(this.root.model,'warnFlg','')
			this.$set(this.root.model, 'warnList', curWarnList)
			this.updateWarningVisible(false)
			this.$emit('closeWarning')
    },
    handleCloseWarning () {
      this.updateWarningVisible(false)
    },
		handleCancelWarning () {
			this.updateWarningVisible(false)
			this.$emit('cancelWarning')
		},
		handleSureWarning () {
			this.$emit('handleSureWarning')
			this.updateWarningVisible(false)
		},
		handleCloseErrorRule () {
			this.updateErrorRuleVisible(false)
		},
		handleShowMessage () {
			this.$refs.message.init();
		},
		handleCloseMessage () {
			this.$refs.messageVisible = false
    },
    handleCloseWorkflow () {
			this.$refs.workflowVisible = false
    },
        handleCloseSignature () {
			this.$refs.signatureVisible = false
    },
    handleCloseRemark () {
			this.$refs.remarkVisible = false
    },
    getModel(value){
      var tmplModel = JSON.parse(value);
      var oldModel = this.root.model;
      var trnCod = this.root.trnName.toLowerCase();
      // 'gitopn','gitpop','nitopn','nitpop','hitpop','hitopn'
      // 国际保函
      if(trnCod == 'gitopn' || trnCod == 'gitpop'){
          let params = {
            transName: trnCod,
            gidgrp: {
              rec: {
                inr: this.$route.query.inr || ""
              }
            }
          };
          this.root.init(params).then(()=>{
            // '接收目的':'Incoming Purpose'
            this.root.model.gidgrp.rec.purposin = tmplModel.gidgrp.rec.purposin;
            // Incoming Lose
            this.root.model.gitp.inc760 = tmplModel.gitp.inc760;
            // '支出目的':'Outgoing Purpose',
            this.root.model.gidgrp.rec.hndtyp = tmplModel.gidgrp.rec.hndtyp;
            this.root.model.gidgrp.rec.purpos = tmplModel.gidgrp.rec.purpos;
            // Form of Undertaking
            this.root.model.gidgrp.rec.legfrm = tmplModel.gidgrp.rec.legfrm;
            // '保函种类':'Undertaking Type'
            this.root.model.gidgrp.rec.gartyp = tmplModel.gidgrp.rec.gartyp;
            // '申请人':'Applicant', 'name'
            // 50 Sequence B
            this.root.model.gidgrp.apl = tmplModel.gidgrp.apl;
            // 50 Sequence C
            this.root.model.gidgrp.apc = tmplModel.gidgrp.apc;
            // 22D Sequence B
            this.root.model.gidgrp.rec.legfrm = tmplModel.gidgrp.rec.legfrm;
            // 22D Sequence C
            this.root.model.gidgrp.rec.legfrmc = tmplModel.gidgrp.rec.legfrmc;
            // 40C Sequence B
            this.root.model.gidgrp.blk.apprul = tmplModel.gidgrp.blk.apprul;
            this.root.model.gidgrp.blk.apprultxt = tmplModel.gidgrp.blk.apprultxt;
            // 40C Sequence C
            this.root.model.gidgrp.blk.apprulc = tmplModel.gidgrp.blk.apprulc;
            this.root.model.gidgrp.blk.apprultxtc = tmplModel.gidgrp.blk.apprultxtc;
            // 23B
            this.root.model.gidgrp.rec.liatypc = tmplModel.gidgrp.rec.liatypc;
            this.root.model.gidgrp.rec.exptyp = tmplModel.gidgrp.rec.exptyp;
            // 51 '债务人':'Obligor'
            this.root.model.gidgrp.ctr = tmplModel.gidgrp.ctr;
            // 59a '受益人':'Beneficiary'
            this.root.model.gidgrp.ben = tmplModel.gidgrp.ben;
            // 56a '通知行或收报行':'Advising Bank(Tag 56a)'
            this.root.model.gidgrp.atb = tmplModel.gidgrp.atb;
            // 71D '费用承担人':'Charges Condition'   Sequence B
            this.root.model.gidgrp.rec.chato = tmplModel.gidgrp.rec.chato;
            // Charges Sequence B
            this.root.model.gidgrp.blk.feetxt = tmplModel.gidgrp.blk.feetxt;
            // 71D Charges Sequence C
            this.root.model.gidgrp.blk.feetxtc = tmplModel.gidgrp.blk.feetxtc;
            // 45C
            this.root.model.gitp.prepermodflg = tmplModel.gitp.prepermodflg;
            // 45C Sequence B
            this.root.model.gidgrp.blk.atxpreper = tmplModel.gidgrp.blk.atxpreper;
            this.root.model.gidgrp.blk.preper = tmplModel.gidgrp.blk.preper;
            // 45C Sequence C
            this.root.model.gidgrp.blk.atxpreperc = tmplModel.gidgrp.blk.atxpreperc;
            this.root.model.gidgrp.blk.preperc = tmplModel.gidgrp.blk.preperc;
            // 44H Sequence B
            this.root.model.gidgrp.rec.jurlaws20 = tmplModel.gidgrp.rec.jurlaws20;
            this.root.model.gidgrp.rec.jurlaw = tmplModel.gidgrp.rec.jurlaw;
            this.root.model.gidgrp.rec.jurplc = tmplModel.gidgrp.rec.jurplc;
            // 44H Sequence C
            this.root.model.gidgrp.rec.jurlawtxtc = tmplModel.gidgrp.rec.jurlawtxtc;
            this.root.model.gidgrp.rec.jurplcc = tmplModel.gidgrp.rec.jurplcc;
            this.root.model.gidgrp.rec.jurlawc = tmplModel.gidgrp.rec.jurlawc;
            // 48B Sequence B
            this.root.model.gidgrp.rec.demand = tmplModel.gidgrp.rec.demand;
            // 48B Sequence C
            this.root.model.gidgrp.rec.demandc = tmplModel.gidgrp.rec.demandc;
            // 24E Sequence B
            this.root.model.gidgrp.rec.delori = tmplModel.gidgrp.rec.delori;
            this.root.model.gidgrp.rec.deloritxt = tmplModel.gidgrp.rec.deloritxt;
            // 24E Sequence C
            this.root.model.gidgrp.rec.deloric = tmplModel.gidgrp.rec.deloric;
            this.root.model.gidgrp.rec.deloritxtc = tmplModel.gidgrp.rec.deloritxtc;
            // 保函文本 Sequence B
            this.root.model.gitp.gidtxtmodflg = tmplModel.gitp.gidtxtmodflg;
            this.root.model.gidgrp.rec.atxinr = tmplModel.gidgrp.rec.atxinr;
            this.root.model.gidgrp.blk.gidtxt = tmplModel.gidgrp.blk.gidtxt?tmplModel.gidgrp.blk.gidtxt.replace(/<br>Guarantee No. ([\S]*?)<br>/g,"<br>Guarantee No.               <br>"):tmplModel.gidgrp.blk.gidtxt;
						this.root.model.gidgrp.blk.modifySet = tmplModel.gidgrp.blk.modifySet;
            this.root.model.gidgrp.blk.gtxgidtxt = tmplModel.gidgrp.blk.gtxgidtxt;
            // 保函文本 Sequence C
            this.root.model.gitp.gidtxtmodflgc = tmplModel.gitp.gidtxtmodflgc;
            this.root.model.gidgrp.rec.gtxinrc = tmplModel.gidgrp.rec.gtxinrc;
            this.root.model.gidgrp.blk.gidtxtc = tmplModel.gidgrp.blk.gidtxtc;
            this.root.model.gidgrp.blk.gtxgidtxtc = tmplModel.gidgrp.blk.gtxgidtxtc;

            // 备查表
            this.root.model.addbcb.label5 = tmplModel.addbcb.label5;
            this.root.model.addbcb.label6 = tmplModel.addbcb.label6;
            this.root.model.addbcb.bccls1 = tmplModel.addbcb.bccls1;
            this.root.model.addbcb.expdat = tmplModel.addbcb.expdat;
            this.root.model.addbcb.preexpdat = tmplModel.addbcb.preexpdat;
            this.root.model.addbcb.bccls2 = tmplModel.addbcb.bccls2;
            this.root.model.addbcb.bccls3 = tmplModel.addbcb.bccls3;

            //合同信息
            this.root.model.gidgrp.rec.projnam= tmplModel.gidgrp.rec.projnam;
            this.root.model.gidgrp.rec.orcref= tmplModel.gidgrp.rec.orcref;
            this.root.model.gidgrp.rec.guatyp= tmplModel.gidgrp.rec.guatyp;
            this.root.model.gidgrp.rec.countrycod= tmplModel.gidgrp.rec.countrycod;
          });
      }
      // 国内保函
      if(trnCod == 'nitopn' || trnCod == 'nitpop'){
          let params = {
            transName: trnCod,
            nidgrp: {
              rec: {
                inr: this.$route.query.inr || ""
              }
            }
          };
          this.root.init(params).then(()=>{
            // 开立方式
            this.root.model.nidgrp.rec.hndtyp = tmplModel.nidgrp.rec.hndtyp;
            // 分离式保函
            this.root.model.nidgrp.rec.fenlishi = tmplModel.nidgrp.rec.fenlishi;
            // 保函类型
            this.root.model.nidgrp.rec.gartyp = tmplModel.nidgrp.rec.gartyp;
            // 上海自贸海关关税(特殊保函类型)
            this.root.model.nidgrp.rec.segtyp = tmplModel.nidgrp.rec.segtyp;
            // 是否对外担保
            this.root.model.nidgrp.rec.fingua = tmplModel.nidgrp.rec.fingua;
            // 对外担保类型
            this.root.model.nidgrp.rec.cfaguatyp = tmplModel.nidgrp.rec.cfaguatyp;
            // 跨境人民币保函
            this.root.model.nidgrp.rec.cmtflg = tmplModel.nidgrp.rec.cmtflg;
            // 电子保函标志
            this.root.model.nitp.dzbhflg = tmplModel.nitp.dzbhflg;
            // 生成查询码
            this.root.model.nidgrp.rec.cxmflg = tmplModel.nidgrp.rec.cxmflg;
            // 适用规则
            this.root.model.nidgrp.blk.apprul = tmplModel.nidgrp.blk.apprul;
            this.root.model.nidgrp.blk.apprultxt = tmplModel.nidgrp.blk.apprultxt;
            // 面函标题
            this.root.model.nitp.lettername = tmplModel.nitp.lettername;
            // 文本格式
            this.root.model.nidgrp.rec.gtxinr = tmplModel.nidgrp.rec.gtxinr;
            // 文本语言
            this.root.model.nidgrp.rec.giduil = tmplModel.nidgrp.rec.giduil;
            // 申请人
            this.root.model.nidgrp.apl = tmplModel.nidgrp.apl;
            // 受益人
            this.root.model.nidgrp.ben = tmplModel.nidgrp.ben;
            // 保函文本
            this.root.model.nitp.gidtxtmodflg = tmplModel.nitp.gidtxtmodflg;
						this.root.model.nidgrp.blk.gidtxt = tmplModel.nidgrp.blk.gidtxt?tmplModel.nidgrp.blk.gidtxt.replace(/保函编号:([\S]*?)<br>/g,"保函编号:              <br>"):tmplModel.nidgrp.blk.gidtxt;
						this.root.model.nidgrp.blk.modifySet = tmplModel.nidgrp.blk.modifySet;
            this.root.model.nidgrp.blk.gtxgidtxt = tmplModel.nidgrp.blk.gtxgidtxt;

            // 备查表
            this.root.model.addbcb.label6 = tmplModel.addbcb.label6;
            this.root.model.addbcb.label5 = tmplModel.addbcb.label5;
            this.root.model.addbcb.bccls1 = tmplModel.addbcb.bccls1;
            this.root.model.addbcb.expdat = tmplModel.addbcb.expdat;
            this.root.model.addbcb.preexpdat = tmplModel.addbcb.preexpdat;
            this.root.model.addbcb.bccls2 = tmplModel.addbcb.bccls2;
            this.root.model.addbcb.bccls3 = tmplModel.addbcb.bccls3;

            //合同信息
            this.root.model.nidgrp.rec.projnam= tmplModel.nidgrp.rec.projnam;
            this.root.model.nidgrp.rec.orcref= tmplModel.nidgrp.rec.orcref;
            this.root.model.nidgrp.rec.guatyp= tmplModel.nidgrp.rec.guatyp;
            this.root.model.nidgrp.rec.countrycod= tmplModel.nidgrp.rec.countrycod;
          });
      }
      // 海关保函
      if(trnCod == 'hitopn' || trnCod == 'hitpop'){
          let params = {
            transName: trnCod,
            nidgrp: {
              rec: {
                inr: this.$route.query.inr || ""
              }
            }
          };
          this.root.init(params).then(()=>{
            // 开立方式
            this.root.model.nidgrp.rec.hndtyp = tmplModel.nidgrp.rec.hndtyp;
            // 保函类型
            this.root.model.nidgrp.rec.gartyp = tmplModel.nidgrp.rec.gartyp;
            // 特殊保函类型
            this.root.model.nidgrp.rec.segtyp = tmplModel.nidgrp.rec.segtyp;
            // 分离式保函
            this.root.model.nidgrp.rec.fenlishi = tmplModel.nidgrp.rec.fenlishi;
            // 电子保函标志
            this.root.model.nitp.dzbhflg = tmplModel.nitp.dzbhflg;
            // 生成查询码
            this.root.model.nidgrp.rec.cxmflg = tmplModel.nidgrp.rec.cxmflg;
            // 面函标题
            this.root.model.nitp.lettername = tmplModel.nitp.lettername;
            // 文本格式
            this.root.model.nidgrp.rec.gtxinr = tmplModel.nidgrp.rec.gtxinr;
            // 文本语言
            this.root.model.nidgrp.rec.giduil = tmplModel.nidgrp.rec.giduil;
            // 申请人
            this.root.model.nidgrp.apl = tmplModel.nidgrp.apl;
            // 备案海关
            this.root.model.nidgrp.ben = tmplModel.nidgrp.ben;
            // 保函文本
						this.root.model.nitp.gidtxtmodflg = tmplModel.nitp.gidtxtmodflg;
						this.root.model.nidgrp.blk.gidtxt = tmplModel.nidgrp.blk.gidtxt?tmplModel.nidgrp.blk.gidtxt.replace(/编号:([\S]*?)<\/p>/g,"编号:              </p>"):tmplModel.nidgrp.blk.gidtxt;
						this.root.model.nidgrp.blk.modifySet = tmplModel.nidgrp.blk.modifySet;
            this.root.model.nidgrp.blk.gtxgidtxt = tmplModel.nidgrp.blk.gtxgidtxt;

            // 备查表
            this.root.model.addbcb.label6 = tmplModel.addbcb.label6;
            this.root.model.addbcb.label5 = tmplModel.addbcb.label5;
            this.root.model.addbcb.bccls1 = tmplModel.addbcb.bccls1;
            this.root.model.addbcb.expdat = tmplModel.addbcb.expdat;
            this.root.model.addbcb.preexpdat = tmplModel.addbcb.preexpdat;
            this.root.model.addbcb.bccls2 = tmplModel.addbcb.bccls2;
            this.root.model.addbcb.bccls3 = tmplModel.addbcb.bccls3;

            //合同信息
            this.root.model.nidgrp.rec.projnam= tmplModel.nidgrp.rec.projnam;
            this.root.model.nidgrp.rec.orcref= tmplModel.nidgrp.rec.orcref;
            this.root.model.nidgrp.rec.guatyp= tmplModel.nidgrp.rec.guatyp;
            this.root.model.nidgrp.rec.countrycod= tmplModel.nidgrp.rec.countrycod;
          });
      }
		},
		
		async handleSunscanShow(){
			if(!this.reference) {
				this.$message.warning("请首先输入交易Reference编号");
				return;
			}
			// if(this.promptMessage() != ''){
			// 	this.$notify.info({
			// 		title: '提示',
			// 		message: this.promptMessage(),
			// 	})
			// }
			if(!this.root.model.trnInfo || !this.root.model.trnInfo.imginr){ 
				//不存在Imginr则请求新的imginr
				await this.getImginr();
			}
			if(!this.root.model.trnInfo.imginr) return;
			this.showimgListDialogDialog = true
		},
		async getImginr() {
      await Api.post("/manager/img/generateImgInr").then(res => {
        if (res.respCode == SUCCESS) {
          if(!this.root.model.trnInfo){
            this.$set(this.root.model,"trnInfo",{});
          }
          this.$set(this.root.model.trnInfo,"imginr",res.data.imgInr);
        }
      });
		},
		showDocData(){
			this.$refs.invImg.showDoc = true
			this.$refs.invImg.getList(this.root.model.imgInvmod)
		}
  }
};
</script>
<style scoped lang="less">
.item {
  margin-left: 2px;
}
.m-Btn-eContainer {
	display: flex; /*flex布局*/
	position:relative;
	z-index:10;
	height: 54px;
	padding: 10px 20px;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
	background-color: var(--white);
	box-shadow: 0 0 11px 0 rgba(0,0,0,.1);
}
.m-funcBtn-eContainer {
  order: 1;
}
.m-zhanWei-forfuncBtn{
  order: 2;
}
.m-openleft {
  order: 3;
}

.m-funcBtn-eContainer button,
.m-funcBtn-eContainer .el-button + .el-button {
  margin: 0px 10px 0px 0px;
}
.m-funcBtn-eContainer .el-button--default {
  /* background-image: linear-gradient(#fff,#dedede); */
  border: 1px solid #ccc;
}
// .m-funcBtn-eContainer .el-button--primary {
//   /* border: 1px solid #0D4FBD; */
// }
.m-openleft-item {
  display: inline-block;
  padding: 0px;
}

.m-setting-btn {
  padding: 0px 10px 0px 8px;
  font-size: 12px;
  line-height: 22px;
}

.m-openleft-item > span {
  display: inline-block;
}
.m-openleft-item .el-button+.el-button {
  margin: 0;
}
.m-openleft-item > button,
.m-openleft-item > span > button,
.m-openleft-item > span > div > button {
  color: #606266;
  background-color: #fff;
  border: 1px #ccc solid;
  padding: 0px 7px;
  background-image: linear-gradient(#fff,#dedede);
}

.m-openleft-item > button:hover,
.m-openleft-item > span > button:hover,
.m-openleft-item > span > div > button:hover {
  background-color: #b3d8ff;
  color: #606266;
}

/* ui美化 */
.m-Btn-eContainer .el-button--small,.m-Btn-eContainer .el-button--small.is-round {
  padding: 0 30px !important;
  font-size: 14px;
	height: 34px;
	line-height:34px;
  font-weight:bold;
}

.btn-group {
	width: 50%;
	height: 30px;
	position: fixed;
	right: 20px;
	top: 70px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	z-index: 1000;
	::v-deep .el-button {
		height: 28px!important;
		padding: 0 8px!important;
		border-radius: 5px;
	}
}
.warning-wrap {
	width: 100%;
	.warning-item {
		width: 100%;
		text-align: left;
		font-size: 16px;
		min-height: 32px;
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}
}
</style>