<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="培训计划id" prop="TrainId">
        <el-input
          v-model="queryParams.TrainId"
          placeholder="请输入培训计划id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="ZYIdList">
        <el-input
          v-model="queryParams.ZYIdList"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户名称" prop="UserName">
        <el-input
          v-model="queryParams.UserName"
          placeholder="请输入用户名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证后八位" prop="UserPwd">
        <el-input
          v-model="queryParams.UserPwd"
          placeholder="请输入身份证后八位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证" prop="UserCord">
        <el-input
          v-model="queryParams.UserCord"
          placeholder="请输入身份证"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="UserDate">
        <el-input
          v-model="queryParams.UserDate"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电话号" prop="UserPhone">
        <el-input
          v-model="queryParams.UserPhone"
          placeholder="请输入电话号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="邮箱号" prop="UserEmail">
        <el-input
          v-model="queryParams.UserEmail"
          placeholder="请输入邮箱号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报名城市" prop="City">
        <el-input
          v-model="queryParams.City"
          placeholder="请输入报名城市"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专业  监理员/监理工程师" prop="ZcsZhuanYe">
        <el-select v-model="queryParams.ZcsZhuanYe" placeholder="请选择专业  监理员/监理工程师" clearable>
          <el-option
            v-for="dict in dict.type.jxjy_zhuanye"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="${comment}" prop="Zsbh">
        <el-input
          v-model="queryParams.Zsbh"
          placeholder="请输入${comment}"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="证书有效期" prop="Yxqz">
        <el-input
          v-model="queryParams.Yxqz"
          placeholder="请输入证书有效期"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司id" prop="BMdept">
        <el-input
          v-model="queryParams.BMdept"
          placeholder="请输入公司id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司名称" prop="DeptName">
        <el-input
          v-model="queryParams.DeptName"
          placeholder="请输入公司名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司电话" prop="DeptTel">
        <el-input
          v-model="queryParams.DeptTel"
          placeholder="请输入公司电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单位联系人" prop="DeptLxr">
        <el-input
          v-model="queryParams.DeptLxr"
          placeholder="请输入单位联系人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单位联系人电话" prop="DeptLxrPhone">
        <el-input
          v-model="queryParams.DeptLxrPhone"
          placeholder="请输入单位联系人电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司邮箱" prop="DeptEmail">
        <el-input
          v-model="queryParams.DeptEmail"
          placeholder="请输入公司邮箱"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司地址" prop="DeptAddress">
        <el-input
          v-model="queryParams.DeptAddress"
          placeholder="请输入公司地址"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="公司邮编" prop="DeptZipcode">
        <el-input
          v-model="queryParams.DeptZipcode"
          placeholder="请输入公司邮编"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否缴费  0未缴费 1已缴费" prop="FeeFlg">
        <el-select v-model="queryParams.FeeFlg" placeholder="请选择是否缴费  0未缴费 1已缴费" clearable>
          <el-option
            v-for="dict in dict.type.jxjy_jiaofei"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="0以往注册周期   1本注册周期  " prop="Bzq">
        <el-input
          v-model="queryParams.Bzq"
          placeholder="请输入0以往注册周期   1本注册周期  "
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="${comment}" prop="AddDate">
        <el-date-picker clearable
          v-model="queryParams.AddDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择${comment}">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="是否完成本次资格考试" prop="OverFlg">
        <el-input
          v-model="queryParams.OverFlg"
          placeholder="请输入是否完成本次资格考试"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="签发日期" prop="QianFaDate">
        <el-input
          v-model="queryParams.QianFaDate"
          placeholder="请输入签发日期"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="企业审核" prop="ShenHe">
        <el-input
          v-model="queryParams.ShenHe"
          placeholder="请输入企业审核"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培训点审核" prop="PeiXunFlg">
        <el-input
          v-model="queryParams.PeiXunFlg"
          placeholder="请输入培训点审核"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="视频是否看完0未完成 1已完成" prop="wanchengflg">
        <el-input
          v-model="queryParams.wanchengflg"
          placeholder="请输入视频是否看完0未完成 1已完成"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总学时" prop="zongxueshi">
        <el-input
          v-model="queryParams.zongxueshi"
          placeholder="请输入总学时"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="毕业学校" prop="BYschool">
        <el-input
          v-model="queryParams.BYschool"
          placeholder="请输入毕业学校"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="学历" prop="xueli">
        <el-input
          v-model="queryParams.xueli"
          placeholder="请输入学历"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职称" prop="zhicheng">
        <el-input
          v-model="queryParams.zhicheng"
          placeholder="请输入职称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职称批准单位" prop="ZCpizhunDept">
        <el-input
          v-model="queryParams.ZCpizhunDept"
          placeholder="请输入职称批准单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="民族" prop="minzu">
        <el-input
          v-model="queryParams.minzu"
          placeholder="请输入民族"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="专业工作年限" prop="zygznx">
        <el-input
          v-model="queryParams.zygznx"
          placeholder="请输入专业工作年限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="监理工作年限" prop="jlgznx">
        <el-input
          v-model="queryParams.jlgznx"
          placeholder="请输入监理工作年限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职称评定时间" prop="zcpdsj">
        <el-input
          v-model="queryParams.zcpdsj"
          placeholder="请输入职称评定时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所学专业" prop="sxzy">
        <el-input
          v-model="queryParams.sxzy"
          placeholder="请输入所学专业"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职务" prop="zhiwu">
        <el-input
          v-model="queryParams.zhiwu"
          placeholder="请输入职务"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报名方式 个人报名：1；企业报名：0" prop="bmfs">
        <el-input
          v-model="queryParams.bmfs"
          placeholder="请输入报名方式 个人报名：1；企业报名：0"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="企业审核通过：1；未通过：0；撤回：2" prop="grshenhe">
        <el-input
          v-model="queryParams.grshenhe"
          placeholder="请输入企业审核通过：1；未通过：0；撤回：2"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培训点审核 1通过 2不通过 3材料补正" prop="pxshenhe">
        <el-input
          v-model="queryParams.pxshenhe"
          placeholder="请输入培训点审核 1通过 2不通过 3材料补正"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="培训审核意见" prop="pxshyj">
        <el-input
          v-model="queryParams.pxshyj"
          placeholder="请输入培训审核意见"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开票类型 0个人  1企业" prop="KplxFlg">
        <el-select v-model="queryParams.KplxFlg" placeholder="请选择开票类型 0个人  1企业" clearable>
          <el-option
            v-for="dict in dict.type.jxjy_kplx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="个人姓名" prop="KpGRName">
        <el-input
          v-model="queryParams.KpGRName"
          placeholder="请输入个人姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开票注册电话" prop="kpzcdh">
        <el-input
          v-model="queryParams.kpzcdh"
          placeholder="请输入开票注册电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开票银行账户" prop="kpyhzh">
        <el-input
          v-model="queryParams.kpyhzh"
          placeholder="请输入开票银行账户"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开票个人邮箱" prop="kpGRemail">
        <el-input
          v-model="queryParams.kpGRemail"
          placeholder="请输入开票个人邮箱"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电子发票邮箱" prop="dzfpyx">
        <el-input
          v-model="queryParams.dzfpyx"
          placeholder="请输入电子发票邮箱"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收件人" prop="sjr">
        <el-input
          v-model="queryParams.sjr"
          placeholder="请输入收件人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收件人手机" prop="sjrsj">
        <el-input
          v-model="queryParams.sjrsj"
          placeholder="请输入收件人手机"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="邮寄编码" prop="yjbm">
        <el-input
          v-model="queryParams.yjbm"
          placeholder="请输入邮寄编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开票类型  增值税普通发票" prop="kplx">
        <el-select v-model="queryParams.kplx" placeholder="请选择开票类型  增值税普通发票" clearable>
          <el-option
            v-for="dict in dict.type.jxjy_fplx"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="开票方式 单独开一张发票 字典" prop="kpfs">
        <el-select v-model="queryParams.kpfs" placeholder="请选择开票方式 单独开一张发票 字典" clearable>
          <el-option
            v-for="dict in dict.type.jxjy_kpfs"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="开票单位" prop="kpdw">
        <el-input
          v-model="queryParams.kpdw"
          placeholder="请输入开票单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="纳税人识别号" prop="nsrsbh">
        <el-input
          v-model="queryParams.nsrsbh"
          placeholder="请输入纳税人识别号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="证书有效期" prop="zsyxq">
        <el-input
          v-model="queryParams.zsyxq"
          placeholder="请输入证书有效期"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="资格证书号" prop="zgzsh">
        <el-input
          v-model="queryParams.zgzsh"
          placeholder="请输入资格证书号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否是国证" prop="sfsgz">
        <el-input
          v-model="queryParams.sfsgz"
          placeholder="请输入是否是国证"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['zgks:ZigePerson:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['zgks:ZigePerson:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['zgks:ZigePerson:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['zgks:ZigePerson:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="ZigePersonList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="${comment}" align="center" prop="PersonId" />
      <el-table-column label="培训计划id" align="center" prop="TrainId" />
      <el-table-column label="${comment}" align="center" prop="ZYIdList" />
      <el-table-column label="用户名称" align="center" prop="UserName" />
      <el-table-column label="身份证后八位" align="center" prop="UserPwd" />
      <el-table-column label="性别" align="center" prop="UserSex" />
      <el-table-column label="身份证" align="center" prop="UserCord" />
      <el-table-column label="${comment}" align="center" prop="UserDate" />
      <el-table-column label="电话号" align="center" prop="UserPhone" />
      <el-table-column label="邮箱号" align="center" prop="UserEmail" />
      <el-table-column label="报名城市" align="center" prop="City" />
      <el-table-column label="专业  监理员/监理工程师" align="center" prop="ZcsZhuanYe">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.jxjy_zhuanye" :value="scope.row.ZcsZhuanYe"/>
        </template>
      </el-table-column>
      <el-table-column label="专业类型  土建" align="center" prop="ZhuanYeType" />
      <el-table-column label="${comment}" align="center" prop="Zsbh" />
      <el-table-column label="证书有效期" align="center" prop="Yxqz" />
      <el-table-column label="公司id" align="center" prop="BMdept" />
      <el-table-column label="公司名称" align="center" prop="DeptName" />
      <el-table-column label="公司电话" align="center" prop="DeptTel" />
      <el-table-column label="单位联系人" align="center" prop="DeptLxr" />
      <el-table-column label="单位联系人电话" align="center" prop="DeptLxrPhone" />
      <el-table-column label="公司邮箱" align="center" prop="DeptEmail" />
      <el-table-column label="公司地址" align="center" prop="DeptAddress" />
      <el-table-column label="公司邮编" align="center" prop="DeptZipcode" />
      <el-table-column label="是否缴费  0未缴费 1已缴费" align="center" prop="FeeFlg">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.jxjy_jiaofei" :value="scope.row.FeeFlg"/>
        </template>
      </el-table-column>
      <el-table-column label="0以往注册周期   1本注册周期  " align="center" prop="Bzq" />
      <el-table-column label="${comment}" align="center" prop="AddDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.AddDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="是否完成本次资格考试" align="center" prop="OverFlg" />
      <el-table-column label="签发日期" align="center" prop="QianFaDate" />
      <el-table-column label="备注" align="center" prop="BeiZhu" />
      <el-table-column label="企业审核" align="center" prop="ShenHe" />
      <el-table-column label="培训点审核" align="center" prop="PeiXunFlg" />
      <el-table-column label="资格证书号" align="center" prop="Undef1" />
      <el-table-column label="证书有效期" align="center" prop="Undef2" />
      <el-table-column label="是否是国证" align="center" prop="Undef3" />
      <el-table-column label="${comment}" align="center" prop="Undef4" />
      <el-table-column label="${comment}" align="center" prop="Undef5" />
      <el-table-column label="视频是否看完0未完成 1已完成" align="center" prop="wanchengflg" />
      <el-table-column label="总学时" align="center" prop="zongxueshi" />
      <el-table-column label="毕业学校" align="center" prop="BYschool" />
      <el-table-column label="学历" align="center" prop="xueli" />
      <el-table-column label="职称" align="center" prop="zhicheng" />
      <el-table-column label="职称批准单位" align="center" prop="ZCpizhunDept" />
      <el-table-column label="民族" align="center" prop="minzu" />
      <el-table-column label="专业工作年限" align="center" prop="zygznx" />
      <el-table-column label="监理工作年限" align="center" prop="jlgznx" />
      <el-table-column label="职称评定时间" align="center" prop="zcpdsj" />
      <el-table-column label="所学专业" align="center" prop="sxzy" />
      <el-table-column label="职务" align="center" prop="zhiwu" />
      <el-table-column label="报名方式 个人报名：1；企业报名：0" align="center" prop="bmfs" />
      <el-table-column label="企业审核通过：1；未通过：0；撤回：2" align="center" prop="grshenhe" />
      <el-table-column label="培训点审核 1通过 2不通过 3材料补正" align="center" prop="pxshenhe" />
      <el-table-column label="培训审核意见" align="center" prop="pxshyj" />
      <el-table-column label="职称专业" align="center" prop="zhichengZhuanYe" />
      <el-table-column label="毕业时间" align="center" prop="BYTime" />
      <el-table-column label="开票类型 0个人  1企业" align="center" prop="KplxFlg">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.jxjy_kplx" :value="scope.row.KplxFlg"/>
        </template>
      </el-table-column>
      <el-table-column label="个人姓名" align="center" prop="KpGRName" />
      <el-table-column label="开票注册地址" align="center" prop="kpzcdz" />
      <el-table-column label="开票注册电话" align="center" prop="kpzcdh" />
      <el-table-column label="开票开户银行" align="center" prop="kpkhyh" />
      <el-table-column label="开票银行账户" align="center" prop="kpyhzh" />
      <el-table-column label="开票个人邮箱" align="center" prop="kpGRemail" />
      <el-table-column label="电子发票邮箱" align="center" prop="dzfpyx" />
      <el-table-column label="收件人" align="center" prop="sjr" />
      <el-table-column label="收件人手机" align="center" prop="sjrsj" />
      <el-table-column label="邮寄地址" align="center" prop="yjdz" />
      <el-table-column label="邮寄编码" align="center" prop="yjbm" />
      <el-table-column label="开票类型  增值税普通发票" align="center" prop="kplx">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.jxjy_fplx" :value="scope.row.kplx"/>
        </template>
      </el-table-column>
      <el-table-column label="开票方式 单独开一张发票 字典" align="center" prop="kpfs">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.jxjy_kpfs" :value="scope.row.kpfs"/>
        </template>
      </el-table-column>
      <el-table-column label="开票单位" align="center" prop="kpdw" />
      <el-table-column label="纳税人识别号" align="center" prop="nsrsbh" />
      <el-table-column label="证书有效期" align="center" prop="zsyxq" />
      <el-table-column label="资格证书号" align="center" prop="zgzsh" />
      <el-table-column label="是否是国证" align="center" prop="sfsgz" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['zgks:ZigePerson:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['zgks:ZigePerson:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改资格考试报名对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="培训计划id" prop="TrainId">
          <el-input v-model="form.TrainId" placeholder="请输入培训计划id" />
        </el-form-item>
        <el-form-item label="${comment}" prop="ZYIdList">
          <el-input v-model="form.ZYIdList" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="用户名称" prop="UserName">
          <el-input v-model="form.UserName" placeholder="请输入用户名称" />
        </el-form-item>
        <el-form-item label="身份证后八位" prop="UserPwd">
          <el-input v-model="form.UserPwd" placeholder="请输入身份证后八位" />
        </el-form-item>
        <el-form-item label="身份证" prop="UserCord">
          <el-input v-model="form.UserCord" placeholder="请输入身份证" />
        </el-form-item>
        <el-form-item label="${comment}" prop="UserDate">
          <el-input v-model="form.UserDate" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="电话号" prop="UserPhone">
          <el-input v-model="form.UserPhone" placeholder="请输入电话号" />
        </el-form-item>
        <el-form-item label="邮箱号" prop="UserEmail">
          <el-input v-model="form.UserEmail" placeholder="请输入邮箱号" />
        </el-form-item>
        <el-form-item label="报名城市" prop="City">
          <el-input v-model="form.City" placeholder="请输入报名城市" />
        </el-form-item>
        <el-form-item label="专业  监理员/监理工程师" prop="ZcsZhuanYe">
          <el-select v-model="form.ZcsZhuanYe" placeholder="请选择专业  监理员/监理工程师">
            <el-option
              v-for="dict in dict.type.jxjy_zhuanye"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="${comment}" prop="Zsbh">
          <el-input v-model="form.Zsbh" placeholder="请输入${comment}" />
        </el-form-item>
        <el-form-item label="证书有效期" prop="Yxqz">
          <el-input v-model="form.Yxqz" placeholder="请输入证书有效期" />
        </el-form-item>
        <el-form-item label="公司id" prop="BMdept">
          <el-input v-model="form.BMdept" placeholder="请输入公司id" />
        </el-form-item>
        <el-form-item label="公司名称" prop="DeptName">
          <el-input v-model="form.DeptName" placeholder="请输入公司名称" />
        </el-form-item>
        <el-form-item label="公司电话" prop="DeptTel">
          <el-input v-model="form.DeptTel" placeholder="请输入公司电话" />
        </el-form-item>
        <el-form-item label="单位联系人" prop="DeptLxr">
          <el-input v-model="form.DeptLxr" placeholder="请输入单位联系人" />
        </el-form-item>
        <el-form-item label="单位联系人电话" prop="DeptLxrPhone">
          <el-input v-model="form.DeptLxrPhone" placeholder="请输入单位联系人电话" />
        </el-form-item>
        <el-form-item label="公司邮箱" prop="DeptEmail">
          <el-input v-model="form.DeptEmail" placeholder="请输入公司邮箱" />
        </el-form-item>
        <el-form-item label="公司地址" prop="DeptAddress">
          <el-input v-model="form.DeptAddress" placeholder="请输入公司地址" />
        </el-form-item>
        <el-form-item label="公司邮编" prop="DeptZipcode">
          <el-input v-model="form.DeptZipcode" placeholder="请输入公司邮编" />
        </el-form-item>
        <el-form-item label="是否缴费  0未缴费 1已缴费" prop="FeeFlg">
          <el-select v-model="form.FeeFlg" placeholder="请选择是否缴费  0未缴费 1已缴费">
            <el-option
              v-for="dict in dict.type.jxjy_jiaofei"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="0以往注册周期   1本注册周期  " prop="Bzq">
          <el-input v-model="form.Bzq" placeholder="请输入0以往注册周期   1本注册周期  " />
        </el-form-item>
        <el-form-item label="${comment}" prop="AddDate">
          <el-date-picker clearable
            v-model="form.AddDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择${comment}">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="是否完成本次资格考试" prop="OverFlg">
          <el-input v-model="form.OverFlg" placeholder="请输入是否完成本次资格考试" />
        </el-form-item>
        <el-form-item label="签发日期" prop="QianFaDate">
          <el-input v-model="form.QianFaDate" placeholder="请输入签发日期" />
        </el-form-item>
        <el-form-item label="备注" prop="BeiZhu">
          <el-input v-model="form.BeiZhu" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="企业审核" prop="ShenHe">
          <el-input v-model="form.ShenHe" placeholder="请输入企业审核" />
        </el-form-item>
        <el-form-item label="培训点审核" prop="PeiXunFlg">
          <el-input v-model="form.PeiXunFlg" placeholder="请输入培训点审核" />
        </el-form-item>
        <el-form-item label="资格证书号" prop="Undef1">
          <el-input v-model="form.Undef1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="证书有效期" prop="Undef2">
          <el-input v-model="form.Undef2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="是否是国证" prop="Undef3">
          <el-input v-model="form.Undef3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="${comment}" prop="Undef4">
          <el-input v-model="form.Undef4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="${comment}" prop="Undef5">
          <el-input v-model="form.Undef5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="视频是否看完0未完成 1已完成" prop="wanchengflg">
          <el-input v-model="form.wanchengflg" placeholder="请输入视频是否看完0未完成 1已完成" />
        </el-form-item>
        <el-form-item label="总学时" prop="zongxueshi">
          <el-input v-model="form.zongxueshi" placeholder="请输入总学时" />
        </el-form-item>
        <el-form-item label="毕业学校" prop="BYschool">
          <el-input v-model="form.BYschool" placeholder="请输入毕业学校" />
        </el-form-item>
        <el-form-item label="学历" prop="xueli">
          <el-input v-model="form.xueli" placeholder="请输入学历" />
        </el-form-item>
        <el-form-item label="职称" prop="zhicheng">
          <el-input v-model="form.zhicheng" placeholder="请输入职称" />
        </el-form-item>
        <el-form-item label="职称批准单位" prop="ZCpizhunDept">
          <el-input v-model="form.ZCpizhunDept" placeholder="请输入职称批准单位" />
        </el-form-item>
        <el-form-item label="民族" prop="minzu">
          <el-input v-model="form.minzu" placeholder="请输入民族" />
        </el-form-item>
        <el-form-item label="专业工作年限" prop="zygznx">
          <el-input v-model="form.zygznx" placeholder="请输入专业工作年限" />
        </el-form-item>
        <el-form-item label="监理工作年限" prop="jlgznx">
          <el-input v-model="form.jlgznx" placeholder="请输入监理工作年限" />
        </el-form-item>
        <el-form-item label="职称评定时间" prop="zcpdsj">
          <el-input v-model="form.zcpdsj" placeholder="请输入职称评定时间" />
        </el-form-item>
        <el-form-item label="所学专业" prop="sxzy">
          <el-input v-model="form.sxzy" placeholder="请输入所学专业" />
        </el-form-item>
        <el-form-item label="职务" prop="zhiwu">
          <el-input v-model="form.zhiwu" placeholder="请输入职务" />
        </el-form-item>
        <el-form-item label="报名方式 个人报名：1；企业报名：0" prop="bmfs">
          <el-input v-model="form.bmfs" placeholder="请输入报名方式 个人报名：1；企业报名：0" />
        </el-form-item>
        <el-form-item label="企业审核通过：1；未通过：0；撤回：2" prop="grshenhe">
          <el-input v-model="form.grshenhe" placeholder="请输入企业审核通过：1；未通过：0；撤回：2" />
        </el-form-item>
        <el-form-item label="培训点审核 1通过 2不通过 3材料补正" prop="pxshenhe">
          <el-input v-model="form.pxshenhe" placeholder="请输入培训点审核 1通过 2不通过 3材料补正" />
        </el-form-item>
        <el-form-item label="培训审核意见" prop="pxshyj">
          <el-input v-model="form.pxshyj" placeholder="请输入培训审核意见" />
        </el-form-item>
        <el-form-item label="职称专业" prop="zhichengZhuanYe">
          <el-input v-model="form.zhichengZhuanYe" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="毕业时间" prop="BYTime">
          <el-input v-model="form.BYTime" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="开票类型 0个人  1企业" prop="KplxFlg">
          <el-select v-model="form.KplxFlg" placeholder="请选择开票类型 0个人  1企业">
            <el-option
              v-for="dict in dict.type.jxjy_kplx"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="个人姓名" prop="KpGRName">
          <el-input v-model="form.KpGRName" placeholder="请输入个人姓名" />
        </el-form-item>
        <el-form-item label="开票注册地址" prop="kpzcdz">
          <el-input v-model="form.kpzcdz" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="开票注册电话" prop="kpzcdh">
          <el-input v-model="form.kpzcdh" placeholder="请输入开票注册电话" />
        </el-form-item>
        <el-form-item label="开票开户银行" prop="kpkhyh">
          <el-input v-model="form.kpkhyh" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="开票银行账户" prop="kpyhzh">
          <el-input v-model="form.kpyhzh" placeholder="请输入开票银行账户" />
        </el-form-item>
        <el-form-item label="开票个人邮箱" prop="kpGRemail">
          <el-input v-model="form.kpGRemail" placeholder="请输入开票个人邮箱" />
        </el-form-item>
        <el-form-item label="电子发票邮箱" prop="dzfpyx">
          <el-input v-model="form.dzfpyx" placeholder="请输入电子发票邮箱" />
        </el-form-item>
        <el-form-item label="收件人" prop="sjr">
          <el-input v-model="form.sjr" placeholder="请输入收件人" />
        </el-form-item>
        <el-form-item label="收件人手机" prop="sjrsj">
          <el-input v-model="form.sjrsj" placeholder="请输入收件人手机" />
        </el-form-item>
        <el-form-item label="邮寄地址" prop="yjdz">
          <el-input v-model="form.yjdz" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="邮寄编码" prop="yjbm">
          <el-input v-model="form.yjbm" placeholder="请输入邮寄编码" />
        </el-form-item>
        <el-form-item label="开票类型  增值税普通发票" prop="kplx">
          <el-select v-model="form.kplx" placeholder="请选择开票类型  增值税普通发票">
            <el-option
              v-for="dict in dict.type.jxjy_fplx"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="开票方式 单独开一张发票 字典" prop="kpfs">
          <el-select v-model="form.kpfs" placeholder="请选择开票方式 单独开一张发票 字典">
            <el-option
              v-for="dict in dict.type.jxjy_kpfs"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="开票单位" prop="kpdw">
          <el-input v-model="form.kpdw" placeholder="请输入开票单位" />
        </el-form-item>
        <el-form-item label="纳税人识别号" prop="nsrsbh">
          <el-input v-model="form.nsrsbh" placeholder="请输入纳税人识别号" />
        </el-form-item>
        <el-form-item label="证书有效期" prop="zsyxq">
          <el-input v-model="form.zsyxq" placeholder="请输入证书有效期" />
        </el-form-item>
        <el-form-item label="资格证书号" prop="zgzsh">
          <el-input v-model="form.zgzsh" placeholder="请输入资格证书号" />
        </el-form-item>
        <el-form-item label="是否是国证" prop="sfsgz">
          <el-input v-model="form.sfsgz" placeholder="请输入是否是国证" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listZigePerson, getZigePerson, delZigePerson, addZigePerson, updateZigePerson } from "@/api/xiehui/zgks/ZigePerson";

export default {
  name: "ZigePerson",
  dicts: ['jxjy_zhuanye', 'jxjy_fplx', 'jxjy_kplx', 'jxjy_kpfs', 'jxjy_jiaofei'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 资格考试报名表格数据
      ZigePersonList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        TrainId: null,
        ZYIdList: null,
        UserName: null,
        UserPwd: null,
        UserSex: null,
        UserCord: null,
        UserDate: null,
        UserPhone: null,
        UserEmail: null,
        City: null,
        ZcsZhuanYe: null,
        ZhuanYeType: null,
        Zsbh: null,
        Yxqz: null,
        BMdept: null,
        DeptName: null,
        DeptTel: null,
        DeptLxr: null,
        DeptLxrPhone: null,
        DeptEmail: null,
        DeptAddress: null,
        DeptZipcode: null,
        FeeFlg: null,
        Bzq: null,
        AddDate: null,
        OverFlg: null,
        QianFaDate: null,
        BeiZhu: null,
        ShenHe: null,
        PeiXunFlg: null,
        Undef1: null,
        Undef2: null,
        Undef3: null,
        Undef4: null,
        Undef5: null,
        wanchengflg: null,
        zongxueshi: null,
        BYschool: null,
        xueli: null,
        zhicheng: null,
        ZCpizhunDept: null,
        minzu: null,
        zygznx: null,
        jlgznx: null,
        zcpdsj: null,
        sxzy: null,
        zhiwu: null,
        bmfs: null,
        grshenhe: null,
        pxshenhe: null,
        pxshyj: null,
        zhichengZhuanYe: null,
        BYTime: null,
        KplxFlg: null,
        KpGRName: null,
        kpzcdz: null,
        kpzcdh: null,
        kpkhyh: null,
        kpyhzh: null,
        kpGRemail: null,
        dzfpyx: null,
        sjr: null,
        sjrsj: null,
        yjdz: null,
        yjbm: null,
        kplx: null,
        kpfs: null,
        kpdw: null,
        nsrsbh: null,
        zsyxq: null,
        zgzsh: null,
        sfsgz: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询资格考试报名列表 */
    getList() {
      this.loading = true;
      listZigePerson(this.queryParams).then(response => {
        this.ZigePersonList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        PersonId: null,
        TrainId: null,
        ZYIdList: null,
        UserName: null,
        UserPwd: null,
        UserSex: null,
        UserCord: null,
        UserDate: null,
        UserPhone: null,
        UserEmail: null,
        City: null,
        ZcsZhuanYe: null,
        ZhuanYeType: null,
        Zsbh: null,
        Yxqz: null,
        BMdept: null,
        DeptName: null,
        DeptTel: null,
        DeptLxr: null,
        DeptLxrPhone: null,
        DeptEmail: null,
        DeptAddress: null,
        DeptZipcode: null,
        FeeFlg: null,
        Bzq: null,
        AddDate: null,
        OverFlg: null,
        QianFaDate: null,
        BeiZhu: null,
        ShenHe: null,
        PeiXunFlg: null,
        Undef1: null,
        Undef2: null,
        Undef3: null,
        Undef4: null,
        Undef5: null,
        wanchengflg: null,
        zongxueshi: null,
        BYschool: null,
        xueli: null,
        zhicheng: null,
        ZCpizhunDept: null,
        minzu: null,
        zygznx: null,
        jlgznx: null,
        zcpdsj: null,
        sxzy: null,
        zhiwu: null,
        bmfs: null,
        grshenhe: null,
        pxshenhe: null,
        pxshyj: null,
        zhichengZhuanYe: null,
        BYTime: null,
        KplxFlg: null,
        KpGRName: null,
        kpzcdz: null,
        kpzcdh: null,
        kpkhyh: null,
        kpyhzh: null,
        kpGRemail: null,
        dzfpyx: null,
        sjr: null,
        sjrsj: null,
        yjdz: null,
        yjbm: null,
        kplx: null,
        kpfs: null,
        kpdw: null,
        nsrsbh: null,
        zsyxq: null,
        zgzsh: null,
        sfsgz: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.PersonId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加资格考试报名";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const PersonId = row.PersonId || this.ids
      getZigePerson(PersonId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改资格考试报名";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.PersonId != null) {
            updateZigePerson(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addZigePerson(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const PersonIds = row.PersonId || this.ids;
      this.$modal.confirm('是否确认删除资格考试报名编号为"' + PersonIds + '"的数据项？').then(function() {
        return delZigePerson(PersonIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('zgks/ZigePerson/export', {
        ...this.queryParams
      }, `ZigePerson_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
