This commit is contained in:
Paidax
2025-06-12 14:24:57 +08:00
parent 2409b3ddfe
commit 726dfd50be
321 changed files with 2483 additions and 1911 deletions
@@ -215,9 +215,9 @@ layout("/mobile/platform.html"){
<div class="container">
<div class="header">
<div class="title">
<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
<!--<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
{{baseData.lotName}}
</van-tag>
</van-tag>-->
{{baseData.baseName}}
</div>
<div style="margin-top: 10px">
@@ -279,6 +279,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>
<div class="join_content">
<van-form @submit="joinSubmit">
@@ -292,17 +296,31 @@ layout("/mobile/platform.html"){
<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 label="身份证件" name="idCard" :rules="[{ required: true }]"
<van-field label="身份证件" name="idCard" required :rules="[{ required: true }]"
placeholder="请填写身份证号、护照、台胞证等" v-model="formData.idCard"></van-field>
<van-field label="手机号" name="mobile" :rules="[{ required: true }]"
<van-field label="手机号" name="mobile" required :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.baseName"></van-field>
<van-field label="出行时间" readonly @click="timeVisible = true"
:rules="[{ required: true }]" placeholder="请选择出行时间" required
is-link v-model="formData.specificTime" name="specificTime"></van-field>
</div>
</div>
<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
签字
</div>
<div class="van-card-body">
<mobile-sign :is_value_base64="false" v-model="formData.sign" prefix="RAPY"
ref="signature"></mobile-sign>
</div>
</div>
<!--床位信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<!--<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
房间信息
@@ -319,10 +337,10 @@ layout("/mobile/platform.html"){
<div>
<span style="color: red;margin-left: 14px;font-size: 14px">包房需自费;不包房两位老师一间且随机分配</span>
</div>
<!--<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
&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>-->
<!--<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
: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>
@@ -338,11 +356,11 @@ layout("/mobile/platform.html"){
<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>-->
:rules="[{ required: true }]"></van-field>&ndash;&gt;
</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"
@@ -363,7 +381,7 @@ layout("/mobile/platform.html"){
<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>-->
&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">
@@ -385,7 +403,7 @@ layout("/mobile/platform.html"){
placeholder="随行人与本人关系" v-model="item.relation"
:rules="[{ required: true }]"></van-field>
<!--<van-field @click="self = false; roomVisible = true" readonly is-link label="房间"
&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">
@@ -405,7 +423,7 @@ layout("/mobile/platform.html"){
</van-field>
<van-field v-if="item.bedInfo.bedType == '标准间' && item.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="item.bedInfo.otherSleepUser"></van-field>-->
v-model="item.bedInfo.otherSleepUser"></van-field>&ndash;&gt;
</van-tab>
</van-tabs>
</div>
@@ -420,13 +438,15 @@ layout("/mobile/platform.html"){
<van-field label="家属数量" name="familyNumber" placeholder="请填写家属数量" v-model="formData.familyNumber"
type="digit" :rules="[{ required: true }]"></van-field>
</template>
</div>
</div>-->
<div class="submitButton">
<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>
@@ -462,6 +482,22 @@ 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-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>
</div>
<script>
function getQueryString(name) {
@@ -478,6 +514,8 @@ layout("/mobile/platform.html"){
return {
isPdf: false,
active: 0,
minDate: new Date(2010, 0, 1),
maxDate: new Date(2010, 0, 31),
roomColumns: ['包房', '默认房间'],
bedColumns: ['1', '2'],
companionColumns: ['配偶', '子女', '亲属', '其他'],
@@ -499,6 +537,8 @@ layout("/mobile/platform.html"){
takePartInUnionId: '',
companionList: [],
bedInfo: {},
specificTime: '',
sign: ''
},
self: true,
btnFlag: false,
@@ -507,9 +547,34 @@ layout("/mobile/platform.html"){
fromUrlByMy: '',
enrollId: '',
configData: {},
// 出行日期相关
timeVisible: false,
// 定点疗休养申请表相关
applyFormShow: false,
}
},
methods: {
// 展示申请表
async showApplyForm(){
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.$nextTick(() => {
pdfh5 = new Pdfh5('#basePdf', {
pdfurl: url,
});
})
},
// 出行日期相关
calConfirm(date) {
console.log(date)
this.$set(this.formData, "specificTime", moment(date).format('YYYY年MM月DD日'))
this.timeVisible = false
},
getAgeAndSex(item){
try {
const value = item.idCard
@@ -555,54 +620,45 @@ layout("/mobile/platform.html"){
}
})
if (cloneData.companionList) {
for (let i = 0; i < cloneData.companionList.length; i++) {
const companion = cloneData.companionList[i];
// 检查每个字段是否为空
if (!companion.userName || !companion.idCard || !companion.mobile || !companion.relation) {
this.$toast('请填写完整随行人信息')
return
}
// 填了身份证,校验是否正确
if (companion.idCard) {
if (!this.validateIdCard(companion.idCard)) {
this.$toast('随行人'+ (i+1) +'的身份证不正确')
return
} else {
// 判断companion.age,是不是在3到70岁之间,不是就提示
if (companion.age < 3 || companion.age > 70) {
this.$toast('随行人'+ (i+1) +'的年龄超出限制,请天添加其他联系人')
return
}
}
}
}
if (!this.formData.sign) {
this.$toast.fail('请签字')
return
}
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
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'
}
vant.Dialog.confirm({
title: '温馨提示',
message: '请确认您已阅览【定点自由行申请表】,是否确认提交报名?',
confirmButtonText: '确认',
cancelButtonText: '取消',
}).then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/doSignUpForBaseManagement', {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
toast.clear()
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)
if (resp.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index
}
}, 1000)
}).catch(() => {
// on cancel
})
},
addCompanion() {
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
@@ -637,7 +693,10 @@ layout("/mobile/platform.html"){
companionList: [],
bedInfo: {},
}
this.$set(this.formData.bedInfo, 'bedType', '大床房')
// this.$set(this.formData.bedInfo, 'bedType', '大床房')
}
if(this.index == 3) {
await this.getTimeArray()
}
this.joinPopup = true
},
@@ -645,6 +704,7 @@ 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
@@ -690,6 +750,13 @@ layout("/mobile/platform.html"){
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
async getTimeArray(){
const res = await $.post('/platform/theRapyRecuperation/baseManagement/getTimeArray', {
id: this.id
})
this.minDate = new Date(res.data.minDate)
this.maxDate = new Date(res.data.maxDate)
},
calculateAgeFromIdCard(idCard) {
// 检查身份证号码是否合法
if (!idCard) {
@@ -805,7 +872,6 @@ layout("/mobile/platform.html"){
try {
const parser = new DOMParser();
const doc = parser.parseFromString(this.baseData.content, 'text/html');
console.log(this.baseData)
const link = doc.querySelector('a');
const href = link.getAttribute('href');
this.$nextTick(() => {