/**
* @Author Sean
* @Date 2019/4/19
*/
<template>
  <div>
    <list-item :item-height="45">
      <item>
        <div slot="name">合同类型</div>
        <div slot="content">{{ contract.bp_id_tenant_n }}</div>
      </item>
      <item>
        <div slot="name">销售金额</div>
        <div slot="content">{{ contract.project_number }}</div>
      </item>
      <item>
        <div slot="name">主机金额</div>
        <div slot="content">{{ contract.contract_number }}</div>
      </item>
      <item>
        <div slot="name">首付款</div>
        <div slot="content">{{ contract.company_id_n }}</div>
      </item>
      <item>
        <div slot="name">管理费</div>
        <div slot="content">{{ contract.business_type_n }}</div>
      </item>
      <item>
        <div slot="name">保证金</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>

      <item>
        <div slot="name">留购金</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>
      <item>
        <div slot="name">基准利率</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>
      <item>
        <div slot="name">租赁开始日</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>
      <item>
        <div slot="name">支付开始日</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>
      <item>
        <div slot="name">租赁本金</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>
      <item>
        <div slot="name">租赁期间</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>
      <item>
        <div slot="name">利率</div>
        <div slot="content">{{ contract.division_n }}</div>
      </item>

    </list-item>
    <!--银行信息-->
    <list-item >
      <item>
        <img slot="left-icon" src="../../../../assets/image/icon.png" class="left-icon">
        <div slot="name">物件名称</div>
      </item>
      <item>
        <div slot="name">机种名称</div>
        <div slot="content">{{ contract.project_number }}</div>
      </item>
      <item>
        <div slot="name">机型</div>
        <div slot="content">{{ contract.project_number }}</div>
      </item>
      <item>
        <div slot="name">型号</div>
        <div slot="content">{{ contract.project_number }}</div>
      </item>
      <item>
        <div slot="name">机号</div>
        <div slot="content">{{ contract.project_number }}</div>
      </item>

    </list-item>

  </div>
</template>

<script>
export default {
  props: {
    contract: Object,
    readOnly: {
      type: String,
      default: function () {
        return 'mainten'
      }
    }
  },
  data () {
    return {
      bank_list: [],
      bank_account_list: [],
    }
  },
  created: function () {
    this.selectListLoad()
  },
  mounted: function () {
  },
  updated: function () {
  },
  methods: {
    // 查询下拉框
    selectListLoad () {
      let vm = this
      let url = process.env.basePath + 'account_bank_lov_list'
      let param = {}
      vm.$post(url, param).then(function (res) {
        if (res.result === 'S') {
          // 银行
          vm.bank_list = res.bank_list
          // 账户类型
          vm.bank_account_list = res.bank_account_list
        } else if (res.result === 'E') {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
    selectDebitBank () {
      let vm = this
      hlsPopup.selectList({
        list: vm.bank_list,
        code: 'direct_debit_bank_id',
        object: {},
        returnItem: function (index, obj, child) {
          vm.$set(vm.contract, 'direct_debit_bank_id', vm.bank_list[index].code)
          vm.$set(vm.contract, 'direct_debit_bank_id_n', vm.bank_list[index].code_name)
        },
      })
    },
    selectEbankAccount () {
      let vm = this
      hlsPopup.selectList({
        list: vm.bank_account_list,
        code: 'ebank_account_prop',
        object: {},
        returnItem: function (index, obj, child) {
          vm.$set(vm.contract, 'ebank_account_prop', vm.bank_account_list[index].code)
          vm.$set(vm.contract, 'ebank_account_prop_n', vm.bank_account_list[index].code_name)
        /* vm.contract['ebank_account_prop'] = vm.bank_account_list[index].code
          vm.contract['ebank_account_prop_n'] = vm.bank_account_list[index].code_name */
        },
      })
    },
  },
}
</script>

<style scoped lang="less" rel="stylesheet">
.right-icon{
  width: 12px;
}
.hls-item .contents .add-name .left-icon {
  margin-right: 0.1rem;
  width: 0.6rem;
}
</style>
