<template>
  <div>
    <div class="dialog-h-content scroll-h">

      <div v-if="initLoading"
           class="m-detail-main">

        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">所属网格：</span>
          <span>{{ fmData.gridName }}</span>
        </div>

        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">所属房屋：</span>
          <span>{{ fmData.allName?fmData.allName:'--' }}</span>
        </div>

        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">姓名：</span>
          <span>{{ fmData.name}}</span>
        </div>

        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">手机号：</span>
          <span>{{ fmData.mobile?fmData.mobile:'--'}}</span>
        </div>

        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">证件号：</span>
          <span>{{ fmData.idCard?fmData.idCard:'--'}}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">性别：</span>
          <span>{{fmData.genderName?fmData.genderName:'--' }}</span>
        </div>

        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">年龄：</span>
          <span>{{ fmData.age?fmData.age:'--' }}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">迁入日期：</span>
          <span>{{ fmData.inTime?fmData.inTime:'--' }}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">迁入原因：</span>
          <span>{{ fmData.inReason?fmData.inReason:'--' }}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">来源地：</span>
          <span>{{ fmData.sourceAddress?fmData.sourceAddress:'--' }}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">详细地址：</span>
          <span>{{ fmData.address? fmData.address:'--'}}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">迁移证号码：</span>
          <span>{{ fmData.moveNumber?fmData.moveNumber:'--' }}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">户主姓名：</span>
          <span>{{ fmData.householderName? fmData.householderName:'--'  }}</span>
        </div>
        <div class="m-info-prop">
          <span class="u-info-title u-info-title-100">与户主关系：</span>
          <span>{{ fmData.householderRelationName? fmData.householderRelationName:'--' }}</span>
        </div>

      </div>

    </div>
    <div class="m-detail-btn">
      <el-button size="small"
                 @click="handleCancle">关 闭</el-button>

    </div>
  </div>
</template>

<script>
import { requestPost } from "@/js/dai/request";

export default {
  data () {
    return {
      initLoading: false,
      fmData: {},

    }
  },
  components: {},
  computed: {

  },
  props: {},
  watch: {},

  async mounted () {
    console.log('mounted-----我执行了')

  },

  methods: {
    handleCancle () {

      this.$emit('diaDetailClose')

    },
    async initForm (id) {

      await this.getDatail(id)

      this.initLoading = true

    },
    async getDatail (moveInId) {
      let url = '/actual/base/residentMoveInRecord/detail'

      const params = {
        moveInId: moveInId || ''
      }
      const { data, code, msg } = await requestPost(url, params)
      if (code === 0) {
        this.fmData = { ...data }


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


  }
}
</script>

<style lang="scss" scoped >
@import "@/assets/scss/modules/management/detail-main.scss";
</style>

