疗休养
This commit is contained in:
@@ -223,9 +223,6 @@ 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">
|
||||
{{baseData.lotName}}
|
||||
</van-tag>-->
|
||||
{{baseData.baseName}}
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
@@ -250,16 +247,9 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
</div>
|
||||
<van-divider></van-divider>
|
||||
<!-- <div v-if="baseData.content" v-html="baseData.content" class="content"></div>-->
|
||||
<!-- <div v-else v-html="configData.notice" class="content"></div>-->
|
||||
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看图片,再单击返回</van-divider>
|
||||
<div v-if="isPdf" v-html="baseData.content" class="content"></div>
|
||||
<div v-else id="demo" class="pdf_div"></div>
|
||||
<!--<van-empty
|
||||
v-else class="custom-image"
|
||||
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
|
||||
description="暂无详细信息"
|
||||
></van-empty>-->
|
||||
|
||||
</div>
|
||||
</van-skeleton>
|
||||
@@ -354,36 +344,6 @@ layout("/mobile/platform.html"){
|
||||
</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-calendar title="出行日期选择" v-model="timeVisible" :show-confirm="false"
|
||||
:min-date="minDate" :max-date="maxDate"
|
||||
ref="cal" @confirm="calConfirm" :style="{ height: '660px' }"></van-calendar>
|
||||
@@ -499,7 +459,7 @@ layout("/mobile/platform.html"){
|
||||
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 : '')
|
||||
+ '&sign=' + (this.formData.sign ? this.formData.sign : '') + '&idCard=' + (this.formData.idCard ? this.formData.idCard : '')
|
||||
|
||||
this.readVisible = true
|
||||
this.$nextTick(() => {
|
||||
@@ -525,43 +485,6 @@ layout("/mobile/platform.html"){
|
||||
this.$set(this.formData, "specificTime", moment(date).format('YYYY年MM月DD日'))
|
||||
this.timeVisible = false
|
||||
},
|
||||
getAgeAndSex(item){
|
||||
try {
|
||||
const value = item.idCard
|
||||
const age = this.calculateAgeFromIdCard(value)
|
||||
this.$set(item, "age", age)
|
||||
|
||||
const sex = this.getGenderFromIdCard(value)
|
||||
this.$set(item, "sex", sex)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
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.hasReadSafe === false) {
|
||||
this.$toast('请先阅读安全告知书')
|
||||
@@ -572,7 +495,7 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
if (!this.formData.sign) {
|
||||
this.$toast.fail('请签字')
|
||||
this.$toast('请签字')
|
||||
return
|
||||
}
|
||||
this.formData.editOther = this.editOther ? this.editOther : ''
|
||||
@@ -613,12 +536,6 @@ layout("/mobile/platform.html"){
|
||||
// on cancel
|
||||
})
|
||||
},
|
||||
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({
|
||||
@@ -710,106 +627,7 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
this.minDate = new Date(res.data.minDate)
|
||||
this.maxDate = new Date(res.data.maxDate)
|
||||
},
|
||||
calculateAgeFromIdCard(idCard) {
|
||||
// 检查身份证号码是否合法
|
||||
if (!idCard) {
|
||||
throw new Error("Invalid ID card format")
|
||||
}
|
||||
|
||||
let birthDateStr
|
||||
let birthYear, birthMonth, birthDay
|
||||
|
||||
// 处理18位身份证号码
|
||||
if (idCard.length === 18) {
|
||||
birthDateStr = idCard.substring(6, 14)
|
||||
birthYear = parseInt(birthDateStr.substring(0, 4), 10)
|
||||
birthMonth = parseInt(birthDateStr.substring(4, 6), 10) - 1 // 月份从0开始
|
||||
birthDay = parseInt(birthDateStr.substring(6, 8), 10)
|
||||
}
|
||||
// 处理15位身份证号码
|
||||
else if (idCard.length === 15) {
|
||||
birthDateStr = idCard.substring(6, 12)
|
||||
birthYear = parseInt("19" + birthDateStr.substring(0, 2), 10) // 使用字符串拼接
|
||||
birthMonth = parseInt(birthDateStr.substring(2, 4), 10) - 1 // 月份从0开始
|
||||
birthDay = parseInt(birthDateStr.substring(4, 6), 10)
|
||||
} else {
|
||||
throw new Error("Invalid ID card format. Only 15 or 18 digits are supported.")
|
||||
}
|
||||
|
||||
// 获取当前日期
|
||||
const currentDate = new Date()
|
||||
|
||||
// 计算年龄
|
||||
let age = currentDate.getFullYear() - birthYear
|
||||
|
||||
// 如果当前日期还没过生日,则年龄减1
|
||||
if (currentDate.getMonth() < birthMonth || (currentDate.getMonth() === birthMonth && currentDate.getDate() < birthDay)) {
|
||||
age -= 1
|
||||
}
|
||||
|
||||
return age
|
||||
},
|
||||
getGenderFromIdCard(idCard) {
|
||||
// 检查身份证号码是否合法
|
||||
if (!idCard) {
|
||||
throw new Error("Invalid ID card format")
|
||||
}
|
||||
|
||||
let genderDigit
|
||||
|
||||
// 处理18位身份证号码
|
||||
if (idCard.length === 18) {
|
||||
genderDigit = parseInt(idCard.charAt(16), 10) // 第17位
|
||||
}
|
||||
// 处理15位身份证号码
|
||||
else if (idCard.length === 15) {
|
||||
genderDigit = parseInt(idCard.charAt(14), 10) // 第15位
|
||||
} else {
|
||||
throw new Error("Invalid ID card format. Only 15 or 18 digits are supported.")
|
||||
}
|
||||
|
||||
// 判断性别
|
||||
if (genderDigit % 2 === 0) {
|
||||
return "女"
|
||||
} else {
|
||||
return "男"
|
||||
}
|
||||
},
|
||||
validateIdCard(idCard) {
|
||||
if (!idCard) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 18位身份证号码校验
|
||||
if (idCard.length === 18) {
|
||||
const idCardRegex = /^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/
|
||||
if (!idCardRegex.test(idCard)) {
|
||||
return false
|
||||
}
|
||||
|
||||
// 校验码计算
|
||||
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
|
||||
const checksums = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"]
|
||||
let sum = 0
|
||||
for (let i = 0; i < 17; i++) {
|
||||
sum += idCard[i] * weights[i]
|
||||
}
|
||||
const checksum = checksums[sum % 11]
|
||||
return checksum === idCard[17].toUpperCase()
|
||||
}
|
||||
|
||||
// 15位身份证号码校验
|
||||
else if (idCard.length === 15) {
|
||||
const idCardRegex = /^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/
|
||||
return idCardRegex.test(idCard)
|
||||
}
|
||||
|
||||
// 外国人或其他情况
|
||||
else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
// 修改其他线路标识
|
||||
|
||||
Reference in New Issue
Block a user