creditDetail.vue 40.6 KB
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
<template>
  <div class="body_wrap">
    <div class="w80">
      <div class="common_con mb10">
        <el-row :gutter="40">
          <el-col :span="2" style="position: relative">
            <div class="col_title title_color_0" v-if="state.enterpriseInfo.name">
              <div>{{state.enterpriseInfo.name.substring(0, 2)}}</div>
              <div>{{state.enterpriseInfo.name.substring(2, 4)}}</div>
            </div>
          </el-col>
          <el-col :span="21">
            <!--企业信息模块-->
            <el-descriptions :column="4">
              <template v-for="col in state.columnsList">
                <el-descriptions-item v-if="col.prop != 'regStatus'" :label="col.label">
                  <template v-if="col.prop.indexOf(',') > -1">
                    {{state.enterpriseInfo[col.prop.split(',')[0]] + '至' + state.enterpriseInfo[col.prop.split(',')[1]]}}
                  </template>
                  <template v-else-if="col.type && col.type === 'date'">
                    {{DateUtil.formatDate(state.enterpriseInfo[col.prop])}}
                  </template>
                  <template v-else>
                    {{contentFormat(state.enterpriseInfo[col.prop])}}
                  </template>
                </el-descriptions-item>
              </template>
              <template #title>
                <div class="mb10">
                  {{state.enterpriseInfo.name}}
                  <el-tag class="ml20" type="success">{{state.enterpriseInfo.status}}</el-tag>
                </div>
                <!--        <div>
                          <el-tag class="mr10" type="info" v-for="tag in state.enterpriseInfo.tags" size="small">{{tag}}</el-tag>
                        </div>-->
              </template>
              <template #extra>
                <template v-if="state.creditDataInfo.creditReport">
                  <el-button type="primary" size="large" :loading="state.isSubmit" @click="handleSubmit(state.creditDataInfo.creditReport)">查看授信报告</el-button>
                </template>
                <el-button v-else type="primary" size="large" v-if="isHaveButton('front:getCreditReport')" :loading="state.isSubmit" @click="handleSubmit(1)">生成授信报告</el-button>
              </template>
            </el-descriptions>
          </el-col>
        </el-row>
      </div>
    </div>

    <div class="w80">
      <div class="common_con mb10">
        <el-row :gutter="40">
          <el-col :span="12">
            <div id="enterpriseAnalystId" style="width: 100%; height: 400px"></div>
          </el-col>
          <el-col :span="12" style="display: flex; align-items: center">
            <div>
              <h3>企业各维度分析:</h3>
              <div v-for="item in state.creditAnalysis" class="analyst_content">{{item.name}}:{{item.value}}</div>
            </div>
          </el-col>
        </el-row>
      </div>

      <div class="common_con mb10">
        <el-row :gutter="40">
          <el-col :span="10">
            <div id="levelId" style="width: 100%; height: 400px"></div>
          </el-col>
          <el-col :span="14" style="display: flex; align-items: center">
            <div style="width: 100%">
              <el-row style="text-align: center">
                <el-col :span="4">
                  <div style="float: left">
                    <div style="font-size: 40px">{{state.creditDataInfo.creditLv}}</div>
                    <div>信用级别</div>
                  </div>
                </el-col>
                <el-col :span="10">
                  <div style="font-size: 40px">{{state.creditDataInfo.creditLimit}}<span style="font-size: 20px">万元</span></div>
                  <div>建议授信额度</div>
                </el-col>
                <el-col :span="10" v-if="state.creditDataInfo.creditLimitLast">
                  <div style="font-size: 40px">{{state.creditDataInfo.creditLimitLast}}<span style="font-size: 20px">万元</span></div>
                  <div>申请授信额度</div>
                </el-col>
              </el-row>
              <div class="mt20">
                等级释义:目标公司信用良好,目前往来交易无问题。
              </div>
            </div>
          </el-col>
        </el-row>
      </div>

      <div class="common_con mb10">
        <el-tabs type="card" @tab-click="handleTabClick" v-model="state.tabLabel">
          <el-tab-pane v-for="(tab, tabIndex) in state.tabList" :label="tab.name" :name="tabIndex" style="padding: 0">

            <div class="table_wrap" v-for="item in state.modelList[tab.prop]">
              <div class="table_title">
                {{item.name}}
              </div>
              <el-descriptions border v-if="state.detailItem[item.id].type === 'desc'" :column="state.detailItem[item.id].column">
                <template v-for="col in state.detailItem[item.id].data">
                  <el-descriptions-item :label="col.label" :span="col.span" width="100px">
                    <template v-if="col.prop.indexOf(',') > -1">
                      {{state.creditDataInfo[col.prop.split(',')[0]] + '至' + state.creditDataInfo[col.prop.split(',')[1]]}}
                    </template>
                    <template v-else-if="col.type && col.type === 'date'">
                      {{DateUtil.formatDate(state.enterpriseInfo[col.prop])}}
                    </template>
                    <template v-else-if="col.type && col.type === 'file'">
                      <template v-if="state.creditDataInfo[col.prop]">
                        <template v-if="Array.isArray(JSON.parse(state.creditDataInfo[col.prop]))">
                          <el-link v-for="item in JSON.parse(state.creditDataInfo[col.prop])" :href="item.url" target="_blank">{{item.fileName}}</el-link>
                        </template>
                        <template v-else>
                          <el-link :href="JSON.parse(state.creditDataInfo[col.prop]).url" target="_blank">{{JSON.parse(state.creditDataInfo[col.prop]).fileName}}</el-link>
                        </template>
                      </template>
                    </template>
                    <template v-else>
                      {{contentFormat(state[state.detailItem[item.id].dataSource][col.prop])}}
                    </template>
                  </el-descriptions-item>
                </template>
              </el-descriptions>

              <el-table :data="state.detailData[item.id] && state.detailData[item.id].rows" border class="own_table" v-else>
                <el-table-column v-for="item in state.detailItem[item.id].data" :label="item.label" :prop="item.prop">
                  <template #default="scope">
                    <template v-if="item.type && item.type === 'date' && ((typeof scope.row[item.prop] === 'string' && scope.row[item.prop].indexOf('-') === -1) || (typeof scope.row[item.prop] === 'number'))">
                      {{DateUtil.formatDate(scope.row[item.prop])}}
                    </template>
                  </template>
                </el-table-column>
              </el-table>

            </div>

            <template v-if="tab.prop === 'score'">
              <table class="scoreTable" v-if="state.creditDataInfo.evaluationModeList">
                <tr>
                  <th>一级指标</th>
                  <th>得分</th>
                  <th>二级级指标</th>
                  <th>得分</th>
                  <th>三级指标</th>
                  <th>得分</th>
                </tr>
                <tr>
                  <td rowspan="4">企业规模</td>
                  <td rowspan="4">{{state.creditDataInfo.evaluationModeList[30].score}}</td>
                  <td rowspan="3">经营规模</td>
                  <td rowspan="3">{{state.creditDataInfo.evaluationModeList[19].score}}</td>
                  <td>注册资本</td>
                  <td>{{state.creditDataInfo.evaluationModeList[0].score}}</td>
                </tr>
                <tr>
                  <td>资产规模</td>
                  <td>{{state.creditDataInfo.evaluationModeList[1].score}}</td>
                </tr>
                <tr>
                  <td>销售规模</td>
                  <td>{{state.creditDataInfo.evaluationModeList[2].score}}</td>
                </tr>
                <tr>
                  <td>对外投资</td>
                  <td>{{state.creditDataInfo.evaluationModeList[20].score}}</td>
                  <td>关联企业数量</td>
                  <td>{{state.creditDataInfo.evaluationModeList[3].score}}</td>
                </tr>

                <tr>
                  <td rowspan="3">基本素质</td>
                  <td rowspan="3">{{state.creditDataInfo.evaluationModeList[31].score}}</td>
                  <td>经营时长</td>
                  <td>{{state.creditDataInfo.evaluationModeList[21].score}}</td>
                  <td>经营时长</td>
                  <td>{{state.creditDataInfo.evaluationModeList[4].score}}</td>
                </tr>
                <tr>
                  <td rowspan="2">企业类型</td>
                  <td rowspan="2">{{state.creditDataInfo.evaluationModeList[22].score}}</td>
                  <td>企业性质</td>
                  <td>{{state.creditDataInfo.evaluationModeList[5].score}}</td>
                </tr>
                <tr>
                  <td>企业类型</td>
                  <td>{{state.creditDataInfo.evaluationModeList[6].score}}</td>
                </tr>

                <tr>
                  <td rowspan="3">高管素质</td>
                  <td rowspan="3">{{state.creditDataInfo.evaluationModeList[32].score}}</td>
                  <td>高管素质</td>
                  <td>{{state.creditDataInfo.evaluationModeList[23].score}}</td>
                  <td>高管从业经验</td>
                  <td>{{state.creditDataInfo.evaluationModeList[7].score}}</td>
                </tr>
                <tr>
                  <td rowspan="2">高管稳定性</td>
                  <td rowspan="2">{{state.creditDataInfo.evaluationModeList[24].score}}</td>
                  <td>股东稳定性</td>
                  <td>{{state.creditDataInfo.evaluationModeList[8].score}}</td>
                </tr>
                <tr>
                  <td>高管稳定性</td>
                  <td>{{state.creditDataInfo.evaluationModeList[9].score}}</td>
                </tr>

                <tr>
                  <td rowspan="4">经营稳定性</td>
                  <td rowspan="4">{{state.creditDataInfo.evaluationModeList[33].score}}</td>
                  <td rowspan="3">经营稳定性</td>
                  <td rowspan="3">{{state.creditDataInfo.evaluationModeList[25].score}}</td>
                  <td>营业收入增长率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[10].score}}</td>
                </tr>
                <tr>
                  <td>盈利稳定性</td>
                  <td>{{state.creditDataInfo.evaluationModeList[11].score}}</td>
                </tr>
                <tr>
                  <td>投资总额增长率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[12].score}}</td>
                </tr>
                <tr>
                  <td>结构稳定性</td>
                  <td>{{state.creditDataInfo.evaluationModeList[26].score}}</td>
                  <td>资产负债变动率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[13].score}}</td>
                </tr>

                <tr>
                  <td rowspan="5">经营稳定性</td>
                  <td rowspan="5">{{state.creditDataInfo.evaluationModeList[34].score}}</td>
                  <td rowspan="2">经营稳定性</td>
                  <td rowspan="2">{{state.creditDataInfo.evaluationModeList[27].score}}</td>
                  <td>利润率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[14].score}}</td>
                </tr>
                <tr>
                  <td>总资产收益率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[15].score}}</td>
                </tr>
                <tr>
                  <td>运营能力</td>
                  <td>{{state.creditDataInfo.evaluationModeList[28].score}}</td>
                  <td>总资产周转率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[16].score}}</td>
                </tr>
                <tr>
                  <td rowspan="2">偿债能力</td>
                  <td rowspan="2">{{state.creditDataInfo.evaluationModeList[29].score}}</td>
                  <td>资产负债率</td>
                  <td>{{state.creditDataInfo.evaluationModeList[17].score}}</td>
                </tr>
                <tr>
                  <td>收入负债比</td>
                  <td>{{state.creditDataInfo.evaluationModeList[18].score}}</td>
                </tr>
              </table>
            </template>

          </el-tab-pane>
        </el-tabs>
      </div>

      <div class="common_con">
        <div style="padding: 30px 50px">
          <h3>企业授信智能测算说明</h3>
          <div class="mb10">1、联合信用征信根据历史交易数据、企业特征、历史账期、历史履约情况、企业征信数据等大数据进行企业授信额度计算;</div>
          <div class="mb10">2、运用创新研发的预测模型计算企业授信额度,样本数据符合率高达90%以上;</div>
          <div class="mb10">3、计算出的企业授信额度仅供参考,不代表任何商业担保或承诺。</div>
        </div>
      </div>
    </div>

    <div class="w80">
      <div style="margin: 50px 0 80px; text-align: center">
        <template v-if="state.creditDataInfo.creditReport">
          <el-button type="primary" size="large" :loading="state.isSubmit" @click="handleSubmit(state.creditDataInfo.creditReport)">查看授信报告</el-button>
        </template>
        <el-button v-else type="primary" size="large" v-if="isHaveButton('front:getCreditReport')" :loading="state.isSubmit" @click="handleSubmit(1)">生成授信报告</el-button>
      </div>
    </div>
  </div>

  <change-quota title="调增授信额度申请" :open="state.changeQuotaOpen" open-name="changeQuotaOpen" @handleClose="handleClose"></change-quota>
