<template>
  <d2-container class="page" id="by_apply">
    <el-tabs value="first">
      <el-tab-pane label="毕业申请" name="first">
        <div style="margin-bottom: 8px; border-left: 3px solid; color: rgb(230, 162, 60);">
          <div role="alert" class="el-alert el-alert--warning" v-if="timeLimit">
            <div class="el-alert__content">
              <span class="el-alert__title">毕业在线申请时间：<font style="color:red;">{{timeLimit.apply_start_time}} 到 {{timeLimit.apply_end_time}}</font></span>
             <br>
               <div class="el-alert__title" v-if="ByApplyControl" v-html="ByApplyControl"></div>
                
                 <!-- 
                <br>
               <span class="el-alert__title">通知：因疫情防控需要，2020年6月自学考试毕业申请取消现场确认，请考生务必留下正确联系方式，并确保畅通。</span>
                -->
            </div>
          </div>
        </div>
        <!-- <div v-if="canApply"> -->
        <div> 
          <el-button type="primary"  v-if="canApply" @click="selected_apply=null;goApplyone();">申请毕业</el-button>


        </div>

        <el-table
          v-loading="loading"
          :data="applyList"
          style="width: 100%">
         <el-table-column
            prop="year_code"
            label="毕业批次"
            width="95">
          </el-table-column>
          <el-table-column
            prop="ticket_no"
            label="准考证"
            width="115">
          </el-table-column>
          <el-table-column
            prop="major_name"
            label="专业名称"
            width="210">
          </el-table-column>
          <el-table-column
            prop="is_xuexin_pass"
            label="学信网学历认证"
            width="80">
            <template slot-scope="scope">
                <div v-if="scope.row.is_xuexin_pass == 1">
                  通过
                </div>
                <div v-if="scope.row.major_level == '1' && scope.row.is_xuexin_pass == 0">
                  不通过
                </div>
              </template>
          </el-table-column>
          
          <el-table-column
            prop="school_name"
            label="主考院校"
            width="160"
            >
          </el-table-column>
          <el-table-column
            prop="status_text"
            label="状态"
            width="120">
            <template slot-scope="scope">
                <span v-if="scope.row.status == '7'" style="color:red;">
                  {{scope.row.status_text}}
                </span>
                <span v-else>
                  {{scope.row.status_text}}
                </span>

              </template>

          </el-table-column>
          <el-table-column
            prop="org_name"
            label="毕业证书领取单位"
            width="160">
          </el-table-column>
          <!--
           <el-table-column
            prop="time_out"
            label="是否过期"
            width="80">
          </el-table-column>
          -->

          <el-table-column
            prop="status_text"
            label="毕业照片"
            width="80">
            <template slot-scope="scope">
             <img v-if="(scope.row.status == '3'||scope.row.status == '5') && scope.row.by_photo_path" style="width:100%;height:80px;cursor:pointer;" title="点击下载毕业照片" :src="photoHttp+scope.row.by_photo_path" @click="downByPhoto(scope.row.id)">
              <img v-if="(scope.row.status == '3'||scope.row.status == '5') && !scope.row.by_photo_path && scope.row.photo_path" style="width:100%;height:80px;cursor:pointer;" title="点击下载毕业照片" :src="photoHttp+scope.row.photo_path" @click="downByPhoto(scope.row.id)">

              </template>

          </el-table-column>

          <el-table-column
            label="操作" align="left"
            fixed="right"
            width="350">
              <template slot-scope="scope">
                <!-- 驳回 -->
               
                  <el-button v-if="scope.row.is_auth_back == 1 && scope.row.time_out != '已过期'" @click="std_confirm='';goEdit(scope.row)">修改</el-button>
                  <el-button v-if="canAudit && scope.row.status=='7' && scope.row.time_out != '已过期'" @click="showTableDialog(scope.row)">网上确认</el-button>
                  <el-button v-if="canAudit && scope.row.status!='7' && scope.row.time_out != '已过期'" @click="showTableDialog(scope.row)">毕业生登记表预览</el-button>
                
                <el-button v-if="scope.row.status_text !='待终审'" @click="showAuditInfo(scope.row)">查看</el-button>



              </template>
          </el-table-column>
        </el-table>
        <el-dialog title="审批信息列表" width="800px" :visible.sync="auditDialogVisible">
          <el-table
            v-loading="loading"
            :data="auditInfoArray"
            style="width: 800px">
            <el-table-column
              type="index"
              label="序号"
              width="60">
            </el-table-column>
            <el-table-column
              prop="auth_remark"
              label="审批内容"
              width="350">
            </el-table-column>
            <el-table-column
              prop="auth_type_text"
              label="审批环节"
              width="160">
              <template slot-scope="scope">
                <span v-if="scope.row.auth_type >= 2">
                  待终审
                </span>
                <span v-else>
                  {{scope.row.auth_type_text}}
                </span>

              </template>
            </el-table-column>
            <el-table-column
              prop="auth_time"
              label="审批时间"
              width="160"
              >
            </el-table-column>
          </el-table>
        </el-dialog>

        <el-dialog :title="by_apply_note_title" width="1200px" style="margin-top: -80px;" :visible.sync="applyDialogVisibleone">
          <div style="margin-top: -20px;padding-top:-20px;">
            <iframe :src="by_apply_note" style="margin-top: 0px;padding-top:0px;" width="1170px" height="450px" scrolling="auto"></iframe>
            <center>
              <el-button type="primary" @click="applyInfoConfirm = false;selected_apply=null;goApply()">{{secCountDownInfo}}</el-button>
            </center>
             
          </div>

        </el-dialog>


        <el-dialog title="毕业申请" width="800px" :visible.sync="applyDialogVisible">
          <div v-show="curStep == 1 && stdRegInfo">
            <table style="font-size: 14px;width:100%">
              <tr>
                <td align='right' style="width:35%">我是：</td>
                <td>
                   <el-select size="medium" v-model="stdRegInfo.std_source" style="width:300px;" filterable placeholder="请选择考生来源" @change="std_sourceChange" title="使用沟通课成绩、专本衔接合成成绩、主考学校网络助学成绩（不包括365网络助学成绩）毕业的考生，请选择助学考生，并选择正确的主考院校。">
                        <el-option label="社会考生" value="1"></el-option>
                        <el-option label="助学考生" value="3"></el-option>
                    </el-select>
                </td>

              </tr>
              <tr style="height: 40px;">
                <td align='right'>原报考专业：</td>
                <td>{{old_std_major}}</td>
              </tr>
              <tr style="height: 40px;" v-if="newMajorInfo">
                <td align='right'>对应新专业：</td>
                <td>{{newMajorInfo}}</td>
              </tr>
              <tr>
                <td align='right'>选择毕业专业层次：</td>
                <td>
                  <el-select size="medium" v-model="stdRegInfo.major_level" filterable clearable placeholder="请选择专业层次" @change="majorLevelChange" style="width:300px;">
                       <el-option  v-for="(item,index) in majorLevelArray" :key="index" :label="item.dict_value+' | '+item.dict_text" :value="item.dict_value"></el-option>
                  </el-select>
                </td>
              </tr>
              <tr>
                <td align='right'>选择毕业专业：</td>
                <td>
                   <el-select size="medium" v-model="selected_major_id" filterable clearable placeholder="请选择专业" @change="majorChange" style="width:300px;">
                     <el-option  v-for="item in byMajorArray" :key="item.id" :label="item.major_full_name" :value="item.id"></el-option>
                  </el-select>
                </td>

              </tr>
             <tr style="height: 40px;">
                      <td align='right'>对应旧专业：</td>
                      <td>
                        <table style="width:200px;font-size: 13px;">
                          <!-- <tr> -->
                            <!-- <td>序号</td> -->
                            <!-- <td>专业代码</td> -->
                            <!-- <td>专业名称</td> -->
                          <!-- </tr> -->
                          <tr  v-for="(item, index) in oldMajorArray" :key="index">
                            <!-- <td>{{index+1}}</td> -->
                            <td>{{item.major_code}} - {{item.major_name}}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
              
              <tr style="height: 40px;">
                <td align='right'>主考院校：</td>
                <td>
                  <span v-if="stdRegInfo.std_source == '1'" style="font-size: 14px;color: #606266;">{{school_name}}</span>

                  <el-select size="medium" v-if="stdRegInfo.std_source == '3'" clearable v-model="stdRegInfo.school_id" @change="schoolChange" filterable placeholder="请选择主考院校" style="width:300px;">
                      <el-option v-for="(item,index) in orgArray_std_source_3" :label="item.org_code+' | '+item.org_name" :value="item.id" :key="index"></el-option>
                  </el-select>
                </td>

              </tr>
              <tr style="height: 40px;" v-if="stdRegInfo.std_source == '1'">
                <td align='right'>领取毕业证书及登记表单位：</td>
                <td>
                  <el-select size="medium" clearable v-model="order_org_id"  filterable placeholder="请选择领取毕业证书及登记表单位" style="width:300px;">
                      <el-option v-for="(item,index) in orderOrgArray_std_source_1" :label="item.org_code+' | '+item.org_name" :value="item.id" :key="index"></el-option>
                  </el-select>
                </td>
              </tr>
            </table>
            <br>
            <center>
              <el-button type="primary" @click="applyInfoConfirm = true;goApply()">确定</el-button>
            </center>
             
          </div>

          <div v-show="curStep == 2">
            <el-row>
              <el-col :span="18">
                <table class="el-table" style="width:760px;margin-left:10px;">
                  <tr class="el-table__row">
                    <td colspan="6" style="text-overflow: ellipsis;">毕业申请列表> 新增毕业信息</td>
                  </tr>
                  <tr class="el-table__row">
                    <td>姓名</td>
                    <td>{{stdRegInfo.std_name}}</td>
                    <td>身份证号</td>
                    <td>{{stdRegInfo.cert_no}}</td>
                    <td rowspan="5">
                      <center>
                      <!-- 无毕业申请图片显示 考生图片-->
                      <img v-if="stdRegInfo.photo_url && !by_photo_url_p && (!selected_apply || !selected_apply.by_photo)" style="width:140px;height:170px;border:1px;border-color:black;" :src="photo_url">

                      <!-- 有毕业申请图片显示毕业图片-->
                      <!--
                      <img v-if="(selected_apply && selected_apply.by_photo) || by_photo_url_p" style="width:140px;height:170px;border:1px;border-color:black;" :src="by_photo_url"><br>
                      <el-button type="primary" @click="toUploadByImg()" title="考生照片不符合毕业要求时，请上传毕业照片。">上传图片</el-button>
                      -->
                      </center>
                      
                    </td>
                    
                  </tr>
                  <tr class="el-table__row">
                    <td>民族</td>
                    <td>{{stdRegInfo.std_nation_text}}</td>
                    <td>政治面貌</td>
                    <td>{{stdRegInfo.political_status_text}}</td>
                  </tr>
                  <tr class="el-table__row">
                    <td>户籍类型</td>
                    <td>{{stdRegInfo.std_family_reg_text}}</td>
                    <td>学历</td>
                    <td>
                        {{stdRegInfo.std_edu_text}}
                    </td>
                  </tr>
                  <tr class="el-table__row">
                    <td>职业</td>
                    <td>{{stdRegInfo.std_occupation_text}}</td>
                    <td>联系电话</td>
                    <td>{{stdRegInfo.std_mobile}}</td>
                  </tr>
                  <tr class="el-table__row">
                    <td>邮政编码</td>
                    <td>{{stdRegInfo.std_postcode}}</td>
                    <td>电子邮箱</td>
                    <td>{{stdRegInfo.std_email}}</td>
                  </tr>
                </table>


                <br>

            <table style="font-size: 14px;width:100%">
              <tr>
                <td align='right' style="width: 80px;">专业层次：</td>
                <td>
                  <el-select size="medium" v-model="stdRegInfo.major_level" disabled="disabled" filterable clearable placeholder="请选择专业层次" @change="majorLevelChange" >
                       <el-option  v-for="(item,index) in majorLevelArray" :key="index" :label="item.dict_value+' | '+item.dict_text" :value="item.dict_value"></el-option>
                  </el-select>
                </td>
              </tr>
              <tr>
                <td align='right'>毕业专业：</td>
                <td>
                   <el-select size="medium" v-model="selected_major_id" disabled="disabled" filterable clearable placeholder="请选择专业" @change="majorChange">
                     <el-option  v-for="item in byMajorArray" :key="item.id" :label="item.major_code+' | '+item.major_name" :value="item.id"></el-option>
                  </el-select>
                </td>

              </tr>
              
              <tr style="height: 40px;">
                <td align='right'>主考院校：</td>
                <td>
                  <span v-if="stdRegInfo.std_source == '1'" style="font-size: 14px;color: #606266;">{{school_name}}</span>

                  <el-select size="medium" v-if="stdRegInfo.std_source == '3'" disabled="disabled" clearable v-model="stdRegInfo.school_id" filterable placeholder="请选择主考院校">
                      <el-option v-for="(item,index) in orgArray_std_source_3" :label="item.org_code+' | '+item.org_name" :value="item.id" :key="index"></el-option>
                  </el-select>

                </td>

              </tr>
            </table>
              </el-col>
              <el-col :span="6">
                
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                &nbsp;
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-table
                  v-loading="loading"
                  :data="courseScoreList"
                  style="width: 760px">
                  <el-table-column
                  label="序号"
                    type="index"
                    width="50">
                  </el-table-column>
                  <el-table-column
                    prop="course_code"
                    label="课程代码"
                    width="80">
                  </el-table-column>
                  <el-table-column
                    prop="course_name"
                    label="课程名称"
                    width="200">
                  </el-table-column>
                  <el-table-column
                    prop="score_source"
                    label="成绩来源"
                    width="100"
                    >
                    <template slot-scope="scope">
                       <span v-if="scope.row.final_score == 0">
                          实践课
                        </span>
                        <span v-else-if="scope.row.final_score == 3">
                          沟通课
                        </span>
                        <span  v-else>
                             <span v-if="scope.row.score_source == 0">
                                  <!-- 校考导入 -->
                                  校考
                              </span>
                              <span v-if="scope.row.score_source == 1">
                                  <!-- 统考导入 -->
                                  统考
                              </span>
                              <span v-if="scope.row.score_source == 2">
                                  顶替
                              </span>
                              <span v-if="scope.row.score_source == 3">
                                  被顶替
                              </span>
                              <span v-if="scope.row.score_source == 4">
                                  手工增加
                              </span>
                              <span v-if="scope.row.score_source == 5">
                                  免考
                              </span>
                              <span v-if="scope.row.score_source == 6">
                                  外省转入
                              </span>
                              <span v-if="scope.row.score_source == 7">
                                  <!-- 网考合成 -->
                                  合成成绩
                              </span>
                              <span v-if="scope.row.score_source == 8">
                                  <!-- 衔接合成 -->
                                  合成成绩
                              </span>
                              <span v-if="scope.row.score_source == 9">
                                  <!-- 百分百合成 -->
                                  合成成绩
                              </span>
                              <span v-if="scope.row.score_source == 10">
                                  <!-- 手工评卷 -->
                                  统考
                              </span>
                              <span v-if="scope.row.score_source == 11">
                                  毕业论文
                              </span>
                              <span v-if="scope.row.score_source == 12">
                                  关联准考证
                              </span>
                              <span v-if="scope.row.score_source == 13">
                                  手工转入
                              </span>
                              <span v-if="scope.row.score_source == 14">
                                  违规
                              </span>
                              <span v-if="scope.row.score_source == 15">
                                  作弊
                              </span>
                        </span>
                     
                    </template>
                  </el-table-column>
                  <!-- <el-table-column
                    prop="score_nature"
                    label="成绩性质"
                    width="100"
                    >
                  </el-table-column> -->
                  <!-- <el-table-column
                    prop="origin_score"
                    label="原始成绩"
                    width="100"
                    >
                  </el-table-column> -->
                  <el-table-column
                    prop="score_type"
                    label="分数类型"
                    width="80">
                    <template slot-scope="scope">
                       
                      </template>
                  </el-table-column>


                  <el-table-column
                    prop="final_score"
                    label="最终成绩(合成后)"
                    width="150">
                      <template slot-scope="scope">
                        <span v-if="scope.row.final_score == 998 || scope.row.final_score == 999 || scope.row.final_score == 200 ">
                          免考
                        </span>
                        <span v-else-if="scope.row.final_score == 887 || scope.row.final_score == 888">
                          课程顶替
                        </span>
                        <span v-else-if="scope.row.final_score == 201">
                          及格
                        </span>
                        <span v-else-if="scope.row.final_score == 202">
                          中等
                        </span>
                        <span v-else-if="scope.row.final_score == 203">
                          良好
                        </span>
                        <span v-else-if="scope.row.final_score == 204">
                          优秀
                        </span>
                        <span v-else-if="scope.row.final_score == -1">
                          舞弊
                        </span>
                        <span v-else-if="scope.row.final_score == -3">
                          违纪
                        </span>
                        <span v-else-if="scope.row.final_score == -9">
                          缺考
                        </span>
                        
                        <span v-else-if="scope.row.final_score != 887 && scope.row.final_score != 888 && scope.row.final_score != 998 && scope.row.final_score != 999">
                          {{scope.row.final_score}}
                        </span>
                      </template>
                  </el-table-column>
                  <el-table-column
                    prop="is_pass"
                    label="是否合格"
                    width="100">
                 
                  </el-table-column>
                </el-table>
              </el-col>
            </el-row>

            <!-- <el-row>
              <el-col :span="24">
                &nbsp;
              </el-col>
              <el-col :span="2">
                备注
              </el-col>
              <el-col :span="22">
                  <el-input
                    type="textarea"
                    :autosize="{ minRows: 2, maxRows: 4}"
                    placeholder="请输入内容"
                    v-model="remark">
                  </el-input>
              </el-col>
            </el-row> -->
              
            
              <center>
                <br>
                <el-button type="primary" @click="check()">毕业申请判定</el-button>
                <el-button type="primary" @click="colseWin()">关闭</el-button>
              </center>
            
          </div>
          <div v-show="curStep == 3">
            <!-- v-if="this.isAllowGraduate" -->
            <div>
              <center>
                 <div v-if="msgArray.length >0" style="font-size: 16px;margin-buttom:5px;color:red">
                    <div v-for="(msg,index) in msgArray" :key="index">
                      <table style="margin-left:20px">
                        <tr>
                          <td>{{index+1}}.</td>
                          <td>{{msg}}</td>
                        </tr>
                      </table>
                    </div>
                   <br>
                   
                </div>

                <div>
                  <!-- {{checkMsg}}请完善【考生填写栏】信息 -->
                 <span style="font-size: 35px;color: black;margin-buttom:5px">毕&nbsp;&nbsp;业&nbsp;&nbsp;生&nbsp;&nbsp;登&nbsp;&nbsp;记&nbsp;&nbsp;表 </span> 
                   <br>
                   <table width="100%">
                      <tr>
                        <td colspan="4" align="center">
                          <font style="font-size:20px" v-if="selected_major">
                          (大学<u>{{selected_major.major_level==0?'专':'本'}}</u>科)
                          </font>
                          
                        </td>
                      </tr>
                     <tr>
                       <!-- <td style="width:20px">
                         考生基础信息
                       </td> -->
                       <td>
                         <table width="100%" height="100%">
                            <tr>
                              <td colspan="4" align="center">
                                <h4>考生基础信息</h4>
                              </td>
                            </tr>
                            <!--
                            <tr v-if="countryCityMap">
                              <td align="right">市&nbsp;地：</td>
                              <td align="left">
                                 {{countryCityMap.city_name}} 
                              </td>
                              <td align="right">县&nbsp;(市)：</td>
                              <td align="left">
                               {{countryCityMap.country_name}} 
                              </td>

                            </tr>
                            -->
                            <tr>
                              <td align="right">主考院校：</td>
                              <td align="left">
                                {{school_name}}
                              </td>
                              <td align="right">专业：</td>
                              <td align="left" v-if="selected_major">
                                {{selected_major.major_code}} - {{selected_major.major_name}}
                              </td>

                            </tr>
                            <tr>
                              <td align="right">毕业证号：</td>
                              <td align="left">
                               <!-- {{diaplmaNo}}-->
                              </td>
                              <td align="right">身份证号：</td>
                              <td align="left">
                                {{stdRegInfo.cert_no}}
                              </td>
                            </tr>
                          </table>
                       </td>
                     </tr>

                     <tr>
                       <td colspan="5">
                        <el-table
                          v-loading="loading"
                          :data="courseScoreList"
                          style="width: 760px">
                          <el-table-column
                          label="序号"
                            type="index"
                            width="50">
                          </el-table-column>
                          <el-table-column
                            prop="course_code"
                            label="课程代码"
                            width="80">
                          </el-table-column>
                          <el-table-column
                            prop="course_name"
                            label="课程名称"
                            width="200">
                          </el-table-column>
                          <!-- <el-table-column
                            prop="score_source"
                            label="成绩来源"
                            width="80"
                            >
                          </el-table-column> -->
                          <el-table-column
                            prop="score_source"
                            label="成绩来源"
                            width="100"
                            >
                            <template slot-scope="scope">
                              <span v-if="scope.row.final_score == 0">
                                  实践课
                                </span>
                                <span v-else-if="scope.row.final_score == 3">
                                  沟通课
                                </span>
                                <span  v-else>
                                  <span v-if="scope.row.score_source == 0">
                                      <!-- 校考导入 -->
                                      校考
                                  </span>
                                  <span v-if="scope.row.score_source == 1">
                                      <!-- 统考导入 -->
                                      统考
                                  </span>
                                  <span v-if="scope.row.score_source == 2">
                                      顶替
                                  </span>
                                  <span v-if="scope.row.score_source == 3">
                                      被顶替
                                  </span>
                                  <span v-if="scope.row.score_source == 4">
                                      手工增加
                                  </span>
                                  <span v-if="scope.row.score_source == 5">
                                      免考
                                  </span>
                                  <span v-if="scope.row.score_source == 6">
                                      外省转入
                                  </span>
                                  <span v-if="scope.row.score_source == 7">
                                      <!-- 网考合成 -->
                                      合成成绩
                                  </span>
                                  <span v-if="scope.row.score_source == 8">
                                      <!-- 衔接合成 -->
                                      合成成绩
                                  </span>
                                  <span v-if="scope.row.score_source == 9">
                                      <!-- 百分百合成 -->
                                      合成成绩
                                  </span>
                                  <span v-if="scope.row.score_source == 10">
                                      <!-- 手工评卷 -->
                                      统考
                                  </span>
                                  <span v-if="scope.row.score_source == 11">
                                      毕业论文
                                  </span>
                                  <span v-if="scope.row.score_source == 12">
                                      关联准考证
                                  </span>
                                  <span v-if="scope.row.score_source == 13">
                                      手工转入
                                  </span>
                                  <span v-if="scope.row.score_source == 14">
                                      违规
                                  </span>
                                  <span v-if="scope.row.score_source == 15">
                                      作弊
                                  </span>
                                </span>
                            
                            </template>
                          </el-table-column>
                          <!-- <el-table-column
                            prop="origin_score"
                            label="原始成绩"
                            width="100"
                            >
                          </el-table-column> -->
                          <el-table-column
                            prop="final_score"
                            label="最终成绩(合成后)"
                            width="150">
                              <template slot-scope="scope">
                                <span v-if="scope.row.final_score == 998 || scope.row.final_score == 999 || scope.row.final_score == 200 ">
                                  免考
                                </span>
                                <span v-else-if="scope.row.final_score == 887 || scope.row.final_score == 888">
                                  课程顶替
                                </span>
                                <span v-else-if="scope.row.final_score == 201">
                                  及格
                                </span>
                                <span v-else-if="scope.row.final_score == 202">
                                  良好
                                </span>
                                <span v-else-if="scope.row.final_score == 203">
                                  中等
                                </span>
                                <span v-else-if="scope.row.final_score == 204">
                                  优秀
                                </span>
                                <span v-else-if="scope.row.final_score == -1">
                                  舞弊
                                </span>
                                <span v-else-if="scope.row.final_score == -3">
                                  违纪
                                </span>
                                <span v-else-if="scope.row.final_score == -9">
                                  缺考
                                </span>

                                <span v-else-if="scope.row.final_score != 887 && scope.row.final_score != 888 && scope.row.final_score != 998 && scope.row.final_score != 999">
                                  {{scope.row.final_score}}
                                </span>
                              </template>
                          </el-table-column>
                          <el-table-column
                            prop="is_pass"
                            label="是否合格"
                            width="100">
                        
                          </el-table-column>
                        </el-table>
                       </td>
                     </tr>
                      <tr>
                        <td colspan="4" align="center">
                           <h4>考生填写栏 </h4>
                        </td>
                      </tr>
                     <tr>
                       <!-- <td>
                         考生填写栏
                       </td> -->
                       <td>
                         <el-form ref="stdRegInfo" :model="stdRegInfo" :rules="stdRegInfoRule" label-width="80px" size="mini">
                           <el-row>
                             <el-col :span="12" style="height:37px;">
                              <el-form-item label="姓名" prop="std_name" label-width="140px">
                                <el-input size="mini" disabled clearable v-model="stdRegInfo.std_name" style="width:180px;"></el-input>
                                <!-- {{stdRegInfo.std_name}} -->
                              </el-form-item>
                            </el-col>
                             <el-col :span="12" style="height:37px;">
                              <el-form-item label="性别" prop="std_sex" label-width="140px">
                                <el-select v-model="stdRegInfo.std_sex" filterable placeholder="请选择性别" style="width:180px;">
                                  <el-option v-for="(item,index) in sexArray" :key="'sexArray_'+index" :label="item.dict_value+' | '+item.dict_text" :value="item.dict_value"></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                           </el-row>
                            <el-row>
                              <el-col :span="24">
                                <font style="color:red;margin-left:10px;margin-bottom:0px;">
                                注意：以下省（市、自治区），市（县）请填写籍贯信息
                                </font>
                              </el-col>
                            </el-row>
                           <el-row>
                             <el-col :span="12" style="height:37px;">
                              <el-form-item label="省（市、自治区）" prop="native_prov" label-width="140px">
                                <el-select v-model="stdRegInfo.native_prov" filterable clearable placeholder="请选择省"  style="width:180px;">
                                  <el-option v-for="(item) in prov_city_data" :key="item.areaId" :label="item.areaName" :value="item.areaName"></el-option>
                                </el-select>
                                <!-- <el-input size="mini"  clearable v-model="stdRegInfo.native_prov"></el-input> -->
                                <!-- {{stdRegInfo.std_name}} -->
                              </el-form-item>
                            </el-col>
                             <el-col :span="12" style="height:37px;">
                               <el-form-item label="市（县）" prop="native_city" label-width="140px">
                                <el-input size="mini" clearable v-model="stdRegInfo.native_city"  maxlength="15" style="width:180px;"></el-input>
                              </el-form-item>

                              
                            </el-col>
                           </el-row>

                           <el-row>
                             <el-col :span="12" style="height:37px;">
                              <el-form-item label="出生年月" required prop="std_birth" label-width="140px">
                                <el-date-picker size="mini" value-format="yyyy-MM-dd" type="date" v-model="stdRegInfo.std_birth" placeholder="选择出生年月" style="width:180px;"></el-date-picker>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12" style="height:37px;">
                              <el-form-item label="考前学历" prop="std_edu" label-width="140px">
                                <el-select size="mini" clearable v-model="stdRegInfo.std_edu" filterable placeholder="请选择学历" style="width:180px;">
                                  <el-option v-for="(item,index) in eduArray" :label="item.dict_value+' | '+item.dict_text" :value="item.dict_value" :key="index"></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                           </el-row>
                           <el-row>
                            <el-col :span="12" style="height:37px;">
                              <el-form-item label="民族" prop="std_nation" label-width="140px">
                                <el-select size="mini" clearable v-model="stdRegInfo.std_nation" filterable placeholder="请选择民族" style="width:180px;">
                                  <el-option v-for="(item,index) in nationArray" :label="item.dict_value+' | '+item.dict_text" :value="item.dict_value" :key="index"></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12" style="height:37px;">
                              <el-form-item label="政治面貌" prop="political_status" label-width="140px">
                                <el-select size="mini" clearable v-model="stdRegInfo.political_status" filterable placeholder="请选择政治面貌" style="width:180px;">
                                  <el-option v-for="(item,index) in politicalStatusArray" :label="item.dict_value+' | '+item.dict_text" :value="item.dict_value" :key="index"></el-option>
                                </el-select>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="12" style="height:37px;">
                              <el-form-item label="联系电话" prop="std_mobile" label-width="140px">
                                <el-input size="mini" clearable v-model="stdRegInfo.std_mobile"  maxlength="11" style="width:180px;"></el-input>
                              </el-form-item>
                            </el-col>
                            <el-col :span="12" style="height:37px;">
                              <el-form-item label="邮政编码" prop="std_postcode" label-width="140px">
                                <el-input size="mini" clearable v-model="stdRegInfo.std_postcode"  maxlength="6" style="width:180px;"></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                          <el-row>
                            <el-col :span="24" style="height:37px;">
                              <el-form-item label="工作单位" label-width="140px">
                                <el-input size="mini" clearable v-model="stdRegInfo.std_work_unit" maxlength="30" style="width:360px;" title="如有工作单位，请填写工作单位。"></el-input>
                              </el-form-item>
                            </el-col>
                          </el-row>
                           <el-row>
                            <el-col :span="24" style="height:37px;">
                              <el-form-item label="家庭地址" prop="std_address" label-width="140px">
                                <el-input size="mini" clearable v-model="stdRegInfo.std_address" maxlength="75" style="width:360px;"></el-input>
                              </el-form-item>
                            </el-col>
                            <!-- <el-col :span="12">
                              <el-form-item label="电子邮件" prop="std_email">
                                <el-input size="mini" clearable v-model="stdRegInfo.std_email"></el-input>
                              </el-form-item>
                            </el-col> -->
                          </el-row>

                           <el-row v-if="good_photo == '0'">
                            <el-col :span="24">
                              <el-form-item label="毕业照片">
                                <div style="width:600px">
                                    <el-upload
                                      :http-request = "customUploadStdByPhoto"
                                      action=""
                                      class="upload-demo"
                                      ref="uploadStdByPhoto"
                                      :on-preview="handlePreviewStdByPhoto"
                                      :on-remove="handleRemoveStdByPhoto"
                                      :before-upload="beforeUploadStdByPhoto"
                                      :before-remove="beforeRemoveStdByPhoto"
                                      list-type="picture"
                                      :limit="1"
                                      :on-exceed="handleExceedStdByPhoto"
                                      :on-change="handleChangeStdByPhoto"
                                      :auto-upload="true"
                                      :file-list="stdbyphotofileList"
                                      accept="image/jpeg,image/jpg,image/png" 
                                      >
                                      <el-button size="small" type="primary">点击上传</el-button>
                                      <div slot="tip" class="el-upload__tip" style="color:red">注意：请上传一张本人近期免冠照片，照片要求：宽480像素*高640像素，人像居中，蓝底，文件大小在20KB至40KB，JPG格式。</div>

                                    </el-upload>

                                  </div>
                              </el-form-item>
                            </el-col>
                          </el-row>


                             <el-row>
                            <el-col :span="24">
                              <el-form-item label="身份证件">
                                <div style="width:600px">
                                    <el-upload
                                      :http-request = "customUploadCert"
                                      action=""
                                      class="upload-demo"
                                      ref="uploadCert"
                                      :on-preview="handlePreviewCert"
                                      :on-remove="handleRemoveCert"
                                      :before-upload="beforeUploadCert"
                                      :before-remove="beforeRemoveCert"
                                      list-type="picture"
                                      :limit="2"
                                      :on-exceed="handleExceedCert"
                                      :on-change="handleChangeCert"
                                      :auto-upload="true"
                                      :file-list="certfileList"
                                      accept="image/jpeg,image/jpg,image/png" 
                                      >
                                      <el-button size="small" type="primary">点击上传</el-button>
                                      <div slot="tip" class="el-upload__tip" style="color:red">注意：请上传身份证件正反面照片，只能上传jpg/jpeg/png文件，且不超过2MB；最多允许上传2个文件。</div>

                                    </el-upload>

                                  </div>
                              </el-form-item>
                            </el-col>
                          </el-row>

                      
                          <el-row>
                            <el-col :span="24">
                              <el-form-item label="学历证明">
                                <div style="width:600px">
                                    <el-upload
                                      :http-request = "customUpload"
                                      action=""
                                      class="upload-demo"
                                      ref="upload"
                                      :on-preview="handlePreview"
                                      :on-remove="handleRemove"
                                      :before-upload="beforeUpload"
                                      :before-remove="beforeRemove"
                                      list-type="picture"
                                      :limit="5"
                                      :on-exceed="handleExceed"
                                      :on-change="handleChange"
                                      :auto-upload="true"
                                      :file-list="fileList"
                                      accept="image/jpeg,image/jpg,image/png" 
                                      >
                                      <el-button size="small" type="primary">点击上传</el-button>
                                      <div slot="tip" class="el-upload__tip" style="color:red">注意：若申请本科毕业证出现前置学历验证不通过，请考生上传相关证明材料：1.前置学历毕业证原件2.教育部学历证书电子注册备案表或中国高等教育学历认证报告（二选一）3.如考生由于更改姓名、身份证号导致前置学历不通过，还须上传信息更正的相关凭证，如户口簿、派出所更改证明等。4.专本衔接应届专科毕业生请上传专科学生证或学校出具的在读证明。5.只能上传jpg/jpeg/png文件，且不超过2MB；最多允许上传5个文件。</div>

                                    </el-upload>

                                  </div>
                              </el-form-item>
                            </el-col>
                          </el-row>

                          <el-row>
                            <el-col :span="24">
                              <el-form-item label="成绩证明">
                                <div style="width:600px">
                                    <el-upload
                                      :http-request = "customUploadScore"
                                      action=""
                                      class="upload-demo"
                                      ref="uploadScore"
                                      :on-preview="handlePreviewScore"
                                      :on-remove="handleRemoveScore"
                                      :before-upload="beforeUploadScore"
                                      :before-remove="beforeRemoveScore"
                                       list-type="picture"
                                      :limit="5"
                                      :on-exceed="handleExceedScore"
                                      :on-change="handleChangeScore"
                                      :auto-upload="true"
                                      :file-list="scorefileList"
                                      accept="image/jpeg,image/jpg,image/png" 
                                      >
                                      <el-button size="small" type="primary">点击上传</el-button>
                                      <div slot="tip" class="el-upload__tip" style="color:red">注意：如果课程成绩有空缺，请上传相应课程成绩证明（如单科合格证、2004年及以前的准考证、转考介绍信、免考合格证等材料）。请将证明材料压缩成压缩包再上传。只能上传jpg/jpeg/png文件，且不超过2MB；最多允许上传5个文件。</div>

                                    </el-upload>

                                  </div>
                              </el-form-item>
                            </el-col>
                          </el-row>

                        
                         </el-form>
                         
                       </td>
                     </tr>
                   </table>

                   <table>
                    <thead>
                       <tr>
                        <td colspan="5" align="center">
                           <h4>个人简历(考生本人填写) </h4>
                        </td>
                      </tr>
                      <tr>
                        <th valign="bottom" style="width:35px">序号</th>
                        <th valign="bottom" style="width:145px">起止年月</th>
                        <th valign="bottom" style="width:350px">在何地,何单位学习或工作<br><font style="color:red">简历信息从高中阶段开始</font></th>
                        <th valign="bottom" style="width:170px">任何职务</th>
                        <!-- <th><el-button type="primary" @click="addRow(i)">添加</el-button></th> -->
                        
                        <th> <li class="el-icon-plus" style="color:green;cursor:pointer;" title="点击新增一行"  @click="addRow(i)"></li></th>
                      </tr>
                    </thead>
                    <tr v-for="(i,index) in stdResumeList" :key="i.id" v-if="i != null">
                      <td valign="bottom" align="center">{{index+1}}</td>
                      <td valign="bottom" align="center">
                        <el-date-picker size="mini" value-format="yyyy-MM" type="month" v-model="i.start_date" placeholder="选择开始日期" title="简历起止年月不允许断档三个月" style="width:135px;padding:0px;margin:0px;"></el-date-picker>
                        <br>
                        <el-date-picker size="mini" value-format="yyyy-MM" type="month" v-model="i.end_date" placeholder="选择结束日期" title="简历起止年月不允许断档三个月" style="width:135px;padding:0px;margin:0px;"></el-date-picker>
                      </td>
                      <td valign="bottom">
                        <el-input size="medium" v-model="i.work_exp" maxlength="256" placeholder="请输入学习或工作经历"></el-input>
                      </td>
                      <td valign="bottom">
                        <el-input size="medium" v-model="i.position" maxlength="64" placeholder="请输入职务"></el-input>
                      </td>
                      <td valign="bottom" align="center">
                        <!-- <el-button type="primary" @click="delRow(i)">删除</el-button> -->
                       
                          <li class="el-icon-close" style="color:red;cursor:pointer;" title="点击删除该行" @click="delRow(index)"></li>
                        
                      </td>
                    
                    </tr>
                  </table>

                   
                    <el-button type="primary" @click="step4()">确认毕业申请信息</el-button>
                    <el-button type="primary" @click="colseWin()">关闭</el-button>
                </div>
              </center>
            </div>

            <!-- <div v-if="!this.isAllowGraduate">
              <center>
                <div style="font-size: 25px;color: green;margin-buttom:5px;color:red">
                    <div v-for="(msg,index) in msgArray" :key="index">
                      <table style="margin-left:20px">
                        <tr>
                          <td>{{index+1}}.</td>
                          <td>{{msg}}</td>
                        </tr>
                      </table>
                    </div>
                   <br>
                    <el-button disabled="" type="primary" @click="submit()">核实并提交申请</el-button>
                    <el-button type="primary" @click="colseWin()">关闭</el-button>
                </div>
              </center>
            </div> -->
             

          </div>
           
      

           <div v-show="curStep == 4" style="text-align:center;">
             <el-row>
              <el-col :span="24">
                <span style="font-size: 35px;color: black;margin-buttom:5px">请确认毕业申请信息 </span> 
              </el-col>
              <el-col :span="24">
                <font style="font-size:20px" v-if="selected_major">
                      (大学<u>{{selected_major.major_level==0?'专':'本'}}</u>科)
                      </font>
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="24">
                <table class="el-table" style="width:760px;margin-left:10px;">
                  <tr>
                    <td rowspan="3" colspan="4"></td>
                   
                    <td rowspan="5">
                      <center>
                      <!-- 无毕业申请图片显示 考生图片-->
                      <img v-if="stdRegInfo.photo_url && !by_photo_url_p && (!selected_apply || !selected_apply.by_photo)" style="width:140px;height:170px;border:1px;border-color:black;" :src="photo_url">
                      </center>
                      
                    </td>
                  </tr>
                  <tr>
                    <td></td>
                   
                  </tr>
                  
                  <tr>
                    
                    <td></td>
                  </tr>
                  <tr class="el-table__row">
                    <td align="right" style="text-align:right;">准考证号：</td>
                    <td>{{stdRegInfo.ticket_no}}</td>
                    <td align="right" style="text-align:right;">身份证号：</td>
                    <td>{{stdRegInfo.cert_no}}</td>
                     
                    
                  </tr>
                  <tr class="el-table__row">
                    <td align="right" style="text-align:right;">主考学校：</td>
                    <td>{{school_name}}</td>
                    <td align="right" style="text-align:right;">专&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业：</td>
                    <td v-if="selected_major">{{selected_major.major_code}} - {{selected_major.major_name}}</td>
                  </tr>

                  
                  
                </table>

              </el-col>
              
            </el-row>

            <el-row>
              <el-col :span="18">
               
                <table class="el-table" style="width:760px;margin-left:10px;border-collapse: collapse;border:1px solid #000000;">
                 
                  <tr class="el-table__row" >
                    <td style="text-align:center;border:0px solid #000000;">姓名</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_name}}</td>
                    <td style="text-align:center;border:1px solid #000000;">性别</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_sex_text}}</td>
                    <td style="text-align:center;border:1px solid #000000;">出生年月</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_birth}}</td>
                    <td style="wdith:1px;border:1px solid #000000;"></td>
                  </tr>
                  <tr class="el-table__row" style="border:1px solid #000000;">
                    <td style="text-align:center;border:1px solid #000000;">籍贯</td>
                    <td colspan="5" style="text-align:left;border:1px solid #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{stdRegInfo.native_prov}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;省 (市、自治区 )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{stdRegInfo.native_city}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;市 ( 县 )</td>
                    <td style="wdith:1px;border:1px solid #000000;"></td>
                  </tr>
                  <tr class="el-table__row" style="border:1px solid #000000;">
                    <td style="text-align:center;border:1px solid #000000;">民族</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_nation_text}}</td>
                    <td style="text-align:center;border:1px solid #000000;">政治面貌</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.political_status_text}}</td>
                    <td style="text-align:center;border:1px solid #000000;">考前学历</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_edu_text}}</td>
                  <td style="wdith:1px;border:1px solid #000000;"></td>
                  </tr>
                  <tr class="el-table__row" style="border:1px solid #000000;">
                    <td style="text-align:center;border:1px solid #000000;">工作单位</td>
                    <td colspan="3" style="text-align:left;border:1px solid #000000;">{{stdRegInfo.std_work_unit}}</td>
                    <td style="text-align:center;border:1px solid #000000;">联系电话</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_mobile}}</td>
                  <td style="wdith:1px;border:1px solid #000000;"></td>
                  </tr>
                  <tr class="el-table__row" style="border:1px solid #000000;">
                    <td style="text-align:center;border:1px solid #000000;">家庭地址</td>
                    <td colspan="3" style="text-align:left;border:1px solid #000000;">{{stdRegInfo.std_address}}</td>
                    <td style="text-align:center;border:1px solid #000000;">邮政编码</td>
                    <td style="text-align:center;border:1px solid #000000;">{{stdRegInfo.std_postcode}}</td>
                   <td style="wdith:1px;border:1px solid #000000;"></td>
                  </tr>
                  

                  
                </table>


                <br>

           
              </el-col>
              <el-col :span="6">
                
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="18">
               
                <table class="el-table" style="width:760px;margin-left:10px;border-collapse: collapse;border-bottom:1px solid #000000;border-left:1px solid #000000;" >
                 <tr class="el-table__row">
                    
                    <td colspan="6" align="center" style="text-align:center;border-bottom:1px solid #000000;border-top:1px solid #000000;">
                        <h3  style="padding:0px;margin:0px;">个人简历 </h3>
                    </td>
                    
                    <td colspan="1" align="center" style="border:1px solid #000000;">
                        
                    </td>
                  </tr>
                   <tr class="el-table__row" >
                    <td colspan="2" style="text-align:center;width:100px;border:1px solid #000000;">起止年月</td>
                    <td colspan="2" style="text-align:center;border:1px solid #000000;">在何地、何单位学习或工作</td>
                    <td colspan="2" style="text-align:center;width:120px;border:1px solid #000000;">任何职务</td>
                  <td colspan="1" align="center" style="border-top:1px solid #000000;"></td>
                  </tr>
                  <tr v-for="(i) in stdResumeList" :key="i.id" v-if="i != null">
                    <td colspan="2" style="text-align:center;width:160px;border:1px solid #000000;">{{i.start_date}}&nbsp;~&nbsp;{{i.end_date}}</td>
                    <td colspan="2" style="text-align:center;width:420px;border:1px solid #000000;">{{i.work_exp}}</td>
                    <td colspan="2" style="text-align:center;width:160px;border:1px solid #000000;">{{i.position}}</td>
                    <td colspan="1" align="center" style="border-top:1px solid #000000;"></td>
                    
                    </tr>

                  
                </table>


              

           
              </el-col>
              <el-col :span="6">
                
              </el-col>
            </el-row>

            <el-row>
              <el-col :span="24">
                &nbsp;
              </el-col>
            </el-row>
          

              
            
              <center>
                <br>
                <el-button type="primary" @click="curStep = 3;">上一步</el-button>

                <el-button type="primary" v-if="can_submit" @click="submit()">确认无误并提交毕业申请</el-button>
                <el-button type="primary" @click="colseWin()">关闭</el-button>
              </center>
            
          </div>

        </el-dialog>

        <!-- 考生图片上传  -->
        <el-dialog id="imgUploadDiv"
          title="图片上传"
          :visible.sync="imgUploadDialogVisible"
          width="1200px"
          height="600px"
          center>
          <span>
              <el-row>
                  <el-col :span="6" class="tip" style="margin:0px !important;height: 490px;font-size: 15px;">
                    <font style="font-weight:600">考生注意：</font><font color="red">本照片即为今后的毕业证照片，请注意照片形象和质量要求。</font><br>
                    <font style="font-weight:600">位置要求：</font>高度，头上空1/10，头部占7/10，宽度；肩部占1/5，左右各空1/10<br>
                    <font style="font-weight:600">背景要求：</font>蓝底或白底<br>
                    <font style="font-weight:600">文件格式：</font>jpg格式<br>
                    <font style="font-weight:600">像素要求：</font>288*384，300DPI，文件最大不超过1MB<br>
                    <font style="font-weight:600">形象要求：</font>免冠证件照，着有领衣服，表情评和，正面直视，衣着整洁。 <br>
                    <font style="font-weight:600;">上传限制：</font><font color="red">照片上传后，不允许再修改，请慎重点击上传图片。</font> <br>
                  </el-col>
                  <el-col :span="9">
                      <center>
                        <vueCropper
                          ref="cropper"
                          :img="option.img"
                          :outputSize="option.size"
                          :outputType="option.outputType"
                          :info="false"
                          :full="option.full"
                          :canMove="option.canMove"
                          :canMoveBox="option.canMoveBox"
                          :canScale="option.canScale"
                          :fixedBox="option.fixedBox"
                          :original="option.original"
                          :autoCrop="option.autoCrop"
                          :autoCropWidth="option.autoCropWidth"
                          :autoCropHeight="option.autoCropHeight"
                          :centerBox="option.centerBox"
                          :high="option.high"
                          :infoTrue="option.infoTrue"
                          @realTime="realTime"
                          @imgLoad="imgLoad"
                          @cropMoving="cropMoving"
                          :enlarge="option.enlarge"
                        ></vueCropper>
                      

                      <!-- <i class="el-icon-zoom-in"></i>
                      <i class="el-icon-zoom-out"></i>
                      <i class="el-icon-arrow-left"></i>
                      <i class="el-icon-arrow-right"></i> -->
                      <!-- <button @click="changeScale(1)" class="btn">+</button>
                      <button @click="changeScale(-1)" class="btn">-</button>
                      <button @click="rotateLeft" class="btn">rotateLeft</button>
                      <button @click="rotateRight" class="btn">rotateRight</button> -->
                      <div style="margin-top:5px">
                        <el-button icon="el-icon-refresh" size="mini" @click="refreshCrop"></el-button>
                        <el-button icon="el-icon-download" size="mini" @click="down('blob')"></el-button>
                        
                        <el-button icon="el-icon-zoom-in" size="mini" @click="changeScale(1)"></el-button>
                        <el-button icon="el-icon-zoom-out" size="mini" @click="changeScale(-1)"></el-button>
                        <el-button icon="fa fa-rotate-left" size="mini" @click="rotateLeft"></el-button>
                        <el-button icon="fa fa-rotate-right" size="mini" @click="rotateRight"></el-button>
                      </div>
                    </center>
                  </el-col>
                  <el-col :span="9">
                    <center>
                      <div class="show-preview" :style="{'width': previews.w + 'px', 'height': previews.h + 'px',  'overflow': 'hidden',}">
                        <div :style="previews.div">
                          <img :src="previews.url" :style="previews.img">
                        </div>
                      </div>
                    </center>
                  </el-col>
                </el-row>
          </span>


          <span slot="footer" class="dialog-footer">
            <!-- image/png, image/jpeg, image/gif,  -->
            <input type="file" id="uploads" ref="uploadBtn" :value="imgFile" style="position:absolute; clip:rect(0 0 0 0);" accept="image/jpg" @change="uploadImg($event, 1)">
            <el-button size="mini" @click="chooseFile()">选择本地图片</el-button>
            <el-button size="mini" type="primary" @click="finishUpload('blob')">上传图片</el-button>
            <el-button size="mini" @click="imgUploadDialogVisible = false">取消</el-button>
          </span>
        </el-dialog>

        <el-dialog title="毕业生登记表预览" width="800px" :visible.sync="tableDialogVisible">
          <div>
            
          
            <center>
              <el-button type="primary" @click="downByApplyRegisterPdf">下载毕业生登记表</el-button>

            </center>
            <br>
             <br>
              <br>
             <center v-if="selected_apply && selected_apply.status=='7'">
               <el-button type="primary" @click="tableDialogVisible = false;std_confirm='2';goEdit(selected_apply)">毕业信息有误，修改重新提交</el-button>

              <el-button type="primary" @click="confirmByApply(selected_apply)">确认毕业信息无误</el-button>

            </center>
             
          </div>

          
          

        </el-dialog>

