<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-news__populationinformation}">
      <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <el-form-item>
          <el-input v-model="dataForm.id" placeholder="id" 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('news:populationinformation:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
        </el-form-item>
        <el-form-item>
          <el-button v-if="$hasPermission('news:populationinformation: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="id" label="主键" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentsName" label="姓名" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentsSex" label="性别 (0：女 1：男)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentsNation" label="民族" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentsBirthday" label="出生年/月" header-align="center" align="center"></el-table-column>
        <el-table-column prop="educationLevel" label="文化程度" header-align="center" align="center"></el-table-column>
        <el-table-column prop="politicsStatus" label="政治面貌 (0：群众 1：党员)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="joinTime" label="入党时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="organizationalRelationshipLocation" label="组织关系所在地" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentsIdentityNo" label="身份证号码" header-align="center" align="center"></el-table-column>
        <el-table-column prop="residentsPhone" label="联系电话" header-align="center" align="center"></el-table-column>
        <el-table-column prop="bodyStatus" label="身体状况 (0：病残 1：健康)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="maritalStatus" label="婚姻状况 (0：未婚 1：已婚)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="accountType" label="户口类型 (0：城镇 1：农业)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="militaryService" label="服兵役 (0：否 1：是)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="householdRegistrationPlace" label="户籍地" header-align="center" align="center"></el-table-column>
        <el-table-column prop="employmentStatus" label="就业情况 (0：在岗 1：就业)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="currentEmployer" label="现工作单位" header-align="center" align="center"></el-table-column>
        <el-table-column prop="currentEmployerAddress" label="现单位地址" header-align="center" align="center"></el-table-column>
        <el-table-column prop="unemploymentReason" label="失业原因 (0：原单位破产 1：解除合同  2：效益不好 3：减员 4：其他)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="reemploymentPermit" label="再就业优惠证 (0：无 1：有)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="unemploymentRegister" label="失业登记 (0：否 1：是)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="unemploymentRegisterTime" label="失业登记时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="familyCategory" label="家庭类别 (0：普通家庭 1：五好家庭 2：军烈家庭 3：优抚家庭 4：单亲家庭 5：空巢老人 6：困难家庭)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="helpStatus" label="救助情况 (0：低保 1：大病 2：廉租 3：教育 4：临时 5：其他)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="motorVehicleNum" label="机动车数量" header-align="center" align="center"></el-table-column>
        <el-table-column prop="motorVehicleCategory" label="机动车类型 (0：轿车 1：摩托 2：其他)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="dogStatus" label="宠物犬状况 (0：无 1：有)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="familyMemberNum" label="家庭成员数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="familyMemberOutNum" label="家庭外出成员数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="familyMemberOutReason" label="外出原因 (0：务工 1：上学 2：探亲 3：其他)" header-align="center" align="center"></el-table-column>
        <el-table-column prop="familyMemberOutMonth" label="在外月数" header-align="center" align="center"></el-table-column>
        <el-table-column prop="delFlag" label="删除标识" header-align="center" align="center"></el-table-column>
        <el-table-column prop="revision" label="乐观锁" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createdBy" label="创建人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="createdTime" label="创建时间" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updatedBy" label="更新人" header-align="center" align="center"></el-table-column>
        <el-table-column prop="updatedTime" label="更新时间" 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="parentDeptIds" label="父所有部门" header-align="center" align="center"></el-table-column>
        <el-table-column prop="parentDeptNames" label="父所有部门" header-align="center" align="center"></el-table-column>
        <el-table-column prop="allDeptIds" label="所有部门ID" header-align="center" align="center"></el-table-column>
        <el-table-column prop="allDeptNames" label="所有部门名称" 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('news:populationinformation:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
            <el-button v-if="$hasPermission('news:populationinformation: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 './populationinformation-add-or-update'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      mixinViewModuleOptions: {
        getDataListURL: '/news/populationinformation/page',
        getDataListIsPage: true,
        deleteURL: '/news/populationinformation',
        deleteIsBatch: true
      },
      dataForm: {
        id: ''
      }
    }
  },
  components: {
    AddOrUpdate
  }
}
</script>