</template>

<script setup lang="ts">
  import DateUtil from "../../utils/date.js";
  import * as api from "../../interface/api.ts";
  import * as echarts from 'echarts';
  import router from "../../router";
  import {isHaveButton} from "../../utils/until.ts";

  let state = reactive({
    enterpriseInfo: {},
    columnsList: [{
      label: "法定代表人",
      prop: "legalPersonName"
    }, {
      label: "注册资本",
      prop: "regCapital"
    }, {
      label: "成立日期",
      prop: "estiblishTime",
      type: 'date'
    }, {
      label: "注册地址",
      prop: "regLocation"
    }],
    isSubmit: false,
    changeQuotaOpen: false,
    tabLabel: 0,
    tabList: [
      {
        name: "基础授信信息",
        prop: 'base',
      }, {
        name: "补充授信信息",
        prop: 'supplement',
      }, {
        name: "指标得分",
        prop: 'score',
      }
    ],
    modelList: {
      base: [
        {
          name: "企业基本信息",
          id: 'jbxx'
        }, {
          name: "民事案件",
          icon: "Bell",
          id: 'msaj'
        }, {
          name: "刑事案件",
          icon: "Bell",
          id: 'xsaj'
        }, {
          name: "行政案件",
          icon: "Bell",
          id: 'xzaj',
        }, {
          name: "执行案件",
          icon: "Bell",
          id: 'zxaj',
        }, {
          name: "强制清算与破产",
          icon: "Bell",
          id: 'qzqsypc',
        }, {
          name: "非诉保全案件",
          icon: "Bell",
          id: 'fsbqaj',
        }, {
          name: "失信被执行人",
          icon: "Bell",
          id: 'sxbzxr',
        }, {
          name: "限制高消费",
          icon: "Bell",
          id: 'xzgxf',
        }, {
          name: "司法协助",
          icon: "Bell",
          id: 'sfxz',
        }, {
          name: "司法拍卖",
          icon: "Bell",
          id: 'sfpm',
        }, {
          name: "经营异常",
          icon: "Bell",
          id: 'jyyc',
        }, {
          name: "行政处罚",
          icon: "Bell",
          id: 'xzcf',
        }, {
          name: "海关行政处罚",
          icon: "Bell",
          id: 'hgxzcf',
        }, {
          name: "严重违法",
          icon: "Bell",
          id: 'yzwf',
        }, {
          name: "股权出质",
          icon: "Bell",
          id: 'gqcz',
        }, {
          name: "欠税公告",
          icon: "Bell",
          id: 'qsgg',
        }, {
          name: "清算信息",
          icon: "Bell",
          id: 'qsxx',
        }, {
          name: "动产抵押",
          icon: "Bell",
          id: 'dcdy',
        }, {
          name: "抽样检查检查",
          icon: "Bell",
          id: 'cyjc',
        }
      ],
      supplement: [
        {
          name: "企业信息",
          id: 'info'
        }, {
          name: "财务信息",
          id: 'cwxx'
        }, {
          name: "抵押物信息",
          id: 'dywxx'
        }, {
          name: "担保信息",
          id: 'dbxx'
        }, {
          name: "附件",
          id: 'file'
        },
      ]
    },
    // 表格表头
    detailItem: {
      jbxx: {
        type: 'desc',
        column: 2,
        dataSource: 'enterpriseInfo',
        data: [
          {
            label: "企业名称",
            prop: "name"
          },{
            label: "法定代表人",
            prop: "legalPersonName"
          }, {
            label: "注册资本",
            prop: "regCapital"
          }, {
            label: "成立日期",
            prop: "estiblishTime",
            type: 'date'
          }, {
            label: "企业性质",
            prop: "companyOrgType"
          }, {
            label: "注册地址",
            prop: "regLocation",
          }, {
            label: "经营范围",
            prop: "businessScope",
            span: 2,
          }
        ]
      },
      info: {
        type: 'desc',
        column: 2,
        dataSource: 'creditDataInfo',
        data: [
          {
            label: "企业名称",
            prop: "ename",
            span: 2,
          }, {
            label: "企业性质",
            prop: "companyNature"
          }, {
            label: "企业类型",
            prop: "companyType"
          }, {
            label: "授信有效期",
            prop: "effectiveDate,deadline",
          }
        ]
      },
      msaj: {
        type: 'table',
        data: [
          {
            prop: "cAh",
            label: "案号"
          },
          {
            prop: "nSsdw",
            label: "诉讼地位"
          },
          {
            prop: "dLarq",
            label: "立案时间"
          },
          {
            prop: "nAjjzjd",
            label: "案件进展阶段"
          },
          {
            prop: "nSqzxbdje",
            label: "申请执行标的金额"
          },
          {
            prop: "nLaay",
            label: "立案案由"
          },
          {
            prop: "dJarq",
            label: "结案时间"
          },
          {
            prop: "nJafs",
            label: "结案方式"
          },
          {
            prop: "nJbfy",
            label: "执行法院"
          }]
      },
      xsaj: {
        type: 'table',
        data: [
          {
            prop: "cAh",
            label: "案号"
          },
          {
            prop: "nSsdw",
            label: "诉讼地位"
          },
          {
            prop: "dLarq",
            label: "立案时间"
          },
          {
            prop: "nAjjzjd",
            label: "案件进展阶段"
          },
          {
            prop: "nSlcx",
            label: "审理程序"
          },
          {
            prop: "nLaay",
            label: "立案案由"
          },
          {
            prop: "dJarq",
            label: "结案时间"
          },
          {
            prop: "nJafs",
            label: "结案方式"
          },
          {
            prop: "nJbfy",
            label: "经办法院"
          }
        ]
      },
      xzaj: {
        type: 'table',
        data: [
          {
            prop: "cAh",
            label: "案号"
          },
          {
            prop: "nSsdw",
            label: "诉讼地位"
          },
          {
            prop: "dLarq",
            label: "立案时间"
          },
          {
            prop: "nAjjzjd",
            label: "案件进展阶段"
          },
          {
            prop: "nSlcx",
            label: "审理程序"
          },
          {
            prop: "nLaay",
            label: "立案案由"
          },
          {
            prop: "dJarq",
            label: "结案时间"
          },
          {
            prop: "nJafs",
            label: "结案方式"
          },
          {
            prop: "nJbfy",
            label: "经办法院"
          }
        ]
      },
      fsbqaj: {
        type: 'table',
        data: [
          {
            prop: "cAh",
            label: "案号"
          },
          {
            prop: "nSsdw",
            label: "诉讼地位"
          },
          {
            prop: "dLarq",
            label: "立案时间"
          },
          {
            prop: "nAjjzjd",
            label: "案件进展阶段"
          },
          {
            prop: "nSqbqse",
            label: "申请保全数额"
          },
          {
            prop: "dJarq",
            label: "结案时间"
          },
          {
            prop: "nJafs",
            label: "结案方式"
          },
          {
            prop: "nJbfy",
            label: "执行法院"
          }
        ]
      },
      zxaj: {
        type: 'table',
        data: [
          {
            prop: "cAh",
            label: "案号"
          },
          {
            prop: "nSsdw",
            label: "诉讼地位"
          },
          {
            prop: "dLarq",
            label: "立案时间"
          },
          {
            prop: "nAjjzjd",
            label: "案件进展阶段"
          },
          {
            prop: "nSqzxbdje",
            label: "申请执行标的金额"
          },
          {
            prop: "nLaay",
            label: "立案案由"
          },
          {
            prop: "dJarq",
            label: "结案时间"
          },
          {
            prop: "nJafs",
            label: "结案方式"
          },
          {
            prop: "nJbfy",
            label: "执行法院"
          }
        ]
      },
      qzqsypc: {
        type: 'table',
        data: [
          {
            prop: "cAh",
            label: "案号"
          },
          {
            prop: "nSsdw",
            label: "诉讼地位"
          },
          {
            prop: "dLarq",
            label: "立案时间"
          },
          {
            prop: "nAjjzjd",
            label: "案件进展阶段"
          },
          {
            prop: "dJarq",
            label: "结案时间"
          },
          {
            prop: "nJafs",
            label: "结案方式"
          },
          {
            prop: "nJbfy",
            label: "执行法院"
          }
        ]
      },
      sxbzxr: {
        type: 'table',
        data: [
          {
            prop: "ah",
            label: "案号"
          },
          {
            prop: "larq",
            label: "立案时间"
          },
          {
            prop: "zxfy",
            label: "执行法院"
          },
          {
            prop: "zxyjdw",
            label: "做出执行依据单位"
          },
          {
            prop: "zxyjwh",
            label: "执行依据文号"
          },
          {
            prop: "pjje_gj",
            label: "金额"
          },
          {
            prop: "sf",
            label: "省份"
          },
          {
            prop: "lxqk",
            label: "被执行人的履行情况"
          },
          {
            prop: "fbrq",
            label: "发布时间",
          },
          {
            prop: "yw",
            label: "生效法律文书确定的义务"
          },
          {
            prop: "xwqx",
            label: "失信被执行人行为具体情形"
          }
        ]
      },
      xzgxf: {
        type: 'table',
        data: [
          {
            prop: "ah",
            label: "案号"
          }, {
            prop: "zxfy",
            label: "执行法院"
          }, {
            prop: "fbrq",
            label: "发布时间"
          }
        ]
      },
      sfxz: {
        type: 'table',
        data: [
          {
            prop: "executeNoticeNum",
            label: "执行通知书文号"
          },
          {
            prop: "equityAmount",
            label: "股权数额"
          },
          {
            prop: "typeState",
            label: "类型/状态"
          },
          {
            prop: "executiveCourt",
            label: "执行法院"
          },
          {
            prop: "executedPerson",
            label: "被执行人"
          }
        ]
      },
      sfpm: {
        type: 'table',
        data: [
          {
            prop: "scopeDate",
            label: "拍卖起止时间"
          }, {
            prop: "content",
            label: "拍卖公告",
            type: 'link'
          }, {
            prop: "targetObject",
            label: "拍卖标的"
          }, {
            prop: "startingPrice",
            label: "拍卖价(元)"
          }, {
            prop: "court",
            label: "委托法院"
          }
        ]
      },
      jyyc: {
        type: 'table',
        data: [
          {
            prop: "putReason",
            label: "列入原因"
          }, {
            prop: "putDate",
            label: "列入日期",
            type: 'date'
          }, {
            prop: "putDepartment",
            label: "作出列入决定机关"
          }, {
            prop: "removeReason",
            label: "移出原因"
          }, {
            prop: "removeDate",
            label: "移出日期",
            type: 'date'
          }, {
            prop: "removeDepartment",
            label: "作出移出决定机关"
          }
        ]
      },
      xzcf: {
        type: 'table',
        data: [
          {
            prop: "punishNumber",
            label: "决定书文号"
          }, {
            prop: "reason",
            label: "违法行为类型"
          }, {
            prop: "content",
            label: "处罚内容"
          }, {
            prop: "punishName",
            label: "决定机关名称"
          }, {
            prop: "decisionDate",
            label: "决定日期",
            type: 'date'
          }
        ]
      },
      hgxzcf: {
        type: 'table',
        data: [
          {
            prop: "penaltyDate",
            label: "处罚日期",
            type: 'date'
          }, {
            prop: "natureOfCase",
            label: "案件性质"
          }, {
            prop: "party",
            label: "当事人"
          }, {
            prop: "decisionNumber",
            label: "处罚决定书编号"
          }
        ]
      },
      yzwf: {
        type: 'table',
        data: [
          {
            prop: "putReason",
            label: "列入原因"
          }, {
            prop: "putDate",
            label: "列入日期",
            type: 'date'
          }, {
            prop: "putDepartment",
            label: "作出列入决定机关"
          }, {
            prop: "removeReason",
            label: "移出原因"
          }, {
            prop: "removeDate",
            label: "移出日期",
            type: 'date'
          }, {
            prop: "removeDepartment",
            label: "作出移出决定机关"
          }
        ]
      },
      gqcz: {
        type: 'table',
        data: [
          {
            prop: "putDate",
            label: "公告日期",
            type: "date"
          }, {
            prop: "regNumber",
            label: "登记编号"
          }, {
            prop: "pledgor",
            label: "出质人"
          }, {
            prop: "pledgee",
            label: "质权人"
          }, {
            prop: "equityAmount",
            label: "出质股权数额"
          }, {
            prop: "regDate",
            label: "设立登记日期",
            type: 'date'
          }, {
            prop: "state",
            label: "状态"
          }
        ]
      },
      qsgg: {
        type: 'table',
        data: [
          {
            prop: "taxCategory",
            label: "所欠税种"
          }, {
            prop: "ownTaxBalance",
            label: "欠税金额"
          }, {
            prop: "newOwnTaxBalance",
            label: "当前新发生欠税金额"
          }, {
            prop: "ownTaxBalance",
            label: "欠税余额"
          }, {
            prop: "department",
            label: "发布机关"
          }, {
            prop: "publishDate",
            label: "发布日期",
            type: 'date'
          }
        ]
      },
      qsxx: {
        type: 'table',
        data: [
          {
            prop: "manager",
            label: "清算组负责人"
          }, {
            prop: "member",
            label: "清算组成员"
          }
        ]
      },
      dcdy: {
        type: 'table',
        data: [
          {
            prop: "regDate",
            label: "登记日期"
          }, {
            prop: "regNum",
            label: "登记编号"
          }, {
            prop: "regDepartment",
            label: "登记机关"
          }, {
            prop: "type",
            label: "被担保债权类型"
          }, {
            prop: "amount",
            label: "被担保债权数额"
          }, {
            prop: "status",
            label: "担保状态"
          }
        ]
      },
      cyjc: {
        type: 'table',
        data: [
          {
            prop: "checkDate",
            label: "日期",
            type: 'date'
          }, {
            prop: "checkType",
            label: "类型"
          }, {
            prop: "checkResult",
            label: "结果"
          }, {
            prop: "checkOrg",
            label: "检查实施机关"
          }
        ]
      },
      cwxx: {
        type: "table",
        data: [
          {
            label: '年份',
            prop: 'year'
          }, {
            label: '资产总计',
            prop: 'totAssets'
          }, {
            label: '负债总计',
            prop: 'totLiab'
          }, {
            label: '所有者权益总计',
            prop: 'totalEquity'
          }, {
            label: '营业总收入',
            prop: 'operRev'
          }, {
            label: '利润总额',
            prop: 'totProfit'
          }, {
            label: '净利润',
            prop: 'netProfit'
          },
        ]
      },
      dywxx: {
        type: "table",
        data: [
          {
            label: '抵押物名称',
            prop: 'name'
          }, {
            label: '类型',
            prop: 'type'
          }, {
            label: '账目价格(万元)',
            prop: 'price'
          }, {
            label: '评估价值(万元)',
            prop: 'assessValue'
          }, {
            label: '折扣率',
            prop: 'discountRate'
          }, {
            label: '抵押物价值(万元)',
            prop: 'collateraValue'
          },
        ]
      },
      dbxx: {
        type: "table",
        data: [
          {
            label: '担保合同名称',
            prop: 'name'
          }, {
            label: '担保人名称',
            prop: 'peopleName'
          }, {
            label: '担保金额(万元)',
            prop: 'matters'
          }, {
            label: '担保责任',
            prop: 'responsibility'
          }, {
            label: '担保期限',
            prop: 'term'
          }, {
            label: '担保事项',
            prop: 'matters'
          },
        ]
      },
      file: {
        type: "desc",
        column: 2,
        dataSource: 'creditDataInfo',
        data: [
          {
            label: '增信证明',
            prop: 'creditLimitAddAnnex',
            type: "file",
          }, {
            label: '历史交易数据',
            prop: 'historicalTransactionsAnnex',
            type: "file",
          },
        ]
      }
    },
    creditAnalysis: [],
    creditDataInfo: {},
    detailData: {},
  })

  let contentFormat = (content: any) => {
    if (content === undefined) {
      return "--"
    } else if (typeof content === 'string' && content.indexOf("[{") > -1) {
      let json = JSON.parse(content)
      let temp: any = []
      json.forEach((item: object) => {
        temp.push(JSON.stringify(item))
      })
      return temp.join(",")
    }
    return content
  }

  let getBaseInfo = () => {
    api.getBaseInfo({name: state.searchName}).then((res: any)=> {
      if (res) {
        state.enterpriseInfo = Object.assign( {}, res.data)
      }
    })
  }

  let getCreditResult = () => {
    // let cgId = getCreditId.value
    let cgId = localStorage.getItem('creditId')
    // let cgId = 78
    api.getInfoList({cgId: cgId}, '/web/creditGrantingInfo/getCreditResult').then((res: any)=> {
      state.creditAnalysis = JSON.parse(res.data.creditAnalysis)
      state.creditDataInfo = res.data

      let keyList:any = {cwxx: 'financeInfoList',dywxx: 'collateralList',dbxx: 'guaranteeContract'}

      state.modelList.supplement.forEach(item=> {
        if (state.detailData[item.id] === undefined) {
          state.detailData = Object.assign(state.detailData, {[item.id]: {total: 0, rows: []}})
          if (res.data[keyList[item.id]]) {
            console.log(typeof res.data[keyList[item.id]])
            if (typeof res.data[keyList[item.id]] === 'string') {
              state.detailData[item.id].rows = JSON.parse(res.data[keyList[item.id]])
            } else {
              state.detailData[item.id].rows = res.data[keyList[item.id]]
            }
          }
        }
      })

      let radarData: any = []
      let radarTitleData: any = []
      state.creditAnalysis.forEach((item: object)=> {
        radarTitleData.push({text: item.name, max: 1})
        radarData.push(item.scoreRate)
      })
      let myChart = echarts.init(document.getElementById("enterpriseAnalystId"))
      myChart.setOption({
        radar: [
          {
            indicator: radarTitleData
          }
        ],
        series:[{
          data: [
            {
              value: radarData,
              areaStyle: {
                color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
                  {
                    color: 'rgba(255, 145, 124, 0.1)',
                    offset: 0
                  },
                  {
                    color: 'rgba(255, 145, 124, 0.9)',
                    offset: 1
                  }
                ])
              }
            }
          ]
        }]
      })
      myChart.resize()

      let levelChart = echarts.init(document.getElementById("levelId"))
      levelChart.setOption({
        series:[{
          data: [
            {
              value: state.creditDataInfo.comprehensiveRate,
              name: "总分"
            }
          ]
        }]
      })
      levelChart.resize()
    })
  }

  let enterpriseRadarInit = () => {
    var chartDom = document.getElementById('enterpriseAnalystId');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
      color: ['#FF917C'],
      legend: {},
      radar: [
        {
          indicator: [
            { text: '资本背景', max: 150 },
            { text: '成长性', max: 150 },
            { text: '企业规模', max: 150 },
            { text: '风险状况', max: 120 },
            { text: '经营质量', max: 108 },
          ],
          center: ['50%', '50%'],
          radius: 120,
          axisName: {
            color: '#fff',
            backgroundColor: '#666',
            borderRadius: 3,
            padding: [3, 5]
          }
        }
      ],
      series: [
        {
          type: 'radar',
          data: [
            {
              value: [100, 93, 50, 90, 70],
              areaStyle: {
                color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
                  {
                    color: 'rgba(255, 145, 124, 0.1)',
                    offset: 0
                  },
                  {
                    color: 'rgba(255, 145, 124, 0.9)',
                    offset: 1
                  }
                ])
              }
            }
          ]
        }
      ]
    };

    option && myChart.setOption(option);

  }

  let levelId = () => {

    var chartDom = document.getElementById('levelId');
    var myChart = echarts.init(chartDom);
    var option;

    option = {
      series: [
        {
          type: 'gauge',
          startAngle: 180,
          endAngle: 0,
          radius: 180,
          center: ['50%', '65%'],
          axisLine: {
            show: true,
            lineStyle: {
              width: 30,
              color: [[0.3, '#E63929'], [0.5, '#F7860E'], [0.7, '#EBD31B'], [0.9, '#91D02A'], [1.0, '#4AA941']]
            }
          },
          pointer: {
            itemStyle: {
              color: 'auto'
            }
          },
          axisTick: {
            distance: -30,
            length: 8,
            lineStyle: {
              color: '#fff',
              width: 2
            }
          },
          splitLine: {
            distance: -30,
            length: 30,
            lineStyle: {
              color: '#fff',
              width: 4
            }
          },
          axisLabel: {
            color: 'inherit',
            distance: 36,
            fontSize: 16
          },
          detail: {
            valueAnimation: true,
            formatter: '{value}',
            offsetCenter: [0, '40%'],
            color: 'inherit'
          },
          data: [
            {
              value: 0,
              name: "总分"
            }
          ]
        }
      ]
    };

    option && myChart.setOption(option);

  }

  let getCreditRisk = () => {
    let cgId = localStorage.getItem('creditId')
    api.getInfoList({cgId: cgId}, '/web/creditGrantingRisk/find').then((res: any)=> {
      state.modelList.base.forEach(item=> {
        if (state.detailData[item.id] === undefined) {
          state.detailData = Object.assign(state.detailData, {[item.id]: {total: 0, rows: []}})
          if (res.data[item.id]) {
            if (item.id === 'dcdy') {
              JSON.parse(res.data[item.id]).forEach(dc=> {
                state.detailData[item.id].rows.push(dc.baseInfo)
              })
            } else {
              state.detailData[item.id].rows = JSON.parse(res.data[item.id])
            }
          }
        }
      })

      console.log(state.detailData)
    })
  }

  let handleTabClick = () => {
  }

  const route = useRoute();

  let handleClose = (name: string, value: boolean, isRefresh: boolean) => {
    state[name] = value
  }

  let handleSubmit = (val: any) => {
    if (val === 1) {
      router.push("/creditResult?name="+ state.creditDataInfo.ename)
    } else {
      window.open(val, "_blank")
    }
  }

  onMounted(()=> {
    state.searchName = route.query.name
    getBaseInfo()

    enterpriseRadarInit()
    levelId()
    getCreditResult()

    getCreditRisk()
  })

