<template>
  <div>
    <div class="app-container">
      <div style="align-items: center;text-align: center;height: 5vh;line-height: 3vh;font-weight: 700;font-size: 17px;">
        {{
          this.$route.query.title }}
        <!-- _{{ this.$route.query.QiciYear }}年第{{ this.$route.query.QiCi }}期 -->
      </div>
      <el-form :model="peoData" ref="peoData" size="small" :inline="true" label-width="90px">
        <el-form-item label-width="80" label="姓名" prop="UserName">
          <el-input v-model="peoData.UserName" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
        </el-form-item>
        <el-form-item label="身份证号" prop="UserCord">
          <el-input v-model="peoData.UserCord" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery" />
        </el-form-item>
        <el-form-item label="地点" prop="City" v-hasRole="['xiehui']">
          <el-select v-model="peoData.City" placeholder="请选择地点" clearable>
            <el-option v-for="dict in dict.type.zgks_address" :key="dict.value" :label="dict.label" :value="dict.label" />
          </el-select>
        </el-form-item>
        <el-form-item label="执业单位" prop="DeptName">
          <el-input v-model="peoData.DeptName" placeholder="请输入执业单位" clearable @keyup.enter.native="handleQuery" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="peoHandleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="peoResetQuery">重置</el-button>
        </el-form-item>
      </el-form>
      <el-row v-hasRole="['peixundian']" :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button type="warning" @click="handleExportBaoming" plain icon="el-icon-download"
            size="mini">审核通过人员导出</el-button></el-col>
        <el-col :span="1.5">
          <el-button type="primary" @click="handleImport" plain icon="el-icon-upload"
            size="mini">考试通过人员导入</el-button></el-col>

        <el-col :span="1.5">
          <el-link type="primary" :underline="false" style="font-size:14px;vertical-align: middle;margin-top: 3px;"
            @click="importTemplate">导入说明.doc</el-link>
        </el-col>
      </el-row>
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane :label="'待审核 (' + daishenhe + ')'" name="0">
          <el-table v-loading="peoLoading" :data="peoList" @selection-change="peoSelect">
            <el-table-column label="序号" align="center" prop="PersonId" width="55">
              <template slot-scope="scope">
                {{ getXvhao(scope.$index, peoData) }}
              </template>
            </el-table-column>
            <el-table-column label="期次" align="center" prop="ZYIdList" width="140">
              <template slot-scope="scope">
                <span>{{ scope.row.QiciYear + "年 第" + scope.row.QiCi + "期" }}</span>
              </template>
            </el-table-column>
            <el-table-column label="地点" align="center" prop="ZYIdList" width="55">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.zgks_address" :value="scope.row.City" />
              </template>
            </el-table-column>
            <el-table-column label="姓名" align="center" prop="UserName" width="150">
             <!-- <template slot-scope="scope">
                <el-button type="text" @click="getPeoInfo(scope.row, false)">{{ scope.row.UserName }}</el-button>
              </template> -->
            </el-table-column>
            <el-table-column label="性别" align="center" prop="UserSex" width="55" />
            <el-table-column label="身份证号" align="center" prop="UserCord" width="170" />
            <el-table-column label="手机号码" align="center" width="120" prop="UserPhone" />
            <el-table-column label="培训类别" width="100" align="center">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.jxjy_zhuanye" :value="scope.row.ZYIdList" />
              </template>
            </el-table-column>
            <el-table-column label="执业单位" align="center" prop="DeptName" />
            <el-table-column label="报名时间" width="150" align="center" prop="UserPwd">
              <template slot-scope="scope">
                {{ parseTime(scope.row.AddDate, "{y}-{m}-{d} {h}:{i}:{s}") }}
              </template>
            </el-table-column>
            <el-table-column width="120" label="培训点审核" align="center" prop="pxshenhe">
              <template slot-scope="scope">
                <el-tag type="" v-if="scope.row.pxshenhe == 0">待审核</el-tag>
                <el-tag type="success" v-if="scope.row.pxshenhe == 1">审核通过</el-tag>
                <el-popover v-if="scope.row.pxshenhe == 2" placement="left" width="200" trigger="hover">
                  <template slot="reference">
                    <el-tag type="danger">不通过(原因)</el-tag>
                  </template>
                  <div v-html="scope.row.pxshyj"></div>
                </el-popover>
                <el-tag type="warning" v-if="scope.row.pxshenhe == 3">材料补正</el-tag>
              </template>
            </el-table-column>

            <el-table-column v-hasRole="['peixundian']" fixed="right" width="120" label="操作" align="center"
              class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button size="mini" type="text" icon="el-icon-s-check"
                  v-if="scope.row.grshenhe == null || scope.row.grshenhe == 1 || scope.row.pxshenhe == 0"
                  @click="getPeoInfo(scope.row, false)">审核</el-button>
                <el-button size="mini" type="text" icon="el-icon-delete" style="color: #f56c6c"
                  @click="handleUpdate(scope.row, false)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane :label="'已通过 (' + yishenhe + ')'" name="1">
          <el-table v-loading="peoLoading" :data="peoList" @selection-change="peoSelect">
            <el-table-column label="序号" align="center" prop="PersonId" width="55">
              <template slot-scope="scope">
                {{ getXvhao(scope.$index, peoData) }}
              </template>
            </el-table-column>
            <el-table-column label="期次" align="center" prop="ZYIdList" width="140">
              <template slot-scope="scope">
                <span>{{ scope.row.QiciYear + "年 第" + scope.row.QiCi + "期" }}</span>
              </template>
            </el-table-column>
            <el-table-column label="地点" align="center" prop="ZYIdList" width="55">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.zgks_address" :value="scope.row.City" />
              </template>
            </el-table-column>
            <el-table-column label="姓名" align="center" prop="UserName" width="150">
              <template slot-scope="scope">
                <el-button type="text" @click="getPeoInfo(scope.row, false)">{{ scope.row.UserName }}</el-button>
              </template>
            </el-table-column>
            <el-table-column label="性别" align="center" prop="UserSex" width="55" />
            <el-table-column label="身份证号" align="center" prop="UserCord" width="170" />
            <el-table-column label="手机号码" align="center" width="120" prop="UserPhone" />
            <el-table-column label="培训类别" width="100" align="center">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.jxjy_zhuanye" :value="scope.row.ZYIdList" />
              </template>
            </el-table-column>
            <el-table-column label="执业单位" align="center" prop="DeptName" />
            <el-table-column label="报名时间" width="150" align="center" prop="UserPwd">
              <template slot-scope="scope">
                {{ parseTime(scope.row.AddDate, "{y}-{m}-{d} {h}:{i}:{s}") }}
              </template>
            </el-table-column>
            <el-table-column width="100" label="是否参加培训" align="center" prop="pxshenhe">
              <template slot-scope="scope">
                {{ scope.row.PeiXunFlg == null ? "" : scope.row.PeiXunFlg == 1 ? "已参加" : "未参加" }}
              </template>
            </el-table-column>
            <el-table-column width="100" label="考试是否通过" align="center" prop="OverFlg">
              <template slot-scope="scope">
                {{ scope.row.OverFlg == null ? "" : scope.row.OverFlg == 1 ? "通过" : "未通过" }}
              </template>
            </el-table-column>
            <el-table-column width="120" label="培训点审核" align="center" prop="pxshenhe">
              <template slot-scope="scope">
                <el-tag type="" v-if="scope.row.pxshenhe == 0">待审核</el-tag>
                <el-tag type="success" v-if="scope.row.pxshenhe == 1">审核通过</el-tag>
                <el-popover v-if="scope.row.pxshenhe == 2" placement="left" width="200" trigger="hover">
                  <template slot="reference">
                    <el-tag type="danger">不通过(原因)</el-tag>
                  </template>
                  <div v-html="scope.row.pxshyj"></div>
                </el-popover>
                <el-tag type="warning" v-if="scope.row.pxshenhe == 3">材料补正</el-tag>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane :label="'已退回 (' + yituihui + ')'" name="2">
          <el-table v-loading="peoLoading" :data="peoList" @selection-change="peoSelect">
            <el-table-column label="序号" align="center" prop="PersonId" width="55">
              <template slot-scope="scope">
                {{ getXvhao(scope.$index, peoData) }}
              </template>
            </el-table-column>
            <el-table-column label="期次" align="center" prop="ZYIdList" width="140">
              <template slot-scope="scope">
                <span>{{
                  scope.row.QiciYear + "年 第" + scope.row.QiCi + "期"
                }}</span>
              </template>
            </el-table-column>
            <el-table-column label="地点" align="center" prop="ZYIdList" width="55">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.zgks_address" :value="scope.row.City" />
              </template>
            </el-table-column>
            <el-table-column label="姓名" align="center" prop="UserName" width="150">
              <template slot-scope="scope">
                <el-button type="text" @click="getPeoInfo(scope.row, false)">{{ scope.row.UserName }}</el-button>
              </template>
            </el-table-column>
            <el-table-column label="性别" align="center" prop="UserSex" width="55" />
            <el-table-column label="身份证号" align="center" prop="UserCord" width="170" />
            <el-table-column label="手机号码" align="center" width="120" prop="UserPhone" />
            <el-table-column label="培训类别" width="100" align="center">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.jxjy_zhuanye" :value="scope.row.ZYIdList" />
              </template>
            </el-table-column>
            <el-table-column label="执业单位" align="center" prop="DeptName" />
            <el-table-column label="报名时间" width="150" align="center" prop="UserPwd">
              <template slot-scope="scope">
                {{ parseTime(scope.row.AddDate, "{y}-{m}-{d} {h}:{i}:{s}") }}
              </template>
            </el-table-column>
            <el-table-column width="120" label="培训点审核" align="center" prop="pxshenhe">
              <template slot-scope="scope">
                <el-tag type="" v-if="scope.row.pxshenhe == 0">待审核</el-tag>
                <el-tag type="success" v-if="scope.row.pxshenhe == 1">审核通过</el-tag>
                <el-popover v-if="scope.row.pxshenhe == 2" placement="left" width="200" trigger="hover">
                  <template slot="reference">
                    <el-tag type="danger">不通过(原因)</el-tag>
                  </template>
                  <div v-html="scope.row.pxshyj"></div>
                </el-popover>
                <el-tag type="warning" v-if="scope.row.pxshenhe == 3">材料补正</el-tag>
              </template>
            </el-table-column>

            <el-table-column v-hasRole="['peixundian']" fixed="right" width="120" label="操作" align="center"
              class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button size="mini" type="text" icon="el-icon-delete" style="color: #f56c6c"
                  @click="handleUpdate(scope.row, false)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
        <el-tab-pane :label="'材料补正 (' + cailiaobz + ')'" name="3">
          <el-table v-loading="peoLoading" :data="peoList" @selection-change="peoSelect">
            <el-table-column label="序号" align="center" prop="PersonId" width="55">
              <template slot-scope="scope">
                {{ getXvhao(scope.$index, peoData) }}
              </template>
            </el-table-column>
            <el-table-column label="期次" align="center" prop="ZYIdList" width="140">
              <template slot-scope="scope">
                <span>{{ scope.row.QiciYear + "年 第" + scope.row.QiCi + "期" }}</span>
              </template>
            </el-table-column>
            <el-table-column label="地点" align="center" prop="ZYIdList" width="55">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.zgks_address" :value="scope.row.City" />
              </template>
            </el-table-column>
            <el-table-column label="姓名" align="center" prop="UserName" width="150">
              <template slot-scope="scope">
                <el-button type="text" @click="getPeoInfo(scope.row, false)">{{ scope.row.UserName }}</el-button>
              </template>
            </el-table-column>
            <el-table-column label="性别" align="center" prop="UserSex" width="55" />
            <el-table-column label="身份证号" align="center" prop="UserCord" width="170" />
            <el-table-column label="手机号码" align="center" width="120" prop="UserPhone" />
            <el-table-column label="培训类别" width="100" align="center">
              <template slot-scope="scope">
                <dict-tag :options="dict.type.jxjy_zhuanye" :value="scope.row.ZYIdList" />
              </template>
            </el-table-column>
            <el-table-column label="执业单位" align="center" prop="DeptName" />
            <el-table-column label="报名时间" width="150" align="center" prop="UserPwd">
              <template slot-scope="scope">
                {{ parseTime(scope.row.AddDate, "{y}-{m}-{d} {h}:{i}:{s}") }}
              </template>
            </el-table-column>
            <el-table-column width="120" label="培训点审核" align="center" prop="pxshenhe">
              <template slot-scope="scope">
                <el-tag type="" v-if="scope.row.pxshenhe == 0">待审核</el-tag>
                <el-tag type="success" v-if="scope.row.pxshenhe == 1">审核通过</el-tag>
                <el-popover v-if="scope.row.pxshenhe == 2" placement="left" width="200" trigger="hover">
                  <template slot="reference">
                    <el-tag type="danger">不通过(原因)</el-tag>
                  </template>
                  <div v-html="scope.row.pxshyj"></div>
                </el-popover>
                <el-tag type="warning" v-if="scope.row.pxshenhe == 3">材料补正</el-tag>
              </template>
            </el-table-column>

            <el-table-column v-hasRole="['peixundian']" width="120" label="操作" align="center"
              class-name="small-padding fixed-width">
              <template slot-scope="scope">
                <el-button size="mini" type="text" icon="el-icon-delete" style="color: #f56c6c"
                  @click="handleUpdate(scope.row, false)">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
      <pagination v-show="peoTotal > 0" :total="peoTotal" :page.sync="peoData.pageNum" :limit.sync="peoData.pageSize"
        @pagination="getPeoList" />
    </div>
    <!-- 添加或修改资格考试报名对话框 -->
    <el-dialog top="3vh" title="报名信息" :visible.sync="bmShow" width="70%" :close-on-click-modal="false" destroy-on-close>
      <div style="height: 74vh;overflow-y: auto;overflow-x: hidden;padding-top: 0;" class="pd-10">
        <component ref="zgks" :is="zgks" :info="zgksInfo" :type="1" :xiugai="xiugaiType" @submitSuccess="submitSuccess">
        </component>
      </div>
      <div slot="footer" class="dialog-footer">
		<el-button type="primary" @click="shenhe(zgksInfo)" v-if="activeName == 0" >通 过</el-button>
		<el-button type="danger" @click="shenheShow = true" v-if="activeName == 0" >退 回</el-button>
        <el-button @click="bmCancel">关 闭</el-button>
      </div>
    </el-dialog>
    <el-dialog top="3vh" :title="upload.title" :visible.sync="upload.open" width="500px" append-to-body>
      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="uploadUrl"
        :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" drag>
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip text-center" slot="tip">
          <span>仅允许导入xls、xlsx格式文件。</span>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
	<el-dialog top="3vh" title="不通过原因" :visible.sync="shenheShow" width="40%">
		<div>
			<el-form ref="shenheForm" :model="shenheForm" :rules="shenheRules" label-width="100px">
				<el-form-item label="原因" prop="pxshenhe">
					<!-- <el-input v-model="form.TrainName" placeholder="请输入计划名称" /> -->
					<el-radio-group v-model="shenheForm.pxshenhe">
						<el-radio :label="3">材料补正</el-radio>
						<el-radio :label="2">不通过</el-radio>
					</el-radio-group>
				</el-form-item>
				<el-form-item label="具体原因" prop="pxshyj">
					<el-input v-model="shenheForm.pxshyj" type="textarea" placeholder="请输入具体原因" />
				</el-form-item>
			</el-form>
		</div>
		<div slot="footer" class="dialog-footer">
			<el-button type="primary" @click="shenheSubmit">确 认</el-button>
		</div>
	</el-dialog>
  </div>
