<template>
  <div class="m-room-pop">
    <div class="wrap">
      <cpt-card>
        <div class="title">
          <img src="@/assets/img/shuju/title-tip.png" />
          <span>房屋信息</span>
        </div>

        <div class="btn-close"
             @click="handleClose">
          <img src="@/assets/img/shuju/people/close.png" />
        </div>

        <!-- <div class="list">

          <div class="item">
            <span class="item-field">所属小区：</span>
            <span>{{ formData.neighborHoodName }}</span>
          </div>
        </div> -->
        <div class="list">
          <div class="item">
            <span class="item-field">所属楼栋：</span>
            <span>{{  formData.buildingName }}</span>
          </div>

        </div>
        <div class="list">
          <div class="item">
            <span class="item-field">房屋名称：</span>
            <span>{{ formData. houseName }}</span>
          </div>
        </div>
        <div class="list">
          <div class="item">
            <span class="item-field">房屋类型：</span>
            <span>{{ formData.houseTypeName }}</span>
          </div>

        </div>
        <div class="list">

          <div class="item">
            <span class="item-field">房屋状态：</span>
            <span>{{ formData. rentName }}</span>
          </div>

        </div>
        <div class="list">

          <div class="item">
            <span class="item-field">房屋用途：</span>
            <span>{{ formData. purposeName }}</span>
          </div>

        </div>
        <div class="list">

          <div class="item">
            <span class="item-field">房主姓名：</span>
            <span>{{ formData.ownerName?formData.ownerName:'无' }}</span>
          </div>
        </div>
        <div class="list">
          <div class="item">
            <span class="item-field">房主电话：</span>
            <span>{{  formData.ownerPhone?formData.ownerPhone:'无' }}</span>
          </div>
        </div>
        <div class="list">
          <div class="item">
            <span class="item-field">房主身份证：</span>
            <span>{{ formData. ownerIdCard?formData.ownerIdCard:'无' }}</span>
          </div>

        </div>

      </cpt-card>
    </div>
  </div>
</template>

<script>
import cptCard from "@/views/modules/visual/cpts/card";
import { requestGet } from "@/js/dai/request";
import cptTb from "@/views/modules/visual/cpts/tb";

export default {
  name: "peopleMore",
  props: {
    selHouseId: {
      type: String,
      default: "",
    },
    gridName: {
      type: String,
      default: "",
    },
  },

  components: {
    cptCard, cptTb
  },

  data () {
    return {
      formData: {
        gridId: '',
        agencyId: '',//当前网格所属组织Id	
        userId: '',//居民端小程序的用户id、数字社区的icResiUserId、其他情况无值	
        userType: 'icresi',//居民端小程序的人：resi;数字社区的居民：icresi;导入的：import;同步的：synchro	
        name: '',
        idCard: '',
        mobile: '',
        heSuanCheck: false,
        presentAddress: '',
        presentAddressCode: '',
        detailAddress: '',
        sourceAddressCode: '',
        presentAddressPathCode: '',
        sourceAddress: '',
        sourceAddressPathCode: '',
        arriveDate: '',
        remark: '',
        leaveDate: '',
        userType: 'input',
        content: '',
        channel: []

      },
    };
  },

  computed: {

  },

  watch: {
    selHouseId () {
      this.getApiData();
    },
  },

  mounted () {
    this.getApiData();
  },

  methods: {

    handleClose () {
      this.$emit("close");
    },

    async getApiData () {

      this.loadHouseInfo()

    },

    async loadHouseInfo () {

      const url = "/gov/org/ichouse/" + this.selHouseId

      const { data, code, msg } = await requestGet(url)

      if (code === 0) {
        this.formData = data


      } else {
        this.$message.error(msg)
      }

    },
  },
};
</script>
<style
  lang="scss"
  src="@/assets/scss/modules/visual/basicInfoMain.scss"
  scoped
></style>