</script>

<style scoped>
.col_title {
  text-align: center;
  border-radius: 10px;
  color: #ffffff;
  font-size: 22px;
  padding: 5px;
  position: absolute;
  right: 0;
  div {
    letter-spacing: 10px;
    padding-left: 10px;
  }
  &.title_color_0, &.title_color_5 {
    background-color: #93BBF2;
  }
  &.title_color_1, &.title_color_6 {
    background-color: #93DDF2;
  }
  &.title_color_2, &.title_color_7 {
    background-color: #B693F2;
  }
  &.title_color_3, &.title_color_8 {
    background-color: #F6AEAE;
  }
  &.title_color_4, &.title_color_9 {
    background-color: #EEC5AB;
  }
}
.analyst_content {
  margin-bottom: 10px;
}

.table_wrap {
  padding-bottom: 30px;
}

.table_title {
  text-align: center;
  padding-bottom: 20px;
}

.scoreTable{
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  th {
    word-break: break-word;
    background-color: #f8f8f9;
    color: #515a6e;
    height: 40px;
    border-width: 1px;
    border-style: solid;
    border-color: #dfe6ec;
  }
  th.lf{
    text-align: left;
  }
  td {
    border-width: 1px;
    border-style: solid;
    border-color: #dfe6ec;
    padding:  10px 10px;
    height: 40px;
    text-align: left;
    line-height: 20px;
    background-color: #ffffff;
  }
  td.lf{
    text-align: left;
  }
  td.rg{
    text-align: right;
  }
}
</style>