operationFunc.js 73.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 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535
// 此文件存放交易流转的一些公共方法
import Api from '~/service/Api';
import Utils from "~/utils"
import commonFunctions from '../mixin/commonFunctions.js';
import macBalance from '../mixin/macBalanceMixin.js';
import setmod from '~/components/business/setmod/event';
import ccvpan from '~/components/business/ccvpan/event';
import glentry from '~/components/business/glentry/event';
import engp from '~/components/business/engp/event';
import docpan from '~/components/business/docpan/event';
import limitbody from '~/components/business/limitbody/event';
import doctre from '~/components/business/doctre2/event';
import usrmd from '~/components/business/Usrmd/event';
import forexmod from '~/components/business/Forexmod/event';
import entmod from '~/components/business/entmod/event';
import rmbbop from '../components/business/rmb/rmbbop/event';
import jshmod from '../components/business/jshmod/event';
import cfagit from '~/components/business/Cfagit/event';
import cfabop from '~/components/business/cfa/cfabop/event';
import yapin from '~/components/business/yapin/event';
import dftcre from '~/components/business/dftcre/event';
import trtcre from '~/components/business/trtcre/event';
import bptbck from '~/components/business/bptbck/event';
import gedmod from '~/components/business/gedmod/event';
import bopgat from '~/components/business/Bopgat/event';
import boprem from '~/components/business/Boprem/event';
import boppay from '~/components/business/Boppay/event';
import invchkpan from '~/components/business/Invchkpan/event';
import PubCheckEvent from '../components/business/commonModel/CommonCheckEvent.js';
import {cloneDeep} from "lodash";

import pendingMixin from "./pendingMixin.js"

