疗休养

This commit is contained in:
Paidax
2025-06-18 22:21:53 +08:00
parent 4064a88a1b
commit bc3ca19212
19 changed files with 971 additions and 684 deletions
@@ -197,6 +197,14 @@ layout("/mobile/platform.html"){
background-color: white;
}
.sign_div {
background-color: white;
margin-bottom: 16px;
padding: 18px;
border-radius: 6px;
box-shadow: 0 8px 12px #ebedf0;
}
.pdf_div {
padding-bottom: 70px;
height: calc(100vh - 46px - 170px - 60px - 24px);
@@ -265,12 +273,12 @@ layout("/mobile/platform.html"){
<template v-if="baseData.isNormal==0&&baseData.isNormalFalse>0">
<van-button @click="join"
class="join">
{{ (fromUrlByMy == 'editDo') ? '修改报名' : '我要报名' }}
{{ (fromUrlByMy == 'editDo' || editOther) ? '修改报名' : '我要报名' }}
</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(baseData.signUpEndTime).unix()" @click="join" class="join">
{{ (fromUrlByMy == 'editDo') ? '修改报名' : '我要报名' }}
{{ (fromUrlByMy == 'editDo' || editOther) ? '修改报名' : '我要报名' }}
</van-button>
<van-button v-if="moment().unix() > moment(baseData.signUpEndTime).unix()" class="join">报名结束</van-button>
</template>
@@ -279,10 +287,10 @@ layout("/mobile/platform.html"){
<!--报名弹出框-->
<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
background="#ecf9ff" color="red" left-icon="volume-o"
text="温馨提示:报名定点疗休养需签署【定点自由行申请表】,填写基础信息和签字后会同步在申请表中,点击查看按钮可展示申请表"
></van-notice-bar>
<van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o">
温馨提示:报名定点疗休养需签署【定点自由行申请表】,填写基础信息和签字后会同步在申请表中,点击查看按钮可展示申请表
</van-notice-bar>
<div class="join_content">
<van-form @submit="joinSubmit">
@@ -319,137 +327,31 @@ layout("/mobile/platform.html"){
</div>
</div>
<!--床位信息-->
<!--<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
房间信息
<div class="sign_div">
<div style="display: flex">
<van-checkbox v-model="hasReadSafe" shape="square" @change="readChangeSafe" class="mr10"></van-checkbox>
我已查看
<span @click="openReadSafe" style="color: #0e5996; text-decoration: underline">
《安全告知书》
</span>
<van-tag @click="openReadSafe" size="large" type="primary" color="#1867b0">查看</van-tag>
</div>
<div class="van-card-body">
<van-field :rules="[{ required: true, message: '请选择是否包房' }]" label="是否包房" name="bedType">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.bedInfo.bedType">
<van-radio name="包房" shape="square">包房</van-radio>
<van-radio name="不包房" shape="square">不包房</van-radio>
</van-radio-group>
</template>
</van-field>
<div>
<span style="color: red;margin-left: 14px;font-size: 14px">包房需自费;不包房两位老师一间且随机分配</span>
</div>
&lt;!&ndash;<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>&ndash;&gt;
&lt;!&ndash;<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>&ndash;&gt;
<div style="display: flex; margin-top: 10px" v-if="formData.specificTime && formData.sign">
<van-checkbox v-model="hasRead" shape="square" @change="readChange" class="mr10"></van-checkbox>
我已查看
<span @click="openRead" style="color: #0e5996; text-decoration: underline">
《定点自由行申请表》
</span>
<van-tag @click="openRead" size="large" type="primary" color="#1867b0">查看</van-tag>
</div>
</div>
&lt;!&ndash;随行人信息&ndash;&gt;
<div v-if="index != 2" 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>
<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>
<span style="color: red;margin-left: 20px;font-size: 14px">限填写3岁以上70岁以下随行人</span>
</div>
<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>
&lt;!&ndash;<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>&ndash;&gt;
<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 }]" maxlength="18"
@input="getAgeAndSex(item)" 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>
&lt;!&ndash;<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: 8px; 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>&ndash;&gt;
</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="submitButton">
<div class="submitButton" v-if="showButton">
<van-button class="join join_submit">提交报名</van-button>
</div>
</van-form>
<div class="submitButton" style="margin-top: -10px">
<van-button class="join join_submit" @click="showApplyForm">查看定点自由行申请表</van-button>
</div>
</div>
</van-popup>
<!--房间类型弹出框-->
@@ -482,21 +384,25 @@ layout("/mobile/platform.html"){
</van-picker>
</van-popup>
<van-calendar title="出行日期选择" v-model="timeVisible" :show-confirm="false"
:min-date="minDate" :max-date="maxDate"
ref="cal" @confirm="calConfirm" :style="{ height: '660px' }"></van-calendar>
<van-action-sheet v-model="readVisibleSafe" 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="onReadSafe" class="join join_submit" style="margin: 10px 0">我已阅读确认</van-button>
</div>
</van-action-sheet>
<van-popup v-model="applyFormShow" closeable position="right"
:style="{ height: '100%',width: '100%' }" get-container="body">
<van-sticky>
<van-nav-bar @click-left="applyFormShow = false" fixed left-arrow placeholder title="定点自由行申请表"></van-nav-bar>
</van-sticky>
<div id="basePdf" style="height: 80vh"></div>
</van-popup>
<van-action-sheet v-model="readVisible" title="定点自由行申请表">
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看,再单击返回</van-divider>
<div id="basePdf" 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>
@@ -512,6 +418,7 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins],
data() {
return {
showButton: true,
isPdf: false,
active: 0,
minDate: new Date(2010, 0, 1),
@@ -552,23 +459,66 @@ layout("/mobile/platform.html"){
timeVisible: false,
// 定点疗休养申请表相关
applyFormShow: false,
readVisible: false,
hasRead: false,
clickRead: false,
// 修改其他线路相关
editOther: '',
// 安全告知书相关
readVisibleSafe: false,
clickReadSafe: false,
hasReadSafe: '',
}
},
methods: {
// 展示安全告知书
async openReadSafe(){
this.readVisibleSafe = true
this.$nextTick(() => {
if (this.configData.files && this.configData.files.length > 0) {
pdfh5 = new Pdfh5('#readFile', {
pdfurl: CREATE_PREVIEW_URL(this.configData.files[0].id),
})
}
})
},
onReadSafe() {
this.clickReadSafe = true
this.hasReadSafe = true
this.readVisibleSafe = false
},
readChangeSafe() {
if (this.clickReadSafe === false) {
this.$toast('请先阅读安全告知书')
this.hasReadSafe = false
}
},
// 展示申请表
async showApplyForm(){
async openRead(){
const url = '/platform/theRapyRecuperation/baseManagement/showBaseApplyPdf?baseName='
+ (this.formData.baseName ? this.formData.baseName : '') + '&specificTime=' + (this.formData.specificTime ? this.formData.specificTime : '')
+ '&sign=' + (this.formData.sign ? this.configData.sign : '') + '&idCard=' + (this.formData.idCard ? this.formData.idCard : '')
this.applyFormShow = true
this.readVisible = true
this.$nextTick(() => {
pdfh5 = new Pdfh5('#basePdf', {
pdfurl: url,
});
})
},
onRead() {
this.clickRead = true
this.hasRead = true
this.readVisible = false
},
readChange() {
if (this.clickRead === false) {
this.$toast('请先阅读定点自由行申请表')
this.hasRead = false
}
},
// 出行日期相关
calConfirm(date) {
console.log(date)
@@ -613,26 +563,29 @@ layout("/mobile/platform.html"){
return value != null
},
async joinSubmit() {
const cloneData = clone(this.formData)
cloneData.companionList.forEach((item, index) => {
if (item.userName === '') {
cloneData.companionList.splice(index, 1)
}
})
if (this.hasReadSafe === false) {
this.$toast('请先阅读安全告知书')
return
}
if (this.hasRead === false) {
this.$toast('请先阅读定点自由行申请表')
return
}
if (!this.formData.sign) {
this.$toast.fail('请签字')
return
}
this.formData.editOther = this.editOther ? this.editOther : ''
const cloneData = clone(this.formData)
vant.Dialog.confirm({
title: '温馨提示',
message: '请确认您已阅览【定点自由行申请表】,是否确认提交报名',
confirmButtonText: '确认',
message: '请确保信息填写无误,是否确认提交?',
confirmButtonText: '提交',
cancelButtonText: '取消',
}).then(async () => {
const toast = vant.Toast.loading({
this.showButton = false
const loading = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
@@ -641,21 +594,21 @@ layout("/mobile/platform.html"){
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForBaseManagement', {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}
}, 500)
loading.clear()
if (resp.code === 0) {
vant.Dialog.alert({
title: '提示',
message: '报名成功',
}).then(() => {
location.replace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
})
} else {
vant.Dialog.alert({
title: '提示',
message: resp.msg,
})
this.showButton = true
}
}).catch(() => {
// on cancel
})
@@ -671,7 +624,8 @@ layout("/mobile/platform.html"){
enroll: JSON.stringify({
takePartInBaseManagementId: this.baseData.id,
isNormal: this.baseData.isNormal,
id: this.enrollId
id: this.enrollId,
editOther: this.editOther
}),
})
if (re.code !== 0) {
@@ -682,18 +636,24 @@ layout("/mobile/platform.html"){
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')}",
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
bedInfo: {},
if (this.editOther) {
this.$set(this.formData, 'baseName', this.baseData.baseName)
this.$set(this.formData, 'takePartInLineId', null)
this.$set(this.formData, 'takePartInUnionId', null)
this.$set(this.formData, 'takePartInTravelAgencyId', null)
this.$set(this.formData, 'takePartInBaseManagementId', this.baseData.id)
} else {
this.formData = {
userName: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
idCard: "${@shiro.getPrincipalProperty('idcard')}",
mobile: "${@shiro.getPrincipalProperty('mobile')}",
baseName: this.baseData.baseName,
takePartInBaseManagementId: this.baseData.id,
companionList: [],
}
}
// this.$set(this.formData.bedInfo, 'bedType', '大床房')
}
if(this.index == 3) {
await this.getTimeArray()
@@ -704,7 +664,6 @@ layout("/mobile/platform.html"){
const res = await $.get('/platform/theRapyRecuperation/baseManagement/selectBaseAllInfo', {
id: this.id
})
debugger
if (res.code === 0) {
this.baseData = res.data
this.formData.baseName = this.baseData.baseName
@@ -730,19 +689,14 @@ layout("/mobile/platform.html"){
},
//修改时查询报名信息,进行回显
async findSignUpInfoById() {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/findSignUpInfoById/' + this.enrollId)
const res = await $.post('/platform/theRapyRecuperation/line/enroll/findSignUpInfoById', {
id: this.enrollId,
editOther: this.editOther
})
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.formData.bedInfo = {}
this.formData.companionList = []
this.$forceUpdate()
}
},
@@ -858,13 +812,16 @@ layout("/mobile/platform.html"){
},
},
async created() {
// 修改其他线路标识
this.editOther = getQueryString('editOther') ? getQueryString('editOther') : ''
this.id = getQueryString('id') ? getQueryString('id') : ''
this.enrollId = getQueryString('enrollId') ? getQueryString('enrollId') : ''
this.index = getQueryString('index') ? getQueryString('index') : ''
await this.getConfigData()
//编辑传出来的参数
this.fromUrlByMy = getQueryString('fromUrlByMy') ? getQueryString('fromUrlByMy') : ''
if (this.enrollId) {
if (this.enrollId || this.editOther) {
await this.findSignUpInfoById()
}
await this.getData()
@@ -881,50 +838,30 @@ layout("/mobile/platform.html"){
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
}
this.$nextTick(() => {
pdfh5.on("complete", function () {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(o.getAttribute('class') !== 'top_icon') {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
})
})
},
mounted() {
window.addEventListener('scroll', this.scrollToTop)
document.addEventListener('click', function (event) {
const imgDoc = document.querySelectorAll('img')
let array = []
let classArray = []
imgDoc.forEach(o => {
if(o.getAttribute('class') !== 'top_icon') {
classArray.push(o.getAttribute('class'))
array.push(o.getAttribute('src'))
}
})
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG') {
vant.ImagePreview([event.target.src])
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = array.indexOf(event.target.currentSrc)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
},