see.vue 12.5 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
<template>
  <el-dialog
    :title="title"
    v-if="open"
    :visible.sync="open"
    width="1000px"
    append-to-body
    top="10vh"
    custom-class="new_dialog"
  >
    <div style="margin-left: 95%">
      <el-button type="text" @click="getPdf('企业风控报告')">导出</el-button>
    </div>
    <div id="pdfDom">
      <div class="box" v-if="data.applyCreditType == 1">
        <div>
          <p>申请时间</p>
          <p>{{ parseTime(data.applyTime) }}</p>
        </div>
        <div>
          <p>申请产品</p>
          <p>{{ ProductCode(data.applyProductCode) }}</p>
        </div>
        <div>
          <p>风控类型</p>
          <p>{{ queryDict(data.applyCreditType, dict.type.file_risk_type) }}</p>
        </div>
        <div>
          <p>风控结果</p>
          <p>{{ queryDict(data.applyStatus, dict.type.file_examine_type) }}</p>
        </div>
      </div>
      <div class="box2" v-if="data.applyCreditType == 2">
        <div class="pingfen">
          <Ex1 ref="ex" :percentage.sync="data.creditScore"></Ex1>
        </div>
        <div class="content">
          <div class="chanpin">
            <div>
              <span>申请产品:</span
              ><b>{{ ProductCode(data.applyProductCode) }}</b>
            </div>
            <div v-if="data.applyProductCode == 'CSINK'">
              <span>碳量(T):</span><b>{{ data.carbonContent }}</b>
            </div>
          </div>
          <div class="neirong">
            <div>
              <span>申请额度(元):</span><b>{{ data.applyAmount }}</b>
            </div>
            <div>
              <span>建议额度(元):</span><b>{{ data.resultAmount }}</b>
            </div>
            <div v-if="data.applyProductCode == 'CSINK'">
              <span>碳汇估算额度(元):</span><b>{{ data.resultMoney }}</b>
            </div>
            <div><span>申请时间:</span>{{ parseTime(data.applyTime) }}</div>
            <div>
              <span>风控类型:</span
              >{{ queryDict(data.applyCreditType, dict.type.file_risk_type) }}
            </div>
          </div>
          <div class="pingji">
            <div>
              <img src="@/assets/image/jiangzhuang.png" alt="" />
              <div class="titelP">评级</div>
            </div>
            <div class="size">{{ data.createLevel }}</div>
          </div>
        </div>
      </div>
      <el-descriptions title="客户基本信息" :size="size" :column="3" border>
        <el-descriptions-item label="企业名称">{{
          data.entName
        }}</el-descriptions-item>
        <el-descriptions-item label="统一社会信用代码">{{
          data.creditCode
        }}</el-descriptions-item>
        <el-descriptions-item label="法定代表人手机号">{{
          data.operatorPhone
        }}</el-descriptions-item>
        <el-descriptions-item label="经办人手机号">{{
          data.phone
        }}</el-descriptions-item>
        <el-descriptions-item label="经办人名称">{{
          data.name
        }}</el-descriptions-item>
        <el-descriptions-item label="经办人身份证号码">{{
          data.idCard
        }}</el-descriptions-item>
        <el-descriptions-item label="联系地址">{{
          data.contactAddress
        }}</el-descriptions-item>
      </el-descriptions>
      <div class="demo-image__placeholder">
        <div class="block">
          <span class="demonstration">企业营业执照</span>
          <el-image :src="zhizhao"></el-image>
        </div>
        <div class="block">
          <span class="demonstration">经办人身份证正面照</span>
          <el-image :src="zhengmian"></el-image>
        </div>
        <div class="block">
          <span class="demonstration">经办人身份证反面照</span>
          <el-image :src="fanmian">
            <div slot="placeholder" class="image-slot">
              加载中<span class="dot">...</span>
            </div>
          </el-image>
        </div>
      </div>
      <el-descriptions title="企业实控人信息">
        <el-descriptions-item label="实控人名称">{{
          data.controlName
        }}</el-descriptions-item>
        <el-descriptions-item label="实控人身份证号码">{{
          data.controlIdCard
        }}</el-descriptions-item>
        <el-descriptions-item label="实控人手机号">{{
          data.controlPhone
        }}</el-descriptions-item>
        <el-descriptions-item label="婚姻状况"
          >{{ queryDict(data.maritalStatus, dict.type.sys_marriag_type) }}
        </el-descriptions-item>
        <el-descriptions-item label="学历"
          >{{ queryDict(data.education, dict.type.sys_education_type) }}
        </el-descriptions-item>
      </el-descriptions>
      <div class="demo-image__placeholder">
        <div class="block2">
          <span class="demonstration">实控人身份证正面照</span>
          <el-image :src="zhengmian"></el-image>
        </div>
        <div class="block2">
          <span class="demonstration">实控人身份证反面照</span>
          <el-image :src="fanmian">
            <div slot="placeholder" class="image-slot">
              加载中<span class="dot">...</span>
            </div>
          </el-image>
        </div>
      </div>
      <h4>规则状态</h4>
      <div>
        <el-table
          v-loading="loading"
          :data="postList"
          :border="false"
          :span-method="objectSpanMethod"
        >
          <el-table-column label="策略节点" align="center" prop="groupName" />
          <el-table-column label="规则" align="center" prop="rule">
            <template slot-scope="scope">
              <span v-if="scope.row.targetEncrypt">
                <!-- {{ scope.row.targetEncrypt }} -->
                {{ scope.row.targetBaseName }} {{ scope.row.judgeName }}
                {{ scope.row.threshold }}
                <!-- {{ getPostList(scope.row.targetEncrypt, scope.row.threshold) }} -->
              </span>
              <span v-else
                >{{ scope.row.targetBaseName }} {{ scope.row.judgeName }}
                {{ scope.row.threshold }}</span
              >
            </template>
          </el-table-column>
          <el-table-column label="取值" align="center" prop="targetValue">
            <template slot-scope="scope">
              <span v-if="scope.row.targetEncrypt">
                <!-- {{ getPostList(scope.row.targetEncrypt, scope.row.targetValue) }} -->
                {{ scope.row.targetValue }}
              </span>
              <span v-else>{{ scope.row.targetValue }}</span>
            </template>
          </el-table-column>
          <el-table-column label="结果" align="center" prop="hit">
            <template slot-scope="scope">
              <span v-if="scope.row.execType == 0">
                <span v-if="scope.row.hit == 0">未命中</span>
                <span v-else style="color: rgb(255, 77, 79)">命中</span>
              </span>
              <span v-else-if="scope.row.execType == 1">
                {{ scope.row.score }}分
              </span>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancel">关 闭</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { selectAll, ossDownloadFile, listData } from "@/api/postList/list";