export default {
    mixins: [commonFunctions, pendingMixin, setmod,invchkpan, ccvpan, glentry, engp, docpan, limitbody,entmod, doctre, usrmd, forexmod,rmbbop, jshmod, cfagit, cfabop, bopgat, boprem, boppay, macBalance, yapin, dftcre, trtcre, bptbck, gedmod],
    methods: {
        //  初始化
        async init(data) {
            return new Promise(async (resolve) => {
                //清除缓存变量
                delete this.$store.state["infoEntrank"];
                delete this.$store.state["infoChkmsg"];
                let params = {
                    ...data,
                    businessInr: this.$route.query.businessInr,
                    businessType: this.$route.query.businessType,
                    operation: this.$route.query.type
                };
                if (this.$router.history.getCurrentLocation().indexOf("display") > -1) {
                    params.operation = "view"
                }
                this.$initParams = {
                    params,
                    //此参数为了退出时候取路由module
                    currentRouteModule: this.$route.meta.module || 'business'
                };
                this.$store.commit('setLoadingStash', true);
                const loading = this.loading();
                const rtnmsg = await Api.post(`/${this.moduleRouter()}/${this.trnName}/init`, params);
//异步关闭,避免关闭过快
                this.$nextTick(() => setTimeout(() => {
                    this.$store.commit('setLoadingStash', false);
                    loading.close()
                }, 1500));
                if (rtnmsg.respCode === SUCCESS) {
                    this._rtnmsg = rtnmsg;
                    //收单行上收标时,modifiedSet忽略
                    let ignoreModFlg = !this.isInDisplay && rtnmsg.data.trnInfo && rtnmsg.data.trnInfo.sptHldflg;
                    Utils.copyValueFromVoData(this.model, rtnmsg.data, ignoreModFlg);
                    if (this.model.setmod) {
                        Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data, ignoreModFlg);
                        Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data.setmod, ignoreModFlg);
                    }
                    if (this.model.mtabut) {
                        Utils.copyValueFromVoData(this.model.mtabut, rtnmsg.data, ignoreModFlg);
                    }
                    if (this.model.trnmod) {
                        Utils.copyValueFromVoData(this.model.trnmod, rtnmsg.data, ignoreModFlg)
                    }
                    if (this.model.liaall) {
                        Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data, ignoreModFlg);
                        Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data.liaall, ignoreModFlg);
                    }
                    if (this.model.liaccv) {
                        Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data, ignoreModFlg);
                        Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data.liaccv, ignoreModFlg);
                    }
                    if (this.model.docpan) {
                        Utils.copyValueFromVoData(this.model.docpan, rtnmsg.data, ignoreModFlg);
                    }
                    if (this.model.limmod) {
                        Utils.copyValueFromVoData(this.model.limmod, rtnmsg.data.limmod, ignoreModFlg);
                        //复核时候判断额度试算按钮亮灰显
                        if (this.isInDisplay) {
                            this.judgementAmeamt()
                        }
                    }
                    if (this.model.umdmod) {
                        Utils.copyValueFromVoData(this.model.umdmod, rtnmsg.data.umdmod, ignoreModFlg);
                    }
                    if (this.model.ypnmod) {
                        Utils.copyValueFromVoData(this.model.ypnmod, rtnmsg.data.ypnmod, ignoreModFlg);
                    }
                    if (this.model.trndia) {
                        Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data, ignoreModFlg);
                        Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data.trndia, ignoreModFlg);
                    }
                    if (this.model.rmbbop) {
                        Utils.copyValueFromVoData(this.model.rmbbop, rtnmsg.data.rmbbop, ignoreModFlg);
                    }
                    if (this.model.cfagit) {
                        Utils.copyValueFromVoData(this.model.cfagit, rtnmsg.data.cfagit, ignoreModFlg);
                    }
                    if (this.model.cfabop) {
                        Utils.copyValueFromVoData(this.model.cfabop, rtnmsg.data.cfabop, ignoreModFlg);
                    }
                    if (this.model.bopgat) {
                        Utils.copyValueFromVoData(this.model.bopgat, rtnmsg.data.bopgat, ignoreModFlg);
                    }
                    if (this.model.boprem) {
                        Utils.copyValueFromVoData(this.model.boprem, rtnmsg.data.boprem, ignoreModFlg);
                    }
                    if (this.model.boppay) {
                        Utils.copyValueFromVoData(this.model.boppay, rtnmsg.data.boppay, ignoreModFlg);
                    }
                    if (this.model.textTempData) {
                        this.model.textTempData = rtnmsg.data.textTempData || {}
                    }
                    if (this.model.textTempDatac) {
                        this.model.textTempDatac = rtnmsg.data.textTempDatac || {}
                    }
                    // 附件相关数据
                    if (rtnmsg.data.shwinc) {
                        this.$set(this.model, 'shwinc', ignoreModFlg ? [] : rtnmsg.data.shwinc || [])
                    }
                    // 附件相关数据
                    if (rtnmsg.data.shwout) {
                        this.$set(this.model, 'shwout', ignoreModFlg ? [] : rtnmsg.data.shwout || [])
                    }
                    //影像使用,针对model中位定义trnInfo的进行处理
                    if (!this.model.trnInfo) {
                        this.$set(this.model, "trnInfo", rtnmsg.data.trnInfo);
                    }
                    if ("gmgfVo" in this.model) {
                        //国贸公服
                        this.$set(this.model, "gmgfVo", rtnmsg.data.gmgfVo);
                    }
                    //更新表单号,避免重复提交
                    this.model.trnInfo.formNo = rtnmsg.data.trnInfo.formNo;

                    if (!this.model.spt) {
                        this.$set(this.model, "spt", rtnmsg.data.spt);
                    } else {
                        //修正某些交易spt节点没加添smhinr的问题
                        if (rtnmsg.data.spt && rtnmsg.data.spt.smhinr && !this.model.spt.smhinr) {
                            this.$set(this.model.spt, "smhinr", rtnmsg.data.spt.smhinr);
                        }
                        if (rtnmsg.data.spt) {
                            this.$set(this.model.spt, "inr", rtnmsg.data.spt.inr)
                        }
                    }
                    await resolve(rtnmsg.data);
                    await this.handleWarning(rtnmsg.data);
                    // 执行各交易中的default
                    await this.initDefault();
                    // 复核,快照交易去除校验
                    this.handleIsImportRules();
                    // console.log('this=========', this.model)
                    //异步关闭,避免关闭过快
                    this.$nextTick(() => setTimeout(() => {
                        this.$store.commit('setLoadingStash', false);
                        loading.close();
                    }, 1500));
                    //oit的提示
                    this.oitcheck();
                } else if (rtnmsg.respCode === '400001' || rtnmsg.respCode === '600000') {
                    //锁定失败和数据状态发生变化关闭页面
                    this.$store.commit('setLoadingStash', false);
                    loading.close();
                    this.$store.commit('delTagsArry', this.$route.path);
                    this.$router.back()
                } else if (rtnmsg.respCode === '500001') {
                    //非收单不可做交易提示信息
                    this.$store.commit('setLoadingStash', false);
                    loading.close();
                    const h = this.$createElement;
                    this.$confirm(h('div', [
                        h('p', rtnmsg.respMsg)
                    ]), '提示', {
                        confirmButtonText: '确定', //确认按钮的文字
                        showCancelButton: false,
                        type: 'warning'
                    }).then(() => {
                        this.$store.commit('delTagsArry', this.$route.path);
                        this.$router.back()
                    })
                }
            })
        },
        oitcheck() {
            let extkey = '';
            let objtyp = '';
            let path = '';

            if (this.model.gidgrp) {
                extkey = this.model.gidgrp.rec.ownref;
                objtyp = 'gid';
                path = 'gidgrp.rec.ownref'
            }
            if (this.model.nidgrp) {
                extkey = this.model.nidgrp.rec.ownref;
                objtyp = 'nid';
                path = 'nidgrp.rec.ownref'
            }
            this.ejectOitWarning(objtyp, extkey, path);
        },
        // 复核、快照交易去除初始化校验
        handleIsImportRules() {
            if (this.$route.path.startsWith("/review") || this.$route.path.startsWith("/display")) {
                this.$nextTick(() => {
                    this.$refs['modelForm'].clearValidate()
                })
            }
        },
        // 处理warning的问题
        handleWarning(rtnmsg) {
            this.$set(this.model, 'warnList', rtnmsg.warnList || []);
            this.$set(this.model, 'warnFlg', '')
        },
        // 点击提交时,先弹出warning弹框,点击弹框确定执行
        handleSureWarning() {
            this.submitCallback()
        },
        // 初始化default
        initDefault() {
            let trnName = (this.$sourceTrnName || this.trnName);
            trnName = trnName.replace(trnName.charAt(0), trnName.charAt(0).toUpperCase());
            let moduleDefault = null;
            try {
                moduleDefault = require(`~/page/${this.moduleRouter(true)}/${trnName}/model/default.js`);
            } catch (e) {
                console.log(`~/page/${this.moduleRouter(true)}/${trnName}/model/default.js` + '加载失败');
                return
            }
            let mothodsObj = {};
            if (moduleDefault.default && moduleDefault.default.methods) {
                mothodsObj = moduleDefault.default.methods;
            }
            let fnKeys = Object.keys(mothodsObj);
            fnKeys.map((item) => {
                mothodsObj[item].call(this)
            })
        },
        async getTemplateMap(gtxinr, objtyp) {
            return new Promise(async (resolve) => {
                let params = {
                    objinr: gtxinr,
                    objtyp: objtyp
                };
                let res = await Api.post("/manager/gtxUse/listGidTmplVar", params);
                if (res.respCode === SUCCESS) {
                    resolve(res.data)
                } else {
                    this.$notify.error({
                        title: "错误",
                        message: "服务请求失败!"
                    });
                }
            })
        },
        // 格式化保函模板
        formatTxtp(template, gtxinr, objtyp, fieldDataMap, code, type) {
            if (!template || !gtxinr) {
                return;
            }
            this.getTemplateMap(gtxinr, objtyp).then(async (tmpList) => {
                let templateMap = {
                    ...fieldDataMap
                };
                tmpList.map((item) => {
                    if (item.showflg !== 'Y') {
                        templateMap[item.cod] = item.path
                    }
                });
                let params = {
                    vo: {
                        ...this.model,
                        transName: this.trnName,
                        spt: {
                            inr: this.$route.query.businessInr,
                        },
                        liaccvg: this.model.liaccv === undefined ? null : this.model.liaccv.liaccvg,
                        liaccv: this.model.liaccv === undefined ? null : this.model.liaccv,
                        liaallg: this.model.liaall === undefined ? null : this.model.liaall.liaallg,
                        liaall: this.model.liaall === undefined ? null : this.model.liaall,
                        setmod: this.model.setmod === undefined ? null : this.model.setmod,
                        setfog: this.model.setmod === undefined ? null : this.model.setmod.setfog,
                        setfeg: this.model.setmod === undefined ? null : this.model.setmod.setfeg,
                        setglg: this.model.setmod === undefined ? null : this.model.setmod.setglg,
                        doceot: this.model.docpan === undefined ? null : this.model.docpan.doceot,
                        limmod: this.model.limmod === undefined ? null : this.model.limmod,
                        ypnmod: this.model.ypnmod === undefined ? null : this.model.ypnmod,
                    },
                    template: template,
                    fieldMap: templateMap,
                };
                const rtnmsg = await Api.post(`/${this.moduleRouter()}/${this.trnName}/showText`, params);
                if (rtnmsg.respCode === SUCCESS) {
                    if (type === 'gtxinrmw') {
                        this.model[code].blk.gidtxtmw = rtnmsg.data;
                    } else if (type === 'fdb') {
                        this.model.nitp.indirectswiadd = rtnmsg.data;
                        if (!this.model.nidgrp.blk.modifySet || !this.model.nidgrp.blk.modifySet.includes("gidtxt")) {
                            let str = this.model.nitp.indirectswiadd + this.model.nidgrp.blk.gidtxt;
                            this.model.nidgrp.blk.gidtxt = str
                        }
                        //		优化反担保协议保函标题从居中放置保函初始
                        //		this.model.nitp.indirectswiadd = rtnmsg.data
                        //		if(!this.model.nidgrp.blk.modifySet || !this.model.nidgrp.blk.modifySet.includes("gidtxt")){
                        // 处理存在反担保协议的保函文本
                        //			if(this.model.nitp.indirectswiadd && (this.model.nidgrp.rec.giduil && this.model.nidgrp.rec.giduil !='CN')){
                        //				let gtxgidtxt = this.model.nidgrp.blk.gtxgidtxt
                        //				let blkgidtxt = this.model.nidgrp.blk.gidtxt
                        //				let title
                        //				let linkdata
                        //           if(gtxgidtxt && gtxgidtxt.includes('{LETTERNAME}') && blkgidtxt.length > 4){
                        //						title = blkgidtxt.substring(0, blkgidtxt.indexOf("</p>") + 4);
                        //						linkdata = blkgidtxt.substring(blkgidtxt.indexOf("</p>") + 4, blkgidtxt.length);
                        //						this.model.nidgrp.blk.gidtxt = title + this.model.nitp.indirectswiadd + linkdata
                        //					 }else{
                        //						let str = this.model.nitp.indirectswiadd + this.model.nidgrp.blk.gidtxt
                        //						this.model.nidgrp.blk.gidtxt = str
                        //					 }
                        //			}
                        //		}
                    } else if (type === 'dz'){
                        if (!this.model.nidgrp.blk.modifySet || !this.model.nidgrp.blk.modifySet.includes("gidtxt")) {
                            let str = this.model.nidgrp.blk.gidtxt + rtnmsg.data;
                            this.model.nidgrp.blk.gidtxt = str
                        }
                    }else if (type === true) {
                        this.model[code].blk.gidtxtc = rtnmsg.data
                    } else {
                        this.model[code].blk.gidtxt = rtnmsg.data
                    }
                }
            })
        },
        getHistory(params) {
            return new Promise(async (resolve) => {
                const rtnmsg = await Api.post(`/public/quesel/getAllOreList`, params);
                if (rtnmsg.respCode === SUCCESS) {
                    this.historyRemark = rtnmsg.data;
                    resolve(rtnmsg.data)
                }
            })
        },
        async tabClick(tab, isChecking) {
            const rmbbopTabs = ['rmb', 'ads2101', 'ads2103', 'ads2106', 'ads2107', 'ads2108', 'ads2111', 'ads2112', 'ads2122', 'ads2123'];
            const cfabopTabs = ['cfacomp', 'cfaeca', 'cfaead', 'cfaeaf'];
            const jshmodTabs = ['jsh', 'basp', 'vrfp'];
            if (rmbbopTabs.includes(tab.name)) {
                this.$refs.rmbbop.activeName = tab.name;
                this.tabVal = 'rmbbop';
            } else if (cfabopTabs.includes(tab.name)) {
                this.$refs.cfabop.activeName = tab.name;
                this.tabVal = 'cfabop';
            } else if (jshmodTabs.includes(tab.name)) {
                this.$refs.jshmod.activeName = tab.name;
                this.tabVal = 'jshmod';
            } else {
                this.tabVal = tab.name;
            }
            if (tab.name === 'liacombo' && (this.model.limmod.buildParams == undefined || this.model.limmod.buildParams == null)) {
                //解决额度只check不手动点击页签不走交易初始化common问题
                this.model.limmod.buildParams = this.buildCommonData(this.model, this.trnName);
            }
            //如果是检核报错触发的tabclick 不走后端试算逻辑 (统一名单由于没有试算 需要触发tabclick)
            if (isChecking && isChecking === '1' && tab.name !== 'usrmd' && tab.name !== 'bptbck') {
                if (tab.name === 'setpan') {
                    //触发业务信息赋值逻辑
                    let params = this.buildCommonData(this.model, this.trnName);
                    this.getSetmodCodeTable(params);
                }
                return;
            }
            if (this.isInDisplay) {
                return
            }
            let name = tab.name;
            switch (name) {
                case 'trtcre':
                    this.executeAfterKey("trtcre", tab.$parent);
                    break;
                case 'dftcre':
                    this.executeAfterKey("dftcre", tab.$parent);
                    break;
                case 'ccvpan':
                    this.executeAfterKey("liaccv", tab.$parent);
                    // let buildCcvpan = this.buildCommonData(this.model, this.trnName);
                    // this.initCcvpan(buildCcvpan);
                    break;
                case 'engp':
                    this.executeAfterKey("liaall", tab.$parent);
                    // let buildEngp = this.buildCommonData(this.model, this.trnName);
                    // this.initEngp(buildEngp);
                    break;
                case 'liauni':
                    this.executeAfterKey("liaccv", tab.$parent);
                    // let buildEngp = this.buildCommonData(this.model, this.trnName);
                    // this.initEngp(buildEngp);
                    break;
                case 'setpan':
                    this.executeAfterKey("setglg", tab.$parent);
                    // let buildSetmod = this.buildCommonData(this.model, this.trnName);
                    // this.initSetmod(buildSetmod);
                    break;
                case 'docpan':
                    this.executeAfterKey(name, tab.$parent);
                    // let buildDocpan = this.buildCommonData(this.model, this.trnName);
                    // this.initDocpan(buildDocpan);
                    break;
                case 'msdetail':
                    this.executeAfterKey("docpan", tab.$parent);
                    break;
                case 'glepan':
                    this.executeAfterKey(name, tab.$parent);
                    // let buildGlepan = this.buildCommonData(this.model, this.trnName);
                    // this.initGlepan(buildGlepan);
										break;
								//发票切换页签初始化
								case 'invchkpan':
										this.model.imgInvmod.pageTable.tableData =this.paginate(this.model.imgInvmod.pageTable.currentPage,this.model.imgInvmod.pageTable.pageSize);
										break
								case 'limitbody':
                    this.executeAfterKey(name, tab.$parent);
                    // let buildLimitbody = this.buildCommonData(this.model, this.trnName);
                    // this.initLimitbody(buildLimitbody);
                    break;
                case 'liacombo':
                    this.executeAfterKey("limitbody", tab.$parent);
                    break;
                case 'doctre':
                    let buildDoctre = this.buildCommonData(this.model, this.trnName);
                    this.initDoctre(buildDoctre);
                    break;
                case 'regulat':
										this.isEntmodDisplay()
                    this.executeAfterKey('forexmod', tab.$parent);
                    // let buildUsrmd = this.buildCommonData(this.model, this.trnName);
                    // this.initUsrmd(buildUsrmd);
                    break;
                // 人民币报送开立和修改
                case 'rmbbop':
                    this.executeAfterKey(name, tab.$parent);
                    break;
                case 'ads2106':
                    this.initRmbbop(this.buildCommonData(this.model, this.trnName));
                    break;
                case 'jshmod':
                    this.executeAfterKey(name, tab.$parent);
                    break;
                // 人民币报送赔付
                case 'rmbbopPf':
                    let buildRmbbopPf = this.buildCommonData(this.model, this.trnName);
                    let transNamePf = buildRmbbopPf.transName;
                    //	let rmbflg2111 = this.model.rmbbop.rmbbop2111Vo.rmbflg
                    this.executeAfterKey(name, tab.$parent);
                    let rmbflg2123 = this.model.rmbbop.rmbbop2123Vo.rmbflg;
                    if (rmbflg2123 === '1') {
                        if (transNamePf.startsWith('g')) {
                            this.init2123gcd(buildRmbbopPf)
                        } else {
                            this.init2123ncd(buildRmbbopPf)
                        }
                    }
                    break;
                // 人民币报送收回
                case 'rmbbopSh':
                    let buildRmbbopSh = this.buildCommonData(this.model, this.trnName);
                    let transNameSh = buildRmbbopSh.transName;
                    //let rmbflg2101Sh = this.model.rmbbop.rmb2101.rmbflg
                    this.executeAfterKey(name, tab.$parent);
                    let rmbflg2112Sh = this.model.rmbbop.rmb2112.rmbflg;
                    if (rmbflg2112Sh === '1') {
                        if (transNameSh.startsWith('g')) {
                            this.init2112gid(buildRmbbopSh)
                        } else {
                            this.init2112nid(buildRmbbopSh)
                        }
                    }
                    let rmbflg2123Sh = this.model.rmbbop.rmbbop2123Vo.rmbflg;
                    if (rmbflg2123Sh === '1') {
                        if (transNameSh.startsWith('g')) {
                            this.init2123gcd(buildRmbbopSh)
                        } else {
                            this.init2123ncd(buildRmbbopSh)
                        }
                    }
                    break;
                case 'cfagit':
                    let buildCfaggi = this.buildCommonData(this.model, this.trnName);
                    this.initCfa(buildCfaggi);
                    break;
                //资本项目报送
                case 'cfabop':
                    this.executeAfterKey(name, tab.$parent);
                    break;
                case 'bopgat':
                    this.executeAfterKey(name, tab.$parent);
                    break;
                case 'boprem':
                    this.executeAfterKey(name, tab.$parent);
                    break;
                case 'boppay':
                    this.executeAfterKey(name, tab.$parent);
                    break;
                case 'yapin':
                    let buildYapin = this.buildCommonData(this.model, this.trnName);
                    this.initYapin(buildYapin);
                    break;
                case 'bptbck':
                    let buildBptbck = this.buildCommonData(this.model, this.trnName);
                    this.initBptbck(buildBptbck);
                    break;
                case 'gedmod':
                    this.initGedmod();
                    break;
                default:
                    return;
            }
        },

        // 提交
        async handleSubmit() {
            if (this.validateSptInr()) {
                return;
            }
            let curWarnList = this.model.warnList;
            // 判断是否存在未读二级warning
            let isHasNoRead = false;
            if (curWarnList && curWarnList.length > 0) {
                isHasNoRead = curWarnList.some((item) => {
                    return item.level === '2' && item.readFlag === 'N'
                })
            }
            if (isHasNoRead) {
                this.$store.commit('updateWarningVisible', true);
                return;
            }
            // 判断是否存在level为1的warning
            let isHasLevel1 = false;
            if (curWarnList && curWarnList.length > 0) {
                isHasLevel1 = curWarnList.some((item) => {
                    return item.level === '1'
                })
            }
            if (isHasLevel1) {
                this.$store.commit('updateWarningVisible', true);
                return;
            }
            await this.submitCallback()
        },
        async submitCallback() {
            // 前端检验
            this.$refs['modelForm'].clearValidate();
            this.$refs['modelForm'].validate(async (validStatic) => {
                if (validStatic) {
                    // 备案表核验
                    if (this.txfmodpCheckFn && typeof this.txfmodpCheckFn == 'function') {
                        let txfmodp = await this.txfmodpCheckFn();
                        if (txfmodp && txfmodp == '1') {
                            return;
                        }
                    }
                    // 额度等校验
                    let commonRule = this.commonComponentCheckCallBack();
                    if (commonRule && commonRule.isOk) {
                        return
                    }
                    let params = {
                        ...this.model,
                        transName: this.trnName,
                        spt: {
                            inr: this.$route.query.businessInr,
                        },
                        liaccvg: this.model.liaccv === undefined ? null : this.model.liaccv.liaccvg,
                        liaccv: this.model.liaccv === undefined ? null : this.model.liaccv,
                        liaallg: this.model.liaall === undefined ? null : this.model.liaall.liaallg,
                        liaall: this.model.liaall === undefined ? null : this.model.liaall,
                        setmod: this.model.setmod === undefined ? null : this.model.setmod,
                        setfog: this.model.setmod === undefined ? null : this.model.setmod.setfog,
                        setfeg: this.model.setmod === undefined ? null : this.model.setmod.setfeg,
                        setglg: this.model.setmod === undefined ? null : this.model.setmod.setglg,
                        doceot: this.model.docpan === undefined ? null : this.model.docpan.doceot,
                        limmod: this.model.limmod === undefined ? null : this.model.limmod,
                        trndia: this.model.trndia === undefined ? null : this.model.trndia,
                        dias: this.model.trndia === undefined ? null : this.model.trndia.dias,
                        remark: this.model.remark === undefined ? null : this.model.remark,
                        umdmod: this.model.umdmod === undefined ? null : this.model.umdmod,
                        ypnmod: this.model.ypnmod === undefined ? null : this.model.ypnmod,
                    };
                    params = this.simplifyRequest(params);
                    const loading = this.loading();
                    this.$store.commit('setLoadingSubmit', true);
                    const rtnmsg = await Api.post(`/${this.moduleRouter()}/${this.trnName}/save`, params);
                    if (rtnmsg.respCode === SUCCESS) {
                        this.checkCallback(rtnmsg.data, true).then(() => {
                            this.$notify({
                                title: '成功',
                                message: '提交成功',
                                type: 'success',
                            });
                            this.$nextTick(() => {
                                this.$store.commit('delTagsArry', this.$route.path);
                                this.$router.back()
                            })
                        }).catch(() => {

                            Utils.copyValueFromVoData(this.model, rtnmsg.data);
                            if (this.model.setmod) {
                                Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data.setmod);
                            }
                            if (this.model.mtabut) {
                                Utils.copyValueFromVoData(this.model.mtabut, rtnmsg.data);
                            }
                            if (this.model.trnmod) {
                                Utils.copyValueFromVoData(this.model.trnmod, rtnmsg.data);
                                this.model.trnmod.doctreTableData1 = [];
                                this.model.trnmod.doctreTableData2 = rtnmsg.data.modifySet || []
                            }
                            if (this.model.liaall) {
                                Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data.liaall);
                            }
                            if (this.model.liaccv) {
                                Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data.liaccv);
                            }
                            if (this.model.docpan) {
                                Utils.copyValueFromVoData(this.model.docpan, rtnmsg.data);
                            }
                            if (this.model.limmod) {
                                if (this.trnName === 'GITZSQ' || this.trnName === 'NITZSQ') {
                                    //do nothing
                                } else {
                                    Utils.copyValueFromVoData(this.model.limmod, rtnmsg.data.limmod);
                                }
                            }
                            if (this.model.trndia) {
                                Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data.trndia);
                            }
                            // 如果返回了统一名单,则将统一名单更新
                            if (this.model.umdmod && rtnmsg.data && rtnmsg.data.umdmod) {
                                Utils.copyValueFromVoData(this.model.umdmod, rtnmsg.data.umdmod);
                            }

                            let errorMap = rtnmsg.data.errorMap;
                            // 后端校验未通过时,返回的errorMap
                            let errorRules = {};
                            if (errorMap && errorMap.ruleMap) {
                                errorRules = errorMap.ruleMap
                            }
                            this.$nextTick(() => {
                                this.showBackendErrors2(errorRules)
                            })
                        })
                    } else {
                        this.$notify({
                            title: "错误",
                            message: rtnmsg.respMsg,
                            type: "error",
                        });
                    }
                    loading.close();
                    this.$store.commit('setLoadingSubmit', false)
                } else {
                    // 前端校验失败
                    this.$notify({
                        title: '失败',
                        message: '校验失败',
                        type: 'error',
                    });
                    this.showFrontendErrors()
                }
            })
        },
        // 检核
        async handleCheck() {
            // 前端检验
            this.$refs['modelForm'].clearValidate();
            this.$refs['modelForm'].validate(async (validStatic) => {
                if (validStatic) {
                    // 备案表核验
                    if (this.txfmodpCheckFn && typeof this.txfmodpCheckFn == 'function') {
                        let txfmodp = await this.txfmodpCheckFn();
                        if (txfmodp && txfmodp == '1') {
                            return;
                        }
                    }
                    // 额度等校验
                    let commonRule = this.commonComponentCheckCallBack();
                    if (commonRule && commonRule.isOk) {
                        return
                    }
                    const loading = this.loading('正在校验数据');
                    this.$store.commit('setLoadingCheck', true);
                    let params = {
                        ...this.model,
                        transName: this.trnName,
                        liaccvg: this.model.liaccv === undefined ? null : this.model.liaccv.liaccvg,
                        liaccv: this.model.liaccv === undefined ? null : this.model.liaccv,
                        liaallg: this.model.liaall === undefined ? null : this.model.liaall.liaallg,
                        liaall: this.model.liaall === undefined ? null : this.model.liaall,
                        setmod: this.model.setmod === undefined ? null : this.model.setmod,
                        setfog: this.model.setmod === undefined ? null : this.model.setmod.setfog,
                        setfeg: this.model.setmod === undefined ? null : this.model.setmod.setfeg,
                        setglg: this.model.setmod === undefined ? null : this.model.setmod.setglg,
                        doceot: this.model.docpan === undefined ? null : this.model.docpan.doceot,
                        limmod: this.model.limmod === undefined ? null : this.model.limmod,
                        trndia: this.model.trndia === undefined ? null : this.model.trndia,
                        dias: this.model.trndia === undefined ? null : this.model.trndia.dias,
                        umdmod: this.model.umdmod === undefined ? null : this.model.umdmod,
                        ypnmod: this.model.ypnmod === undefined ? null : this.model.ypnmod,
                    };
                    params = this.simplifyRequest(params);
                    const rtnmsg = await Api.post(`/${this.moduleRouter()}/${this.trnName}/checkAll`, params);
                    if (rtnmsg.respCode === SUCCESS) {
                        Utils.copyValueFromVoData(this.model, rtnmsg.data);
                        if (this.model.setmod) {
                            Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data);
                            Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data.setmod);
                        }
                        if (this.model.mtabut) {
                            Utils.copyValueFromVoData(this.model.mtabut, rtnmsg.data);
                        }
                        if (this.model.trnmod) {
                            Utils.copyValueFromVoData(this.model.trnmod, rtnmsg.data);
                            this.model.trnmod.doctreTableData1 = [];
                            this.model.trnmod.doctreTableData2 = rtnmsg.data.modifySet || []
                        }
                        if (this.model.liaall) {
                            Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data);
                            Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data.liaall);
                        }
                        if (this.model.liaccv) {
                            Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data);
                            Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data.liaccv);
                        }
                        if (this.model.docpan) {
                            Utils.copyValueFromVoData(this.model.docpan, rtnmsg.data);
                        }
                        if (this.model.limmod) {
                            if (this.trnName === 'GITZSQ' || this.trnName === 'NITZSQ') {
                                //do nothing
                            } else {
                                Utils.copyValueFromVoData(this.model.limmod, rtnmsg.data.limmod);
                            }
                        }
                        if (this.model.trndia) {
                            Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data);
                            Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data.trndia);
                        }
                        // 如果返回了统一名单,则将统一名单更新
                        if (this.model.umdmod && rtnmsg.data && rtnmsg.data.umdmod) {
                            Utils.copyValueFromVoData(this.model.umdmod, rtnmsg.data.umdmod);
                        }
                        this.$nextTick(
                            () => this.checkCallback(rtnmsg.data).then(async () => {
                                await this.recalcLimitBody();
                            })
                        )
                    }
                    loading.close();
                    this.$store.commit('setLoadingCheck', false)
                } else {
                    // 前端校验失败
                    this.$notify({
                        title: '失败',
                        message: '校验失败',
                        type: 'error',
                    });
                    this.showFrontendErrors()
                }
            })
				},
				isEntmodDisplay(){
					if (this.model.entmod){
						this.model.entmod.visflg = '';
						let trnName = this.trnName;
						if ("-CPTOPN-CPTATO-".includes(trnName.toUpperCase())) {
							if (this.model.cpdgrp.rec.trntyp === '01') {
								this.model.entmod.visflg = 'X';
							}
						}
						if ("-CPTREP-CPTADV-CPTATI-".includes(trnName.toUpperCase())) {
							if (this.model.cpdgrp.rec.trntyp === '01' && this.model.cpdgrp.rec.accmod != '2') {
								this.model.entmod.visflg = 'X';
							}
						}
						if ("-BOTDAV1-BCTDAV1-BOTSET-BCTSET1-BETSET-TRTOPN-BCTACC1-LETOPN-LETRSV1-LETDRW1-LTTOPN1-LTTAME1-BTTSET-".includes(trnName.toUpperCase())) {
							this.model.entmod.visflg = 'X';
						}
						if ("-BRTUDP1-BRTSET1-LITOPN1-".includes(trnName.toUpperCase())) {
							if (this.model.lidgrp.rec.dkflg === 'X') {
								let extkey = this.model.lidgrp.apo.pts.extkey;
								if (extkey.startsWith('9999') || extkey.startsWith('Temp')) {
									this.model.entmod.visflg = '';
								} else {
									this.model.entmod.visflg = 'X';
								}
							} else {
								this.model.entmod.visflg = 'X';
							}
						}
						if (trnName === 'bptopn') {
								if ("-I-P-D-".includes(this.model.bpdgrp.rec.fintyp)) {
									this.model.entmod.visflg = 'X';
								}
								if ("-F-U-".includes(this.model.bpdgrp.rec.fintyp) && this.model.bpdgrp.rec.fortyp === '1') {
									this.model.entmod.visflg = 'X';
								}
						}
						if (trnName === 'litame' || trnName === 'litame1') {
							if (this.model.lidgrp.rec.dkflg === 'X') {
								let extkey = this.model.lidgrp.apo.pts.extkey;
								if (extkey.startsWith('9999') || extkey.startsWith('Temp')) {
										this.model.entmod.visflg = '';
								} else {
										this.model.entmod.visflg = 'X';
								}
							} else {
								this.model.entmod.visflg = 'X';
							}
						}
						if (trnName === 'jstopn' || trnName === 'jstopt') {
							if (this.model.jsdgrp.rec.maimpz === '4' && this.model.verifyFlag === 'X') {
								this.model.entmod.visflg = 'X';
							}
						}
						if (this.model.entmod.visflg === '') {
							this.model.entmod.isShowErrorMsg = false;
						}
					}
				},
        showBackendErrors2(errorRules) {
            let keysList = Object.keys(errorRules);
            if (!keysList.length) {
                return
            }
            const tab = this.showBackendErrors(errorRules);
            if (tab) {
                // 判断校验失败的表单不属于当前的tab,则切换tab到对应报错的tab页面
                if (tab.name !== this.tabVal) {
                    this.tabClick(tab, '1');
                }
            }

            let errorRuleList = [];
            keysList.map((item) => {
                let idx = this.$refs.modelForm.fields.findIndex(field => {
                    return field.prop === item
                });
                if (idx < 0 && item != 'entmod.rtyflg') {
                    errorRuleList.push({
                        msg: `${item}${errorRules[item]}`
                    })
                }
                // if (this.rules[item] === undefined || this.rules[item] === null) {

                // }
            });
            if (errorRuleList.length > 0) {
                this.$store.commit('updateErrorRuleVisible', true);
                this.$store.commit('updateErrorRuleList', errorRuleList)

            }
        },
        // 校验回调
        checkCallback(rtnmsg, isSubmit) {
            this.handleWarning(rtnmsg);
            return new Promise((resolve, reject) => {
                let errorMap = rtnmsg.errorMap;
                let errorList = [];
                if (errorMap && errorMap.errorList) {
                    errorList = errorMap.errorList
                }
                let shouldRej = false;
                // 判断是否弹出error
                if (errorList && errorList.length > 0) {
                    let errorMsg = '<div>';
                    errorList.map((errorItem) => {
                        errorMsg += `<div>${errorItem.message}</div>`
                    });
                    errorMsg += '</div>';

                    this.$notify({
                        title: "提示",
                        dangerouslyUseHTMLString: true,
                        message: errorMsg,
                        type: "warning",
                    });
                    shouldRej = true
                }
                // 后端校验未通过时,返回的errorMap
                let errorRules = {};
                if (errorMap && errorMap.ruleMap) {
                    errorRules = errorMap.ruleMap
                }
                let keysList = Object.keys(errorRules);
                // 如果后端返回的对象为空,则后端校验成功
                if (!shouldRej && !keysList.length) {
                    // 清除之前的校验状态
                    this.$refs['modelForm'].clearValidate();
                    if (!isSubmit) {
                        this.$notify({
                            title: "成功",
                            message: "校验成功",
                            type: "success",
                        });
                    }
                } else {
                    if (!isSubmit || isSubmit === -1) {
                        this.showBackendErrors2(errorRules)
                    }
                    shouldRej = true
                }
                // warning有变化时
                if (errorMap && errorMap.warningListChange && errorMap.warningListChange === 'Y') {
                    // this.$alert('警告信息有变化,请查看', 'warning', {
                    //     confirmButtonText: '我知道了',
                    //     callback: action => {
                    //     }
                    // });
                    this.$set(this.model, 'warnFlg', 'Y');
                    shouldRej = true
                } else {
                    this.$set(this.model, 'warnFlg', '')
                }
                if (shouldRej) {
                    reject("校验失败");
                } else {
                    resolve()
                }
            })
        },
        // 公共组件的一些校验事件
        commonComponentCheckCallBack() {
            let commonFn = PubCheckEvent;
            let commonFnList = Object.keys(commonFn);
            let resFn = null;
            for (let i = 0; i < commonFnList.length; i++) {
                resFn = commonFn[commonFnList[i]].call(this);
                if (resFn && resFn.isOk) {
                    break;
                }
            }
            if (resFn && resFn.isOk) {
                let fields = this.$refs['modelForm'].fields;
                for (let i = 0; i < fields.length; i++) {
                    let parentVC = fields[i];
                    let firstErrorTab = null;
                    // while循环找出哪个tab和Collapse中报出的校验失败
                    while (!firstErrorTab) {
                        const vcName = parentVC.$options.name;
                        if (vcName === "ElTabPane") {
                            firstErrorTab = parentVC;
                            break;
                        }
                        parentVC = parentVC.$parent;
                    }
                    if (firstErrorTab.name === resFn.name) {
                        const tabs = firstErrorTab.$parent;
                        tabs.currentName = firstErrorTab.name;
                        this.tabClick(firstErrorTab);
                        break;
                    }
                }
            }
            return resFn
        },
        // 前端校验失败时候,tab和Collapse组件效果处理
        showFrontendErrors() {
            this.$nextTick(() => {
                let fields = this.$refs['modelForm'].fields;
                let parentVC = null;
                for (let i = 0; i < fields.length; i++) {
                    let fieldItem = fields[i];
                    if (fieldItem.validateState === 'error') {
                        parentVC = fieldItem;
                        break;
                    }
                }
                let firstErrorTab = null;
                let collapsePanel = null;
                // while循环找出哪个tab和Collapse中报出的校验失败
                while (true) {
                    const vcName = parentVC.$options.componentName;
                    // 没有Tabs的表单
                    if (vcName === "ElForm") {
                        break;
                    }
                    if (vcName === "ElTabPane") {
                        firstErrorTab = parentVC;
                        break;
                    }
                    if (vcName === "ElCollapseItem") {
                        collapsePanel = parentVC;
                    }
                    parentVC = parentVC.$parent;
                }
                if (firstErrorTab && firstErrorTab.name !== this.tabVal) {
                    const tabs = firstErrorTab.$parent;
                    tabs.currentName = firstErrorTab.name;
                    this.tabClick(firstErrorTab);
                }
                if (collapsePanel && collapsePanel.collapse.activeNames.indexOf(collapsePanel.name) < 0) {
                    collapsePanel.collapse.activeNames.push(collapsePanel.name)
                }
                setTimeout(() => {
                    let isError = document.querySelectorAll('.is-error');
                    isError[0].scrollIntoView({
                        block: 'center',
                        behavior: 'smooth'
                    })
                }, 0);
            })
        },
        // 后端校验
        showBackendErrors(fieldErrors) {
            // 清除之前的校验状态
            if (!this.$refs.modelForm) {
                return
            }
            const fields = this.$refs.modelForm.fields;
            console.log('backFileds', fields);
            return Utils.positioningErrorMsg(fieldErrors, fields);
        },
        // 暂存
        async handleStash() {
            if (this.validateSptInr()) {
                this.$store.commit('setLoadingStash', false);
                return;
            }
            const loading = this.loading('正在暂存数据');
            let params = {
                ...this.model,
                transName: this.trnName.toUpperCase(),
                liaccvg: this.model.liaccv === undefined ? null : this.model.liaccv.liaccvg,
                liaccv: this.model.liaccv === undefined ? null : this.model.liaccv,
                liaallg: this.model.liaall === undefined ? null : this.model.liaall.liaallg,
                liaall: this.model.liaall === undefined ? null : this.model.liaall,
                setmod: this.model.setmod === undefined ? null : this.model.setmod,
                setfog: this.model.setmod === undefined ? null : this.model.setmod.setfog,
                setfeg: this.model.setmod === undefined ? null : this.model.setmod.setfeg,
                setglg: this.model.setmod === undefined ? null : this.model.setmod.setglg,
                doceot: this.model.docpan === undefined ? null : this.model.docpan.doceot,
                limmod: this.model.limmod === undefined ? null : this.model.limmod,
                trndia: this.model.trndia === undefined ? null : this.model.trndia,
                dias: this.model.trndia === undefined ? null : this.model.trndia.dias,
                remark: this.model.remark === undefined ? null : this.model.remark,
                umdmod: this.model.umdmod === undefined ? null : this.model.umdmod,
                ypnmod: this.model.ypnmod === undefined ? null : this.model.ypnmod,
                spt: {
                    inr: this.$route.query.businessInr,
                },
            };
            if (params.umdmod && params.umdmod.buildParams) {
                delete params.umdmod.buildParams;
            }
            params = this.simplifyRequest(params);
            const res = await Api.post(`/${this.moduleRouter()}/${this.trnName}/txnHold`, params);
            if (res.respCode === SUCCESS) {
                this.$notify({
                    title: '成功',
                    message: '暂存成功',
                    type: 'success',
                });
                this.$store.commit('delTagsArry', this.$route.path);
                this.$router.back()
            }
            loading.close();
            this.$store.commit('setLoadingStash', false)
        },
        // 复核
        async handlePass(params) {
            const loading = this.loading();
            if (this.$store.state["infoEntrank"]) {
                params.infoEntrank = true;
            }
            if (this.$store.state["infoChkmsg"]) {
                params.infoChkmsg = true;
            }
            if (this.$store.state["confirm0958"]) {
                params.confirm0958 = true;
            }
            if (this.$store.state["confirmMainRw02"]) {
                params.confirmMainRw02 = true;
            }
            if (this.$store.state["confirmOthRw02"]) {
                params.confirmOthRw02 = true;
            }
            if (this.$store.state["confirmFinwar"]) {
                params.confirmFinwar = true;
            }
            if (this.$store.state["confirmBuyXrt"]) {
                params.confirmBuyXrt = true;
            }
            if (this.$store.state["confirmSellXrt"]) {
                params.confirmSellXrt = true;
            }
            const res = await Api.post(`/public/trnrel/relrow`, params);
            if (res.respCode === SUCCESS) {
                this.$notify({title: '成功', message: res.respMsg, type: 'success',});
                this.$store.commit('delTagsArry', this.$route.path);
                this.$router.back();
                this.clearResp();
            } else if (res.respCode.includes("confirm")) {
                let confirmMsg2 = res.data && res.data.confirmMsg ? res.data.confirmMsg : [];
                this.alertConfirm(confirmMsg2, params, res.respMsg, res.respCode);
            } else if (res.respCode.includes("info")) {
                let confirmMsg = res.data && res.data.confirmMsg ? res.data.confirmMsg : [];
                this.alertFormat(confirmMsg, params, res.respMsg, res.respCode);
            } else {
                this.$notify({title: "错误", message: res.respMsg, type: "error"});
                this.clearResp();
            }
            this.$store.commit('setLoadingPass', false);
            loading.close();
            // if (res.respCode === "CHECKECIF0958" && !res.data.confirm) {
            //     //ECIF0958交易校验不通过,不允许复核业务
            //     let confirmMsg = res.data.confirmMsg;
            //     const h = this.$createElement;
            //     this.$alert(
            //         h('div', [
            //             h('p', confirmMsg[0]),
            //             h('p', confirmMsg[1]),
            //             h('p', confirmMsg[2]),
            //             h('p', confirmMsg[3]),
            //             h('p', confirmMsg[4]),
            //             h('p', confirmMsg[5]),
            //             h('p', confirmMsg[6]),
            //             h('p', confirmMsg[7])
            //         ]),
            //         '提示', {
            //             confirmButtonText: '确定',
            //             type: 'warning',
            //         }).then(async () => {
            //         loading.close();
            //         this.$store.commit('setLoadingPass', false)
            //     })
            // } else if (res.respCode === "CHECKECIF0958" && res.data.confirm) {
            //     //ECIF0958交易校验通过,允许复核业务有提示
            //     let confirmMsg = res.data.confirmMsg;
            //     const h = this.$createElement;
            //     this.$confirm(
            //         h('div', [
            //             h('p', confirmMsg[0]),
            //             h('p', confirmMsg[1]),
            //             h('p', confirmMsg[2]),
            //             h('p', confirmMsg[3]),
            //             h('p', confirmMsg[4]),
            //             h('p', confirmMsg[5]),
            //             h('p', confirmMsg[6]),
            //             h('p', confirmMsg[7])
            //         ]),
            //         '提示', {
            //             confirmButtonText: '确定',
            //             cancelButtonText: '取消',
            //             type: 'warning',
            //         }).then(async () => {
            //         const loading = this.loading();
            //         params.ecif0958choice = "X";
            //         let ress = await Api.post(`/public/trnrel/relrow`, params);
            //         if (ress.respCode === SUCCESS) {
            //             this.$notify({
            //                 title: '成功',
            //                 message: ress.respMsg,
            //                 type: 'success',
            //             });
            //             loading.close();
            //             this.$store.commit('delTagsArry', this.$route.path);
            //             this.$router.back()
            //         } else if (ress.respCode === "CHECKRW02") {
            //             let confirmMsg = ress.data.confirmMsg;
            //             const h = this.$createElement;
            //             this.$confirm(
            //                 h('div', [
            //                     h('p', confirmMsg[0]),
            //                     h('p', confirmMsg[1]),
            //                     h('p', confirmMsg[2]),
            //                     h('p', confirmMsg[3]),
            //                     h('p', confirmMsg[4]),
            //                     h('p', confirmMsg[5]),
            //                     h('p', confirmMsg[6]),
            //                     h('p', confirmMsg[7])
            //                 ]),
            //                 '提示', {
            //                     confirmButtonText: '确定',
            //                     cancelButtonText: '取消',
            //                     type: 'warning',
            //                 }).then(async () => {
            //                 const loading = this.loading();
            //                 params.rw02choice = "X";
            //                 let resss = await Api.post(`/public/trnrel/relrow`, params);
            //                 if (resss.respCode === SUCCESS) {
            //                     this.$notify({
            //                         title: '成功',
            //                         message: resss.respMsg,
            //                         type: 'success',
            //                     });
            //                     loading.close();
            //                     this.$store.commit('delTagsArry', this.$route.path);
            //                     this.$router.back()
            //                 } else {
            //                     this.$notify({
            //                         title: "错误",
            //                         message: resss.respMsg,
            //                         type: "error"
            //                     });
            //                     loading.close();
            //                 }
            //             }).catch((e) => {
            //                 loading.close();
            //             });
            //             this.$store.commit('setLoadingPass', false)
            //         } else {
            //             this.$notify({
            //                 title: "错误",
            //                 message: ress.respMsg,
            //                 type: "error"
            //             });
            //             loading.close();
            //         }
            //     }).catch((e) => {
            //         loading.close();
            //     });
            //     this.$store.commit('setLoadingPass', false)
            // } else if (res.respCode === "CHECKRW02") {
            //     let confirmMsg = res.data.confirmMsg;
            //     const h = this.$createElement;
            //     this.$confirm(
            //         h('div', [
            //             h('p', confirmMsg[0]),
            //             h('p', confirmMsg[1]),
            //             h('p', confirmMsg[2]),
            //             h('p', confirmMsg[3]),
            //             h('p', confirmMsg[4]),
            //             h('p', confirmMsg[5]),
            //             h('p', confirmMsg[6]),
            //             h('p', confirmMsg[7])
            //         ]),
            //         '提示', {
            //             confirmButtonText: '确定',
            //             cancelButtonText: '取消',
            //             type: 'warning',
            //         }).then(async () => {
            //         const loading = this.loading();
            //         params.rw02choice = "X";
            //         let resss = await Api.post(`/public/trnrel/relrow`, params);
            //         if (resss.respCode === SUCCESS) {
            //             this.$notify({
            //                 title: '成功',
            //                 message: resss.respMsg,
            //                 type: 'success',
            //             });
            //             loading.close();
            //             this.$store.commit('delTagsArry', this.$route.path);
            //             this.$router.back()
            //         } else {
            //             this.$notify({
            //                 title: "错误",
            //                 message: resss.respMsg,
            //                 type: "error"
            //             });
            //             loading.close();
            //         }
            //     }).catch((e) => {
            //         loading.close();
            //     });
            //     this.$store.commit('setLoadingPass', false)
            // } else {
            //     this.$notify({
            //         title: "错误",
            //         message: res.respMsg,
            //         type: "error",
            //     });
            //     loading.close();
            //     this.$store.commit('setLoadingPass', false)
            // }
            // }
        },

        clearResp() {
            delete this.$store.state["infoEntrank"];
            delete this.$store.state["infoChkmsg"];
            delete this.$store.state["info0958"];
            delete this.$store.state["infoRW02"];
            delete this.$store.state["confirm0958"];
            delete this.$store.state["confirmMainRw02"];
            delete this.$store.state["confirmOthRw02"];
            delete this.$store.state["confirmFinwar"];
            delete this.$store.state["confirmBuyXrt"];
            delete this.$store.state["confirmSellXrt"];
        },
        alertConfirm(confirmMsg, params, respMsg, respCode) {
            const h = this.$createElement;
            this.$confirm(
                confirmMsg.length > 0 ? h('div', [
                    h('p', confirmMsg[0]),
                    h('p', confirmMsg[1]),
                    h('p', confirmMsg[2]),
                    h('p', confirmMsg[3]),
                    h('p', confirmMsg[4]),
                    h('p', confirmMsg[5]),
                    h('p', confirmMsg[6]),
                    h('p', confirmMsg[7])
                ]) : respMsg,
                '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning',
                }).then(async () => {
                this.$store.state[respCode] = true;
                this.handlePass(params);
            });
            this.clearResp();
        },

        alertFormat(confirmMsg, params, respMsg, respCode) {
            const h = this.$createElement;
            this.$alert(confirmMsg.length > 0 ?
                h('div', [
                    h('p', confirmMsg[0]),
                    h('p', confirmMsg[1]),
                    h('p', confirmMsg[2]),
                    h('p', confirmMsg[3]),
                    h('p', confirmMsg[4]),
                    h('p', confirmMsg[5]),
                    h('p', confirmMsg[6]),
                    h('p', confirmMsg[7])
                ]) : respMsg,
                '提示', {
                    confirmButtonText: '确定',
                    type: 'warning',
                }).then(async () => {
                if (respCode === "infoEntrank" || respCode === "infoChkmsg") {
                    this.$store.state[respCode] = true;
                    this.handlePass(params);
                }
                if (respCode === "info0958") {
                    //ECIF0958
                    this.clearResp();
                }
                if (respCode === "infoRW02") {
                    //RW02 预警命中  05 和 07 不允许release
                    this.clearResp();
                }
            });
        },
        // 打回
        async handleRefuse(params) {
            const loading = this.loading();
            const res = await Api.post(`/public/trnrel/reprow`, params);
            if (res.respCode === SUCCESS) {
                this.$notify({
                    title: '成功',
                    message: '打回成功',
                    type: 'success',
                });
                loading.close();
                this.$store.commit('delTagsArry', this.$route.path);
                this.$router.back()
            } else {
                if (res && res.respMsg !== "OK") {
                    this.$notify({
                        title: "错误",
                        message: res.respMsg,
                        type: "error",
                    });
                    loading.close();
                }
            }
            this.$store.commit('setLoadingRefuse', false)
        },
        // 检核 promise
        handleCheckPromise() {
            return new Promise((resolve, reject) => {
                // 前端检验
                this.$refs['modelForm'].validate(async (validStatic) => {
                    if (validStatic) {
                        // 额度等校验
                        let commonRule = this.commonComponentCheckCallBack();
                        if (commonRule && commonRule.isOk) {
                            return
                        }
                        const loading = this.loading('正在校验数据');
                        let params = {
                            ...this.model,
                            transName: this.trnName,
                            liaccvg: this.model.liaccv === undefined ? null : this.model.liaccv.liaccvg,
                            liaccv: this.model.liaccv === undefined ? null : this.model.liaccv,
                            liaallg: this.model.liaall === undefined ? null : this.model.liaall.liaallg,
                            liaall: this.model.liaall === undefined ? null : this.model.liaall,
                            setmod: this.model.setmod === undefined ? null : this.model.setmod,
                            setfog: this.model.setmod === undefined ? null : this.model.setmod.setfog,
                            setfeg: this.model.setmod === undefined ? null : this.model.setmod.setfeg,
                            setglg: this.model.setmod === undefined ? null : this.model.setmod.setglg,
                            doceot: this.model.docpan === undefined ? null : this.model.docpan.doceot,
                            limmod: this.model.limmod === undefined ? null : this.model.limmod,
                            trndia: this.model.trndia === undefined ? null : this.model.trndia,
                            dias: this.model.trndia === undefined ? null : this.model.trndia.dias,
                            umdmod: this.model.umdmod === undefined ? null : this.model.umdmod,
                            ypnmod: this.model.ypnmod === undefined ? null : this.model.ypnmod,
                        };
                        params = this.simplifyRequest(params);
                        const rtnmsg = await Api.post(`/${this.moduleRouter()}/${this.trnName}/checkAll`, params);

                        loading.close();
                        if (rtnmsg.respCode === SUCCESS) {
                            Utils.copyValueFromVoData(this.model, rtnmsg.data);
                            if (this.model.setmod) {
                                Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.setmod, rtnmsg.data.setmod);
                            }
                            if (this.model.mtabut) {
                                Utils.copyValueFromVoData(this.model.mtabut, rtnmsg.data);
                            }
                            if (this.model.trnmod) {
                                Utils.copyValueFromVoData(this.model.trnmod, rtnmsg.data);
                                this.model.trnmod.doctreTableData1 = [];
                                this.model.trnmod.doctreTableData2 = rtnmsg.data.modifySet || []
                            }
                            if (this.model.liaall) {
                                Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.liaall, rtnmsg.data.liaall);
                            }
                            if (this.model.liaccv) {
                                Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.liaccv, rtnmsg.data.liaccv);
                            }
                            if (this.model.docpan) {
                                Utils.copyValueFromVoData(this.model.docpan, rtnmsg.data);
                            }
                            if (this.model.limmod) {
                                if (this.trnName === 'GITZSQ' || this.trnName === 'NITZSQ') {
                                    //do nothing
                                } else {
                                    Utils.copyValueFromVoData(this.model.limmod, rtnmsg.data.limmod);
                                }
                            }
                            if (this.model.trndia) {
                                Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data);
                                Utils.copyValueFromVoData(this.model.trndia, rtnmsg.data.trndia);
                            }
                            // 如果返回了统一名单,则将统一名单更新
                            if (this.model.umdmod && rtnmsg.data && rtnmsg.data.umdmod) {
                                Utils.copyValueFromVoData(this.model.umdmod, rtnmsg.data.umdmod);
                            }
                            this.$nextTick(
                                () => this.checkCallback(rtnmsg.data, -1).then(() => resolve())
                            )
                        }
                    } else {
                        // 前端校验失败
                        this.$notify({
                            title: '失败',
                            message: '校验失败',
                            type: 'error',
                        });
                        this.showFrontendErrors()
                    }
                })
            })
        },
        async handleTransExit() {
            if (this.$initParams && this.$initParams.params && this.trnName && !this.root) {
                const res = await Api.post(`/${this.$initParams.currentRouteModule}/${this.trnName}/exit`, this.$initParams.params);
                console.log(res);
            }
        },
        simplifyRequest(params) {
            let cloneParams = cloneDeep(params);
            if (cloneParams.liaccv) {
                delete cloneParams.liaccv.liaccvg;
                delete cloneParams.liaccv.buildParams;
            }
            if (cloneParams.liaall) {
                delete cloneParams.liaall.liaallg;
                delete cloneParams.liaall.buildParams;
            }
            if (cloneParams.setmod) {
                delete cloneParams.setmod.setfog;
                delete cloneParams.setmod.setfeg;
                delete cloneParams.setmod.setglg;
                delete cloneParams.setmod.buildParams;
                delete cloneParams.setmod.foreignRoleSet;
                delete cloneParams.setmod.roleSet;
                delete cloneParams.setmod.feeCodeSet;
            }
            if (cloneParams.trndia) {
                delete cloneParams.trndia.dias;
                delete cloneParams.trndia.buildParams;
            }
            return cloneParams;
        },
        validateSptInr() {
            let businessInr = this.$route.query.businessInr;
            let businessType = this.$route.query.businessType;
            if (businessType === 'SPT' && businessInr) {
                if (this.model.spt && this.model.spt.inr !== businessInr) {
                    console.log(businessInr + "|...|" + this.model.spt.inr);
                    this.$notify.error({
                        title: "错误",
                        message: "系统发现数据与界面存在不一致情况,请联系管理员登记问题!"
                    });
                    return true
                }
            }
            return false
        }
    },
    beforeDestroy() {
        this.handleTransExit()
    },
    created() {
        let trnNameRouter = this.trnNameRouter();
        if (trnNameRouter) {
            this.$sourceTrnName = this.trnName;
            this.trnName = trnNameRouter
        }
    }
}