</template>

<script>
import {
  pxShenhe,
  importPxResult
} from "@/api/xiehui/zgks/ZigeTraining";
import {
  getToken
} from "@/utils/auth";
import {
  listZigePerson,
  getZigePerson
} from "@/api/xiehui/zgks/ZigePerson";
import jly from "../../../components/baoming/jly.vue";
import zj from "../../../components/baoming/zj.vue";
import jlgcs from "../../../components/baoming/jlgcs.vue";
export default {
  dicts: ["jxjy_shenhe", "jxjy_zhuanye", "zgks_address"],
  components: {
    jly,
    zj,
    jlgcs,
  },
  props: {},
  data() {
    return {
      uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", //上传路径
      daishenhe: 0,
      yishenhe: 0,
      yituihui: 0,
      cailiaobz: 0,
      Baoming: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 资格考试培训计划表格数据
      ZigeTrainingList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 用户导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: {
          Authorization: "Bearer " + getToken()
        },
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/zgks/ZigePerson/importPxResult"
      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,

        TID: null,
        ECId: null,
        ClassIdList: null,
        ZYIdList: null,
        TrainName: null,
        ZcsZhuanYe: null,
        ZhuanYeType: null,
        QiciYear: null,
        QiCi: null,
        XueShi: null,
        StartDate: null,
        EndDate: null,
        TContent: null,
        BmEndDate: null,
        dishi: null,
        BmNum: null,
        BmNumMax: null,
        Bzq: null,
        OverFlg: null,
        ShenHe: null,
        AddDate: null,
        BeiZhu: null,
        TongZhi: null,
        Minute: null,
        Undef1: null,
        Undef2: null,
        Undef3: null,
        Undef4: null,
        Undef5: null,
        money: null,
        className: null,
        ksName: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        ZcsZhuanYe: {
          required: true,
          message: "请选择培训类别",
          trigger: ["blur", "change"],
        },
        QiciYear: {
          required: true,
          message: "请填写年",
          trigger: ["blur", "change"],
        },
        QiCi: {
          required: true,
          message: "请填写次",
          trigger: ["blur", "change"],
        },
        TrainName: {
          required: true,
          message: "请填写培训计划名称",
          trigger: ["blur", "change"],
        },
        dishi: {
          required: true,
          message: "请选择培训地点",
          trigger: ["blur", "change"],
        },
        StartDate: {
          required: true,
          message: "请选择培训开始日期",
          trigger: ["blur", "change"],
        },
        EndDate: {
          required: true,
          message: "请选择培训结束日期",
          trigger: ["blur", "change"],
        },
        BmEndDate: {
          required: true,
          message: "请选择报名截止日期",
          trigger: ["blur", "change"],
        },
        ShenHe: {
          required: true,
          message: "请选择是否审核",
          trigger: ["blur", "change"],
        },
      },
      checks: [],
      activeName: '0',
      ksAddress: [],
      //报名人员列表
      peoShow: false,
      peoLoading: false,
      peoList: [],
      peoTotal: 0,
      peoData: {
        pageSize: 10,
        pageNum: 1,
        pxshenhe: 0,
        TrainId: null,
        UserName: null,
        UserCord: null,
        QiciYear: null,
        QiCi: null,
        City: null,
        DeptName: null,
      },
      peoIds: [],
      Train: {
        QiciYear: null,
        QiCi: null,
      },
      shenheShow: false,
      shenheForm: {
        pxshenhe: null,
        pxshyj: null,
      },
      shenheRules: {
        pxshenhe: {
          required: true,
          message: "请选择原因",
          trigger: ["blur", "change"],
        },
        pxshyj: {
          required: true,
          message: "请输入具体原因",
          trigger: ["blur", "change"],
        },
      },
      //查看报名信息
      bmShow: false,
      zgks: null,
      zgksInfo: null,
      xiugaiType: false,
      importFile: null,
      shform: {},
    };
  },
  watch: {},
  computed: {},
  created() {
    this.getPeoList();
  },
  methods: {
    handleClick(tab) {
      this.peoData.pxshenhe = tab.name
      this.getPeoList()
    },
    //获取报名人员详情
    getPeoInfo(row) {
      const PersonId = row.PersonId;
      getZigePerson(PersonId).then((response) => {
        if (response.data.ZYIdList == "8") {
          this.zgks = "jlgcs";
        } else if (response.data.ZYIdList == "28") {
          this.zgks = "jly";
        } else {
          this.zgks = "zj";
        }
        this.zgksInfo = {...row,...response.data}
        this.bmShow = true;
      });
    },
    /** 查询资格考试报名列表 */
    getPeoList() {
      this.peoLoading = true;
      this.peoList = []
      this.peoData.TrainId = this.$route.query.TrainId;
      this.peoData.grshenhe = '1';
      // this.peoData.pxshenhe = '9'
      listZigePerson(this.peoData).then((response) => {
        this.peoList = response.rows;
        this.daishenhe = response.extendMap.pxundoTotal
        this.yishenhe = response.extendMap.pxpassTotal
        this.yituihui = response.extendMap.pxrejectTotal
        this.cailiaobz = response.extendMap.pxclbzTotal
        this.peoTotal = response.total;
        this.peoLoading = false;
      });
    },
    peoSelect(selection) {
      this.peoIds = selection.map((item) => item.PersonId);
    },
    // 取消按钮
    bmCancel() {
      this.$refs.zgks.reset();
      this.bmShow = false;
    },
    peoHandleQuery() {
      this.peoData.pageNum = 1;
      this.getPeoList();
    },
    peoResetQuery() {
      this.resetForm("peoData");
      this.peoData.TrainId = this.Train.TrainId;
      this.peoData.grshenhe = '1';
      this.peoData.pxshenhe = '9'
      this.getPeoList();
    },
    //培训点审核
    shenhe(row) {
      // this.shform = { ...row };
      this.$confirm("是否审核通过？", {
        confirmButtonText: "通过",
        cancelButtonText: "取消",
        type: "warning",
        beforeClose: (action, instance, done) => {
          this.shform.PersonId = row.PersonId;

          if (action === 'confirm') {
            instance.confirmButtonLoading = true;
            instance.confirmButtonText = "执行中...";
            this.shform.pxshenhe = 1;
            pxShenhe(this.shform).then((response) => {
              done();
			  this.bmShow = false;
              setTimeout(() => {
                instance.confirmButtonLoading = false;
                this.$modal.msgSuccess("审核成功");
              }, 300);
              this.getPeoList();
            });
          } else{
            done();
          }
        }
      }).then(() => {
        // 这里不需要处理
      }).catch((action) => {
        // 只有在点击取消按钮时才会进入这里
        if (action === 'cancel') {
          this.shenheShow = true;
        }
      });
    },
    handleExportBaoming() {
      this.download('/zgks/ZigePerson/export', {
        TrainId: this.peoData.TrainId
      }, `${this.$route.query.QiciYear}年_第${this.$route.query.QiCi}期_报名人员_${new Date().getTime()}.xlsx`)
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "报名人员导入";
      this.upload.open = true;
    },
    /** 下载模板操作 */
    importTemplate() {
      window.open(process.env.VUE_APP_BASE_API +
        '/profile/upload/2024/12/24/%E5%AF%BC%E5%85%A5%E8%AF%B4%E6%98%8E.doc', '_blank'
      ); // '_blank' 确保在新标签页中打开
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      console.log("?? ~ handleFileUploadProgress ~ file:", file)
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      console.log("?? ~ handleFileSuccess ~ response:", response.fileName)
      // this.upload.open = false;
      this.importFile = response.fileName
      // this.upload.isUploading = false;
      // // this.$refs.upload.clearFiles();
      // // this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
      // this.getPeoList();
    },
    // 提交上传文件
    submitFileForm() {
      importPxResult({
        TrainId: this.peoData.TrainId,
        importFile: this.importFile
      }).then(res => {
        this.$modal.msgSuccess("导入成功");
        this.upload.open = false;
        this.upload.isUploading = false;
        this.$refs.upload.clearFiles();
        this.getPeoList();
      })

    },
    // 取消按钮
    cancel() {
      this.Baoming = false;
      // this.resetBaoming();
    },
    // 不通过原因提交
    shenheSubmit() {
		this.shform.PersonId = this.zgksInfo.PersonId;
      this.shform.pxshenhe = this.shenheForm.pxshenhe;
      this.shform.pxshyj = this.shenheForm.pxshyj;
      pxShenhe(this.shform).then((response) => {
		  this.bmShow = false
        setTimeout(() => {
          // instance.confirmButtonLoading = false;
          this.$modal.msgSuccess("提交成功");
        }, 300);
        this.shenheShow = false;
        this.getPeoList();
      });
    },
    submitSuccess() { },
  },
  mounted() { }
}
</script>
<style lang="scss" scoped>
::v-deep .el-upload-dragger {
  background-color: #fff;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  width: 460px;
  height: 180px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

::v-deep .el-dialog__body {
  padding: 0px 20px;
  color: #606266;
  font-size: 14px;
  word-break: break-all;
}
</style>
