<template>
  <view class="item-box">
    <item-title label="客户基本信息" :line-type="1"></item-title>
    <view class="item-line">
      <identity-item @onShowImg="onShowImg" :identity-one="business.identity_one" :identity-two="business.identity_two"></identity-item>
    </view>
    <item-text label="姓名" :value="business.name" key-str="name" :type-keys="typeKeys"></item-text>
    <item-text label="身份证" :value="business.id_number" key-str="id_number" :type-keys="typeKeys"></item-text>
    <item-text label="性别" :value="business.sex" key-str="sex" :type-keys="typeKeys" :radio-data="{'1':'男','2':'女'}"></item-text>
    <item-text label="生日" :value="business.birthday" birthday="sex" :type-keys="typeKeys"></item-text>
    <item-text label="手机号" :value="business.phone" key-str="phone" :type-keys="typeKeys"></item-text>
    <item-text label="日常居城市" :value="business.resident_city" key-str="resident_city" :type-keys="typeKeys"></item-text>
    <item-text label="日常居住地" :value="business.resident_address" key-str="resident_address" :type-keys="typeKeys"></item-text>
    <item-title label="婚姻状况信息" :line-type="3" v-show="verifyKey('marriage_type')"></item-title>
    <view >
      <item-text label="婚姻状况信息" :value="business.marriage_type" key-str="marriage_type" :type-keys="typeKeys" :radio-data="{'1':'单身','2':'已婚','3':'离异','4':'丧偶'}"></item-text>
      <item-img @onShowImg="onShowImg" label="结婚证件" v-if="business.marriage_type>1" :value="business.marriage_img" key-str="marriage_img" :type-keys="typeKeys"></item-img>
      <view v-if="business.marriage_type===2">
        <item-title label="配偶基本信息" :line-type="3"></item-title>
        <view class="item-line">
          <identity-item @onShowImg="onShowImg" :identity-one="business.m_identity_one" :identity-two="business.m_identity_two"></identity-item>
        </view>
        <item-text label="配偶姓名" :value="business.mate_name" key-str="mate_name" :type-keys="typeKeys"></item-text>
        <item-text label="配偶身份证号" :value="business.mate_id_number" key-str="mate_id_number" :type-keys="typeKeys"></item-text>
        <item-text label="配偶手机号" :value="business.mate_phone" key-str="mate_phone" :type-keys="typeKeys"></item-text>
        <item-text label="配偶所在企业" :value="business.mate_firm" key-str="mate_firm" :type-keys="typeKeys"></item-text>
      </view>
    </view>

    <item-title label="教育背景/职业信息" :line-type="3" v-show="verifyKey('education_type') || verifyKey('employ_type') || verifyKey('firm_name')|| verifyKey('firm_city')|| verifyKey('firm_address')"></item-title>
    <item-text label="教育背景" :value="business.education_name" key-str="education_type" :type-keys="typeKeys"></item-text>
    <item-text label="雇佣类型" :value="business.employ_type" key-str="employ_type" :type-keys="typeKeys" :radio-data="{'1':'受薪','2':'自雇'}"></item-text>
    <item-text label="企业名称" :value="business.firm_name" key-str="firm_name" :type-keys="typeKeys"></item-text>
    <item-text label="公司城市" :value="business.firm_city" key-str="firm_city" :type-keys="typeKeys"></item-text>
    <item-text label="公司地址" :value="business.firm_address" key-str="firm_address" :type-keys="typeKeys"></item-text>
    <item-title label="社保基本信息" :line-type="3" v-show="verifyKey('social_num') || verifyKey('reserved_money')"></item-title>
    <item-text label="社保连续缴纳时间" :value="business.social_num" key-str="social_num" :type-keys="typeKeys" right-text="个月"></item-text>
    <item-text label="公积金缴费基数" :value="business.reserved_money" key-str="reserved_money" :type-keys="typeKeys" right-text="元"></item-text>
  </view>
</template>

<script>
import IdentityItem from "@/pages-task/task-info/module/identity-item";
import ItemTitle from "@/pages-task/task-info/module/item-title";
import ItemText from "@/pages-task/task-info/module/item-text";
import ItemImg from "@/pages-task/task-info/module/item-img";

export default {
  name: "task-client",
  components: {ItemImg, ItemText, ItemTitle, IdentityItem},
  props: {
    business:{
      default:{}
    },
    typeKeys:{
      default:[]
    }
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {

  },
  methods: {
    verifyKey(field) {
      return this.typeKeys.indexOf(field) >= 0
    },
    onShowImg(img){
      this.$emit('onShowImg',img)
    }
  }
}
</script>

<style scoped lang="scss">
@import "@/static/css/task-info/item";

</style>
