123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752 |
- <template>
- <div class="autoBox container-box">
- <div class="bread-crumb">
- <el-breadcrumb separator="/" style="float: left; margin: 15px">
- <el-breadcrumb-item :to="{ path: 'home' }">{{
- $i18n.locale == "en" ? "Home" : "首页"
- }}</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: 'ConferenceServices' }">{{
- $i18n.locale == "en" ? "Conferences" : "会议"
- }}</el-breadcrumb-item>
- <el-breadcrumb-item>{{
- $i18n.locale == "en" ? "The information provided" : "信息填报"
- }}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <div class="content-box" v-if="$i18n.locale == 'en'">
- <div class="content-item">
- <div class="category-body">
- <el-form
- :model="meetingApply"
- :rules="rulesEn"
- ref="meetingApplyEn"
- label-width="260px"
- key="1"
- >
- <!-- 邀请码 -->
- <el-form-item label="Invitation Code" prop="invitationCode">
- <el-input
- v-model="meetingApply.invitationCode"
- placeholder=""
- ></el-input>
- </el-form-item>
- <!-- 名 -->
- <el-form-item label="Given Name" prop="givenName">
- <el-input
- v-model="meetingApply.givenName"
- placeholder=""
- ></el-input>
- </el-form-item>
- <!-- 中间名 -->
- <el-form-item label="Middle Name">
- <el-input
- v-model="meetingApply.middleName"
- placeholder=""
- ></el-input>
- </el-form-item>
- <!-- 姓 -->
- <el-form-item label="Surname" prop="sumame">
- <el-input v-model="meetingApply.sumame" placeholder=""></el-input>
- </el-form-item>
- <!-- 所在国家 -->
- <el-form-item label="Country/Region" prop="unitCountryDcit">
- <el-select
- v-model="meetingApply.unitCountryDcit"
- filterable
- placeholder=""
- style="width: 100%"
- >
- <el-option
- :label="item.label"
- :value="item.value"
- v-for="item in unitCountryDictEns"
- ></el-option>
- </el-select>
- </el-form-item>
- <!-- 单位名称 -->
- <el-form-item label="Name of Company/Organization" prop="filmName">
- <el-input
- v-model="meetingApply.filmName"
- placeholder=""
- ></el-input>
- </el-form-item>
- <!-- 单位类型 -->
- <el-form-item label="Company/Organization Type" prop="filmTypeDict">
- <el-select
- v-model="meetingApply.filmTypeDict"
- placeholder=""
- style="width: 100%"
- >
- <el-option
- :label="item.label"
- :value="item.value"
- v-for="(item, i) in meetingUnitTypeDictEns"
- :key="i"
- ></el-option>
- </el-select>
- </el-form-item>
- <!-- 职务 -->
- <el-form-item label="Title" prop="title">
- <el-input v-model="meetingApply.title" placeholder=""></el-input>
- </el-form-item>
- <!-- 邮箱 -->
- <el-form-item label="E-mail" prop="mail">
- <el-input v-model="meetingApply.mail" placeholder=""></el-input>
- </el-form-item>
- <el-form-item
- label-width="198px"
- v-if="
- gridData.length && intentions.isShowEnOnlineIntention == 'Yes'
- "
- >
- <p style="font-size: 16px">
- Among multiple events of our conference, please kindly choose
- your preferable events to attend to(Multiple choice).
- </p>
- <el-table
- :data="gridData"
- :border="false"
- @selection-change="checkRow"
- @row-click="setSelectEn"
- size="small"
- ref="multipleTableEn"
- :empty-text="'Sorry no date.'"
- class="active-grid"
- >
- <el-table-column type="selection" width="50"></el-table-column>
- <el-table-column property="activityName" label="ALL">
- <template slot-scope="scope">
- <p style="font-weight: bold">
- {{ momentDate(scope.row.activityStartTime) }} ~
- {{ momentDate(scope.row.activityEndTime) }}
- </p>
- <p>{{ scope.row.activityNameEn }}</p>
- </template>
- </el-table-column>
- </el-table>
- </el-form-item>
- <el-form-item style="text-align: center" label-width="0">
- <el-button
- type="primary"
- @click="submitFormEn('meetingApplyEn')"
- :key="btnKey"
- >Submit</el-button
- >
- </el-form-item>
- </el-form>
- </div>
- </div>
- </div>
- <div class="content-box" v-else>
- <div class="content-item">
- <div class="category-body">
- <el-form
- :model="meetingApply"
- :rules="rulesZh"
- ref="meetingApplyZh"
- label-width="100px"
- key="2"
- >
- <el-form-item label="邀请码" prop="invitationCode">
- <el-input
- v-model="meetingApply.invitationCode"
- placeholder=""
- ></el-input>
- </el-form-item>
- <el-form-item label="姓名" prop="name">
- <el-input v-model="meetingApply.name" placeholder=""></el-input>
- </el-form-item>
- <el-form-item label="国家" prop="unitCountryDcit">
- <el-select
- v-model="meetingApply.unitCountryDcit"
- filterable
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- :label="item.label"
- :value="item.value"
- v-for="item in unitCountryDicts"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="单位名称" prop="filmName">
- <el-input
- v-model="meetingApply.filmName"
- placeholder=""
- ></el-input>
- </el-form-item>
- <el-form-item label="单位类型" prop="filmTypeDict">
- <el-select
- v-model="meetingApply.filmTypeDict"
- placeholder=""
- style="width: 100%"
- >
- <el-option
- :label="item.label"
- :value="item.value"
- v-for="(item, i) in meetingUnitTypeDicts"
- :key="i"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="职务" prop="title">
- <el-input v-model="meetingApply.title" placeholder=""></el-input>
- </el-form-item>
- <el-form-item label="邮箱" prop="mail">
- <el-input v-model="meetingApply.mail" placeholder=""></el-input>
- </el-form-item>
- <el-form-item
- label-width="36px"
- v-if="
- gridData.length && intentions.isShowZhOnlineIntention == 'Yes'
- "
- >
- <p style="font-size: 16px">
- 此次大会包括多场会议活动,请勾选您希望参加的场次(可多选)。
- </p>
- <el-table
- :data="gridData"
- :border="false"
- @selection-change="checkRow"
- @row-click="setSelect"
- size="small"
- ref="multipleTable"
- class="active-grid"
- >
- <el-table-column type="selection" width="50"></el-table-column>
- <el-table-column property="activityName" label="全选">
- <template slot-scope="scope">
- <p style="font-weight: bold">
- {{ momentDate(scope.row.activityStartTime) }} ~
- {{ momentDate(scope.row.activityEndTime) }}
- </p>
- <p>{{ scope.row.activityName }}</p>
- </template>
- </el-table-column>
- </el-table>
- </el-form-item>
- <el-form-item style="text-align: center" label-width="0">
- <el-button type="primary" @click="submitForm('meetingApplyZh')"
- >提交</el-button
- >
- </el-form-item>
- </el-form>
- </div>
- </div>
- </div>
- <el-dialog :show-close="false" :visible.sync="dialogVisible" width="600px">
- <div class="category-body submit-success">
- <p>
- <img
- src="@/assets/img/conference/submit-success.png"
- alt=""
- width="200"
- />
- </p>
- <p style="font-size: 24px; color: #666; margin-bottom: 20px">
- {{ $i18n.locale == "en" ? "Registered!" : "报名成功!" }}
- </p>
- <p>
- <el-button
- style="background: #2c558a; color: #fff"
- @click="toView('ConferenceDetail', $route.query.key)"
- >
- {{ $i18n.locale == "en" ? "Back" : "返回" }}({{ num }}s)
- </el-button>
- <el-button @click="ContinueRegister">{{
- $i18n.locale == "en" ? "Continue" : "继续报名"
- }}</el-button>
- </p>
- </div>
- </el-dialog>
- <div class="apply-history" v-if="applyHistoryInfo.length">
- <span style="font-size: 14px; margin-right: 20px">{{
- $i18n.locale == "en" ? "Registration History" : "报名历史"
- }}</span>
- <el-select
- v-model="applyHistorySelected"
- @change="applyHistoryChanged"
- :placeholder="$i18n.locale == 'en' ? 'Please Select' : '请选择'"
- >
- <el-option
- v-for="(item, i) in applyHistoryInfo"
- :key="i"
- :label="item.name"
- :value="i"
- >
- <span style="float: left">{{ item.name }}</span>
- </el-option>
- </el-select>
- </div>
- <loginTopCh ref="loginTopCh"></loginTopCh>
- </div>
- </template>
- <script>
- import Base from "@/views/base/Base";
- import {
- registerOnline,
- getMeetingApplyActivityInfos,
- getOlApplyHistoryInfosByLoginAccount,
- } from "@/api/meeting/meetingApply";
- import { getConfrenceDetail } from "@/api/meeting/meetingOutInfo";
- import { getToken } from "@/utils/auth";
- import { getDicts } from "@/api/dict";
- import moment from "moment-timezone";
- import { addIntegral, addGrowth } from "@/utils/toCompleteTask";
- import loginTopCh from './loginTopCh'
- export default {
- components:{
- loginTopCh
- },
- extends: Base,
- data() {
- var checkInvitationCode = (rule, value, callback) => {
- if (!value) {
- let errorTxt = "请输入邀请码";
- callback(new Error(errorTxt));
- } else if (!this.invitationCodeArr.includes(value)) {
- let errorTxt ="请输入正确的邀请码。如果没有,请输入000000";
- callback(new Error(errorTxt));
- } else {
- callback();
- }
- };
- var checkEmail = (rule, value, callback) => {
- let reg = /^\w+.*\w+@[a-zA-Z0-9]+.*[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$/gm;
- if (!value) {
- let errorTxt = "请输入邮箱";
- return callback(new Error(errorTxt));
- } else if (!reg.test(value)) {
- let errorTxt =
- "邮箱格式不正确";
- callback(new Error(errorTxt));
- } else {
- callback();
- }
- };
- return {
- newChecked:[],
- applyHistorySelected: "", //被选择的报名历史
- applyHistoryInfo: [], //报名历史信息
- btnKey: 1,
- dialogVisible: false,
- num: 5,
- timer: "",
- meetingUnitTypeDictEns: [],
- meetingUnitTypeDicts: [],
- invitationCodePrefix: [],
- invitationCodeArr: ["000000"],
- unitCountryDicts: [],
- unitCountryDictEns: [],
- gridData: [],
- checkedIds: [],
- baseInfo: {},
- intentions: {},
- meetingApply: {
- // meetingId: window.localStorage.getItem('conferenceId'),
- meetingId: this.$route.query.key,
- invitationCode: "",
- name: "",
- middleName: "",
- givenName: "",
- sumame: "",
- filmName: "",
- filmType: "",
- filmTypeDict: "",
- title: "",
- mail: "",
- unitCountryDcit: "",
- applyWay: "",
- isSendNotice: "No",
- },
- rulesEn: {
- invitationCode: [
- { required: true, validator: checkInvitationCode, trigger: "blur" },
- ],
- givenName: [
- {
- required: true,
- message: "Please enter Given Name.",
- trigger: "blur",
- },
- ],
- sumame: [
- { required: true, message: "Please enter Surname.", trigger: "blur" },
- ],
- mail: [{ required: true, validator: checkEmail, trigger: "blur" }],
- unitCountryDcit: [
- {
- required: true,
- message: "Please select Country/Region.",
- trigger: "change",
- },
- ],
- filmName: [
- {
- required: true,
- message: "Please enter Name of Company/Organization.",
- trigger: "blur",
- },
- ],
- filmTypeDict: [
- {
- required: true,
- message: "Company/Organization Type.",
- trigger: "change",
- },
- ],
- title: [
- { required: true, message: "Please enter Title.", trigger: "blur" },
- ],
- },
- rulesZh: {
- invitationCode: [
- { required: true, validator: checkInvitationCode, trigger: "blur" },
- ],
- name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
- unitCountryDcit: [
- { required: true, message: "请选择国家", trigger: "change" },
- ],
- mail: [{ required: true, validator: checkEmail, trigger: "blur" }],
- filmName: [
- { required: true, message: "请输入单位名称", trigger: "blur" },
- ],
- filmTypeDict: [
- { required: true, message: "请选择单位类型", trigger: "change" },
- ],
- title: [{ required: true, message: "请输入职务", trigger: "blur" }],
- },
- user: {
- umsUser: {},
- },
- };
- },
- watch: {
- "$i18n.locale"(val) {
- this.meetingApply.unitCountryDcit = "china";
- this.getApplyHistoryInfos();
- },
- dialogVisible() {
- if (this.dialogVisible == true) {
- this.loginTipsChange();
- }
- },
- },
- mounted() {
- //localStorage.setItem('aaa','false')
- this.$i18n.locale='zh'
- localStorage.setItem('locale', 'zh');
- //数据截取
- var url = window.location.href;
- var temp1 = url.split('=')[1].split('&')[0];
- let rpath = { path: 'NewConferenceNetworkCh', query: { key: temp1}};
- sessionStorage.setItem('pathReminder', JSON.stringify(rpath));
- if (this.$route.query) {
- localStorage.setItem("conferenceId", this.$route.query.key);
- }else{
- localStorage.setItem("conferenceId", temp1);
- }
- //验证用户是否登录
- this.$refs.loginTopCh.activeChange('NewConferenceNetworkCh',temp1);
- this.initData();
- this.meetingApply.unitCountryDcit = "china";
- getDicts("meeting_unit_type_dict_en, meeting_unit_type_dict, geidco_dept_dict, unit_country_dict, unit_country_dict_en")
- .then((result) => {
- var data = result.data;
- if (data) {
- this.meetingUnitTypeDictEns = result.data[0] || [];
- this.meetingUnitTypeDicts = result.data[1] || [];
- this.invitationCodePrefix = result.data[2] || [];
- this.unitCountryDicts = result.data[3] || [];
- this.unitCountryDictEns = result.data[4] || [];
- if (this.unitCountryDictEns.length) {
- this.unitCountryDictEns.sort(function (a, b) {
- return a.value.charCodeAt() - b.value.charCodeAt();
- });
- }
- }
- })
- .then((res) => {
- getConfrenceDetail(localStorage.getItem("conferenceId")).then((res) => {
- this.baseInfo = res.data.basicInfo;
- // 邀请码集合
- this.invitationCodePrefix.forEach((item) => {
- this.invitationCodeArr.push(`${item.value}${res.data.basicInfo.meetingRand}`);
- });
- });
- getMeetingApplyActivityInfos(localStorage.getItem("conferenceId"))
- .then((_res) => {
- console.log("_res", _res);
- this.gridData = _res.data.allMeetingActivitys || [];
- })
- .catch((err) => {
- this.gridData = [];
- });
- });
- this.getIntentions();
- this.getApplyHistoryInfos();
- },
- methods: {
- initData() {
- this.user = JSON.parse(window.localStorage.getItem("user"));
- },
- applyHistoryChanged(i) {
- Object.keys(this.applyHistoryInfo[i]).forEach((key) => {
- this.meetingApply[key] = this.applyHistoryInfo[i][key];
- });
- },
- //获取报名历史信息
- getApplyHistoryInfos() {
- this.applyHistorySelected = "";
- getOlApplyHistoryInfosByLoginAccount('').then((res) => {
- this.applyHistoryInfo = res.data.olApplyHistoryInfos;
- console.log("ApplyHistoryInfos", res);
- });
- },
- getIntentions() {
- this.intentions ={
- isShowEnOnlineIntention: "Yes",
- isShowEnOnsiteIntention: "Yes",
- isShowZhOnlineIntention: "Yes",
- isShowZhOnsiteIntention: "Yes",
- }
- },
- momentDate(date) {
- // if (this.$i18n.locale == "zh") {
- moment.locale("zh-cn");
- return moment(date).format("YYYY MM DD, H:mm");
- // }
- // else {
- // moment.locale("en");
- // return moment(date).format("lll");
- // }
- },
- checkRow(checkedData) {
- this.checkedIds = [];
- this.newChecked = [];
- const date = []
- checkedData.forEach((item) => {
- date.find(i=>{
- if(i===this.momentDate(item.activityStartTime)){
- let msgTxt ='温馨提示:同一时段平行召开的会议仅限选择一场参加,祝您参会愉快!';
- this.$message({
- message: msgTxt,
- type:'error'
- })
- }
- })
- date.push(this.momentDate(item.activityStartTime))
- this.checkedIds.push(item.id)
- this.newChecked.push(item.activityStartTime)
- });
- },
- setSelect(row) {
- this.$refs.multipleTable.toggleRowSelection(row);
- },
- setSelectEn(row) {
- this.$refs.multipleTableEn.toggleRowSelection(row);
- },
- ContinueRegister() {
- clearInterval(this.timer);
- this.dialogVisible = false;
- this.btnKey = Math.random();
- // this.$refs.meetingApplyEn.resetFields();
- },
- loginTipsChange() {
- const that = this;
- this.num = 5;
- this.timer = setInterval(function () {
- if (that.num > 0) {
- that.num--;
- } else {
- clearInterval(that.timer);
- that.dialogVisible = false;
- that.toView("ConferenceDetail", that.$route.query.key);
- }
- }, 1000);
- },
- toView(router, json) {
- this.$router.push({ path: router, query: { key: json } });
- },
- formatDate(t) {
- if (!t) {
- return "";
- } else {
- var original = new Date(t);
- var year = original.getFullYear();
- var month = original.getMonth() + 1;
- var date = original.getDate();
- return year + "-" + month + "-" + date;
- }
- },
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- if (!valid) {
- this.$message.error("请填写完整信息");
- return false;
- }
- this.save();
- });
- },
- submitFormEn(formName) {
- // alert(this.$route.params.key)
- this.$refs[formName].validate((valid) => {
- if (!valid) {
- this.$message.error("Please fill in the complete information");
- return false;
- }
- this.meetingApply.name = `${this.meetingApply.givenName} ${this.meetingApply.middleName} ${this.meetingApply.sumame}`;
- this.save();
- });
- },
- save: function () {
- var arr1=this.newChecked
- var arr2=arr1.sort()
- for(var i=0;i<arr2.length-1;i++){
- if(arr2[i]==arr2[i+1]){
- let msgTxt ='温馨提示:同一时段平行召开的会议仅限选择一场参加,祝您参会愉快!';
- this.$message.error(msgTxt)
- return false
- }else{
- console.log('hello');
- }
- }
- // console.log("filmName:", this.meetingApply.filmName)
- this.meetingApply.applyWay = '';
- // console.log('this.meetingApply', this.meetingApply);
- // return
- this.submitHandler((token) => {
- registerOnline(
- JSON.stringify(this.meetingApply),
- token,
- this.checkedIds.join(",")
- )
- .then((result) => {
- console.log("result", result);
- if (result.status == "200") {
- if (this.user.umsUser.userUsertypeDict !== "2") {
- addIntegral("meeting_registration_successful", "10");
- addGrowth("meeting_registration_successful");
- }
- if (result.data.isRepeat) {
- let errorMsg ="该嘉宾已报名,请勿重复填写!";
- this.$message.error(errorMsg);
- this.resetToken();
- } else {
- this.dialogVisible = true;
- this.resetToken();
- }
- }
- console.log("result", result);
- })
- .catch((error) => {
- this.resetToken();
- });
- });
- },
- },
- };
- </script>
- <style scoped>
- * {
- box-sizing: border-box;
- }
- .container-box {
- width: 1200px;
- margin: 10px auto;
- position: relative;
- }
- .bread-crumb {
- height: 40px;
- background: #fff;
- margin: 10px 0;
- }
- .content-box {
- width: 100%;
- box-sizing: border-box;
- padding: 60px 150px 20px 150px;
- background: #fff;
- }
- .content-item {
- padding-bottom: 20px;
- border-radius: 12px;
- overflow: hidden;
- }
- /deep/ .content-box .el-input__inner {
- border-top: none;
- border-left: none;
- border-right: none;
- border-radius: 0;
- }
- .submit-success {
- text-align: center;
- font-size: 20px;
- color: #999;
- }
- .submit-success p {
- margin: 0;
- }
- .submit-success .el-button {
- width: 150px;
- font-size: 20px;
- margin: 10px;
- }
- .down-load a {
- font-size: 28px;
- color: #49a2f2;
- text-decoration: none;
- }
- .down-load a:hover {
- color: #de551a;
- }
- /deep/ .el-dialog {
- display: flex;
- flex-direction: column;
- margin: 0 !important;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- max-height: calc(100% - 30px);
- max-width: calc(100% - 30px);
- }
- /deep/ .el-dialog .el-dialog__body {
- flex: 1;
- overflow: auto;
- }
- .active-grid p {
- margin: 0;
- }
- /deep/ .el-table th > .cell {
- padding-left: 14px;
- }
- .apply-history {
- position: absolute;
- top: 60px;
- right: 20px;
- }
- .apply-history .el-select {
- width: 300px;
- }
- </style>
|