import Ex1 from "./ex1.vue";
export default {
  name: "seeMobile",
  components: { Ex1 },
  dicts: [
    "sys_normal_disable",
    "sys_education_type",
    "sys_marriag_type",
    "file_risk_type",
    "file_examine_type",
  ],
  data() {
    return {
      open: false,
      // 弹出层标题
      title: "",
      loading: true,
      reverse: true,
      postList: [],
      data: {},
      zhengmian: "",
      fanmian: "",
      zhizhao: "",
      product: [],
      size: "",
    };
  },
  methods: {
    cancel() {
      this.open = false;
      this.form = {};
    },
    see(res) {
      this.data = res;
      this.postList = res.strategyRuleItemResult;
      this.loading = false;
      this.open = true;
      this.title = "查看风控申请";
      var lis = {
        pageNum: 1,
        pageSize: 10000,
      };
      selectAll(lis).then((response) => {
        this.product = response.data;
      });
      var url = {
        fileIdentifyingCode: res.idCardFront,
        expire: 10000,
      };
      ossDownloadFile(url).then((response) => {
        this.zhengmian = response.data.result.url;
      });
      var url2 = {
        fileIdentifyingCode: res.idCardReverse,
        expire: 10000,
      };
      ossDownloadFile(url2).then((response) => {
        this.fanmian = response.data.result.url;
      });
      var url3 = {
        fileIdentifyingCode: res.businessLicense,
        expire: 10000,
      };
      ossDownloadFile(url3).then((response) => {
        this.zhizhao = response.data.result.url;
      });
    },
    ProductCode(t) {
      for (var i = 0; i < this.product.length; i++) {
        if (t == this.product[i].businessCode) {
          return this.product[i].name;
        }
      }
    },
    //?????未知错误暂未解决 不知道为什么查询接口匹配码表就渲染不出来
    // getPostList(obj, str) {
    //   let p = {
    //     pageNum: 1,
    //     pageSize: 100,
    //     dictType: obj,
    //   };
    //   listData(p).then((res) => {
    //     var arr = []
    //     var arr = res.rows;
    //     for (var i = 0; i < arr.length; i++) {
    //       if (str == arr[i].dictValue) {
    //         console.log(arr[i].dictLabel);
    //         return arr[i].dictLabel;
    //       }
    //     }
    //   });
    // },
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      switch (columnIndex) {
        case 0:
          return this.mergeComon("groupName", rowIndex);
        // case 1:
        //   return this.mergeComon("groupName", rowIndex);
        //   // eslint-disable-next-line no-unreachable
        //   break;
        // case 2:
        //   return this.mergeComon("groupName", rowIndex);
      }
    },
    mergeComon(id, rowIndex) {
      // 合并单元格
      var idName = this.postList[rowIndex][id];
      if (rowIndex > 0) {
        if (this.postList[rowIndex][id] != this.postList[rowIndex - 1][id]) {
          var i = rowIndex;
          var num = 0;
          while (i < this.postList.length) {
            if (this.postList[i][id] === idName) {
              i++;
              num++;
            } else {
              i = this.postList.length;
            }
          }
          return {
            rowspan: num,
            colspan: 1,
          };
        } else {
          return {
            rowspan: 0,
            colspan: 1,
          };
        }
      } else {
        var i = rowIndex;
        var num = 0;
        while (i < this.postList.length) {
          if (this.postList[i][id] === idName) {
            i++;
            num++;
          } else {
            i = this.postList.length;
          }
        }
        return {
          rowspan: num,
          colspan: 1,
        };
      }
    },
  },
};
</script>

