<!-- 销售 -->
<template>
  <list-item :item-height="44">
    <item v-for="(ele, i) of formdata" :key="ele.title">
      <div slot="name" class="font-color">{{ ele.title }}</div>
      <span slot="content" v-if="ele.type == 'currency'">{{ lesseeData[ele.prop] || currency }}</span>
      <span slot="content" v-else="ele.type == 'text'">{{ lesseeData[ele.prop] }}</span>
    </item>
  </list-item>
</template>

<script>
export default {
  props: ["lesseeData"],
  data() {
    return {
      formdata: []
    }
  },
  created() {
    this.createForm()
  },
  methods: {
    factory(arr) {
      // 接收二维数组,产生 formdata
      if (arr.length) {
        arr.forEach(ele => {
          let [title, prop, type] = ele
          this.formdata.push({
            title: title || '',
            prop: prop || 'fdf',
            type: type || 'text'
          })
        });
      }
    },
    createForm() {
      let formArr = [
        ['办事处', 'office_id_n', 'text'],
        ['主机厂', 'factory_n', 'text'],
        ['经销商', 'bp_id_agent_n', 'text'],
        ['业务类别', 'business_type_n', 'text'],
        ['申请编号', 'project_number', 'text'],
        ['项目名称', 'project_name', 'text'],
        ['签约日期', 'sale_date', 'text'],
        ['主机厂业务员', 'manu_manager', 'text'],
        ['业务经理', 'employee_id_n', 'text'],
        ['销售人员', 'bp_user_id_n', 'text'],
        ['销售人员手机', 'bp_user_id_phone', 'text'],
      ]
      this.factory(formArr)
    }
  }
}
</script>

<style lang="less" scoped></style>