<template>
  <div class="app-container">
    <div class="tab-header webtop">
      <!--标题-->
      <div>{{ viewTitle }}</div>
      <!--start 添加修改按钮-->
      <div>
        <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
      </div>
    </div>
    <div class="listconadd">
      <div class="titwu">金融产品政策</div>
      <el-form ref="form_obj" :model="formobj" class="formaddcopy02">
        <el-row style="border-left: 0px">
          <el-col :span="12" style="border-right: 0px">
            <div class="span-sty" style="border-right: 0px"><span>产品政策名称</span></div>
            <el-form-item>
              <div class="addinputInfo">
                <span>{{ formobj.bankShortName }} {{ formobj.guaranteeTypeValue !== '' ? '( ' + formobj.guaranteeTypeValue + '、' : '' }} {{ formobj.isPack == '1' ? '打包 )' : formobj.isPack == '2' ? '不打包 )' : '' }} {{ formobj.downPayRatio }} {{ formobj.bondRatio !== '' ? '+ ' + formobj.bondRatio : '' }}</span>
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="12" style="border-right: 0px"></el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <div class="span-sty"><span>资方简称</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.bankShortName }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>业务类型</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.busTypeValue }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>车辆大类</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.vehCategoryValue }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>车辆功能</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.vehTypeValue }}</span></el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <div class="span-sty"><span>是否打包</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.isPack == '1' ? '是' : '否' }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>担保类型</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.guaranteeTypeValue }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>首付比例</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.downPayRatio }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>最低首付比例</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.downPayRatioLeast }}</span></el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <div class="span-sty"><span>保证金比例</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.bondRatio }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>保证金类型</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.bondType }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>期数</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.period }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>标准年利率(%)</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.yearRatio }}</span></el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <div class="span-sty"><span>服务费类型</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.serviceAmountTypeValue }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>服务费<span v-show="formobj.serviceAmountTypeValue == '比例'">(%)</span></span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.serviceAmount }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>保险保证金</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.depositPremium }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>落户保证金</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.depositSettle }}</span></el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="6">
            <div class="span-sty"><span>单车意外险/年</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.vehAccidentAmount }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>名义/留购价款</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.nominalPrice }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>有效期至</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.validDateTo }}</span></el-form-item>
          </el-col>
          <el-col :span="6">
            <div class="span-sty"><span>备注</span></div>
            <el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
          </el-col>
        </el-row>
        <div v-show="formobj.isOtherProduct">
          <div class="title">其它融信息</div>
          <el-row>
            <el-col :span="6">
              <div class="span-sty"><span>产品类别</span></div>
              <el-form-item><span class="addinputInfo">{{ formobj.loanFinOtherPolicy.productTypeValue }}</span></el-form-item>
            </el-col>
            <el-col :span="6">
              <div class="span-sty"><span>最高融资比例(%)</span></div>
              <el-form-item><span class="addinputInfo">{{ formobj.loanFinOtherPolicy.maxLoanRatio }}</span></el-form-item>
            </el-col>
            <el-col :span="12">
              <div class="span-sty"><span>最高融资额</span></div>
              <el-form-item><span class="addinputInfo">{{ formobj.loanFinOtherPolicy.maxLoanAmount }}</span></el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <div class="span-sty"><span>期数</span></div>
              <el-form-item><span class="addinputInfo">{{ formobj.loanFinOtherPolicy.period }}</span></el-form-item>
            </el-col>
            <el-col :span="6">
              <div class="span-sty"><span>年利率(%)</span></div>
              <el-form-item><span class="addinputInfo">{{ formobj.loanFinOtherPolicy.yearRatio }}</span></el-form-item>
            </el-col>
            <el-col :span="12" />
          </el-row>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script>
import req from '@/api/financialpolicymanagement/financialpolicymanagement'

export default {
  name: 'FinancialPolicyManagementInfo',
  data() {
    return {
      viewTitle: '',
      formobj: {
        bankShortName: '',
        bankSid: '',
        bondRatio: '',
        bondRatioKey: '',
        bondType: '',
        bondTypeKey: '',
        busTypeKey: '',
        busTypeValue: '',
        depositPremium: '',
        depositSettle: '',
        downPayRatio: '',
        downPayRatioKey: '',
        downPayRatioLeast: '',
        downPayRatioLeastKey: '',
        guaranteeTypeKey: '',
        guaranteeTypeValue: '',
        isOtherProduct: false,
        isPack: '',
        loanFinOtherPolicy: {
          maxLoanAmount: '',
          maxLoanRatio: '',
          period: '',
          periodKey: '',
          productTypeKey: '',
          productTypeValue: '',
          yearRatio: ''
        },
        nominalPrice: '',
        orgPath: '',
        period: '',
        periodKey: '',
        policyName: '',
        remarks: '',
        serviceAmount: '',
        serviceAmountTypeKey: '',
        serviceAmountTypeValue: '',
        sid: '',
        useDeptList: [],
        userSid: '',
        validDateTo: '',
        vehAccidentAmount: '',
        vehCategoryKey: '',
        vehCategoryValue: '',
        vehTypeKey: '',
        vehTypeValue: '',
        yearRatio: ''
      }
    }
  },
  methods: {
    showInfo(row) {
      this.viewTitle = '金融产品政策详情'
      req.fetchBySid({ sid: row.sid }).then((res) => {
        if (res.success) {
          this.formobj = res.data
        }
      })
    },
    handleReturn() {
      this.formobj = {
        bankShortName: '',
        bankSid: '',
        bondRatio: '',
        bondRatioKey: '',
        bondType: '',
        bondTypeKey: '',
        busTypeKey: '',
        busTypeValue: '',
        depositPremium: '',
        depositSettle: '',
        downPayRatio: '',
        downPayRatioKey: '',
        downPayRatioLeast: '',
        downPayRatioLeastKey: '',
        guaranteeTypeKey: '',
        guaranteeTypeValue: '',
        isOtherProduct: false,
        isPack: '',
        loanFinOtherPolicy: {
          maxLoanAmount: '',
          maxLoanRatio: '',
          period: '',
          periodKey: '',
          productTypeKey: '',
          productTypeValue: '',
          yearRatio: ''
        },
        nominalPrice: '',
        orgPath: '',
        period: '',
        periodKey: '',
        policyName: '',
        remarks: '',
        serviceAmount: '',
        serviceAmountTypeKey: '',
        serviceAmountTypeValue: '',
        sid: '',
        useDeptList: [],
        userSid: '',
        validDateTo: '',
        vehAccidentAmount: '',
        vehCategoryKey: '',
        vehCategoryValue: '',
        vehTypeKey: '',
        vehTypeValue: '',
        yearRatio: ''
      }
      this.$emit('doback')
    }
  }
}
</script>

<style scoped>
.span-sty {
  width: 140px !important;
}
.addinputInfo {
  margin-left: 130px !important;
}
</style>
