<template>
  <div class="edit-add-detail">
    <div class="form-content">
      <el-form
        ref="formInfo"
        :model="parameter"
        label-position="right"
        label-width="120px"
      >
        <div class="rows">
          <div class="rows-left">
            <div class="rows-hr"></div>
          </div>
          <div class="rows-title">
            <div class="text-overflow">基本信息</div>
          </div>
        </div>
        <el-row :gutter="24">
          <el-col :span="6">
            <el-form-item label="交易对象" prop="name">
              <span>{{ parameter.name }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="交易方式" prop="dealType">
              <span>{{ parameter.dealType }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属公司" prop="belongsOrgName">
              <span>{{ parameter.belongsOrgName }}</span>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="6">
              <el-form-item label="公司性质" prop="assetNature">
                  <span>
                      {{
                          getDictName(
                              'gqgsxz',
                              parameter.assetNature
                          )
                      }}</span
                  >
              </el-form-item>
          </el-col> -->
          <el-col :span="6" prop="dealOrg">
            <el-form-item label="交易机构">
              <span>{{ parameter.dealOrg }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="6">
            <el-form-item
              label="合同金额(万元)"
              prop="contractMoney"
            >
              <span>{{ parameter.contractMoney }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="年收益率(%/年)" prop="yearEarningsRate">
              <span>{{ parameter.yearEarningsRate }}</span>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="还本付息方式" prop="returnType">
                                <span>
                                    {{
                                    getDictName(
                                      'hbfxfs',
                                      parameter.returnType
                                    )
                                  }}</span
                                >
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              label="期限"
              prop="dateLimit"
            >
              <span>{{ parameter.dateLimit }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="6">
            <el-form-item
              label="起始日期"
              prop="startDate"
            >
              <span>{{ parameter.startDate }}</span>
            </el-form-item>
          </el-col>

          <el-col :span="6" prop="endDate">
            <el-form-item label="到期日期">
              <span>{{ parameter.endDate }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="6" prop="riskMeasures">
            <el-form-item label="风控措施">
                                <span>{{
                                    parameter.riskMeasures
                                  }}</span>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item
              label="债权状态"
              prop="loanStatus"
            >
                                <span>
                                    {{
                                    getDictName(
                                      'zqzt',
                                      parameter.loanStatus
                                    )
                                  }}</span
                                >
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col
            :span="6"
            prop="auditMsg"
            v-if="parameter.assetAudit === '1'"
          >
            <el-form-item label="驳回理由">
              <span>{{ parameter.auditMsg }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="18">
            <el-form-item label="备注">
              <span>{{ parameter.remark }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <div class="rows">
          <div class="rows-left">
            <div class="rows-hr"></div>
          </div>
          <div class="rows-title">
            <div class="text-overflow">债权归还信息</div>
          </div>
        </div>
        <el-table :data="parameter.loanInterest" style="width: 100%" border>
          <el-table-column type="index" label="序号" width="80">
          </el-table-column>
          <el-table-column prop="receivableMoney" label="应收利息(万元)">
          </el-table-column>
          <el-table-column prop="actualMoney" label="实收利息(万元)">
          </el-table-column>
          <el-table-column prop="addUpMoney" label="累计收到利息(万元)">
          </el-table-column>
          <el-table-column prop="returnDate" label="归还日期">
          </el-table-column>
          <el-table-column prop="returnDate" label="归还日期">
          </el-table-column>
          <el-table-column
            prop="isOverdue"
            show-overflow-tooltip
            min-width="120"
            align="center"
            label="是否逾期归还"
          >
            <template v-slot="{row}">
              {{ getDictName('zqzt', row.isOverdue) }}
            </template>
          </el-table-column>
          <el-table-column prop="remark" label="备注">
          </el-table-column>
        </el-table>
      </el-form>
    </div>
  </div>
</template>

<script>
import Breadcrumb from '@/components/Breadcrumb/index.vue'
import utils from '@/utils/utils.js'
import api from '@/api/BondAssets/BondAssetsEnter/CreditorRightsRegistered.js'

export default {
  name: 'domesticDialog',
  components: {Breadcrumb},
  data() {
    return {
      breadcrumbOpt: [
        {breadcrumbName: '债权登记入库'},
        {breadcrumbName: '详情'}
      ],
      parameter: {}
    }
  },
  created() {
  },
  mounted() {
  },
  methods: {
    //字典翻译
    getDictName(code, value) {
      return utils.getDictName(code, value)
    },
    //面包屑点击
    breadcrumbClick() {
      this.$emit('closeComponent')
    },
    //详情
    detail(val) {
      if (val) {
        this.modifychoData(val)
      }
    },
    //获取详情
    modifychoData(val) {
      api.detailsData(val.id, (res) => {
        if (res) {
          this.parameter = res
          console.log(this.parameter)
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.edit-add-detail {
  display: flex;
  flex-direction: column;

  // .crumbs {
  // }
  .form-content {
    flex: 1;

    // margin-top: 20px;
    border-radius: 10px;
    overflow-y: scroll;

    .company-information {
      border-radius: 10px;
      padding: 10px 20px;
      background-color: white;
      margin-bottom: 20px;
    }
  }

  .form-content::-webkit-scrollbar {
    display: none;
    /* Chrome Safari */
  }
}

::v-deep .el-form-item__label {
  width: 120px;
  font-size: 14px;
  color: #828282;
  font-weight: 500;
}

::v-deep .el-form-item__content span {
  font-size: 14px;
  color: #000;
  font-weight: 500;
}

::v-deep .el-form-item {
  margin-bottom: 10px;
}

.rows {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ebebeb;
  margin-bottom: 16px;
  padding: 10px 0;

  .rows-left {
    margin-right: 10px;

    .rows-hr {
      width: 3px;
      height: 18px;
      background-color: #0e6eff;
      border-radius: 2px;
    }
  }

  .rows-title {
    .text-overflow {
      width: 100%;
      font-size: 16px;
    }
  }
}
</style>
