840 lines
36 KiB
HTML
840 lines
36 KiB
HTML
<!--#
|
|
layout("/mobile/platform.html"){
|
|
#-->
|
|
<style>
|
|
|
|
#app {
|
|
font-family: 微软雅黑,serif;
|
|
}
|
|
.container img {
|
|
background-size: contain;
|
|
width: 100%;
|
|
height: auto;
|
|
margin: 5px auto;
|
|
display: block;
|
|
}
|
|
.header {
|
|
padding: 10px 20px 0;
|
|
}
|
|
.content {
|
|
line-height: 26px;
|
|
padding: 0 10px 56px 10px;
|
|
}
|
|
.pdf_div {
|
|
height: calc(100vh - 350px);
|
|
position: relative;
|
|
}
|
|
.pdfjs {
|
|
overflow-y: auto;
|
|
}
|
|
.pdfjs .backTop {
|
|
bottom: 30px;
|
|
}
|
|
.title {
|
|
font-weight: bold;
|
|
font-size: 19px;
|
|
color: #505050;
|
|
margin-bottom: 10px;
|
|
}
|
|
.van-divider {
|
|
border-color: grey;
|
|
margin: 0;
|
|
}
|
|
.van-skeleton {
|
|
padding: 20px;
|
|
}
|
|
.van-skeleton__content {
|
|
height: 600px;
|
|
padding-top: 60px;
|
|
}
|
|
.van-skeleton__row, .van-skeleton__title {
|
|
height: 30px;
|
|
}
|
|
.footer {
|
|
background-color: white;
|
|
position: fixed;
|
|
bottom: 0;
|
|
width: 100%;
|
|
height: 60px;
|
|
display: flex;
|
|
justify-content: space-evenly;
|
|
align-items: center;
|
|
left: 0;
|
|
}
|
|
.footer .van-button {
|
|
height: 34px;
|
|
border-radius: 6px;
|
|
width: 90% !important;
|
|
}
|
|
.family_join {
|
|
background-color: #ff976a;
|
|
color: white;
|
|
}
|
|
.join {
|
|
background-color: #0e78c5;
|
|
color: white;
|
|
}
|
|
.joinPopup {
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: #f6f7f9;
|
|
}
|
|
.join_content {
|
|
padding: 20px;
|
|
height: calc(100% - 26px - 60px);
|
|
overflow-y: auto;
|
|
}
|
|
.join_submit {
|
|
width: 90% !important;
|
|
}
|
|
.van-doc-card {
|
|
background-color: #fff;
|
|
border-radius: 6px;
|
|
box-shadow: 0 8px 12px #ebedf0;
|
|
line-height: 20px;
|
|
position: relative;
|
|
}
|
|
.van-card-header {
|
|
padding: 14px 20px;
|
|
border-bottom: 1px solid #ebeef5;
|
|
box-sizing: border-box;
|
|
color: #0e78c5;
|
|
font-weight: bold;
|
|
}
|
|
.van-card-body {
|
|
padding: 0 10px 0 10px
|
|
}
|
|
.van-doc-card > div:first-child {
|
|
border: 2px #0e78c5 solid;
|
|
width: 26px;
|
|
border-radius: 6px;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 20px;
|
|
}
|
|
.van-cell {
|
|
padding: 8px 5px;
|
|
}
|
|
.van-tabs__wrap {
|
|
margin: 6px;
|
|
}
|
|
.van-tabs__nav--card {
|
|
border: none;
|
|
}
|
|
.van-tabs__nav--card .van-tab.van-tab--active {
|
|
border-radius: 6px;
|
|
}
|
|
.van-tabs__nav--card .van-tab {
|
|
border-right: 0 !important;
|
|
}
|
|
.top_icon {
|
|
position: fixed;
|
|
bottom: 80px;
|
|
right: 20px;
|
|
}
|
|
.van-field__control {
|
|
text-overflow: ellipsis;
|
|
}
|
|
.list-card {
|
|
width: auto;
|
|
}
|
|
.companionList_empty_text {
|
|
text-align: center;
|
|
padding: 10px 0;
|
|
font-size: 14px;
|
|
color: grey;
|
|
}
|
|
.header div span {
|
|
color: grey;
|
|
}
|
|
.header :last-child {
|
|
font-size: 14px;
|
|
}
|
|
.van-empty {
|
|
position: relative;
|
|
transform: none;
|
|
top: 0;
|
|
left: 0;
|
|
background-color: transparent;
|
|
height: calc(100vh - 46px - 153px - 60px);
|
|
}
|
|
.submitButton {
|
|
background-color: white !important;
|
|
width: 100%;
|
|
/*height: 60px;
|
|
display: flex;
|
|
justify-content: space-evenly;
|
|
align-items: center;*/
|
|
text-align: center;
|
|
}
|
|
.submitButton .van-button {
|
|
height: 34px;
|
|
border-radius: 6px;
|
|
width: 90% !important;
|
|
}
|
|
.van-image-preview img {
|
|
background-color: white;
|
|
}
|
|
.van-tag {
|
|
color: white !important;
|
|
}
|
|
.sign_div {
|
|
background-color: white;
|
|
margin-bottom: 16px;
|
|
padding: 18px;
|
|
border-radius: 6px;
|
|
box-shadow: 0 8px 12px #ebedf0;
|
|
}
|
|
.van-action-sheet {
|
|
max-height: 90%;
|
|
}
|
|
.van-cell--required::before {
|
|
left: -2px;
|
|
}
|
|
.van-radio__label {
|
|
margin-left: 0;
|
|
}
|
|
.van-radio--horizontal {
|
|
margin-right: 8px;
|
|
}
|
|
.van-dialog__message {
|
|
font-size: 16px;
|
|
}
|
|
|
|
</style>
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<van-sticky>
|
|
<van-nav-bar @click-left="pageBack" fixed left-arrow placeholder
|
|
title="职工疗休养-线路介绍"></van-nav-bar>
|
|
</van-sticky>
|
|
|
|
<template v-if="isLoad">
|
|
<!--线路详情-->
|
|
<div class="container">
|
|
<div class="header">
|
|
<div class="title">
|
|
<van-tag size="large" color="#1867b0" style="position: relative; top: -2px">
|
|
{{lineData.lotName}}
|
|
</van-tag>
|
|
{{lineData.lineName}}
|
|
</div>
|
|
<div style="margin-top: 10px">
|
|
<div>
|
|
<div>
|
|
<span>预计费用:</span>
|
|
{{lineData.estimatedCost}}元
|
|
</div>
|
|
<div>
|
|
<span class="line_label">最少成团:</span>
|
|
<label v-if="lineData.minimumGroupSize">{{lineData.minimumGroupSize}}人</label>
|
|
<label v-else>不限制</label>
|
|
</div>
|
|
<!--<div v-if="configData.familyInfo == 2">
|
|
<span>当前报名:</span>
|
|
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '(家属' + lineData.signUpUserFamilyNum + '人)'}}
|
|
</div>
|
|
<div v-else>
|
|
<span>当前报名:</span>
|
|
{{lineData.signUpUserNum + lineData.familyNumber + '(家属' + lineData.familyNumber + '人)'}}
|
|
</div>-->
|
|
</div>
|
|
|
|
<div>
|
|
<span>报名时间:</span>
|
|
{{moment(configData.implodeStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
|
|
moment(configData.implodeEndTime).format('YYYY-MM-DD HH:mm')}}
|
|
</div>
|
|
<div>
|
|
<span>出行时间:</span>
|
|
{{moment(lineData.playStartTime).format('YYYY-MM-DD HH:mm') + ' ~ ' +
|
|
moment(lineData.playEndTime).format('YYYY-MM-DD HH:mm')}}
|
|
</div>
|
|
<div>
|
|
<span>旅 行 社:</span>
|
|
{{lineData.travelAgencyName}}
|
|
</div>
|
|
<div>
|
|
<span>联系方式:</span>
|
|
{{lineData.contactMobileNumber}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看,再单击返回</van-divider>
|
|
<div class="pdf_div">
|
|
<div v-if="isPdf" v-html="lineData.content" class="content"></div>
|
|
<div v-else id="demo"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!--置顶图标-->
|
|
<image v-if="btnFlag" @click="backTop" src="/assets/mobile/svg/therapyRecuperation/top.svg"
|
|
class="top_icon"></image>
|
|
|
|
<!--底部报名按钮-->
|
|
<div class="footer" v-if="fromUrlByMy != 'edit'">
|
|
<van-button v-if="moment().unix() >= moment(configData.implodeStartTime).unix() && moment().unix() <= moment(configData.implodeEndTime).unix()" @click="join"
|
|
class="join">{{ enrollId ? '修改报名' : '我要报名' }}
|
|
</van-button>
|
|
<van-button v-if="moment().unix() < moment(configData.implodeStartTime).unix()" class="join">报名未开始
|
|
</van-button>
|
|
<van-button v-if="moment().unix() > moment(configData.implodeEndTime).unix()" class="join">报名结束
|
|
</van-button>
|
|
</div>
|
|
</template>
|
|
|
|
<!--报名弹出框-->
|
|
<van-popup v-model:show="joinPopup" position="right" class="joinPopup">
|
|
<van-nav-bar @click-left="joinPopup = false" fixed left-arrow placeholder title="疗休养报名"></van-nav-bar>
|
|
<van-notice-bar
|
|
v-if="Number(lineData.estimatedCost) > 3000"
|
|
left-icon="volume-o"
|
|
text="温馨提醒:您选择的线路预计费用超过3000元,需要选择超出费用类型"
|
|
></van-notice-bar>
|
|
|
|
<van-notice-bar
|
|
v-if="lineData.togetherLine"
|
|
left-icon="volume-o"
|
|
text="温馨提醒:此线路为联合疗休养线路,限定单身教工报名"
|
|
></van-notice-bar>
|
|
|
|
<div class="join_content">
|
|
|
|
<van-form @submit="joinSubmit">
|
|
|
|
<!--基础信息-->
|
|
<div class="van-doc-card" style="margin-bottom: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
基础信息
|
|
</div>
|
|
<div class="van-card-body">
|
|
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
|
|
<van-field label="一卡通号" readonly v-model="formData.loginName"></van-field>
|
|
<van-field required label="身份证件" name="idCard" :rules="[{ required: true }]"
|
|
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
|
|
<van-field required label="手机号" name="mobile" :rules="[{ required: true }]"
|
|
placeholder="请填写手机号" v-model="formData.mobile"></van-field>
|
|
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
|
<van-field label="报名线路" readonly v-model="formData.lineName"></van-field>
|
|
<van-field required v-if="lineData.togetherLine" label="才艺特长" v-model="formData.skill" placeholder="请输入才艺特长" :rules="[{ required: true }]"></van-field>
|
|
<van-field v-if="Number(lineData.estimatedCost) > 3000" required name="moneyType" label="超出费用类型" :rules="[{ required: true, message: '请选择超出费用类型' }]">
|
|
<template #input>
|
|
<van-radio-group v-model="formData.moneyType" direction="horizontal">
|
|
<van-radio :name="1">自己承担</van-radio>
|
|
<van-radio :name="2">使用明年额度</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
</div>
|
|
</div>
|
|
|
|
<!--床位信息-->
|
|
<!--<div v-if="configData.bedInfo === true" class="van-doc-card" style="margin-bottom: 16px">
|
|
<div></div>
|
|
<div class="van-card-header">
|
|
床位信息
|
|
</div>
|
|
<div class="van-card-body">
|
|
<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
|
|
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
|
|
:rules="[{ required: true }]"></van-field>
|
|
<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
|
|
readonly is-link label="床位"
|
|
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
|
|
:rules="[{ required: true }]"></van-field>
|
|
<van-field v-if="formData.bedInfo.bedType == '标准间'"
|
|
:rules="[{ validator, message: '请选择是否拼房' }]"
|
|
label="是否拼房" name="validator">
|
|
<template #input>
|
|
<van-radio-group direction="horizontal" v-model="formData.bedInfo.isSleepTogether">
|
|
<van-radio :name="true" shape="square">是</van-radio>
|
|
<van-radio :name="false" shape="square">否</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
<van-field
|
|
v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
|
|
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
|
|
v-model="formData.bedInfo.otherSleepUser"
|
|
:rules="[{ required: true }]"></van-field>
|
|
</div>
|
|
</div>-->
|
|
|
|
<!--随行人信息-->
|
|
<!--<div class="van-doc-card" style="margin-bottom: 16px">
|
|
<div></div>
|
|
<div class="van-card-header"
|
|
style="display: flex; justify-content: space-between; align-items: center">
|
|
<span style="float:left;">随行人信息</span>
|
|
<div v-if="configData.familyInfo === 2">
|
|
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除随行人
|
|
</van-tag>
|
|
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人
|
|
</van-tag>
|
|
</div>
|
|
</div>
|
|
<template v-if="configData.familyInfo === 2">
|
|
<div v-if="formData.companionList.length > 0" class="van-card-body">
|
|
<van-tabs v-model="active" type="card" color="#0e78c5" animated>
|
|
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
|
|
<van-field label="姓名" name="userName" placeholder="请填写姓名"
|
|
v-model="item.userName"
|
|
:rules="[{ required: true }]"></van-field>
|
|
<!–<van-field label="一卡通号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>–>
|
|
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age"
|
|
type="digit" :rules="[{ required: true }]"></van-field>
|
|
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别"
|
|
name="validator">
|
|
<template #input>
|
|
<van-radio-group direction="horizontal" v-model="item.sex">
|
|
<van-radio name="男" shape="square">男</van-radio>
|
|
<van-radio name="女" shape="square">女</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
<van-field label="身份证件" name="idCard" placeholder="请填写身份证号、护照、台胞证等"
|
|
:rules="[{ required: true }]"
|
|
v-model="item.idCard"></van-field>
|
|
<van-field label="手机号" name="mobile" placeholder="请填写手机号"
|
|
:rules="[{ required: true }]" type="digit"
|
|
v-model="item.mobile"></van-field>
|
|
<van-field @click="companionVisible = true" readonly is-link label="与本人关系"
|
|
name="relation"
|
|
placeholder="随行人与本人关系" v-model="item.relation"
|
|
:rules="[{ required: true }]"></van-field>
|
|
|
|
<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
|
|
name="bedType" placeholder="请选择房间"
|
|
v-model="item.bedInfo.bedType"></van-field>
|
|
<div style="font-size: 12px; color:orangered; padding-left: 16px; padding-bottom: 4px">
|
|
提醒:如果跟报名人员同一房间,无须选择!
|
|
</div>
|
|
<van-field v-if="item.bedInfo.bedType == '标准间'"
|
|
@click="self = false; bedVisible = true"
|
|
readonly is-link label="床位"
|
|
name="bedNum" placeholder="请选择床位"
|
|
v-model="item.bedInfo.bedNum"></van-field>
|
|
<van-field v-if="item.bedInfo.bedType == '标准间'"
|
|
:rules="[{ validator, message: '请选择是否拼房' }]" label="是否拼房">
|
|
<template #input>
|
|
<van-radio-group direction="horizontal"
|
|
v-model="item.bedInfo.isSleepTogether">
|
|
<van-radio :name="true" shape="square">是</van-radio>
|
|
<van-radio :name="false" shape="square">否</van-radio>
|
|
</van-radio-group>
|
|
</template>
|
|
</van-field>
|
|
<van-field
|
|
v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
|
|
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
|
|
v-model="item.bedInfo.otherSleepUser"></van-field>
|
|
</van-tab>
|
|
</van-tabs>
|
|
</div>
|
|
<div v-if="formData.companionList.length == 0" class="companionList_empty_text">
|
|
<span>
|
|
如有随行人出行,请添加随行人
|
|
</span>
|
|
</div>
|
|
</template>
|
|
<template v-else>
|
|
<van-field label="家属数量" name="familyNumber" placeholder="请填写家属数量" v-model="formData.familyNumber"
|
|
type="digit" :rules="[{ required: true }]"></van-field>
|
|
</template>
|
|
</div>-->
|
|
|
|
<div class="sign_div" v-if="formData.companionList.length > 0">
|
|
<div style="display: flex">
|
|
<van-checkbox v-model="hasRead" shape="square" @change="readChange" class="mr10"></van-checkbox>
|
|
我已查看
|
|
<span @click="openRead" style="color: #0e5996; text-decoration: underline">
|
|
《{{configData.files[0].filename.replace(/\.[^/.]+$/, '')}}》
|
|
</span>
|
|
<van-tag @click="openRead" size="large" type="primary" color="#1867b0">查看</van-tag>
|
|
</div>
|
|
<mobile-sign v-if="hasRead" class="mt10" ref="signature" v-model="formData.sign" :is_value_base64="false"></mobile-sign>
|
|
</div>
|
|
|
|
<div class="submitButton">
|
|
<van-button class="join join_submit" style="margin: 10px 0">提交报名</van-button>
|
|
</div>
|
|
|
|
</van-form>
|
|
|
|
</div>
|
|
|
|
</van-popup>
|
|
|
|
<!--房间类型弹出框-->
|
|
<van-popup position="bottom" round v-model="roomVisible">
|
|
<van-picker
|
|
title="入住房间" show-toolbar
|
|
:columns="roomColumns"
|
|
@confirm="roomConfirm"
|
|
@cancel="roomCancel">
|
|
</van-picker>
|
|
</van-popup>
|
|
|
|
<!--床位弹出框-->
|
|
<van-popup position="bottom" round v-model="bedVisible">
|
|
<van-picker
|
|
title="床位" show-toolbar
|
|
:columns="bedColumns"
|
|
@confirm="bedConfirm"
|
|
@cancel="bedVisible = false">
|
|
</van-picker>
|
|
</van-popup>
|
|
|
|
<!--随行人关系弹出框-->
|
|
<van-popup position="bottom" round v-model="companionVisible">
|
|
<van-picker
|
|
title="与本人关系" show-toolbar
|
|
:columns="companionColumns"
|
|
@confirm="(value, index) => {formData.companionList[active].relation = value; companionVisible = false}"
|
|
@cancel="companionVisible = false">
|
|
</van-picker>
|
|
</van-popup>
|
|
|
|
<van-action-sheet v-model="readVisible" title="请仔细阅读确认后签字">
|
|
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看,再单击返回</van-divider>
|
|
<div id="readFile" style="height: 530px; overflow-y: auto"></div>
|
|
<div class="submitButton">
|
|
<van-button @click="onRead" class="join join_submit" style="margin: 10px 0">我已阅读确认</van-button>
|
|
</div>
|
|
</van-action-sheet>
|
|
|
|
</div>
|
|
<script>
|
|
function getQueryString(name) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (r != null) return decodeURI(r[2]);
|
|
return null;
|
|
}
|
|
|
|
let pdfh5 = null
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [mobileMixins],
|
|
data() {
|
|
return {
|
|
readVisible: false,
|
|
hasRead: false,
|
|
clickRead: false,
|
|
isPdf: false,
|
|
isLoad: false,
|
|
active: 0,
|
|
roomColumns: ['大床房', '标准间'],
|
|
bedColumns: ['1', '2'],
|
|
companionColumns: ['配偶', '子女'],
|
|
bedVisible: false,
|
|
roomVisible: false,
|
|
companionVisible: false,
|
|
joinPopup: false,
|
|
skeLoading: true,
|
|
id: '',
|
|
lineData: {},
|
|
formData: {
|
|
userName: "${@shiro.getPrincipalProperty('username')}",
|
|
loginName: "${@shiro.getPrincipalProperty('loginname')}",
|
|
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
|
|
idCard: "",
|
|
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
|
lineName: '',
|
|
takePartInLineId: '',
|
|
takePartInUnionId: '',
|
|
companionList: [],
|
|
bedInfo: {},
|
|
},
|
|
self: true,
|
|
btnFlag: false,
|
|
index: 0,
|
|
scrollTop: 0,
|
|
fromUrlByMy: '',
|
|
enrollId: '',
|
|
configData: {},
|
|
}
|
|
},
|
|
components: {
|
|
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v=' + new Date().getTime()),
|
|
},
|
|
methods: {
|
|
pageBack() {
|
|
document.removeEventListener('click', this.handleClick)
|
|
if(['find', 'edit'].includes(this.fromUrlByMy)) {
|
|
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation')
|
|
} else {
|
|
pjaxReplace('/platform/mobile/theRapyRecuperation/mobileLineListPage')
|
|
}
|
|
},
|
|
openRead() {
|
|
this.readVisible = true
|
|
this.$nextTick(() => {
|
|
if(this.configData.files && this.configData.files.length > 0) {
|
|
const pdf = new Pdfh5('#readFile', {
|
|
pdfurl: CREATE_PREVIEW_URL(this.configData.files[0].id),
|
|
})
|
|
this.readPDFPicture(pdf)
|
|
}
|
|
})
|
|
},
|
|
onRead() {
|
|
this.clickRead = true
|
|
this.hasRead = true
|
|
this.readVisible = false
|
|
},
|
|
readChange() {
|
|
if(this.clickRead === false) {
|
|
this.$toast('请先阅读携带家属须知')
|
|
this.hasRead = false
|
|
}
|
|
},
|
|
roomCancel() {
|
|
if (!this.self) {
|
|
this.formData.companionList[this.active].bedInfo.bedType = ''
|
|
}
|
|
this.roomVisible = false
|
|
},
|
|
roomConfirm(value, index) {
|
|
if (this.self) {
|
|
this.formData.bedInfo.bedType = value
|
|
} else {
|
|
this.formData.companionList[this.active].bedInfo.bedType = value
|
|
}
|
|
this.roomVisible = false
|
|
},
|
|
bedConfirm(value, index) {
|
|
if (this.self) {
|
|
this.formData.bedInfo.bedNum = value
|
|
} else {
|
|
this.formData.companionList[this.active].bedInfo.bedNum = value
|
|
}
|
|
this.bedVisible = false
|
|
},
|
|
validator(value) {
|
|
return value != null
|
|
},
|
|
async joinSubmit() {
|
|
if(this.formData.companionList.length > 0) {
|
|
if(this.hasRead === false) {
|
|
this.$toast('请先阅读携带家属须知')
|
|
return
|
|
}
|
|
if(!this.formData.sign) {
|
|
this.$toast('请签字')
|
|
return
|
|
}
|
|
}
|
|
vant.Dialog.confirm({
|
|
title: '温馨提示',
|
|
message: '确定要报名吗?',
|
|
}).then(async () => {
|
|
const toast = vant.Toast.loading({
|
|
duration: 0,
|
|
forbidClick: true,
|
|
overlay: true,
|
|
message: '努力提交中',
|
|
})
|
|
const cloneData = clone(this.formData)
|
|
cloneData.companionList.forEach((item, index) => {
|
|
if (item.userName === '') {
|
|
cloneData.companionList.splice(index, 1)
|
|
}
|
|
})
|
|
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForLine', {
|
|
enroll: JSON.stringify(cloneData),
|
|
})
|
|
setTimeout(() => {
|
|
toast.clear()
|
|
vant.Dialog.alert({
|
|
title: '温馨提示',
|
|
message: resp.msg,
|
|
})
|
|
if (resp.code === 0) {
|
|
pjaxReplace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
|
|
}
|
|
}, 1000)
|
|
})
|
|
},
|
|
addCompanion() {
|
|
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
|
|
},
|
|
delCompanion() {
|
|
this.formData.companionList.splice(this.active, 1)
|
|
},
|
|
async join() {
|
|
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
|
|
enroll: JSON.stringify({
|
|
id: this.enrollId,
|
|
isNormal: this.lineData.isNormal,
|
|
takePartInLineId: this.lineData.usId,
|
|
takePartInUnionId: this.takePartInUnionId
|
|
}),
|
|
})
|
|
if (re.code !== 0) {
|
|
if (re.msg === '您今年已报名,如要继续报名请进入我的疗休养,取消已选择') {
|
|
vant.Dialog.confirm({
|
|
title: '温馨提示',
|
|
message: re.msg,
|
|
confirmButtonText: '跳转页面',
|
|
}).then(() => {
|
|
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
|
|
}).catch(() => {
|
|
});
|
|
} else {
|
|
vant.Dialog.alert({title: '温馨提示', message: re.msg})
|
|
}
|
|
return
|
|
}
|
|
if (this.fromUrlByMy !== 'editDo') {
|
|
this.formData = {
|
|
userName: "${@shiro.getPrincipalProperty('username')}",
|
|
loginName: "${@shiro.getPrincipalProperty('loginname')}",
|
|
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
|
|
idCard: "${@shiro.getPrincipalProperty('idcard')}",
|
|
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
|
lineName: this.lineData.lineName,
|
|
takePartInLineId: this.lineData.usId,
|
|
takePartInUnionId: this.takePartInUnionId,
|
|
companionList: [],
|
|
bedInfo: {},
|
|
}
|
|
this.$set(this.formData.bedInfo, 'bedType', '大床房')
|
|
}
|
|
this.joinPopup = true
|
|
},
|
|
async getData() {
|
|
const res = await $.get('/platform/theRapyRecuperation/line/enroll/selectLineAllInfo', {
|
|
usId: this.id,
|
|
usUnionId: this.takePartInUnionId
|
|
})
|
|
if (res.code === 0) {
|
|
this.lineData = res.data
|
|
this.formData.lineName = this.lineData.lineName
|
|
this.formData.takePartInLineId = this.lineData.usId
|
|
this.skeLoading = false
|
|
}
|
|
},
|
|
// 点击图片回到顶部方法,加计时器是为了过渡顺滑
|
|
backTop() {
|
|
const that = this
|
|
let timer = setInterval(() => {
|
|
let speed = Math.floor(-that.scrollTop / 5)
|
|
document.documentElement.scrollTop = document.body.scrollTop = that.scrollTop + speed
|
|
if (that.scrollTop === 0) {
|
|
clearInterval(timer)
|
|
}
|
|
}, 16)
|
|
},
|
|
// 为了计算距离顶部的高度,当高度大于100显示回顶部图标,小于100则隐藏
|
|
scrollToTop() {
|
|
const that = this
|
|
that.scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
|
|
that.btnFlag = that.scrollTop > 100;
|
|
},
|
|
//修改时查询报名信息,进行回显
|
|
async findSignUpInfoById() {
|
|
const res = await $.post('/platform/theRapyRecuperation/line/enroll/findSignUpInfoById/' + this.enrollId)
|
|
if (res.code === 0) {
|
|
this.formData = res.data
|
|
if (this.formData.bedInfo === null) {
|
|
this.formData.bedInfo = {}
|
|
}
|
|
if (this.formData.companionList) {
|
|
this.formData.companionList.forEach(item => {
|
|
if (item.bedInfo === null) {
|
|
item.bedInfo = {}
|
|
}
|
|
})
|
|
}
|
|
this.$forceUpdate()
|
|
}
|
|
},
|
|
async getConfigData(year) {
|
|
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne', {
|
|
year: year || this.lineData.year || new Date().getFullYear().toString()
|
|
})
|
|
this.$set(this, 'configData', resp.data)
|
|
},
|
|
handleClick(event, classArray = [], imagesArray = []) {
|
|
if(event == null) {
|
|
return
|
|
}
|
|
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
|
|
if(classArray.length > 0) {
|
|
const index = classArray.indexOf(event.target.className)
|
|
if(index !== -1) {
|
|
vant.ImagePreview({
|
|
images: imagesArray,
|
|
startPosition: index,
|
|
closeable: true,
|
|
})
|
|
}
|
|
} else {
|
|
vant.ImagePreview({
|
|
images: [event.target.src],
|
|
closeable: true,
|
|
})
|
|
}
|
|
}
|
|
},
|
|
readPDFPicture(pdf) {
|
|
if(pdf != null) {
|
|
pdf.on("complete", function () {
|
|
const elements = document.querySelectorAll('[class*="canvasImg"]')
|
|
let classArray = []
|
|
elements.forEach(element => {
|
|
classArray.push(element.getAttribute('src'))
|
|
})
|
|
elements.forEach((element,index) => {
|
|
element.addEventListener('click', function() {
|
|
vant.ImagePreview({
|
|
images: classArray,
|
|
startPosition: index,
|
|
closeable: true,
|
|
})
|
|
});
|
|
});
|
|
})
|
|
}
|
|
},
|
|
},
|
|
async created() {
|
|
this.id = getQueryString('id') ? getQueryString('id') : ''
|
|
this.index = getQueryString('index') ? getQueryString('index') : ''
|
|
//编辑传出来的参数
|
|
this.fromUrlByMy = getQueryString('fromUrlByMy') ? getQueryString('fromUrlByMy') : ''
|
|
this.enrollId = getQueryString('enrollId') ? getQueryString('enrollId') : ''
|
|
this.takePartInUnionId = getQueryString('takePartInUnionId') ? getQueryString('takePartInUnionId') : ''
|
|
if (this.enrollId) {
|
|
await this.findSignUpInfoById()
|
|
}
|
|
await this.getData()
|
|
await this.getConfigData(this.lineData.year)
|
|
this.isLoad = true
|
|
try {
|
|
const parser = new DOMParser();
|
|
const doc = parser.parseFromString(this.lineData.content, 'text/html');
|
|
const link = doc.querySelector('a');
|
|
const href = link.getAttribute('href');
|
|
this.$nextTick(() => {
|
|
pdfh5 = new Pdfh5('#demo', {
|
|
pdfurl: href,
|
|
})
|
|
})
|
|
}catch (e) {
|
|
this.isPdf = true
|
|
}
|
|
this.$nextTick(() => {
|
|
this.readPDFPicture(pdfh5)
|
|
})
|
|
},
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|