<el-dialog width="500px" id="paymodal" title="学历电子认证" :visible.sync="payDialogVisible2" :show-close="false" :close-on-click-modal="false">
     
     <div>
      <center>
        <table  v-if="byXueXin" style="font-size: 16px;margin-top:0px;margin-bottom:5px;width:100%;border-collapse:separate; border-spacing:0px 10px;">
             
              <tr>
                      <td align="right" >姓名：</td>
                       <td align="left">{{byXueXin.xm}}</td>
                    </tr>

                     <tr>
                      <td align="right">证件号码：</td>
                       <td align="left">{{byXueXin.zjhm? byXueXin.zjhm.replace(/^(.{6})(?:\w+)(.{4})$/, "\$1********\$2"):""}}</td>
                    </tr>

                   <tr>
                      <td align="right" >院校名称：</td>
                       <td align="left">{{byXueXin.yxmc}}</td>
                    </tr>

                     <tr>
                      <td align="right">专业名称：</td>
                       <td align="left">{{byXueXin.zymc}}</td>
                    </tr>

                     <tr>
                      <td align="right" >层次：</td>
                       <td align="left">{{byXueXin.cc}}</td>
                    </tr>

                     <tr>
                      <td align="right">学习形式：</td>
                       <td align="left">{{byXueXin.xxxs}}</td>
                    </tr>

                     <tr>
                      <td align="right" >学历类别：</td>
                       <td align="left">{{byXueXin.xllb}}</td>
                    </tr>

                     <tr>
                      <td align="right">毕业年份：</td>
                       <td align="left">{{byXueXin.bynf}}</td>
                    </tr>

                    <tr>
                      <td align="right">毕结业结论：</td>
                       <td align="left">{{byXueXin.bjyjl}}</td>
                    </tr>

                    <tr>
                      <td align="right">认证时间：</td>
                       <td align="left">{{byXueXin.create_date}}</td>
                    </tr>

            </table>

        
           <el-button type="cancel" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="payDialogVisible2=false;">取消</el-button>
          <el-button type="primary" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="showByApplyForBenOne();">重新认证</el-button>

          <el-button type="primary" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="showByApplyForBen();">下一步</el-button>
      </center>
     </div>
     
    </el-dialog>


