<template>
  <div id="claimForm">
    <el-row>
      <el-col :span="24" class="form">
        <el-form :model="ruleForm" ref="ruleForm" label-width="200px" class="demo-ruleForm">
          <el-form-item label="客户姓名：">
            <span>{{ ruleForm.person }}</span>
          </el-form-item>
          <el-form-item label="客户联系方式：">
            <span>{{ ruleForm.phone }}</span>
          </el-form-item>
          <el-form-item label="客户所属企业名称：">
            <span>{{ ruleForm.company  ? ruleForm.company.company_name : '' }}</span>
          </el-form-item>
          <el-form-item label="企业法人：">
            <span>{{ ruleForm.company  ? ruleForm.company.person : '' }}</span>
          </el-form-item>
          <el-form-item label="企业注册资金：">
            <span>{{ ruleForm.company  ? ruleForm.company.capital : ''}}</span>
          </el-form-item>
          <el-form-item label="资料（企业报告）：">
            <el-link :href="'https://jlxwjr.jljrkg.com/files/financial/custom/20200510160327.docx'" :underline="false">企业报告导出模板-长春企业 </el-link>
          </el-form-item>
          <el-form-item label="企业证照信息：">
            <el-button type="primary" @click="bigPhoto(ruleForm.company.business_license)">点击查看企业证照信息</el-button>
<!--            <el-image  :src="getThumb(ruleForm.company.business_license)"></el-image>-->
          </el-form-item>
<!--          <el-form-item label="融资取向：" >-->
<!--          <span>{{ruleForm.orientation}}</span>-->
<!--          </el-form-item>-->
          <el-form-item label="融资金额（万元）：">
            <span>{{ ruleForm.money }}</span>
          </el-form-item>
          <el-form-item label="对接产品：">
            <span>{{ ruleForm.finance_claims  ? ruleForm.finance_claims.name : '' }}</span>
          </el-form-item>
          <el-form-item label="对接银行：" >
          <span>{{ ruleForm.institution  ? ruleForm.institution.name : ''}}</span>
          </el-form-item>
          <!--<el-form-item label="融资期限(个月)：">-->
            <!--<span>{{ ruleForm.claims_min_term }}个月~{{ ruleForm.claims_max_term }}个月</span>-->
          <!--</el-form-item>-->
          <!--<el-form-item label="融资利率：">-->
            <!--<span>{{ ruleForm.mongey_min_rate }}%~{{ ruleForm.mongey_max_rate }}%</span>-->
          <!--</el-form-item>-->
          <el-form-item label="担保方式：">
            <span>{{ ruleForm.dictionary  ? ruleForm.dictionary.name : ''}}</span>
          </el-form-item>
          <!--<el-form-item label="预计何时有融资需求：">-->
            <!--<span>{{ ruleForm.when.name }}</span>-->
          <!--</el-form-item>-->
          <el-form-item label="补充信息：">
            <span>{{ ruleForm.additional_information }}</span>
          </el-form-item>


          <el-form-item label="放款金额(万元)：">
            <span style="color: red">{{ ruleForm.follow  ? ruleForm.follow.credit_money : ''}}</span>
          </el-form-item>
          <el-form-item label="放款期限（个月）：">
            <span style="color: red">{{ ruleForm.follow  ? ruleForm.follow.sxhowlong : '' }}</span>
          </el-form-item>
          <el-form-item label="放款产品：">
            <span style="color: red">{{ ruleForm.follow  ? ruleForm.follow.sxcpname : ''}}</span>
          </el-form-item>
          <el-form-item label="放款利率（%）：">
            <span style="color: red">{{ ruleForm.follow  ? ruleForm.follow.sxcplilue : '' }}</span>
          </el-form-item>

          <el-form-item v-if="saw == '1'">
            <el-button type="primary" size="small" @click="fallow">分配</el-button>
          </el-form-item>
          <el-form-item v-else>
            <el-button type="info" size="small">已匹配</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
    <el-dialog title="指派" :visible.sync="dialogFormVisible" :show-close="false">
      <el-form :model="zhipaiform">
        <el-form-item label="客户经理">
          <el-select v-model="zhipaiform.uuid" filterable placeholder="请选客户经理">
            <el-option v-for="(item, index) in jlList" :key="index" :label="item.name" :value="item.id"> </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="quxiao">取 消</el-button>
        <el-button type="primary" @click="zhipaiformBtn">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog
            :visible.sync="centerDialogVisible"
            width="45%"
            center>
      <el-image  :src="url"></el-image>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'claimForm',
  props: {
    ruleForm: null,
    charList: null,
    saw: null,
    dialogFormVisible: null,
    zhipaiform: null,
    jlList: null,
  },
  components: {},
  data: () => ({
    centerDialogVisible:false,
    url:'',
  }),
  created() {},
  computed: {},
  methods: {
    fallow() {
      this.$emit('fallow');
    },
    zhipaiformBtn() {
      this.$emit('zhipaiformBtn', { data: this.zhipaiform });
    },
    quxiao() {
      this.$emit('quxiao');
    },
    getThumb(url){
      return'data:image/png;base64,'+url;
    },
    bigPhoto(url){
      this.centerDialogVisible = true;
      this.url = this.getThumb(url);
    }
  },
};
</script>

<style lang="less" scoped>
.form {
  padding: 0 200px 0 0;
}
</style>