<style>
.box {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.demo-image__placeholder {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-bottom: 40px;
}

.demonstration {
  line-height: 60px;
}

.block {
  width: 200px;
}

.block2 {
  width: 200px;
}

.new_dialog {
  height: 80%;
  overflow: hidden;
  overflow-y: scroll;
}

h4 {
  font-size: 16px;
  font-weight: bold;
  color: #303133;
}
.box2 {
  width: 96%;
  margin: auto;
  display: flex;
  justify-content: space-between;
  height: 140px;
  margin-bottom: 30px;
}
.box2 .pingfen {
  width: 240px;
  height: 100%;
  margin-top: -70px;
  margin-left: -20px;
}
.content {
  position: relative;
}
.content span {
  width: 100px;
  display: inline-block;
  text-align: justify;
  text-justify: distribute-all-lines;
  text-align-last: justify;
}
.neirong {
  display: flex;
  flex-wrap: wrap;
}
.neirong div {
  width: 50%;
  margin-top: 20px;
}
.neirong div:nth-child(1) b,
.neirong div:nth-child(2) b {
  font-size: 24px;
}
.neirong div:nth-child(1) b {
  color: #f96868;
}
.neirong div:nth-child(2) b {
  color: #15c377;
}
.chanpin {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
}
.chanpin div {
  width: 50%;
}
.chanpin div b {
  width: 50%;
  font-size: 18px;
}
.pingji {
  position: absolute;
  top: 0px;
  right: -50px;
  display: flex;
  flex-wrap: wrap;
  width: 180px;
}
.pingji img {
  height: 50px;
}
.titelP {
  width: 50px;
  text-align: center;
  margin-top: -10px;
}
.size {
  line-height: 70px;
  font-size: 40px;
  color: #d9534f;
}
#pdfDom {
  padding: 30px;
}
</style>