<el-dialog width="500px" id="paymodal" title="信息提示" :visible.sync="payDialogVisible1" :show-close="false" :close-on-click-modal="false">
     
     <div style="margin:5px">
      <center>
        本次毕业审核即将对您的前置学历进行校验，是否同意授权进行？
        <br>
           <el-button type="cancel" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="payDialogVisible1=false;">不同意</el-button>
          <!--
          <el-button type="primary" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="noEduAndApply();">不同意，我自己上传学历证明材料</el-button>
-->
          <el-button type="primary" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="queryEdu();">同意</el-button>
      </center>
     </div>
     
    </el-dialog>


    <el-dialog width="500px" id="paymodal" title="学籍学历电子认证" :visible.sync="payDialogVisible" :show-close="false" :close-on-click-modal="false">
     <table style="padding-top:0px;margin:0px auto;">
       
       <tr>
         <td align="right" style="">姓名:</td>
        <td>{{stdReg.std_name}}</td>
        
      </tr>
       <tr>
        
         <td align="right">证件号码:</td>
        <td>{{stdReg.cert_no}}</td>
        
        
      </tr>

       <tr>
         
         <td align="right">认证编号:</td>
         <td>{{orderNum}}</td>
        
          </tr>
     
     </table>
     <div style="margin:5px">
      <center>
          <img v-if="base64Code" :src="'data:image/*;base64,' + base64Code" alt="" style="width:300px;height:300px"><br>
      <div style="text-align:left;">
       温馨提示：
       <br>
       请您下载学信网手机APP，登录并实人验证绑定本人学历信息后，扫描以上二维码授权本人学历信息核查认定。
      </div>
         
          <el-button type="primary" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="payOk()">完成学历认证后请点击确认</el-button>
      </center>
     </div>
   

     <div style="margin:5px">
       <center>
         <el-button type="primary" size="mini" @click="payDialogVisible=false;">关闭窗口</el-button>
       </center>
     </div>
    </el-dialog>

    
