|
@@ -0,0 +1,482 @@
|
|
|
|
+<!-- 外国嘉宾 -->
|
|
|
|
+<template>
|
|
|
|
+ <van-nav-bar :title="lang[langType].signUp" left-arrow @click-left="onClickLeft" />
|
|
|
|
+ <div class="form">
|
|
|
|
+ <div>
|
|
|
|
+ <span style="font-size: 16px;margin-left: 10px;" v-text="lang[langType].signUp"></span>
|
|
|
|
+ </div>
|
|
|
|
+ <van-form ref="form" @submit="onSubmit" label-width="8em">
|
|
|
|
+ <!-- 国家/地区 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].countryRegionContent }]" required
|
|
|
|
+ v-model="formData.countryRegion" :placeholder="lang[langType].countryRegionContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].countryRegion"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 姓 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].lastNameContent }]" required
|
|
|
|
+ v-model="formData.lastName" :placeholder="lang[langType].lastNameContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].lastName"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 名 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].firstNameContent }]" required
|
|
|
|
+ v-model="formData.firstName" :placeholder="lang[langType].firstNameContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].firstName"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 性别 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].genderContent }]"
|
|
|
|
+ v-model="formData.gender" required :placeholder="lang[langType].genderContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].gender"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 生日 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].birthdayContent }]" clickable
|
|
|
|
+ right-icon="calendar-o" readonly @click="showBirthday = true" v-model="formData.birthday" required
|
|
|
|
+ :placeholder="lang[langType].birthdayContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].birthday"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-popup v-model:show="showBirthday" destroy-on-close round position="bottom">
|
|
|
|
+ <van-date-picker :confirm-button-text="lang[langType].confirm"
|
|
|
|
+ :cancel-button-text="lang[langType].cancel" @confirm="packerConfirm"
|
|
|
|
+ :title="lang[langType].birthday" @cancel="showBirthday = false" :min-date="new Date(1970, 0, 1)"
|
|
|
|
+ :max-date="new Date()" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <!-- 照片 -->
|
|
|
|
+ <van-field input-align="right" :placeholder="lang[langType].photoContent" required
|
|
|
|
+ :rules="[{ required: true, trigger: 'onChange', message: lang[langType].photoContent }]"
|
|
|
|
+ v-model="formData.photoUrl">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].photo"></span>
|
|
|
|
+ </template>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-uploader :preview-full-image="false" accept="image/*" v-model="photo"
|
|
|
|
+ :before-delete="beforeDelete" :max-count="1" :max-size="524288000" @oversize="filesize"
|
|
|
|
+ :after-read="beforeRead" result-type="file">
|
|
|
|
+ </van-uploader>
|
|
|
|
+ <p style="font-size: 12px;" v-text="lang[langType].photoSubContent"> </p>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 手机号 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].contactContent }]"
|
|
|
|
+ v-model="formData.contact" type="number" required :placeholder="lang[langType].contactContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].contact"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 邮箱 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].emailContent }]" required
|
|
|
|
+ v-model="formData.email" :placeholder="lang[langType].emailContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].email"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 紧急联系人 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.emergencyContact"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].emergencyContactContent }]"
|
|
|
|
+ required :placeholder="lang[langType].emergencyContactContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].emergencyContact"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 紧急联系人电话 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.emergencyContactPhone" required
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].emergencyContactPhoneContent }]"
|
|
|
|
+ :placeholder="lang[langType].emergencyContactPhoneContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''"
|
|
|
|
+ v-html="lang[langType].emergencyContactPhone"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 证件类型 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.cardTypeName" clickable
|
|
|
|
+ :rules="[{ required: true, trigger: 'onChange', message: lang[langType].conferenceTypeContent }]"
|
|
|
|
+ right-icon="calendar-o" readonly :placeholder="lang[langType].conferenceTypeContent"
|
|
|
|
+ @click="showCardType = true" required>
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].conferenceType"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-popup v-model:show="showCardType" destroy-on-close round position="bottom">
|
|
|
|
+ <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
|
|
|
|
+ :model-value="formData.cardType" :columns="cardTypeList" @cancel="showCardType = false"
|
|
|
|
+ @confirm="onConfirm" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <!-- 证件 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].passportContent }]"
|
|
|
|
+ v-model="formData.passport" required :placeholder="lang[langType].passportContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].passport"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 宗教 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].beliefContent }]"
|
|
|
|
+ v-model="formData.belief" required :placeholder="lang[langType].beliefContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].belief"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 饮食要求 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.catering" rows="3" autosize
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].cateringContent }]"
|
|
|
|
+ type="textarea" required :placeholder="lang[langType].cateringContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].catering"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <div style="background-color: #F7F7F7;height: 10px;"></div>
|
|
|
|
+
|
|
|
|
+ <!-- 工作单位 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].workUnit }]" required
|
|
|
|
+ v-model="formData.workUnit" :placeholder="lang[langType].companyContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].company"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 单位类型 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.unitTypeName" clickable
|
|
|
|
+ :rules="[{ required: true, trigger: 'onChange', message: lang[langType].unitTypeContent }]"
|
|
|
|
+ right-icon="calendar-o" readonly :placeholder="lang[langType].unitTypeContent"
|
|
|
|
+ @click="showUnitType = true" required>
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].unitType"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-popup v-model:show="showUnitType" destroy-on-close round position="bottom">
|
|
|
|
+ <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
|
|
|
|
+ :model-value="formData.unitType" :columns="unitTypeList" @cancel="showUnitType = false"
|
|
|
|
+ @confirm="onUnitTypeConfirm" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <!-- 职务 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.career"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].careerContent }]" required
|
|
|
|
+ :placeholder="lang[langType].careerContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].career"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 传真 -->
|
|
|
|
+ <van-field input-align="right"
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].faxContent }]"
|
|
|
|
+ v-model="formData.fax" required :placeholder="lang[langType].faxContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].fax"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 办公地址 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.officeAddress" rows="3" autosize required
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].officeAddressContent }]"
|
|
|
|
+ type="textarea" :placeholder="lang[langType].officeAddressContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].officeAddress"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <div style="background-color: #F7F7F7;height: 10px;"></div>
|
|
|
|
+ <!-- 接受采访意向 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.interview" required
|
|
|
|
+ :rules="[{ required: true, trigger: 'onBlur', message: lang[langType].interviewContent }]"
|
|
|
|
+ :placeholder="lang[langType].interviewContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].interview"></span>
|
|
|
|
+ </template>
|
|
|
|
+ <template #input>
|
|
|
|
+ <van-radio-group style="justify-content: flex-end;width: 100%;" v-model="formData.interview"
|
|
|
|
+ direction="horizontal">
|
|
|
|
+ <van-radio :name="lang[langType].confirm">{{ lang[langType].confirm }}</van-radio>
|
|
|
|
+ <van-radio :name="lang[langType].cancel">{{ lang[langType].cancel }}</van-radio>
|
|
|
|
+ </van-radio-group>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <div style="background-color: #F7F7F7;height: 10px;"></div>
|
|
|
|
+
|
|
|
|
+ <!-- 抵达西安交通车次 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.reachTrainNumber"
|
|
|
|
+ :placeholder="lang[langType].reachTrainNumberContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].reachTrainNumber"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 抵达西安时间 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.reachTime" clickable right-icon="calendar-o" readonly
|
|
|
|
+ @click="showReachTime = true" :placeholder="lang[langType].reachTimeContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].reachTime"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-popup v-model:show="showReachTime" destroy-on-close round position="bottom">
|
|
|
|
+ <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
|
|
|
|
+ :title="lang[langType].reachTime" :columns="dateTimeColumns" @confirm="reachTimeConfirm"
|
|
|
|
+ @cancel="showReachTime = false" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <!-- 离开车次 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.leavingTrainNumber"
|
|
|
|
+ :placeholder="lang[langType].leavingTrainNumberContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].leavingTrainNumber"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+
|
|
|
|
+ <!-- 离开时间 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.leavingTime" clickable right-icon="calendar-o" readonly
|
|
|
|
+ @click="showLeavingTime = true" :placeholder="lang[langType].leavingTimeContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].leavingTime"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-popup v-model:show="showLeavingTime" destroy-on-close round position="bottom">
|
|
|
|
+ <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
|
|
|
|
+ :title="lang[langType].leavingTime" :columns="dateTimeColumns" @confirm="leavingTimeConfirm"
|
|
|
|
+ @cancel="showLeavingTime = false" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <!-- 离店时间 -->
|
|
|
|
+ <van-field input-align="right" v-model="formData.checkOutTime" clickable right-icon="calendar-o" readonly
|
|
|
|
+ @click="showCheckOutTime = true" :placeholder="lang[langType].checkOutTimeContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].checkOutTime"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <van-popup v-model:show="showCheckOutTime" destroy-on-close round position="bottom">
|
|
|
|
+ <van-picker :confirm-button-text="lang[langType].confirm" :cancel-button-text="lang[langType].cancel"
|
|
|
|
+ :title="lang[langType].checkOutTime" :columns="dateTimeColumns" @confirm="checkOutTimeConfirm"
|
|
|
|
+ @cancel="showCheckOutTime = false" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <van-field input-align="right" v-model="formData.message" rows="3" autosize type="textarea"
|
|
|
|
+ :placeholder="lang[langType].ortherNotesContent">
|
|
|
|
+ <template #label>
|
|
|
|
+ <span :class="langType === 'zh' ? 'label' : ''" v-html="lang[langType].ortherNotes"></span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-field>
|
|
|
|
+ <br />
|
|
|
|
+ <van-button
|
|
|
|
+ style="background: linear-gradient(270deg, #1D19BC 0%, #1C4CD5 100%);margin: 0 auto;width: calc(100% - 40px);"
|
|
|
|
+ block type="primary" native-type="submit">
|
|
|
|
+ {{ lang[langType].submit }}
|
|
|
|
+ </van-button>
|
|
|
|
+ </van-form>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script setup>
|
|
|
|
+import { defineEmits, defineProps, reactive, ref, computed, defineExpose } from 'vue';
|
|
|
|
+import { showToast, showDialog } from 'vant';
|
|
|
|
+import { saveData, uploadImage } from '@/api/2025.js';
|
|
|
|
+import lang from './lang.js';
|
|
|
|
+const props = defineProps(['langType','verificationCode', 'subData']);
|
|
|
|
+
|
|
|
|
+const emits = defineEmits(['closeComponent']);
|
|
|
|
+
|
|
|
|
+const formData = reactive({})
|
|
|
|
+const cardTypeList = computed(() => lang[props.langType].cardTypeList)
|
|
|
|
+const unitTypeList = computed(() => lang[props.langType].foreignCountryUnitType)
|
|
|
|
+const form = ref(null);
|
|
|
|
+const showBirthday = ref(false)
|
|
|
|
+const showReachTime = ref(false)
|
|
|
|
+const showLeavingTime = ref(false)
|
|
|
|
+const showCardType = ref(false)
|
|
|
|
+const showCheckOutTime = ref(false)
|
|
|
|
+const showUnitType = ref(false)
|
|
|
|
+const photo = ref([]);
|
|
|
|
+
|
|
|
|
+const onClickLeft = () => {
|
|
|
|
+ emits('closeComponent');
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const reset = () => {
|
|
|
|
+ form.value.resetValidation();
|
|
|
|
+}
|
|
|
|
+const createTextDate = values => values.slice(0, 3).join('-') + ' ' + values.slice(3).join(':');
|
|
|
|
+const packerConfirm = (values) => {
|
|
|
|
+ showBirthday.value = false;
|
|
|
|
+ formData.birthday = createTextDate(values.selectedValues);
|
|
|
|
+}
|
|
|
|
+const leavingTimeConfirm = ({ selectedValues }) => {
|
|
|
|
+ showLeavingTime.value = false;
|
|
|
|
+ formData.leavingTime = createTextDate(selectedValues);
|
|
|
|
+}
|
|
|
|
+const reachTimeConfirm = ({ selectedValues }) => {
|
|
|
|
+ showReachTime.value = false;
|
|
|
|
+ formData.reachTime = createTextDate(selectedValues);
|
|
|
|
+}
|
|
|
|
+const checkOutTimeConfirm = ({ selectedValues }) => {
|
|
|
|
+ showCheckOutTime.value = false;
|
|
|
|
+ formData.checkOutTime = createTextDate(selectedValues);
|
|
|
|
+}
|
|
|
|
+const onUnitTypeConfirm = (values) => {
|
|
|
|
+ showUnitType.value = false;
|
|
|
|
+ formData.unitType = values.selectedOptions[0].text;
|
|
|
|
+ formData.unitTypeName = values.selectedOptions[0].text;
|
|
|
|
+}
|
|
|
|
+const onConfirm = (values) => {
|
|
|
|
+ showCardType.value = false;
|
|
|
|
+ formData.cardType = values.selectedOptions[0].text;
|
|
|
|
+ formData.cardTypeName = values.selectedOptions[0].text;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 上传
|
|
|
|
+const beforeDelete = (index) => {
|
|
|
|
+ photo.value.splice(index, 1);
|
|
|
|
+ formData.photoUrl = '';
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+const filesize = () => showToast(lang[props.langType].fileSize);
|
|
|
|
+const beforeRead = (file) => {
|
|
|
|
+ if (!file) showToast(lang[props.langType].photoContent);
|
|
|
|
+ uploadImage(file).then(res => {
|
|
|
|
+ showToast(lang[props.langType].upFileSusscess);
|
|
|
|
+ formData.photoUrl = res
|
|
|
|
+ photo.value = [
|
|
|
|
+ {
|
|
|
|
+ url: res,
|
|
|
|
+ file: file.file,
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ }).catch((res) => {
|
|
|
|
+ showToast(res.msg || lang[props.langType].upFileError);
|
|
|
|
+ })
|
|
|
|
+ return false;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+let arrivalTime = []
|
|
|
|
+const dateTimeColumns = computed(() => {
|
|
|
|
+ const dateList = lang[props.langType].dateList;
|
|
|
|
+ const years = [{ text: dateList[0], value: '', disabled: true }, ...Array.from({ length: 10 }, (_, i) => {
|
|
|
|
+ const t = 2020 + i + ''
|
|
|
|
+ return {
|
|
|
|
+ text: t,
|
|
|
|
+ value: t
|
|
|
|
+ }
|
|
|
|
+ }).reverse()];
|
|
|
|
+ const months = [{ text: dateList[1], value: '', disabled: true }, ...Array.from({ length: 12 }, (_, i) => {
|
|
|
|
+ const m = (i + 1).toString().padStart(2, '0')
|
|
|
|
+ return {
|
|
|
|
+ text: m,
|
|
|
|
+ value: m
|
|
|
|
+ }
|
|
|
|
+ })];
|
|
|
|
+
|
|
|
|
+ // 动态计算当前选中年月对应的天数
|
|
|
|
+ const daysInMonth = new Date(
|
|
|
|
+ parseInt(arrivalTime[0] || '0'),
|
|
|
|
+ parseInt(arrivalTime[1] || '0'),
|
|
|
|
+ 0
|
|
|
|
+ ).getDate();
|
|
|
|
+ const days = [{ text: dateList[2], value: '', disabled: true }, ...Array.from({ length: daysInMonth }, (_, i) => {
|
|
|
|
+ const d = (i + 1).toString().padStart(2, '0')
|
|
|
|
+ return {
|
|
|
|
+ text: d,
|
|
|
|
+ value: d
|
|
|
|
+ }
|
|
|
|
+ })];
|
|
|
|
+
|
|
|
|
+ const hours = [{ text: dateList[3], value: '', disabled: true }, ...Array.from({ length: 24 }, (_, i) => {
|
|
|
|
+ const h = i.toString().padStart(2, '0')
|
|
|
|
+ return {
|
|
|
|
+ text: h,
|
|
|
|
+ value: h
|
|
|
|
+ }
|
|
|
|
+ })];
|
|
|
|
+ const minutes = [{ text: dateList[4], value: '', disabled: true }, ...Array.from({ length: 60 }, (_, i) => {
|
|
|
|
+ const m = i.toString().padStart(2, '0')
|
|
|
|
+ return {
|
|
|
|
+ text: m,
|
|
|
|
+ value: m
|
|
|
|
+ }
|
|
|
|
+ })];
|
|
|
|
+ return [years, months, days, hours, minutes];
|
|
|
|
+});
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+let loading = false
|
|
|
|
+const onSubmit = () => {
|
|
|
|
+ if (loading) return
|
|
|
|
+ loading = true
|
|
|
|
+ saveData({
|
|
|
|
+ code: props.verificationCode, // 邀请码
|
|
|
|
+ lastName: formData.lastName, // 姓
|
|
|
|
+ firstName: formData.firstName, // 名
|
|
|
|
+ gender: formData.gender, // 性别
|
|
|
|
+ birthDate: formData.birthday, // 出生日期
|
|
|
|
+ photo: formData.photoUrl, // 照片
|
|
|
|
+ phone: formData.contact, // 手机号
|
|
|
|
+ countryRegion: formData.countryRegion, // 国家/地区
|
|
|
|
+ email: formData.email, // 邮箱
|
|
|
|
+ religion: formData.belief, // 宗教
|
|
|
|
+ emergencyContact: formData.emergencyContact, // 紧急联系人
|
|
|
|
+ emergencyContactPhone: formData.emergencyContactPhone, // 紧急联系人电话
|
|
|
|
+ cardTypeName: formData.cardTypeName, // 证件类型
|
|
|
|
+ idCard: formData.passport, // 证件号
|
|
|
|
+ dietaryRequirements: formData.catering, // 饮食要求
|
|
|
|
+ workUnit: formData.workUnit, // 工作单位
|
|
|
|
+ unitType: formData.unitType[0], // 单位类型
|
|
|
|
+ position: formData.career, // 职务
|
|
|
|
+ fax: formData.fax, // fax
|
|
|
|
+ interviewIntention: formData.interview, // 接受采访意向
|
|
|
|
+ officeAddress: formData.officeAddress, // 办公地址
|
|
|
|
+ arrivalNumberXian: formData.reachTrainNumber, // 抵达西安交通车次
|
|
|
|
+ arrivalTimeXian: formData.reachTime, // 抵达西安时间
|
|
|
|
+ departureNumber: formData.leavingTrainNumber, // 离开车次
|
|
|
|
+ departureTime: formData.leavingTime, // 离开时间
|
|
|
|
+ checkOutTime: formData.checkOutTime, // 离店时间
|
|
|
|
+ remarks: formData.message, // 备注
|
|
|
|
+ userType: '国外嘉宾'
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (!isNaN(res.code) && res.code !== 0) {
|
|
|
|
+ showToast(res.msg || lang[props.langType].networkError);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // 清空表单内容 from
|
|
|
|
+ // Object.keys(from).forEach((key) => {
|
|
|
|
+ // from[key] = '';
|
|
|
|
+ // });
|
|
|
|
+ loading = false
|
|
|
|
+ showDialog({
|
|
|
|
+ message: lang[props.langType].registration,
|
|
|
|
+ })
|
|
|
|
+ }).catch((res) => {
|
|
|
|
+ loading = false
|
|
|
|
+ showToast(res.msg || lang[props.langType].networkError);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+defineExpose({ reset })
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss"></style>
|