<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-__caResident}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.residentId" placeholder="residentId" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-button @click="getDataList()">{{ $t('query') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission(':caResident:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission(':caResident:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
        <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
        <el-table-column prop="residentId" label="人口ID" header-align="center" align="center"></el-table-column>
        <el-table-column prop="gridId" label="网格ID" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentProperty" label="人口性质" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentType" label="居民分类" header-align="center" align="center"></el-table-column>
        <el-table-column prop="idType" label="证件类型" header-align="center" align="center"></el-table-column>
        <el-table-column prop="idCard" label="证件号码（公民身份证号）" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentName" label="姓名" header-align="center" align="center"></el-table-column>
        <el-table-column prop="sex" label="性别" header-align="center" align="center"></el-table-column>
        <el-table-column prop="birthday" label="出生日期" header-align="center" align="center"></el-table-column>
        <el-table-column prop="nation" label="民族" header-align="center" align="center"></el-table-column>
        <el-table-column prop="telephone" label="联系方式" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdProv" label="户籍省" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdCity" label="户籍市" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdCounty" label="户籍县(区)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdTown" label="户籍镇街" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdVillage" label="户籍社区/村" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdAddressDetail" label="户籍详址" header-align="center" align="center"></el-table-column>
        <el-table-column prop="curliveProv" label="现住省" header-align="center" align="center"></el-table-column>
        <el-table-column prop="curliveCity" label="现住市" header-align="center" align="center"></el-table-column>
        <el-table-column prop="curliveCounty" label="现住县(区)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="curliveTown" label="现住镇街" header-align="center" align="center"></el-table-column>
        <el-table-column prop="curliveVillage" label="现住社区/村" header-align="center" align="center"></el-table-column>
        <el-table-column prop="curliveAddressDetail" label="现住详址" header-align="center" align="center"></el-table-column>
        <el-table-column prop="nativeAddressProv" label="籍贯省" header-align="center" align="center"></el-table-column>
        <el-table-column prop="nativeAddressCity" label="籍贯市" header-align="center" align="center"></el-table-column>
        <el-table-column prop="nativeAddressCounty" label="籍贯县(区)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="formerName" label="曾用名" header-align="center" align="center"></el-table-column>
        <el-table-column prop="education" label="学历" header-align="center" align="center"></el-table-column>
        <el-table-column prop="occupation" label="职业" header-align="center" align="center"></el-table-column>
        <el-table-column prop="occupationType" label="职业类别" header-align="center" align="center"></el-table-column>
        <el-table-column prop="serviceAddress" label="服务处所" header-align="center" align="center"></el-table-column>
        <el-table-column prop="marriageStatus" label="婚姻状况" header-align="center" align="center"></el-table-column>
        <el-table-column prop="party" label="政治面貌" header-align="center" align="center"></el-table-column>
        <el-table-column prop="religious" label="宗教信仰" header-align="center" align="center"></el-table-column>
        <el-table-column prop="conversionState" label="有无皈依（已受洗）" header-align="center" align="center"></el-table-column>
        <el-table-column prop="nationality" label="国籍" header-align="center" align="center"></el-table-column>
        <el-table-column prop="platCode" label="数据来源" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createBy" label="创建人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createDate" label="创建时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updateBy" label="最后修改人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updateDate" label="最后修改时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="deleteFlag" label="删除状态" header-align="center" align="center"></el-table-column>
        <el-table-column prop="versions" label="乐观锁" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute1" label="扩展字段1" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute2" label="扩展字段2" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute3" label="扩展字段3" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute4" label="扩展字段4" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute5" label="扩展字段5" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute6" label="扩展字段6" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute7" label="扩展字段7" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute8" label="扩展字段8" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute9" label="扩展字段9" header-align="center" align="center"></el-table-column>
        <el-table-column prop="attribute10" label="扩展字段10" header-align="center" align="center"></el-table-column>
        <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
          <template slot-scope="scope">
            <el-button v-if="$hasPermission(':caResident:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
            <el-button v-if="$hasPermission(':caResident:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        :current-page="page"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="limit"
        :total="total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="pageSizeChangeHandle"
        @current-change="pageCurrentChangeHandle">
      </el-pagination>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
    import mixinViewModule from '@/mixins/view-module'
    import AddOrUpdate from './'

    export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '//caResident/page',
        getDataListIsPage: true,
        deleteURL: '//caResident',
        deleteIsBatch: true
      },
      dataForm: {;
        residentId: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