<el-dialog width="500px" id="paymodal" title="信息提示" :visible.sync="payDialogVisible3" :show-close="false" :close-on-click-modal="false">
     
     <div style="margin:5px">
      <center>
        {{errorinfo}}
        <br>
           <el-button type="cancel" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="noEduAndApply();">继续毕业申请</el-button>
          
          <el-button type="primary" style="padding-top:10px;margin-top: 10px;margin-bottom:5px;" size="mini" @click="payDialogVisible3=false;">重扫二维码</el-button>
      </center>
     </div>
     
    </el-dialog>


      </el-tab-pane>
    </el-tabs>
  </d2-container>
</template>

<script>
import { mapState, mapActions } from "vuex";
import { json } from "body-parser";
import { isIPv4 } from "net";
import { log, debug } from 'util';
import { VueCropper } from "vue-cropper";

import {prov_city_data} from "./prov_city.js";
import { close } from 'fs';
import { decode } from 'punycode';

export default {
  components: { VueCropper },
  computed: {
    ...mapState({
      stdReg: state => state.enrol.StdReg,
      StdImageArray: state => state.enrol.StdImageArray,
      FrameParam: state => state.enrol.FrameParam
    }),
    photo_url() {
      if(window.isRemotePhoto =='1'){
      return `${window.photoHttp}${this.stdReg.photo_path}`;
      }else{
      this.randomNum = new Date().getTime();
      return `${window.uploadServerUrl}${this.stdReg.photo_url}?${
        this.randomNum
      }`;
      }

     
    },
  
    by_photo_url() {
      this.randomNum = new Date().getTime();
      if(this.selected_apply && this.selected_apply.by_photo){
        return `${window.uploadServerUrl}${this.selected_apply.by_photo}?${
          this.randomNum
        }`;

      }else if(this.by_photo_url_p){
        return `${window.uploadServerUrl}${this.by_photo_url_p}?${
          this.randomNum
        }`;
      }
    },
  },

  data() {
    var checkPhone = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("请输入联系电话"));
      } else {
        const reg = /^1[0|1|2|3|4|5|6|7|8|9][0-9]\d{8}$/;
        // console.log(reg.test(value));
        if (reg.test(value)) {
          callback();
        } else {
          return callback(new Error("请输入正确的手机号"));
        }
      }
    };
    return {
      orderNum: "",
      payDialogVisible:false,
      payDialogVisible1:false,
      payDialogVisible2:false,
      payDialogVisible3:false,
      base64Code:null,
      byXueXin:null,
      errorinfo:"",
      isXueXinWPass:false,
      loading: false,
      majorList: null,
      applyDialogVisible: false,
      tableDialogVisible: false,
      applyDialogVisibleone: false,
      auditDialogVisible: false,
      auditInfoArray: null,
      curStep: 1,
      good_photo:'1',
      by_apply_note:null,
      by_apply_note_title:null,
      can_submit:true,
      selected_major_id: null,
      selected_major: null,
      selected_apply: null,
      canApply: false,
      canAudit: false,

      timeLimit: null,
      applyList: null,
      ByApplyControl: null,
      // isAllowGraduate: false,
      inBlackList: false,
      blackList: null,
      isNeedPreEduApply: true,
      courseScoreList: null,
      paperFailed: false,
      diaplmaNo: null, //毕业证号
      msgArray: [],
      checkMsg: null,

      ticketList: null,
      std: null,
      courseScoreList: null,
      std_confirm:"",
      //数据字典 start
      majorArray: null,
      nationArray: null,
      occupationArray: null,
      familyRegArray: null,
      politicalStatusArray: null,
      sexArray: null,
      healthyArray: null,
      eduArray: null,
      //数据字典 end
      stdResumeList: [],
      time_setInterval :null,
      stdRegInfo: {
        std_name: "",
        std_pass1: "",
        std_pass2: "",
        std_eng_name: "",
        cert_no: "",
        std_sex: "",
        std_source: "",
        political_status: "",
        std_nation: "",
        std_family_reg: "",
        school_id: "",
        std_edu: "",
        std_occupation: "",
        std_healthy: "",
        std_birth: "",
        major_id: "",
        major_code: "",
        major_name: "",
        std_mobile: "",
        std_postcode: "",
        std_address: "",
        email: "",
        remark: "",
        std_work_unit: "",
        major_level:"",
        navtiv_prov:"",
        navtiv_city:"",
        std_by_photo:"1"
      },
      // remark: "",
      stdRegInfoRule: {
        std_source: [
          { required: true, message: "请输入考生来源", trigger: "blur" }
        ],
        political_status: [
          { required: true, message: "请输入政治面貌", trigger: "blur" }
        ],
        std_nation: [
          { required: true, message: "请输入民族", trigger: "blur" }
        ],
        std_family_reg: [
          { required: true, message: "请输入籍贯", trzaigger: "blur" }
        ],
        school_id: [
          { required: true, message: "请输入考生来源", trigger: "blur" }
        ],
        std_edu: [{ required: true, message: "请输入学历", trigger: "blur" }],
        std_occupation: [
          { required: true, message: "请输入职业", trigger: "blur" }
        ],
        std_healthy: [
          { required: true, message: "请输入健康状况", trigger: "blur" }
        ],
        std_birth: [
          { required: true, message: "请输入出生年月", trigger: "blur" }
        ],
        std_mobile: [
          { required: true, message: "请输入联系电话", trigger: "blur" },
          { validator: checkPhone, trigger: "blur" }
        ],
        std_address: [
          { required: true, message: "请输入住址", trigger: "blur" }
        ],
        std_postcode: [
          { required: true, message: "请输入邮政编码", trigger: "blur" }
        ],
        major_id: [{ required: true, message: "请输入专业", trigger: "blur" }],
        std_email: [
          {
            type: "email",
            message: "请输入正确的邮箱地址",
            trigger: ["blur", "change"]
          }
        ],
        std_work_unit: [
          { required: true, message: "请输入工作单位", trigger: "blur" }
        ],
        native_prov: [
          { required: true, message: "请输入省", trigger: "blur" }
        ],
        native_city: [
          { required: true, message: "请输入市", trigger: "blur" }
        ],

        
      },

      orgArray_std_source_3:[],
      school_name:"",
      majorLevelArray:[],
      majorArraySource:[],
      byMajorArray:[],
      byMajorArraySource:[],
      majorLevelArray:[],
      applyInfoConfirm:false,
      oldMajorInfo:"",
      old_std_major:"",
      newMajorInfo:"",
      oldMajorArray:[],
      countryCityMap:null,

     secCountDown: 0,
     secCountDownInfo:"10秒后可以申请毕业",

      prov_city_data:[],
      city_data:[],
      prov:[],
      city:[],
      showByImgDialog:false,
      orderOrgArray_std_source_1:[],
      order_org_id:"",
      by_photo_url_p:"",
      by_photo_path:"",
      by_photo_id:"",
      by_file_item:"",//前端临时使用
      by_file:"",//后台参数
      by_file_two:"",//后台参数
      by_file_three:"",//后台参数
      by_file_four:"",//后台参数
      by_file_five:"",//后台参数
      score_file_item:"",//前端临时使用
      score_file:"",//后台参数
      score_file_two:"",//后台参数
      score_file_three:"",//后台参数
      score_file_four:"",//后台参数
      score_file_five:"",//后台参数
      cert_file_item:"",//前端临时使用
      cert_file:"",//后台参数
      cert_file_two:"",//后台参数
      std_by_photo_item:"",//前端临时使用
      std_by_photo:"",//后台参数
      imgUploadDialogVisible: false,
      crap: false,
      previews: {},
      option: {
        img: "",
        size: 0.9,//压缩质量
        full: false,
        outputType: "jpg",
        canMove: true,
        fixedBox: true,
        original: true,
        canMoveBox: true,
        canScale:true,
        autoCrop: true,
        // 只有自动截图开启 宽度高度才生效
        autoCropWidth: 320,//288 % 0.9 = 288
        autoCropHeight: 426.7,//384 % 0.9 = 384
        centerBox: false,
        high: true,
        cropData: {},
        enlarge: 0.9,//值为1时有bug
        infoTrue: false
      },
      fileName: "", //本机文件地址
      imgFile: "",
      fileList: [],
      scorefileList: [],
      certfileList: [],
      stdbyphotofileList: [],
      photoHttp:"",
      
    };
  },

  async mounted() {
    this.loading = true;
    this.init();
    this.loading = false;

    const resp = await this.$http.get("/std/stdRegInfo/init.htm");
    let dict = resp.data.map.dict;
    this.majorLevelArray = dict["majorLevelArray"];
    this.majorArraySource = dict["majorArray"];
    this.byMajorArraySource = dict["byMajorArray"];
    this.initStdApplyInfo();
  },
  methods: {
    //初始化列表查询
    async init() {

      this.prov_city_data = prov_city_data;
      this.applyInfoConfirm = false;
      let res = await this.$http.post(
        "/by/byApply/listAll.htm",
        {},
        this.$http.headers.FORM
      );
      this.canApply = res.data.map.canApply;
      this.canAudit = res.data.map.canAudit;
      
      this.timeLimit = res.data.map.byTimeConfig;
      this.majorList = res.data.map.majorList;
      this.applyList = res.data.map.applyList;
      this.ByApplyControl = res.data.map.ByApplyControl;
      this.by_apply_note = res.data.map.by_apply_note;
      this.by_apply_note_title = res.data.map.by_apply_note_title;

      this.photoHttp = `${window.photoHttp}`;

      await this.initorderOrgArray_std_source_1();
    },
    async initStdApplyInfo(){
      //初始化考生类型
      this.stdRegInfo.std_source = String(this.stdReg.std_source);
      this.std_sourceChange(this.stdRegInfo.std_source);
      //初始化专业等级
      this.initMajorLevel();


      //初始化专业
      // this.selected_major_id = this.stdReg.major_id;
      // console.log(this.selected_major_id);
      // this.majorChange(this.selected_major_id);

      //主考院校
      // this.stdRegInfo.school_id = this.stdReg.school_id;
    },
    async initMajorLevel(){
      let res = await this.$http.post("/std/stdRegInfo/getStdMajor.htm");
      if(!res.data.entity) return null;
      let stdMajor = res.data.entity;
      this.stdRegInfo.major_level = String(stdMajor.major_level);
      this.old_std_major = stdMajor.major_code + '-' + stdMajor.major_name;
      // let majorArray = this.$options.filters["dataArrayFilter"](this.majorArraySource, {
      //   major_level:stdMajor.major_level
      //   });
      // 
      // this.majorArray.concat(majorArray); 
      await this.majorLevelChange(this.stdRegInfo.major_level);
      // this.byMajorArray.push(stdMajor);
      await this.initNewMajor(stdMajor.id);
      return  stdMajor;
    },
    async showAuditInfo(item) {
      let { data } = await this.$http.post(
        "/by/byApplyAudit/listByApply.htm",
        this.Qs.stringify({
          apply_id: item.id
        }),
        this.$http.headers.FORM
      );
      this.auditInfoArray = data.array;
      this.auditDialogVisible = true;
    },

//跳转申请页面
    async goApplyone(apply) {
      if(this.by_apply_note){
        if(this.time_setInterval){
            window.clearInterval(this.time_setInterval);
          }

        this.applyDialogVisibleone = true;    

        let _this = this;
          _this.secCountDown = 10;
          _this.secCountDownInfo = _this.secCountDown+"秒后可以申请毕业";

          _this.time_setInterval = setInterval(function(){
            _this.secCountDown--;
            if(_this.secCountDown <= 0){
          
              window.clearInterval(_this.time_setInterval);
              //恢复 发送按钮
              _this.secCountDownInfo = "申请毕业";
            }else{
              //倒计时提示
              _this.secCountDownInfo = _this.secCountDown+"秒后可以申请毕业";
            }
          },1000);

      }else{
        this.goApply(apply);
      }

    },

    //跳转申请页面
    async goApply(apply) {
      if(this.secCountDown != 0){
        return;
      }
     this.applyDialogVisibleone = false;    

      if(this.applyInfoConfirm && !this.selected_major_id){
        this.alert("请选择毕业专业!");
        return;
      }

       if(this.applyInfoConfirm && this.stdRegInfo.std_source==1 && this.selected_major_id){

         // 根据专业ID获取专业信息
          let temp_major = await this.$http.post("/pl/plMajor/get.htm",
          this.Qs.stringify({
              major_id: this.selected_major_id,
            }));
          
          // 专业不允许社会考生申请毕业
          if(temp_major.data.entity && temp_major.data.entity.is_allow_social == 0){
               this.alert(temp_major.data.entity.major_code+"|"+temp_major.data.entity.major_name+"不允许社会考生申请毕业，请选择我是助学考生，再选择该专业。主考院校选择该专业的主考院校!");
                return;
          }
      }
      
      if (this.selected_apply) {
        // this.selected_apply = apply;
        // this.remark = this.selected_apply.remark;
        
        //处理附件的初始化
        if(this.selected_apply.by_file){
          this.fileList = [{name:`${this.selected_apply.by_file}`,url:`${window.uploadServerUrl}${this.selected_apply.by_file}`}]
          this.by_file = this.selected_apply.by_file ;
        }else{
         this.fileList = [];
        }

        if(this.selected_apply.by_file_two){
          this.fileList.push({name:`${this.selected_apply.by_file_two}`,url:`${window.uploadServerUrl}${this.selected_apply.by_file_two}`});
          this.by_file_two = this.selected_apply.by_file_two ;
        }

        if(this.selected_apply.by_file_three){
          this.fileList.push({name:`${this.selected_apply.by_file_three}`,url:`${window.uploadServerUrl}${this.selected_apply.by_file_three}`});
          this.by_file_three = this.selected_apply.by_file_three ;
        }

        if(this.selected_apply.by_file_four){
          this.fileList.push({name:`${this.selected_apply.by_file_four}`,url:`${window.uploadServerUrl}${this.selected_apply.by_file_four}`});
          this.by_file_four = this.selected_apply.by_file_four ;
        }

        if(this.selected_apply.by_file_five){
          this.fileList.push({name:`${this.selected_apply.by_file_five}`,url:`${window.uploadServerUrl}${this.selected_apply.by_file_five}`});
          this.by_file_five = this.selected_apply.by_file_five ;
        }

        //处理附件的初始化
        if(this.selected_apply.score_file){
          this.scorefileList = [{name:`${this.selected_apply.score_file}`,url:`${window.uploadServerUrl}${this.selected_apply.score_file}`}]
          this.score_file = this.selected_apply.score_file ;
        }else{
          this.scorefileList = [];
        }

        if(this.selected_apply.score_file_two){
          this.scorefileList.push({name:`${this.selected_apply.score_file_two}`,url:`${window.uploadServerUrl}${this.selected_apply.score_file_two}`});
          this.score_file_two = this.selected_apply.score_file_two ;
        }

        if(this.selected_apply.score_file_three){
          this.scorefileList.push({name:`${this.selected_apply.score_file_three}`,url:`${window.uploadServerUrl}${this.selected_apply.score_file_three}`});
          this.score_file_three = this.selected_apply.score_file_three ;
        }

        if(this.selected_apply.score_file_four){
          this.scorefileList.push({name:`${this.selected_apply.score_file_four}`,url:`${window.uploadServerUrl}${this.selected_apply.score_file_four}`});
          this.score_file_four = this.selected_apply.score_file_four ;
        }

        if(this.selected_apply.score_file_five){
          this.scorefileList.push({name:`${this.selected_apply.score_file_five}`,url:`${window.uploadServerUrl}${this.selected_apply.score_file_five}`});
          this.score_file_five = this.selected_apply.score_file_five ;
        }


        //处理附件的初始化
        if(this.selected_apply.cert_file&&this.selected_apply.cert_file_two){
          this.certfileList=[{name:`${this.selected_apply.cert_file}`,url:`${window.uploadServerUrl}${this.selected_apply.cert_file}`},{name:`${this.selected_apply.cert_file_two}`,url:`${window.uploadServerUrl}${this.selected_apply.cert_file_two}`}];
          this.cert_file = this.selected_apply.cert_file ;
          this.cert_file_two = this.selected_apply.cert_file_two ;
        }

        //if(this.selected_apply.cert_file_two){
        //  this.certfileList.push({name:`${this.selected_apply.cert_file_two}`,url:`${window.uploadServerUrl}${this.selected_apply.cert_file_two}`});
        //  this.cert_file_two = this.selected_apply.cert_file_two ;
      //  }

        

         //处理附件的初始化
        if(this.selected_apply.std_by_photo){
          this.stdbyphotofileList = [{name:`${this.selected_apply.std_by_photo}`,url:`${window.uploadServerUrl}${this.selected_apply.std_by_photo}`}]
          this.std_by_photo = this.selected_apply.std_by_photo ;
        }

        //初始化省市
        this.provChange(this.selected_apply.navtiv_prov);
        this.$nextTick(() => {
          this.cityChange(this.selected_apply.native_city);
        })
      

      } else {
        this.selected_apply = null;
        // this.remark = "";
      }
      if (!this.applyInfoConfirm) {
        this.curStep = 1;
        this.$nextTick(() => {
          if (this.majorList.length > 0 && !this.selected_major_id) {
            this.selected_major_id = this.majorList[0].major_id;
          }
        });
        // return;
      }
      for (const key in this.item) {
        if (this.item.hasOwnProperty(key)) {
          this.item[key] = "";
        }
      }

      // this.loading = true;
      // let loading = this.showLoading();

      const resp = await this.$http.get("/std/stdRegInfo/init.htm");
      let dict = resp.data.map.dict;
      this.majorArray = dict["majorArray"];
      this.nationArray = dict["nationArray"];
      this.occupationArray = dict["occupationArray"];
      this.familyRegArray = dict["familyRegArray"];
      this.politicalStatusArray = dict["politicalStatusArray"];
      this.sexArray = dict["sexArray"];
      this.healthyArray = dict["healthyArray"];
      this.eduArray = dict["eduArray"];

      if (!this.applyInfoConfirm) {
        this.applyDialogVisible = true;
        return;
      }

      if(this.applyInfoConfirm && (null == this.stdRegInfo.school_id ||!String(this.stdRegInfo.school_id))){
        this.alert("主考院校不能为空");
        return ;
      }

      if(this.applyInfoConfirm && this.stdRegInfo.std_source =='1' && !String(this.order_org_id)){
        this.alert("请选择领取毕业证书及登记表单位");
        return ;
      }
      
      let selected_apply_id = "";
      if(this.selected_apply){
        selected_apply_id = this.selected_apply.id;
      }

      let { data } = await this.$http.post(
        "/by/byApply/checkPhoto.htm",
        this.Qs.stringify({
          id: selected_apply_id
        }),
        this.$http.headers.FORM
      );
     
     let error_info = data.map.checkPhoto;
      
     if(error_info){
        this.$confirm("照片不符合毕业证书要求，请在填写毕业生登记表时上传本人近期免冠照片，用于申请毕业。（宽480像素*高640像素，人像居中，蓝底，文件大小在20KB至40KB）", "信息提示", {
              confirmButtonText: "我已知晓",
              cancelButtonText: "取消",
              type: "warning"
            })
              .then(async () => {
              
                this.good_photo='0';
                 
                if(this.stdRegInfo.major_level == '1'){
                   this.isXueXinWPass = false;
                   this.payDialogVisible1=true;

                   /* 
                   this.$confirm("本次毕业审核即将对您的前置学历进行校验，是否同意授权进行？", "信息提示", {
                      confirmButtonText: "同意",
                      cancelButtonText: "取消",
                      type: "warning"
                    })
                      .then(async () => {
                      this.showByApplyForBenOne();
                        
                      })
                      .catch(() => {});
                      */
                }else{
                 
                  this.showByApply();
                
                }
                
              })
              .catch(() => {});
     }else{
          this.good_photo='1';
          if(this.stdRegInfo.major_level == '1'){
            this.isXueXinWPass = false;
            this.payDialogVisible1=true;
                    
           
            /*
              this.$confirm("本次毕业审核即将对您的前置学历进行校验，是否同意授权进行？", "信息提示", {
                confirmButtonText: "同意",
                cancelButtonText: "取消",
                type: "warning"
              })
                .then(async () => {
                this. showByApplyForBen();
                  
                })
                .catch(() => {});
                */

          }else{
           
            this. showByApply();
          
          }
     }
        
    },

    async queryEdu(){
        let { data } = await this.$http.post(
                "/by/byApply/queryEdu.htm",
                this.Qs.stringify({
                  stdId: this.stdRegInfo.id,
                  edu_type:'学历'
                }),
                this.$http.headers.FORM
              );
              if(!data.success){
                this.alert(data.errorMsg);
                
              }
              
              this.byXueXin = data.entity;
              if(this.byXueXin){
                this.isXueXinWPass = true;
                this.payDialogVisible2=true;
              }else{
                this.isXueXinWPass = false;
                this.showByApplyForBenOne();
                
              }

               
             
    },

  async confirmByApply(item){
    
    this.$confirm("确认毕业信息无误吗？", "信息提示", {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
            type: "warning"
          })
            .then(async () => {

              this.doConfirmByApply(item);
              
            })
            .catch(() => {});
  },

  async doConfirmByApply(item){
    let loading = this.showLoading();
          let { data } = await this.$http.post(
              "by/byApply/confirmByApply.htm",
              this.Qs.stringify({
                std_confirm:1,
                id: item.id
                
              }),
              this.$http.headers.FORM
            );
            this.hideLoading(loading);
            
            if (data.success) {
              this.alert("确认成功");
              this.init();
              this.$nextTick(() => {
                this.tableDialogVisible = false;
              });
            } else {
             
              this.hideLoading(loading);
              this.alert(data.errorMsg);
              return false;
            }
  },
   async showByApplyForBenOne(){
     let { data } = await this.$http.post(
        "/by/byApply/queryEduXLQrcode.htm",
        this.Qs.stringify({
          stdId: this.stdReg.id
        }),
        this.$http.headers.FORM
      );
      if(!data.success){
        this.alert(data.errorMsg);
        return;
      }
       //let respJson = JSON.parse(data);
        this.orderNum = data.map.bizSerialNum;
       
        this.payDialogVisible = true;
        this.base64Code = data.map.data;
        
   },
   async payOk(){
     
      let res = await this.$http.post("/by/byApply/queryEduIsSuccess.htm",
        this.Qs.stringify({
            bizSerialNum:this.orderNum
          }));
      if(res.data.success){
         this.isXueXinWPass = true;
         this.payDialogVisible1 = false;
         this.showByApplyForBen();
      }else{
        this.errorinfo = res.data.errorMsg;
        this.payDialogVisible3 = true;
        
      }
   },
   async showByApplyForBen(){
      
      let { data } = await this.$http.post(
        "/by/byApply/educertified.htm",
        this.Qs.stringify({
          stdId: this.stdReg.id,
          majorId: this.selected_major_id,
          schoolId: this.stdRegInfo.school_id
        }),
        this.$http.headers.FORM
      );
      if(!data.success){
        this.alert(data.errorMsg);
        // this.hideLoading(loading);
       // return;
      }
      this.selected_major = data.map.major;
      let std_source = this.stdRegInfo.std_source;
      let major_level = this.stdRegInfo.major_level;
      let school_id = this.stdRegInfo.school_id;
      
      this.stdRegInfo = this.initStdRegInfo(data.map.stdRegInfo); //data.map.stdRegInfo ;//
      this.stdRegInfo.std_source = std_source;
      this.stdRegInfo.major_level = major_level;
      this.stdRegInfo.school_id = school_id;

      // this.isAllowGraduate = data.map.isAllowGraduate; //是否允许毕业
      this.inBlackList = data.map.inBlackList; //是否在黑名单
      this.passXuexin = data.map.passXuexin;//N:不需要验证,0:验证失败,1:验证通过
      this.blackList = data.map.blackList;
      this.isNeedPreEduApply = data.map.isNeedPreEduApply; //是否需要前置学历认证
     // this.isXueXinWPass = data.map.isXueXinWPass;//学信网认证学历
      this.courseScoreList = data.map.courseScoreList;
      this.paperFailed = data.map.paperFailed; //论文是
      this.diaplmaNo = data.map.diaplmaNo;
      this.countryCityMap = data.map.countryCityMap;

      if(this.isXueXinWPass == false){
         this.$confirm("前置学历核验未通过，请上传相关证明材料。继续进行毕业申请吗？", "信息提示", {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
            type: "warning"
          })
            .then(async () => {
              this.initDictData();

              this.curStep = 2;
              // this.loading = false;
              // this.hideLoading(loading);
              this.applyDialogVisible = true;
              this.payDialogVisible = false;
              this.payDialogVisible1 = false;
              this.payDialogVisible2=false;
              

              
            })
            .catch(() => {});
      }else{
         this.$confirm("前置学历认证通过，请点击确认继续进行毕业申请", "信息提示", {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
            type: "warning"
          })
            .then(async () => {
              this.initDictData();

              this.curStep = 2;
              // this.loading = false;
              // this.hideLoading(loading);
              this.applyDialogVisible = true;
              this.payDialogVisible = false;
              this.payDialogVisible1 = false;
              this.payDialogVisible2=false;
              
            })
            .catch(() => {});
       
      }

     
    },

    async noEduAndApply(){
      this.$confirm("前置学历未认证，继续进行毕业申请吗？", "信息提示", {
            confirmButtonText: "确认",
            cancelButtonText: "取消",
            type: "warning"
          })
            .then(async () => {
              this.payDialogVisible1 = false;
              this.payDialogVisible = false;
              this.payDialogVisible3 = false;
              this.payDialogVisible2 = false;
              
              this.showByApply();
              
            })
            .catch(() => {});
    },
    async showByApply(){
      
      let { data } = await this.$http.post(
        "/by/byApply/educertified.htm",
        this.Qs.stringify({
          stdId: this.stdReg.id,
          majorId: this.selected_major_id,
          schoolId: this.stdRegInfo.school_id
        }),
        this.$http.headers.FORM
      );
      if(!data.success){
        this.alert(data.errorMsg);
        // this.hideLoading(loading);
       // return;
      }
      this.selected_major = data.map.major;
      let std_source = this.stdRegInfo.std_source;
      let major_level = this.stdRegInfo.major_level;
      let school_id = this.stdRegInfo.school_id;
      
      this.stdRegInfo = this.initStdRegInfo(data.map.stdRegInfo); //data.map.stdRegInfo ;//
      this.stdRegInfo.std_source = std_source;
      this.stdRegInfo.major_level = major_level;
      this.stdRegInfo.school_id = school_id;

      // this.isAllowGraduate = data.map.isAllowGraduate; //是否允许毕业
      this.inBlackList = data.map.inBlackList; //是否在黑名单
      this.passXuexin = data.map.passXuexin;//N:不需要验证,0:验证失败,1:验证通过
      this.blackList = data.map.blackList;
      this.isNeedPreEduApply = data.map.isNeedPreEduApply; //是否需要前置学历认证
      //this.isXueXinWPass = data.map.isXueXinWPass;//学信网认证学历
      this.courseScoreList = data.map.courseScoreList;
      this.paperFailed = data.map.paperFailed; //论文是
      this.diaplmaNo = data.map.diaplmaNo;
      this.countryCityMap = data.map.countryCityMap;

      this.initDictData();

      this.curStep = 2;
      // this.loading = false;
      // this.hideLoading(loading);
      this.applyDialogVisible = true;
    },

    async initorderOrgArray_std_source_1(){
      let { data } = await this.$http.get("/pl/byApply/orderOrgList.htm");
      if(data.success){
        this.orderOrgArray_std_source_1 = data.array;
      }else{
        this.alert(data.errorMsg);
      }
    },

    initStdRegInfo(std) {
      std.std_edu = String(std.std_edu);
      std.std_nation = String(std.std_nation);
      std.std_family_reg = String(std.std_family_reg);
      std.political_status = String(std.political_status);
      
      if(this.selected_apply && this.selected_apply.id){
         std.std_sex =  String(this.selected_apply.std_sex);

          std.native_prov = this.selected_apply.native_prov;
          std.native_city = this.selected_apply.native_city;
          std.std_nation = String(this.selected_apply.nation);
          std.political_status = String(this.selected_apply.political);
          std.std_work_unit = this.selected_apply.work_unit;
          std.std_address = this.selected_apply.address;
          std.std_postcode = this.selected_apply.post_code;
          std.std_mobile = this.selected_apply.telephone;
          std.std_birth = this.selected_apply.std_birth;
      }else{
        if(std.cert_no && std.cert_no.length==18){
           std.std_birth = std.cert_no.substring(6,10)+'-'+std.cert_no.substring(10,12)+'-'+std.cert_no.substring(12,14);
        }else{
          // 清空出生年月，以解决出生年月格式不正确，导致提交后数据库空BUG
          std.std_birth = '';
        }
        
      }

      return std;
    },
    goEdit(item) {
      // test TODO
      if(!this.timeLimit){
        this.alert("现时间段不允许修改!");
        return;
      } 
      this.selected_apply = item;
      // test TODO
      this.timeLimit.id = item.by_time_config_id;
      // this.selected_major_id = item.major_id;
      this.stdRegInfo.std_source = String(item.std_source);
      this.std_sourceChange(this.stdRegInfo.std_source);
      
      this.stdRegInfo.school_id = item.school_id;
      // this.remark = item.remark;
      this.stdRegInfo.std_sex = item.std_sex;
      this.stdRegInfo.native_prov = item.native_prov;
      this.stdRegInfo.native_city = item.native_city;
      this.stdRegInfo.std_nation = item.nation;
      this.stdRegInfo.political_status = item.political;

      // pre_edu_text
      // let pre_edu_text = this.findDict(
      //         this.eduArray,
      //         this.stdRegInfo.std_edu
      //       );
      // this.pre_edu_text = pre_edu_text;
 
      this.stdRegInfo.std_work_unit = item.work_unit;
      this.stdRegInfo.std_address = item.address;
      this.stdRegInfo.std_postcode = item.post_code;
      this.diaplma_no = item.diaplma_no;
      this.stdRegInfo.std_mobile = item.telephone;
      this.diaplmaNo = item.diaplmaNo;

      this.school_name = item.school_name;

      this.applyInfoConfirm = false;
      this.goApply(item);
    },

    showTableDialog(item){
      this.selected_apply = item;
      
      this.tableDialogVisible = true;
    },

    //初始化话个人信息字典数据
    initDictData() {
      this.stdRegInfo.std_nation_text = this.findDict(
        this.nationArray,
        this.stdRegInfo.std_nation
      );
      this.stdRegInfo.std_occupation_text = this.findDict(
        this.occupationArray,
        this.stdRegInfo.std_occupation
      );
      this.stdRegInfo.std_family_reg_text = this.findDict(
        this.familyRegArray,
        this.stdRegInfo.std_family_reg
      );
      this.stdRegInfo.political_status_text = this.findDict(
        this.politicalStatusArray,
        this.stdRegInfo.political_status
      );
      this.stdRegInfo.std_edu_text = this.findDict(
        this.eduArray,
        this.stdRegInfo.std_edu
      );
      this.stdRegInfo.std_sex_text = this.findDict(
        this.sexArray,
        this.stdRegInfo.std_sex
      );
    },
    async check() {
      //课程分数
      // if(this.courseScoreList.length == 0){
      //   this.isAllowGraduate = 0;
      //    this.msgArray = [];
      //   this.msgArray.push("无考试课程分数");
      //    setTimeout(() => {
      //     this.curStep = 3;
      //   }, 500);
      //   return;
      // }

      // if (this.isAllowGraduate == 1) {
      //   this.checkMsg = "符合毕业条件!";
      // } else {
        let msgArray = [];
        let msgItem = "";

        if(this.stdRegInfo && this.stdRegInfo.cert_no && this.stdRegInfo.cert_no.length == 15){
          msgItem = "";
          msgItem = "考生身份证号是15位，现场毕业审核时，请先进行身份证升位。";
          msgArray.push(msgItem);
        }
        //TODO 提示毕业判定错误提示信息
        if (this.inBlackList) {
          msgItem = "";
          msgItem = "该考生被列入黑名单,";
          _.forEach(this.blackList, item => {
            if (item.in_time == true) {
              msgItem += `【${item.start_date}】至【${
                item.end_date
              }】时间段内无法申请毕业!`;
            }
          });
          msgArray.push(msgItem);
        }
        if (this.isNeedPreEduApply) {
          msgItem = "";
          msgItem = "前置学历核验未通过，请上传相关证明材料。";
          msgArray.push(msgItem);
        }else{
          if(this.stdRegInfo.major_level==1 && !this.isXueXinWPass){
            msgItem = "";
            msgItem = "学信网学历认证无效,本科毕业必须有前置学历认证!";
            msgArray.push(msgItem);
          }
        }
        if (this.paperFailed) {
          msgItem = "";
          msgItem = "毕业必须有合格的毕业论文!";
          msgArray.push(msgItem);
        }

        this.msgArray = msgArray;
      // }
      setTimeout(async () => {
        await this.initStep3();
        this.curStep = 3;
      }, 500);
    },

    async step4() {

      this.$refs["stdRegInfo"].validate(async valid =>   {
        if (valid) {
          //验证
          for (let i = 0; i < this.stdResumeList.length; i++) {
            let item = this.stdResumeList[i];
            let start_date = item.start_date;
            let end_date = item.end_date;
            let work_exp = item.work_exp;
            let position = item.position;

            if (!start_date ||!end_date || !work_exp || !position) {
             
              this.alert("个人简历每行输入项均必填!");
              return;
            }

            if(end_date){
                let startTime = new Date(Date.parse(start_date));
                let endTime = new Date(Date.parse(end_date));
                if (startTime > endTime) {
                 
                  this.alert("开始时间不能大于等于结束时间!");
                  return false;
                }
             }
         }


          if(this.stdResumeList.length < 1){
           
            this.alert("个人简历不能少于一行！");
            return;
          }

           if(this.stdResumeList.length > 12){
           
            this.alert("简历最多显示12条，请优化本人简历。");
            return;
          }


          if(this.good_photo == '0' && !this.std_by_photo){
           
            this.alert("请上传毕业照片！");
            return;
          }

          if(!this.cert_file){
           
            this.alert("请上传身份证件正面反面照片！");
            return;
          }

          if(!this.cert_file_two){
           
            this.alert("请上传身份证件正面反面照片！");
            return;
          }
          


           if(this.stdRegInfo.major_level==1 && this.isXueXinWPass==false && (!this.by_file && !this.by_file_two && !this.by_file_three && !this.by_file_four && !this.by_file_five)){
           
            this.alert("申请本科毕业，学历认证不通过时，请上传学历证明材料！");
            return;
          }

          this.curStep = 4;

        } else {
         
          this.alert("请完成必填项!");
          return false;
        }
        
      });

        
    },

    newStdResume() {
      return {
        start_date: "",
        end_date: "",
        work_exp: "",
        position: ""
      };
    },

    async initStep3() {
      if(this.selected_apply){
       //初始化简历
        let { data } = await this.$http.post(
        "/by/byApply/getResumeList.htm",
        this.Qs.stringify({
          id: this.selected_apply.id
        }),
          this.$http.headers.FORM
        );
        let resumeList = data.array;
        
        this.stdResumeList = [];
        for (let i = 0; i < resumeList.length; i++) {
          const item = resumeList[i];
          this.stdResumeList.push({
              start_date: item.start_date,
              end_date:  item.end_date,
              work_exp:  item.work_exp,
              position:  item.position
            })
        }
      }else{
        this.stdResumeList = [];
        this.stdResumeList.push(this.newStdResume());
        this.stdResumeList.push(this.newStdResume());
        this.stdResumeList.push(this.newStdResume());
      }
    },

    addRow() {
     // if (this.stdResumeList.length == 8) {
      //  this.alert("最多8条数据");
     //   return;
     // }
      this.stdResumeList.push(this.newStdResume());
    },

    delRow(index) {
      let newList = [];
      for (let i = 0; i < this.stdResumeList.length; i++) {
        if (i != index) {
          // this.stdResumeList[i] == null;
          newList.push(this.stdResumeList[i]);
        }
      }
      this.stdResumeList = newList;
    },

    async submit(file_path) {
      let loading = this.showLoading();
      this.can_submit =false;
      this.$refs["stdRegInfo"].validate(async valid =>   {
        if (valid) {
          //验证
          for (let i = 0; i < this.stdResumeList.length; i++) {
            let item = this.stdResumeList[i];
            let start_date = item.start_date;
            let end_date = item.end_date;
            let work_exp = item.work_exp;
            let position = item.position;

    


            if (!start_date ||!end_date || !work_exp || !position) {
              this.hideLoading(loading);
              this.can_submit=true;
              this.alert("个人简历每行输入项均必填!");
              return;
            }

            if(end_date){
                let startTime = new Date(Date.parse(start_date));
                let endTime = new Date(Date.parse(end_date));
                if (startTime > endTime) {
                  this.hideLoading(loading);
                  this.can_submit=true;
                  this.alert("开始时间不能大于等于结束时间!");
                  return false;
                }
             }
         }

            

          if(this.stdResumeList.length < 1){
            this.hideLoading(loading);
            this.can_submit=true;
            this.alert("个人简历不能少于一行");
            return;
          }

          if (this.selected_apply) {
        
            let pre_edu_text = this.findDict(
              this.eduArray,
              this.stdRegInfo.std_edu
            );

            let loading = this.showLoading();
            let { data } = await this.$http.post(
              "by/byApply/reApply.htm",
              this.Qs.stringify({
                std_confirm:this.std_confirm,
                id: this.selected_apply.id,
                major_id: this.selected_major_id,
                std_source: this.stdRegInfo.std_source,
                school_id: this.stdRegInfo.school_id,

                // test TODO
                by_time_config_id: this.timeLimit.id,
                // remark: this.remark,
                std_sex: this.stdRegInfo.std_sex,
                native_prov: this.stdRegInfo.native_prov,
                native_city: this.stdRegInfo.native_city,
                nation: this.stdRegInfo.std_nation,
                political: this.stdRegInfo.political_status,
                pre_edu: pre_edu_text,
                work_unit: this.stdRegInfo.std_work_unit,
                address: this.stdRegInfo.std_address,
                post_code: this.stdRegInfo.std_postcode,
                diaplma_no: this.diaplma_no,
                std_birth_str: this.stdRegInfo.std_birth,
                telephone: this.stdRegInfo.std_mobile,
                diaplmaNo:this.diaplmaNo,
                order_org_id:this.order_org_id,
                by_photo:this.by_photo_url_p,
                by_photo_path:this.by_photo_path,
                by_photo_id:this.by_photo_id,
                by_file:this.by_file,
                by_file_two:this.by_file_two,
                by_file_three:this.by_file_three,
                by_file_four:this.by_file_four,
                by_file_five:this.by_file_five,
                score_file:this.score_file,
                score_file_two:this.score_file_two,
                score_file_three:this.score_file_three,
                score_file_four:this.score_file_four,
                score_file_five:this.score_file_five,
                cert_file:this.cert_file,
                cert_file_two:this.cert_file_two,
                std_by_photo:this.std_by_photo,
                is_xuexin_pass:this.isXueXinWPass == true?1:0,

                resumeJson: JSON.stringify(this.stdResumeList)
              }),
              this.$http.headers.FORM
            );
            this.hideLoading(loading);
            this.can_submit=true;
            if (data.success) {
              this.alert("提交成功");
              this.init();
              this.$nextTick(() => {
                this.applyDialogVisible = false;
              });
            } else {
              this.hideLoading(loading);
              this.can_submit=true;
              this.alert(data.errorMsg);
            }
          } else {
            let pre_edu_text = this.findDict(
              this.eduArray,
              this.stdRegInfo.std_edu
            );

            if(!String(this.stdRegInfo.school_id)){
              this.hideLoading(loading);
              this.can_submit=true;
              this.alert("主考院校id为空!");
              return;
            }

            // if(this.stdResumeList.length<3){
            //   this.alert("考生简历最少三条记录!");
            //   return;
            // }
            
            let { data } = await this.$http.post(
              "by/byApply/apply.htm",
              this.Qs.stringify({
                major_id: this.selected_major_id,
                std_source: this.stdRegInfo.std_source,
                school_id: this.stdRegInfo.school_id,
                // test TODO
                by_time_config_id: this.timeLimit.id,
                // remark: this.remark,
                std_sex: this.stdRegInfo.std_sex,
                native_prov: this.stdRegInfo.native_prov,
                native_city: this.stdRegInfo.native_city,
                nation: this.stdRegInfo.std_nation,
                political: this.stdRegInfo.political_status,
                pre_edu: pre_edu_text,
                work_unit: this.stdRegInfo.std_work_unit,
                address: this.stdRegInfo.std_address,
                post_code: this.stdRegInfo.std_postcode,
                diaplma_no: this.diaplma_no,
                std_birth_str: this.stdRegInfo.std_birth,
                telephone: this.stdRegInfo.std_mobile,
                diaplmaNo:this.diaplmaNo,
                is_xuexin_pass:this.isXueXinWPass == true?1:0,
                order_org_id:this.order_org_id,
                by_photo:this.by_photo_url_p,
                 by_photo_path:this.by_photo_path,
                by_photo_id:this.by_photo_id,
                by_file:this.by_file,
                by_file_two:this.by_file_two,
                by_file_three:this.by_file_three,
                by_file_four:this.by_file_four,
                by_file_five:this.by_file_five,
                score_file:this.score_file,
                score_file_two:this.score_file_two,
                score_file_three:this.score_file_three,
                score_file_four:this.score_file_four,
                score_file_five:this.score_file_five,
                cert_file:this.cert_file,
                cert_file_two:this.cert_file_two,
                std_by_photo:this.std_by_photo,
                resumeJson: JSON.stringify(this.stdResumeList)
                //JSON.stringify(this.stdResumeList)
              }),
              this.$http.headers.FORM
            );
            this.hideLoading(loading);
            this.can_submit=true;
            if (data.success) {
              this.alert("提交成功");
              this.init();
              this.$nextTick(() => {
                this.applyDialogVisible = false;
              });
            } else {
             
              this.hideLoading(loading);
              this.can_submit=true;
              this.alert(data.errorMsg);
              return false;
            }
          }
        } else {
          this.hideLoading(loading);
          this.can_submit=true;
          this.alert("请完成必填项!");
          return false;
        }
        
      });
    },
    colseWin() {
      this.applyDialogVisible = false;
      this.curStep = 1;
      this.selected_major_id = null;
      this.applyInfoConfirm = false;
      this.stdRegInfo.major_level = "";
      this.stdRegInfo.school_id = "";

      this.initStdApplyInfo();
    },

    async schoolChange(school_id){
     let sch =  _.find(this.orgArray_std_source_3,(item,index)=>{
        return item.id == school_id;
      })
      ;
      if(sch){
        this.school_name = sch.org_code + "-" + sch.org_name;
      }
    },

    async initSchoolName(major_id){
      if(!major_id)return;
      let orgArray = [];
      this.stdRegInfo.school_id = "";
      let res = await this.$http.post("/std/cfOrganization/querySchoolListByMajorId.htm",
      this.Qs.stringify({
          major_id: major_id,
        }));
      orgArray = res.data.array;
      // 
      if(orgArray.length >=0){
        this.stdRegInfo.school_id = orgArray[0].id;
        this.school_name = orgArray[0].org_code + "-" + orgArray[0].org_name;
        // this.stdRegInfo.school_id = this.orgArray[0].id;
      }
    },

    async std_sourceChange(std_source){
       
       if(std_source == '3'){
          // 清空主考学校
          this.stdRegInfo.school_id = null;
       }
        //非助学班返回
        // console.log("std_source:"+std_source+" orgArray_std_source_3:"+this.orgArray_std_source_3.length);
        if(std_source != '3' || this.orgArray_std_source_3.length >0){
          //社会考生 联动主考院校名称
          if(String(this.selected_major_id)){
            this.majorChange(this.selected_major_id);
          }

          return;
        }
     
       
        
        //请求所有主考院校数据
        let res = await this.$http.post("/std/cfOrganization/listOrderBy.htm",
          this.Qs.stringify({
            org_type: 1,
          }));

          this.orgArray_std_source_3 = res.data.array;

    },
    async majorChange(major_id){
      if(!String(major_id))return;
      this.school_name = "";
      this.initOldMajor(major_id);
      if(String(this.stdRegInfo.std_source) != "1")  return;
      this.initSchoolName(major_id);
    },
    async initOldMajor(major_id){
      
      let res = await this.$http.post("/by/byApply/getOlaMajorInfoBynewMajorId.htm",
          this.Qs.stringify({
            major_id: major_id,
          }));
          this.oldMajorArray = res.data.array;
      // let major = res.data.map;

      // if(major){
      //   this.oldMajorInfo =  major.major_code + "-" + major.major_name;
      // }else{
      //   this.oldMajorInfo = "无";
      // }
      // console.log(this.oldMajorInfo);
      
    },
    //初始化
    async initNewMajor(major_id){
        let res = await this.$http.post("/by/byApply/getNewMajorInfoByOldMajorId.htm",
          this.Qs.stringify({
            major_id: major_id,
          }));
          if(res.data.array.length >0){
            let major = res.data.array[0];
            this.newMajorInfo = major.major_code + major.major_name;
            this.selected_major_id = major.id;
            this.majorChange(major.id);
          }
    },

    

    async majorLevelChange(value){
     if(!value){ return;}
    //  if(!this.firstLoad)
     this.stdRegInfo.major_id = "";
     this.selected_major_id = null;
     this.oldMajorArray = [];
     this.school_name = "";

     let loading = this.showLoading();
 
     this.byMajorArray = this.$options.filters["dataArrayFilter"](this.byMajorArraySource, {
          major_level:parseInt(value)
        });

     this.hideLoading(loading);
   },

   provChange(name){
      if(!name) return;
      let loading = this.showLoading();

      this.stdRegInfo.native_city= '';
      let prov = _.find(this.prov_city_data,(item)=>{
        return item.areaName == name;
      });
      this.city_data = prov.cities;

      // this.$forceUpdate();
      this.hideLoading(loading);

    },

    cityChange(name){
       if(!name) return;
       this.stdRegInfo.native_city = String(name);
       this.$forceUpdate();


    },
    toUploadByImg(){
      this.imgUploadDialogVisible = true;
      this.$forceUpdate();
    },

     // 图片操作--------------------------------
    chooseFile() {
      this.$refs["uploadBtn"].click();
    },
    changeImg() {
      this.option.img = this.lists[~~(Math.random() * this.lists.length)].img;
    },
    startCrop() {
      // start
      this.crap = true;
      this.$refs.cropper.startCrop();
    },
    stopCrop() {
      //  stop
      this.crap = false;
      this.$refs.cropper.stopCrop();
    },
    clearCrop() {
      // clear
      this.$refs.cropper.clearCrop();
    },
    refreshCrop() {
      // clear
      this.$refs.cropper.refresh();
    },
    changeScale(num) {
      num = num || 1;
      this.$refs.cropper.changeScale(num);
    },
    rotateLeft() {
      this.$refs.cropper.rotateLeft();
    },
    rotateRight() {
      this.$refs.cropper.rotateRight();
    },

    //下载图片
    down(type) { 
        console.log('down')
        var aLink = document.createElement('a') 
        aLink.download = 'author-img' 
        if (type === 'blob') { 
          this.$refs.cropper.getCropBlob((data) => { 
            this.downImg = window.URL.createObjectURL(data)
            aLink.href = window.URL.createObjectURL(data) 
            aLink.click() 
          }) 
        } else { 
          this.$refs.cropper.getCropData((data) => { 
            this.downImg = data;
            aLink.href = data; 
            aLink.click() 
          }) 
        } 
    }, 
    finish(type) {
      // 输出
      // var test = window.open('about:blank')
      // test.document.body.innerHTML = '图片生成中..'
      if (type === "blob") {
        this.$refs.cropper.getCropBlob(data => {
          var img = window.URL.createObjectURL(data);
          this.model = true;
          this.modelSrc = img;
        });
      } else {
        this.$refs.cropper.getCropData(data => {
          this.model = true;
          this.modelSrc = data;
        });
      }
    },
    //上传图片到剪切板
    uploadImg(e, num) {
      console.log("uploadImg");
      let _this = this;
      //上传图片
      let file = e.target.files[0];
      _this.fileName = file.name;
      if (!/\.(gif|jpg|jpeg|png|bmp|GIF|JPG|PNG)$/.test(e.target.value)) {
        this.alert("图片类型必须是.gif,jpeg,jpg,png,bmp中的一种", "信息提示");
        return false;
      }
      let reader = new FileReader();
      reader.onload = e => {
        let data;
        if (typeof e.target.result === "object") {
          // 把Array Buffer转化为blob 如果是base64不需要
          data = window.URL.createObjectURL(new Blob([e.target.result]));
        } else {
          data = e.target.result;
        }
        if (num === 1) {
          _this.option.img = data;
        } else if (num === 2) {
          _this.example2.img = data;
        }
      };
      // 转化为base64
      // reader.readAsDataURL(file)
      // 转化为blob
      reader.readAsArrayBuffer(file);
    },
    // 实时预览函数
    realTime(data) {
      var previews = data;
      var h = 0.5;
      var w = 0.2;

      this.previewStyle1 = {
        width: previews.w + "px",
        height: previews.h + "px",
        overflow: "hidden",
        margin: "0",
        zoom: h
      };

      this.previewStyle2 = {
        width: previews.w + "px",
        height: previews.h + "px",
        overflow: "hidden",
        margin: "0",
        zoom: w
      };
      if (data.url) {
        // data.img['position'] = 'absolute';
        data.img["left"] = "490px";
      }
     
      data.img['margin-right']='29px';
      this.previews = data;
    },
    cropMoving(data) {
      this.option.cropData = data;
    },
    imgLoad(msg) {
      console.log(msg);
    },
    //剪裁图片完成上传
    finishUpload(type) {
      console.log("finish");
      let _this = this;
      let formData = new FormData();
      // 输出

      if(!this.$refs.cropper.imgs){
        this.alert("请选择图片再上传");
        return;
      }
      if (type === "blob") {
        this.$refs.cropper.getCropBlob(data => {
          
          let loading = this.showLoading();
          let img = window.URL.createObjectURL(data);
          _this.model = true;
          _this.modelSrc = img;
          formData.append("file", data, _this.fileName);
          _this.$http
            .post(`/pl/byApply/upload.htm`, formData, {
              contentType: false,
              processData: false,
              headers: { "Content-Type": "application/x-www-form-urlencoded" }
            })
            .then( res => {
              _this.hideLoading(loading);
              _this.by_photo_url_p =  res.data.map.file_path;
              _this.by_photo_path =  res.data.map.by_photo_path;
              _this.by_photo_id =  res.data.map.by_photo_id;
              _this.randomNum = new Date().getTime();

              if (res.data.success) {
                _this.$message({
                  type: "success",
                  message: "上传成功"
                });
               
              }else{
                 
                _this.alert(res.data.errorMsg, "信息提示");
              }
            });
        });
      } else {
        this.$refs.cropper.getCropData(data => {
          this.model = true;
          this.modelSrc = data;
        });
      }
   
    },

    // 上传附件 start
    handleRemove(file, fileList) {
      if (fileList.length == 0) {
          this.fileList = [];
      }
    },

    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning("只能上传五个附件!");
    },
    beforeUpload(file, fileList) {
      return true;
    },
    beforeRemove(file, fileList) {
      //解决删除上传 文件错误问题
     // this.$refs.upload.clearFiles();
    },
    handleChange(file, fileList) {
       if (fileList.length > 0) {
        this.fileList = fileList;
      } else {
        this.fileList = [];
      }

      //if (fileList.length > 0) {
       // this.by_file_item = file;
      //} else {
     //   this.by_file = "";
     // }
    },
    
    customUpload(file) {
      let this_ = this;
        this.fileUpload(file).then(response => {
          //上传成功提交表单
          if (response.data.success) {
            let filePath = response.data.entity;
             for (let i = 0; i < this_.fileList.length; i++) {
                const element = this_.fileList[i];
                if (element.uid == file.file.uid) {
                    
                       if (i == 0) {
                          this_.by_file = filePath;
                        } else if (i == 1) {
                          this_.by_file_two = filePath;
                        }  else if (i == 2) {
                          this_.by_file_three = filePath;
                        }  else if (i == 3) {
                          this_.by_file_four = filePath;
                        }  else if (i == 4) {
                          this_.by_file_five = filePath;
                        } 
                   
                }
              }
              
            
          } else {
            this.alert(response.data.errorMsg);
            //异常自动清除文件列表
           // this.$refs.upload.clearFiles();
          }
        });

        //解决删除上传 文件错误问题
        const prom = new Promise((resolve, reject) => {})
        prom.abort = () => {}
        return prom
    },

    fileUpload(fileobj) {
      let param = new FormData();
      param.append("file", fileobj.file);
      return this.$http.request({
        method: "post",
        url: "pl/byApply/uploadFile.htm",
        headers: { "Content-Type": "multipart/form-data" },
        data: param
      });
    },

      uploadStdByPhoto(fileobj) {
      let param = new FormData();
      param.append("file", fileobj.file);
      return this.$http.request({
        method: "post",
        url: "by/byApply/uploadStdByPhoto.htm",
        headers: { "Content-Type": "multipart/form-data" },
        data: param
      });
    },


    // 上传附件 start
    handleRemoveScore(file, fileList) {
      if (fileList.length == 0) {
        this.scorefileList = [];
      }
    },

    handlePreviewScore(file) {
      console.log(file);
    },
    handleExceedScore(files, fileList) {
      this.$message.warning("只能上传五个附件!");
    },
    beforeUploadScore(file, fileList) {
      return true;
    },
    beforeRemoveScore(file, fileList) {
      //解决删除上传 文件错误问题
     // this.$refs.uploadScore.clearFiles();
    },
    handleChangeScore(file, fileList) {
       if (fileList.length > 0) {
        this.scorefileList = fileList;
      } else {
        this.scorefileList = [];
      }

     // if (fileList.length > 0) {
     //   this.score_file_item = file;
     // } else {
     //   this.score_file = "";
     // }
    },
    
    customUploadScore(file) {
      let this_ = this;
        this.fileUpload(file).then(response => {
          //上传成功提交表单
          if (response.data.success) {
            let filePath = response.data.entity;
             for (let i = 0; i < this_.scorefileList.length; i++) {
                const element = this_.scorefileList[i];
                if (element.uid == file.file.uid) {

                      if (i == 0) {
                          this_.score_file = filePath;
                        } else if (i == 1) {
                          this_.score_file_two = filePath;
                        }  else if (i == 2) {
                          this_.score_file_three = filePath;
                        }  else if (i == 3) {
                          this_.score_file_four = filePath;
                        }  else if (i == 4) {
                          this_.score_file_five = filePath;
                        } 
                   
                }
              }

          } else {
            this.alert(response.data.errorMsg);
            //异常自动清除文件列表
          //  this.$refs.uploadScore.clearFiles();
          }
        });

        //解决删除上传 文件错误问题
        const prom = new Promise((resolve, reject) => {})
        prom.abort = () => {}
        return prom
    },




    
    // 上传附件 start
    handleRemoveCert(file, fileList) {
      if (fileList.length == 0) {
        this.certfileList = [];
      }
      
    },

    handlePreviewCert(file) {
      console.log(file);
    },
    handleExceedCert(files, fileList) {
      this.$message.warning("只能上传两个附件!");
    },
    beforeUploadCert(file, fileList) {
      return true;
    },
    beforeRemoveCert(file, fileList) {
      //解决删除上传 文件错误问题
     // this.$refs.uploadCert.clearFiles();
    },
    handleChangeCert(file, fileList) {
      if (fileList.length > 0) {
        this.certfileList = fileList;
      } else {
        this.certfileList = [];
      }

     // if (fileList.length > 0) {
    //    this.cert_file_item = file;
     // } else {
    //    this.cert_file = "";
     // }
    },
    
    customUploadCert(file) {
        let this_ = this;
        this.fileUpload(file).then(response => {
          //上传成功提交表单
          if (response.data.success) {
            let filePath = response.data.entity;

            for (let i = 0; i < this_.certfileList.length; i++) {
                const element = this_.certfileList[i];
                if (element.uid == file.file.uid) {
                    
                       if (i == 0) {
                          this_.cert_file = filePath;
                        } else if (i == 1) {
                          this_.cert_file_two = filePath;
                        } 
                   
                }
              }

           
          } else {
            this.alert(response.data.errorMsg);
            //异常自动清除文件列表
           // this.$refs.uploadCert.clearFiles();
          }
        });

        //解决删除上传 文件错误问题
        const prom = new Promise((resolve, reject) => {})
        prom.abort = () => {}
        return prom
    },



    
    // 上传附件 start
    handleRemoveStdByPhoto(file, fileList) {
      if (fileList.length == 0) {
        this.files = null;
      }
      this.stdbyphotofileList = [];
    },

    handlePreviewStdByPhoto(file) {
      console.log(file);
    },
    handleExceedStdByPhoto(files, fileList) {
      this.$message.warning("只能上传一个附件!");
    },
    beforeUploadStdByPhoto(file, fileList) {
      return true;
    },
    beforeRemoveStdByPhoto(file, fileList) {
      //解决删除上传 文件错误问题
      this.$refs.uploadStdByPhoto.clearFiles();
    },
    handleChangeStdByPhoto(file, fileList) {
      if (fileList.length > 0) {
        this.std_by_photo_item = file;
      } else {
        this.std_by_photo = "";
      }
    },
    
    customUploadStdByPhoto(file) {
        this.uploadStdByPhoto(file).then(response => {
          //上传成功提交表单
          if (response.data.success) {
            let filePath = response.data.entity;
            this.std_by_photo = filePath;
          } else {
            this.alert(response.data.errorMsg);
            //异常自动清除文件列表
            this.$refs.uploadStdByPhoto.clearFiles();
          }
        });

        //解决删除上传 文件错误问题
        const prom = new Promise((resolve, reject) => {})
        prom.abort = () => {}
        return prom
    },


    async downByApplyRegisterPdf(){
      let res = await this.$http({
        method: "post",
        url: `/by/byApply/downByApplyRegisterPdf.htm?id=`+this.selected_apply.id,
        responseType: "blob"
      });
      let fileName = null;
      
      if(this.stdReg.ticket_no){
        fileName = `${this.stdReg.ticket_no}${this.stdReg.std_name}-毕业生登记表.pdf`;
      }else{
        fileName = `毕业生登记表.pdf`;
      }
      if (window.navigator.msSaveBlob) {
        try {
          var blobObject = new Blob([res.data]);
          window.navigator.msSaveBlob(blobObject, fileName);
        } catch (e) {
          console.log(e);
        }
      } else {
        let loading = this.showLoading();
        let url = window.URL.createObjectURL(new Blob([res.data]));
        let link = document.createElement("a");
        link.style.display = "none";
        link.href = url;
        link.setAttribute("download", fileName);

        document.body.appendChild(link);
        link.click();
        this.hideLoading(loading);
      }
    },

    async downByPhoto(id){
      let res = await this.$http({
        method: "post",
        url: `/by/byApply/downByPhoto.htm?id=`+id,
        responseType: "blob"
      });
      let fileName = null;
      
      if(this.stdReg.ticket_no){
        fileName = `${this.stdReg.ticket_no}${this.stdReg.std_name}-毕业照片.jpg`;
      }else{
        fileName = `-毕业照片.jpg`;
      }
      if (window.navigator.msSaveBlob) {
        try {
          var blobObject = new Blob([res.data]);
          window.navigator.msSaveBlob(blobObject, fileName);
        } catch (e) {
          console.log(e);
        }
      } else {
        let loading = this.showLoading();
        let url = window.URL.createObjectURL(new Blob([res.data]));
        let link = document.createElement("a");
        link.style.display = "none";
        link.href = url;
        link.setAttribute("download", fileName);

        document.body.appendChild(link);
        link.click();
        this.hideLoading(loading);
      }
    },

    

}

  
  
};
</script>

<style lang="scss" scoped>
@import "~@/assets/style/public.scss";
#by_apply {
  .el-dialog__body {
    padding: 5px !important;
  }
  .vue-cropper {
    height: 490px;
    width: 400px;
  }
  .show-preview {
    border: 1px solid #6fb8ff;
  }
}
</style>
