|  | @@ -0,0 +1,444 @@
 | 
	
		
			
				|  |  | +<template>
 | 
	
		
			
				|  |  | +  <div class="app-container bg-page fx-column fx-cen-cen">
 | 
	
		
			
				|  |  | +    <el-card shadow="never" class="bg-white vs-index-card index-block">
 | 
	
		
			
				|  |  | +      <template #header>
 | 
	
		
			
				|  |  | +        <el-steps :active="step" finish-status="success" simple>
 | 
	
		
			
				|  |  | +          <el-step title="1、请确定您的个人信息" class="pointer" @click.native="step=0" />
 | 
	
		
			
				|  |  | +          <el-step title="2、请确定您的家庭情况" class="pointer" @click.native="handleJump(1)" />
 | 
	
		
			
				|  |  | +          <el-step title="3、请确定您的升学意向" class="pointer" @click.native="handleJump(2)" />
 | 
	
		
			
				|  |  | +        </el-steps>
 | 
	
		
			
				|  |  | +      </template>
 | 
	
		
			
				|  |  | +      <el-form v-show="step==0" ref="form0" :model="form0" :rules="rule0" label-width="120px">
 | 
	
		
			
				|  |  | +        <div class="pl60 mb20">
 | 
	
		
			
				|  |  | +          <span class="f-333 f20 bold">请确定您的个人信息</span>
 | 
	
		
			
				|  |  | +          <span class="f-999 f18">(基础信息是保证测评结果准确的关键请您认真填写,平台将对您的信息进行严格保密)</span>
 | 
	
		
			
				|  |  | +        </div>
 | 
	
		
			
				|  |  | +        <el-form-item prop="gender" label="性别">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="gender" v-model="form0.gender">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.multiple_way_gender" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="age" label="年龄">
 | 
	
		
			
				|  |  | +          <el-input-number ref="age" v-model="form0.age" :min="10" :max="50" controls-position="right" />
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="nation" label="民族">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="nation" v-model="form0.nation">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.multiple_way_nation" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="course0" label="科类">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="course0" v-model="form0.course0">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.multiple_way_course0" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="score" label="成绩">
 | 
	
		
			
				|  |  | +          <el-select ref="score" v-model="form0.score">
 | 
	
		
			
				|  |  | +            <el-option
 | 
	
		
			
				|  |  | +              v-for="item in dict.type.multiple_way_score"
 | 
	
		
			
				|  |  | +              :key="item.value"
 | 
	
		
			
				|  |  | +              :label="item.label"
 | 
	
		
			
				|  |  | +              :value="item.value"
 | 
	
		
			
				|  |  | +            />
 | 
	
		
			
				|  |  | +          </el-select>
 | 
	
		
			
				|  |  | +          <span class="ml12 f-999">以满分750为准</span>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="foreignL" label="外语语种">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="foreignL" v-model="form0.foreignL">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.multiple_way_foreign_language" :key="item.value" :label="item.value">
 | 
	
		
			
				|  |  | +              {{ item.label }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="foreignLScore" label="外语成绩">
 | 
	
		
			
				|  |  | +          <el-input-number
 | 
	
		
			
				|  |  | +            ref="foreignLScore"
 | 
	
		
			
				|  |  | +            v-model="form0.foreignLScore"
 | 
	
		
			
				|  |  | +            :min="0"
 | 
	
		
			
				|  |  | +            :max="150"
 | 
	
		
			
				|  |  | +            controls-position="right"
 | 
	
		
			
				|  |  | +          />
 | 
	
		
			
				|  |  | +          <span class="ml12 f-999">以满分150为准</span>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="foreignLSpoken" label="外语口语考试">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="foreignLSpoken" v-model="form0.foreignLSpoken">
 | 
	
		
			
				|  |  | +            <el-radio
 | 
	
		
			
				|  |  | +              v-for="item in dict.type.multiple_way_foreign_language_spoken"
 | 
	
		
			
				|  |  | +              :key="item.value"
 | 
	
		
			
				|  |  | +              :label="item.value"
 | 
	
		
			
				|  |  | +            >{{ item.label }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="height" label="身高">
 | 
	
		
			
				|  |  | +          <el-input-number ref="height" v-model="form0.height" :min="0" :max="300" controls-position="right" />
 | 
	
		
			
				|  |  | +          <span class="ml12 f-999">厘米(CM)</span>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="weight" label="体重">
 | 
	
		
			
				|  |  | +          <el-input-number ref="weight" v-model="form0.weight" :min="0" :max="200" controls-position="right" />
 | 
	
		
			
				|  |  | +          <span class="ml12 f-999">公斤(KG)</span>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item label="视力">
 | 
	
		
			
				|  |  | +          <div class="fx-row">
 | 
	
		
			
				|  |  | +            <span class="mr12 f12">左眼</span>
 | 
	
		
			
				|  |  | +            <el-form-item prop="eyesightL">
 | 
	
		
			
				|  |  | +              <el-input-number
 | 
	
		
			
				|  |  | +                ref="eyesightL"
 | 
	
		
			
				|  |  | +                v-model="form0.eyesightL"
 | 
	
		
			
				|  |  | +                :step="0.1"
 | 
	
		
			
				|  |  | +                :precision="1"
 | 
	
		
			
				|  |  | +                :min="0"
 | 
	
		
			
				|  |  | +                :max="5"
 | 
	
		
			
				|  |  | +                controls-position="right"
 | 
	
		
			
				|  |  | +              />
 | 
	
		
			
				|  |  | +            </el-form-item>
 | 
	
		
			
				|  |  | +            <span class="ml20 mr12 f12">右眼</span>
 | 
	
		
			
				|  |  | +            <el-form-item prop="eyesightR">
 | 
	
		
			
				|  |  | +              <el-input-number
 | 
	
		
			
				|  |  | +                ref="eyesightR"
 | 
	
		
			
				|  |  | +                v-model="form0.eyesightR"
 | 
	
		
			
				|  |  | +                :step="0.1"
 | 
	
		
			
				|  |  | +                :precision="1"
 | 
	
		
			
				|  |  | +                :min="0"
 | 
	
		
			
				|  |  | +                :max="5"
 | 
	
		
			
				|  |  | +                controls-position="right"
 | 
	
		
			
				|  |  | +              />
 | 
	
		
			
				|  |  | +            </el-form-item>
 | 
	
		
			
				|  |  | +            <span class="ml12 f-999">C字表,以满分5.0为准</span>
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="disease" label="疾病情况">
 | 
	
		
			
				|  |  | +          <el-checkbox-group ref="disease" v-model="form0.disease">
 | 
	
		
			
				|  |  | +            <el-checkbox v-for="item in dict.type.multiple_way_disease" :key="item.value" :label="item.value">
 | 
	
		
			
				|  |  | +              {{ item.label }}
 | 
	
		
			
				|  |  | +              <el-popover v-if="item.raw.remark" trigger="hover" popper-class="multiple-way-pop">
 | 
	
		
			
				|  |  | +                {{ item.raw.remark }}
 | 
	
		
			
				|  |  | +                <i slot="reference" class="el-icon-question" />
 | 
	
		
			
				|  |  | +              </el-popover>
 | 
	
		
			
				|  |  | +            </el-checkbox>
 | 
	
		
			
				|  |  | +          </el-checkbox-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item>
 | 
	
		
			
				|  |  | +          <el-button v-loading="loading" type="primary" class="step-button" @click="handleNext(0)">下一步</el-button>
 | 
	
		
			
				|  |  | +          <el-button v-has-history v-loading="loading" class="step-button" @click="$router.back()">返回</el-button>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +      <el-form v-show="step==1" ref="form1" :model="form1" :rules="rule1" label-width="220px">
 | 
	
		
			
				|  |  | +        <div class="pl60 mb20">
 | 
	
		
			
				|  |  | +          <span class="f-333 f20 bold">请确定您的家庭情况</span>
 | 
	
		
			
				|  |  | +          <span class="f-999 f18">(家庭环境信息是保证测评结果准确的关键请您认真填写,平台将对您的信息进行严格保密)</span>
 | 
	
		
			
				|  |  | +        </div>
 | 
	
		
			
				|  |  | +        <el-form-item label="户籍所在县市">
 | 
	
		
			
				|  |  | +          <div class="fx-row">
 | 
	
		
			
				|  |  | +            <el-form-item prop="province">
 | 
	
		
			
				|  |  | +              <el-select ref="province" v-model="form1.province" filterable @change="getCity">
 | 
	
		
			
				|  |  | +                <el-option v-for="item in provinces" :key="item.id" :label="item.name" :value="item.id" />
 | 
	
		
			
				|  |  | +              </el-select>
 | 
	
		
			
				|  |  | +            </el-form-item>
 | 
	
		
			
				|  |  | +            <span class="ml20 mr12">所在城市</span>
 | 
	
		
			
				|  |  | +            <el-form-item prop="city">
 | 
	
		
			
				|  |  | +              <el-select ref="city" v-model="form1.city" filterable @change="getDistrict">
 | 
	
		
			
				|  |  | +                <el-option v-for="item in cities" :key="item.id" :label="item.name" :value="item.id" />
 | 
	
		
			
				|  |  | +              </el-select>
 | 
	
		
			
				|  |  | +            </el-form-item>
 | 
	
		
			
				|  |  | +            <el-form-item prop="district" class="ml12">
 | 
	
		
			
				|  |  | +              <el-select ref="district" v-model="form1.district">
 | 
	
		
			
				|  |  | +                <el-option v-for="item in districts" :key="item.id" :label="item.name" :value="item.id" />
 | 
	
		
			
				|  |  | +              </el-select>
 | 
	
		
			
				|  |  | +            </el-form-item>
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="nativeType" label="学生本人户籍类型">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="nativeType" v-model="form1.nativeType">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.multiple_way_native_type" :key="item.value" :label="item.value">
 | 
	
		
			
				|  |  | +              {{ item.label }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="nativeSWP" label="父母户籍是否与本人一致">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="nativeSWP" v-model="form1.nativeSWP">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.sys_yes_no" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="nativeLocal" label="户籍、学籍高中是否在本地">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="nativeLocal" v-model="form1.nativeLocal">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.sys_yes_no" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="feeExpectable" label="可接受学费范围">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="feeExpectable" v-model="form1.feeExpectable">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.multiple_way_fee_expectable" :key="item.value" :label="item.value">
 | 
	
		
			
				|  |  | +              {{ item.label }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="criminalRecords" label="三代直系亲属是否有刑事记录">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="criminalRecords" v-model="form1.criminalRecords">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.sys_yes_no" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="frontierChildren" label="是否为边防子女">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="frontierChildren" v-model="form1.frontierChildren">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.sys_yes_no" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item>
 | 
	
		
			
				|  |  | +          <el-button v-loading="loading" type="primary" class="step-button" @click="handleNext(1)">下一步</el-button>
 | 
	
		
			
				|  |  | +          <el-button v-loading="loading" class="step-button" @click="handlePrev">上一步</el-button>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +      <el-form v-show="step==2" ref="form2" :model="form2" :rules="rule2" label-width="120px">
 | 
	
		
			
				|  |  | +        <div class="pl60 mb20">
 | 
	
		
			
				|  |  | +          <span class="f-333 f20 bold">请确定您的升学意向</span>
 | 
	
		
			
				|  |  | +          <span class="f-999 f18">(个人信息是保证测评结果准确的关键请您认真填写,平台将对您的信息进行严格保密)</span>
 | 
	
		
			
				|  |  | +        </div>
 | 
	
		
			
				|  |  | +        <el-form-item prop="toBeTeacher" label="师范生意向">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="toBeTeacher" v-model="form2.toBeTeacher">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.sys_yes_no" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="toBeGraduate" label="考研意向">
 | 
	
		
			
				|  |  | +          <el-radio-group ref="toBeGraduate" v-model="form2.toBeGraduate">
 | 
	
		
			
				|  |  | +            <el-radio v-for="item in dict.type.sys_yes_no" :key="item.value" :label="item.value">{{
 | 
	
		
			
				|  |  | +              item.label
 | 
	
		
			
				|  |  | +            }}
 | 
	
		
			
				|  |  | +            </el-radio>
 | 
	
		
			
				|  |  | +          </el-radio-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="awards" label="奖项/荣誉情况">
 | 
	
		
			
				|  |  | +          <el-checkbox-group ref="awards" v-model="form2.awards">
 | 
	
		
			
				|  |  | +            <el-checkbox v-for="item in dict.type.multiple_way_awards" :key="item.value" :label="item.value">
 | 
	
		
			
				|  |  | +              {{ item.label }}
 | 
	
		
			
				|  |  | +              <el-popover v-if="item.raw.remark" trigger="hover" popper-class="multiple-way-pop">
 | 
	
		
			
				|  |  | +                {{ item.raw.remark }}
 | 
	
		
			
				|  |  | +                <i slot="reference" class="el-icon-question" />
 | 
	
		
			
				|  |  | +              </el-popover>
 | 
	
		
			
				|  |  | +            </el-checkbox>
 | 
	
		
			
				|  |  | +          </el-checkbox-group>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item>
 | 
	
		
			
				|  |  | +          <el-button v-loading="loading" type="primary" class="step-button" @click="handleSave(2)">查看报告</el-button>
 | 
	
		
			
				|  |  | +          <el-button v-loading="loading" class="step-button" @click="handlePrev">上一步</el-button>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +    </el-card>
 | 
	
		
			
				|  |  | +  </div>
 | 
	
		
			
				|  |  | +</template>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<script>
 | 
	
		
			
				|  |  | +import { getMultipleWayArea, submitMultipleWayForm } from '@/api/webApi/multiple-way'
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +export default {
 | 
	
		
			
				|  |  | +  name: 'MultipleWayForm',
 | 
	
		
			
				|  |  | +  dicts: ['multiple_way_gender', 'multiple_way_nation', 'multiple_way_course0', 'multiple_way_score',
 | 
	
		
			
				|  |  | +    'multiple_way_foreign_language', 'multiple_way_foreign_language_spoken', 'multiple_way_disease',
 | 
	
		
			
				|  |  | +    'multiple_way_native_type', 'multiple_way_fee_expectable', 'multiple_way_awards', 'sys_yes_no'],
 | 
	
		
			
				|  |  | +  data() {
 | 
	
		
			
				|  |  | +    return {
 | 
	
		
			
				|  |  | +      loading: false,
 | 
	
		
			
				|  |  | +      step: 0,
 | 
	
		
			
				|  |  | +      form0: {
 | 
	
		
			
				|  |  | +        gender: null,
 | 
	
		
			
				|  |  | +        age: 18,
 | 
	
		
			
				|  |  | +        nation: null,
 | 
	
		
			
				|  |  | +        course0: null,
 | 
	
		
			
				|  |  | +        score: null,
 | 
	
		
			
				|  |  | +        foreignL: null,
 | 
	
		
			
				|  |  | +        foreignLScore: 0,
 | 
	
		
			
				|  |  | +        foreignLSpoken: null,
 | 
	
		
			
				|  |  | +        height: 0,
 | 
	
		
			
				|  |  | +        weight: 0,
 | 
	
		
			
				|  |  | +        eyesightL: 0,
 | 
	
		
			
				|  |  | +        eyesightR: 0,
 | 
	
		
			
				|  |  | +        disease: ['无疾病']
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      rule0: {
 | 
	
		
			
				|  |  | +        gender: [{ required: true, message: '请选择性别' }],
 | 
	
		
			
				|  |  | +        age: [{ required: true, message: '请输入年龄' }],
 | 
	
		
			
				|  |  | +        nation: [{ required: true, message: '请选择民族' }],
 | 
	
		
			
				|  |  | +        course0: [{ required: true, message: '请选择科类' }],
 | 
	
		
			
				|  |  | +        score: [{ required: true, message: '请选择分数情况' }],
 | 
	
		
			
				|  |  | +        foreignL: [{ required: true, message: '请选择外语语种' }],
 | 
	
		
			
				|  |  | +        foreignLScore: [{ required: true, message: '请输入英语成绩' }],
 | 
	
		
			
				|  |  | +        foreignLSpoken: [{ required: true, message: '请选择外语口语考试情况' }],
 | 
	
		
			
				|  |  | +        height: [{ required: true, message: '请输入身高' }],
 | 
	
		
			
				|  |  | +        weight: [{ required: true, message: '请输入体重' }],
 | 
	
		
			
				|  |  | +        eyesightL: [{ required: true, message: '请输入左眼视力' }],
 | 
	
		
			
				|  |  | +        eyesightR: [{ required: true, message: '请输入右眼视力' }],
 | 
	
		
			
				|  |  | +        disease: [{ required: true, message: '请选择疾病情况' }, {
 | 
	
		
			
				|  |  | +          validator: (r, v, cb) => {
 | 
	
		
			
				|  |  | +            if (v.includes('无疾病') && v.length > 1) cb('无疾病不能与其它选项同时选择')
 | 
	
		
			
				|  |  | +            else cb() // NOTE: PC must call this function while valid
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }]
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      form1: {
 | 
	
		
			
				|  |  | +        province: null,
 | 
	
		
			
				|  |  | +        city: null,
 | 
	
		
			
				|  |  | +        district: null,
 | 
	
		
			
				|  |  | +        nativeType: null,
 | 
	
		
			
				|  |  | +        nativeSWP: null,
 | 
	
		
			
				|  |  | +        nativeLocal: null,
 | 
	
		
			
				|  |  | +        feeExpectable: null,
 | 
	
		
			
				|  |  | +        criminalRecords: null,
 | 
	
		
			
				|  |  | +        frontierChildren: null
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      rule1: {
 | 
	
		
			
				|  |  | +        province: [{ required: true, message: '请选择省份' }],
 | 
	
		
			
				|  |  | +        city: [{ required: true, message: '请选择城市' }],
 | 
	
		
			
				|  |  | +        district: [{ required: true, message: '请选择区/县' }],
 | 
	
		
			
				|  |  | +        nativeType: [{ required: true, message: '请选择户籍类型' }],
 | 
	
		
			
				|  |  | +        nativeSWP: [{ required: true, message: '请选择父母户籍是否与本人一致' }],
 | 
	
		
			
				|  |  | +        nativeLocal: [{ required: true, message: '请选择户籍、学籍高中是否在本地' }],
 | 
	
		
			
				|  |  | +        feeExpectable: [{ required: true, message: '请选择可接受学费范围' }],
 | 
	
		
			
				|  |  | +        criminalRecords: [{ required: true, message: '请选择三代直系亲属是否有刑事记录' }],
 | 
	
		
			
				|  |  | +        frontierChildren: [{ required: true, message: '请选择是否为边防子女' }]
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      form2: {
 | 
	
		
			
				|  |  | +        toBeTeacher: null,
 | 
	
		
			
				|  |  | +        toBeGraduate: null,
 | 
	
		
			
				|  |  | +        awards: ['无']
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      rule2: {
 | 
	
		
			
				|  |  | +        toBeTeacher: [{ required: true, message: '请选择师范生意向' }],
 | 
	
		
			
				|  |  | +        toBeGraduate: [{ required: true, message: '请选择考研意向' }],
 | 
	
		
			
				|  |  | +        awards: [{ required: true, message: '请选择奖项/荣誉情况' }, {
 | 
	
		
			
				|  |  | +          validator: (r, v, cb) => {
 | 
	
		
			
				|  |  | +            if (v.includes('无') && v.length > 1) cb('无不能与其它选项同时选择')
 | 
	
		
			
				|  |  | +            else cb() // NOTE: PC must call this function while valid
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }]
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      provinces: [],
 | 
	
		
			
				|  |  | +      cities: [],
 | 
	
		
			
				|  |  | +      districts: []
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  mounted() {
 | 
	
		
			
				|  |  | +    this.getProvince({ keyword: '' })
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  | +  methods: {
 | 
	
		
			
				|  |  | +    formErrorHandler(errors) {
 | 
	
		
			
				|  |  | +      const errorKeys = Object.keys(errors)
 | 
	
		
			
				|  |  | +      if (!errorKeys.length) return
 | 
	
		
			
				|  |  | +      const errorKeyDemo = errorKeys[0]
 | 
	
		
			
				|  |  | +      const errorEl = this.$refs[errorKeyDemo]?.$el
 | 
	
		
			
				|  |  | +      if (errorEl) this.$scrollTo(errorEl, { offset: -90 - 40 })
 | 
	
		
			
				|  |  | +      const errorDemo = errors[errorKeyDemo][0]?.message
 | 
	
		
			
				|  |  | +      if (errorDemo) setTimeout(() => this.msgError(errorDemo), 50)
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async validateForm(step) {
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const formName = 'form' + step
 | 
	
		
			
				|  |  | +        const form = this.$refs[formName]
 | 
	
		
			
				|  |  | +        if (form) await form.validate()
 | 
	
		
			
				|  |  | +      } catch (e) {
 | 
	
		
			
				|  |  | +        console.log('validation error', e)
 | 
	
		
			
				|  |  | +        this.formErrorHandler(e)
 | 
	
		
			
				|  |  | +        return Promise.reject(e)
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async handleNext(step) {
 | 
	
		
			
				|  |  | +      await this.validateForm(step)
 | 
	
		
			
				|  |  | +      this.step += 1
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async handlePrev() {
 | 
	
		
			
				|  |  | +      this.step -= 1
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async handleJump(step) {
 | 
	
		
			
				|  |  | +      if (this.step < step) {
 | 
	
		
			
				|  |  | +        for (let i = this.step; i < step; i++) {
 | 
	
		
			
				|  |  | +          this.step = i
 | 
	
		
			
				|  |  | +          await this.validateForm(i) // invalid form will stop here
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      this.step = step
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async getProvince() {
 | 
	
		
			
				|  |  | +      const res = await getMultipleWayArea()
 | 
	
		
			
				|  |  | +      this.provinces = res.data
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async getCity() {
 | 
	
		
			
				|  |  | +      this.form1.city = null
 | 
	
		
			
				|  |  | +      this.form1.district = null
 | 
	
		
			
				|  |  | +      this.cities = []
 | 
	
		
			
				|  |  | +      this.districts = []
 | 
	
		
			
				|  |  | +      const res = await getMultipleWayArea({ parentId: this.form1.province })
 | 
	
		
			
				|  |  | +      this.cities = res.data
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async getDistrict() {
 | 
	
		
			
				|  |  | +      this.form1.district = null
 | 
	
		
			
				|  |  | +      this.districts = []
 | 
	
		
			
				|  |  | +      const res = await getMultipleWayArea({ parentId: this.form1.city })
 | 
	
		
			
				|  |  | +      this.districts = res.data
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async handleSave(step) {
 | 
	
		
			
				|  |  | +      await this.validateForm(step)
 | 
	
		
			
				|  |  | +      const postForm = {
 | 
	
		
			
				|  |  | +        ...this.form0,
 | 
	
		
			
				|  |  | +        ...this.form1,
 | 
	
		
			
				|  |  | +        ...this.form2
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      if (postForm.disease) postForm.disease = postForm.disease.toString()
 | 
	
		
			
				|  |  | +      if (postForm.awards) postForm.awards = postForm.awards.toString()
 | 
	
		
			
				|  |  | +      postForm.provinceName = this.provinces.find(i => i.id == postForm.province)?.name
 | 
	
		
			
				|  |  | +      postForm.cityName = this.cities.find(i => i.id == postForm.city)?.name
 | 
	
		
			
				|  |  | +      postForm.districtName = this.districts.find(i => i.id == postForm.district)?.name
 | 
	
		
			
				|  |  | +      this.loading = true
 | 
	
		
			
				|  |  | +      try {
 | 
	
		
			
				|  |  | +        const res = await submitMultipleWayForm(postForm)
 | 
	
		
			
				|  |  | +        this.$router.push({ path: '/sygh/multiple-way/report', query: { formId: res.data }})
 | 
	
		
			
				|  |  | +      } finally {
 | 
	
		
			
				|  |  | +        this.loading = false
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</script>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +<style scoped>
 | 
	
		
			
				|  |  | +.step-button {
 | 
	
		
			
				|  |  | +  width: 140px;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/deep/ .el-form-item__label {
 | 
	
		
			
				|  |  | +  padding-right: 20px;
 | 
	
		
			
				|  |  | +  font-weight: 400;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</style>
 | 
	
		
			
				|  |  | +<style lang="scss">
 | 
	
		
			
				|  |  | +.multiple-way-pop {
 | 
	
		
			
				|  |  | +  max-width: 40vw;
 | 
	
		
			
				|  |  | +  background-color: rgba(0, 0, 0, 0.7) !important;
 | 
	
		
			
				|  |  | +  color: #FFFFFF !important;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/* 三角箭头 */
 | 
	
		
			
				|  |  | +.multiple-way-pop[x-placement^="bottom"] .popper__arrow::after,
 | 
	
		
			
				|  |  | +.multiple-way-pop[x-placement^="bottom"] .popper__arrow {
 | 
	
		
			
				|  |  | +  border-bottom-color: rgba(0, 0, 0, 0.7) !important;
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +</style>
 |