Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main/resources/views/platform/theRapyRecuperation/signUp/index.html
This commit is contained in:
@@ -223,9 +223,6 @@ layout("/mobile/platform.html"){
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<!--<van-tag size="large" color="#1867b0" style="color: white;position: relative; top: -2px">
|
|
||||||
{{baseData.lotName}}
|
|
||||||
</van-tag>-->
|
|
||||||
{{baseData.baseName}}
|
{{baseData.baseName}}
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
@@ -250,16 +247,9 @@ layout("/mobile/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<van-divider></van-divider>
|
<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>
|
<van-divider :style="{ color: 'orange', fontSize: '12px' }">上下滑动翻页,单击查看图片,再单击返回</van-divider>
|
||||||
<div v-if="isPdf" v-html="baseData.content" class="content"></div>
|
<div v-if="isPdf" v-html="baseData.content" class="content"></div>
|
||||||
<div v-else id="demo" class="pdf_div"></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>
|
</div>
|
||||||
</van-skeleton>
|
</van-skeleton>
|
||||||
@@ -354,36 +344,6 @@ layout("/mobile/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
</van-popup>
|
</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"
|
<van-calendar title="出行日期选择" v-model="timeVisible" :show-confirm="false"
|
||||||
:min-date="minDate" :max-date="maxDate"
|
:min-date="minDate" :max-date="maxDate"
|
||||||
ref="cal" @confirm="calConfirm" :style="{ height: '660px' }"></van-calendar>
|
ref="cal" @confirm="calConfirm" :style="{ height: '660px' }"></van-calendar>
|
||||||
@@ -499,7 +459,7 @@ layout("/mobile/platform.html"){
|
|||||||
async openRead(){
|
async openRead(){
|
||||||
const url = '/platform/theRapyRecuperation/baseManagement/showBaseApplyPdf?baseName='
|
const url = '/platform/theRapyRecuperation/baseManagement/showBaseApplyPdf?baseName='
|
||||||
+ (this.formData.baseName ? this.formData.baseName : '') + '&specificTime=' + (this.formData.specificTime ? this.formData.specificTime : '')
|
+ (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.readVisible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -525,43 +485,6 @@ layout("/mobile/platform.html"){
|
|||||||
this.$set(this.formData, "specificTime", moment(date).format('YYYY年MM月DD日'))
|
this.$set(this.formData, "specificTime", moment(date).format('YYYY年MM月DD日'))
|
||||||
this.timeVisible = false
|
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() {
|
async joinSubmit() {
|
||||||
if (this.hasReadSafe === false) {
|
if (this.hasReadSafe === false) {
|
||||||
this.$toast('请先阅读安全告知书')
|
this.$toast('请先阅读安全告知书')
|
||||||
@@ -572,7 +495,7 @@ layout("/mobile/platform.html"){
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.formData.sign) {
|
if (!this.formData.sign) {
|
||||||
this.$toast.fail('请签字')
|
this.$toast('请签字')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.formData.editOther = this.editOther ? this.editOther : ''
|
this.formData.editOther = this.editOther ? this.editOther : ''
|
||||||
@@ -613,12 +536,6 @@ layout("/mobile/platform.html"){
|
|||||||
// on cancel
|
// on cancel
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addCompanion() {
|
|
||||||
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
|
|
||||||
},
|
|
||||||
delCompanion() {
|
|
||||||
this.formData.companionList.splice(this.active, 1)
|
|
||||||
},
|
|
||||||
async join() {
|
async join() {
|
||||||
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
|
const re = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
|
||||||
enroll: JSON.stringify({
|
enroll: JSON.stringify({
|
||||||
@@ -710,106 +627,7 @@ layout("/mobile/platform.html"){
|
|||||||
})
|
})
|
||||||
this.minDate = new Date(res.data.minDate)
|
this.minDate = new Date(res.data.minDate)
|
||||||
this.maxDate = new Date(res.data.maxDate)
|
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() {
|
async created() {
|
||||||
// 修改其他线路标识
|
// 修改其他线路标识
|
||||||
|
|||||||
@@ -806,11 +806,11 @@ layout("/mobile/platform.html"){
|
|||||||
url = '/platform/theRapyRecuperation/line/enroll/doSignUpForLine'
|
url = '/platform/theRapyRecuperation/line/enroll/doSignUpForLine'
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = this.editOther ? ('此操作会取消之前报名线路,并修改为【'+ this.formData.lineName +'】是否确认?') : '请确保信息填写无误,是否确认?'
|
const msg = this.editOther ? ('此操作会取消之前报名线路,并修改为【'+ this.formData.lineName +'】是否确认提交?') : '请确保信息填写无误,是否确认提交?'
|
||||||
vant.Dialog.confirm({
|
vant.Dialog.confirm({
|
||||||
title: '温馨提示',
|
title: '温馨提示',
|
||||||
message: msg,
|
message: msg,
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '提交',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
}).then(async () => {
|
}).then(async () => {
|
||||||
this.showButton = false
|
this.showButton = false
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ layout("/layouts/platform.html"){
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card class="mt10" shadow="never">
|
<el-card class="mt10" shadow="never">
|
||||||
<table-tool :app="this" label="线路列表">
|
<vi-title2 title="线路列表">
|
||||||
<template #func>
|
<template #func>
|
||||||
<el-radio-group v-model="pageForm.signUpStateId" @change="doSearch">
|
<el-radio-group v-model="pageForm.signUpStateId" @change="doSearch">
|
||||||
<el-radio-button label="1">已报名</el-radio-button>
|
<el-radio-button label="1">已报名</el-radio-button>
|
||||||
@@ -40,7 +40,8 @@ layout("/layouts/platform.html"){
|
|||||||
<el-radio-button label="3">未参加</el-radio-button>
|
<el-radio-button label="3">未参加</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</template>
|
</template>
|
||||||
</table-tool>
|
</vi-title2>
|
||||||
|
|
||||||
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
|
||||||
align="center"
|
align="center"
|
||||||
header-align="center">
|
header-align="center">
|
||||||
@@ -123,11 +124,16 @@ layout("/layouts/platform.html"){
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<line-sign-up ref="lineSignUpRef"></line-sign-up>
|
<line-sign-up ref="lineSignUpRef"></line-sign-up>
|
||||||
|
|
||||||
|
<el-dialog :title="baseName + '报名'" width="60%" :visible.sync="baseVisible" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
|
<base-sign-up ref="baseRef" :config_data="configData" @success="baseSuccess"></base-sign-up>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<!--#include('../signUp/info.js'){}#-->
|
<!--#include('../signUp/info.js'){}#-->
|
||||||
<!--#include('../signUp/lineSignUp.js'){}#-->
|
<!--#include('../signUp/lineSignUp.js'){}#-->
|
||||||
|
<!--#include('../signUp/base.js'){}#-->
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
@@ -141,14 +147,22 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
chooseButton: [],
|
chooseButton: [],
|
||||||
configData: {},
|
configData: {},
|
||||||
lineDialogVisible: false
|
lineDialogVisible: false,
|
||||||
|
baseVisible:false,
|
||||||
|
baseName:""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
'info': INFO,
|
'info': INFO,
|
||||||
'line-sign-up': LineSignUp
|
'line-sign-up': LineSignUp,
|
||||||
|
'base-sign-up': BASE
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 定点相关
|
||||||
|
baseSuccess() {
|
||||||
|
this.baseVisible = false
|
||||||
|
this.pageData();
|
||||||
|
},
|
||||||
edit(o) {
|
edit(o) {
|
||||||
if ([0, 1].includes(this.pageForm.theRapyRecuperationType)) {
|
if ([0, 1].includes(this.pageForm.theRapyRecuperationType)) {
|
||||||
// 线路
|
// 线路
|
||||||
@@ -158,6 +172,15 @@ layout("/layouts/platform.html"){
|
|||||||
}, this.pageForm, this.configData, o.id);
|
}, this.pageForm, this.configData, o.id);
|
||||||
} else if (this.pageForm.theRapyRecuperationType === 3) {
|
} else if (this.pageForm.theRapyRecuperationType === 3) {
|
||||||
// 定点疗休养
|
// 定点疗休养
|
||||||
|
const data = {
|
||||||
|
id: o.takePartInBaseManagementId,
|
||||||
|
enrollId: o.id,
|
||||||
|
}
|
||||||
|
this.baseName = o.baseName
|
||||||
|
this.baseVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.baseRef.initData(data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
editOther(o) {
|
editOther(o) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const BASE = {
|
|||||||
<span @click="openReadSafe" style="color: #0e5996; text-decoration: underline">
|
<span @click="openReadSafe" style="color: #0e5996; text-decoration: underline">
|
||||||
《安全告知书》
|
《安全告知书》
|
||||||
</span>
|
</span>
|
||||||
<el-tag @click="openReadSafe" size="medium" effect="dark">查看</el-tag>
|
<el-tag @click="openReadSafe" size="mini" effect="dark">查看</el-tag>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex;" v-if="formData.specificTime && formData.sign">
|
<div style="display: flex;" v-if="formData.specificTime && formData.sign">
|
||||||
@@ -73,7 +73,7 @@ const BASE = {
|
|||||||
<span @click="openRead" style="color: #0e5996; text-decoration: underline">
|
<span @click="openRead" style="color: #0e5996; text-decoration: underline">
|
||||||
《定点自由行申请表》
|
《定点自由行申请表》
|
||||||
</span>
|
</span>
|
||||||
<el-tag @click="openRead" size="medium" effect="dark">查看</el-tag>
|
<el-tag @click="openRead" size="mini" effect="dark">查看</el-tag>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -123,9 +123,7 @@ const BASE = {
|
|||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
id: '',
|
id: '',
|
||||||
index: '',
|
|
||||||
enrollId: '',
|
enrollId: '',
|
||||||
fromUrlByMy: '',
|
|
||||||
baseData: {},
|
baseData: {},
|
||||||
formData: {
|
formData: {
|
||||||
userName: "",
|
userName: "",
|
||||||
@@ -139,9 +137,49 @@ const BASE = {
|
|||||||
companionList: [],
|
companionList: [],
|
||||||
},
|
},
|
||||||
formRules: {
|
formRules: {
|
||||||
userName: [{required: false, message: "必填", trigger: ["change", "blur"]}],
|
idCard: [
|
||||||
loginName: [{required: false, message: "必填", trigger: ["change", "blur"]}],
|
{
|
||||||
specificTime: [{required: false, message: "必填", trigger: ["change", "blur"]}],
|
required: true,
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (/^[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])$/.test(value)) {
|
||||||
|
// 18位身份证号码格式正确
|
||||||
|
callback();
|
||||||
|
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
|
// 15位身份证号码格式正确
|
||||||
|
callback();
|
||||||
|
} else if (/^[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}$/.test(value)) {
|
||||||
|
// 外国人身份证号码格式正确(18位)
|
||||||
|
callback();
|
||||||
|
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
|
// 外国人身份证号码格式正确(15位)
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
// 格式错误,返回错误信息
|
||||||
|
callback(new Error("身份证号码格式错误"));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: ["change", "blur"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
mobile: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (/^[1][345789][0-9]{9}$/.test(value)) {
|
||||||
|
// 手机号格式正确
|
||||||
|
callback();
|
||||||
|
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
||||||
|
// 座机号格式正确
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
// 格式错误,返回错误信息
|
||||||
|
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
trigger: ["change", "blur"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
specificTime: [{required: true, message: "必填", trigger: ["change", "blur"]}],
|
||||||
},
|
},
|
||||||
// 出行日期相关
|
// 出行日期相关
|
||||||
timeVisible: false,
|
timeVisible: false,
|
||||||
@@ -271,7 +309,7 @@ const BASE = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async join(){
|
async join(){
|
||||||
if (this.fromUrlByMy !== 'editDo') {
|
if (!this.enrollId) {
|
||||||
if (this.editOther) {
|
if (this.editOther) {
|
||||||
this.$set(this.formData, 'baseName', this.baseData.baseName)
|
this.$set(this.formData, 'baseName', this.baseData.baseName)
|
||||||
this.$set(this.formData, 'takePartInLineId', null)
|
this.$set(this.formData, 'takePartInLineId', null)
|
||||||
@@ -291,9 +329,7 @@ const BASE = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.index == 3) {
|
|
||||||
await this.getTimeArray()
|
await this.getTimeArray()
|
||||||
}
|
|
||||||
},
|
},
|
||||||
joinSubmit(){
|
joinSubmit(){
|
||||||
if (this.hasReadSafe === false) {
|
if (this.hasReadSafe === false) {
|
||||||
@@ -311,6 +347,8 @@ const BASE = {
|
|||||||
this.formData.editOther = this.editOther ? this.editOther : ''
|
this.formData.editOther = this.editOther ? this.editOther : ''
|
||||||
const cloneData = clone(this.formData)
|
const cloneData = clone(this.formData)
|
||||||
|
|
||||||
|
this.$refs.formRef.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
this.$confirm('请确保信息填写无误,是否确认提交?', '提示', {
|
this.$confirm('请确保信息填写无误,是否确认提交?', '提示', {
|
||||||
confirmButtonText: '提交',
|
confirmButtonText: '提交',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -328,33 +366,27 @@ const BASE = {
|
|||||||
})
|
})
|
||||||
loading.close()
|
loading.close()
|
||||||
if (resp.code === 0) {
|
if (resp.code === 0) {
|
||||||
this.$message.success('报名成功')
|
this.$message.success('操作成功')
|
||||||
this.$emit('success')
|
this.$emit('success')
|
||||||
// vant.Dialog.alert({
|
|
||||||
// title: '提示',
|
|
||||||
// message: '报名成功',
|
|
||||||
// }).then(() => {
|
|
||||||
// location.replace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
|
|
||||||
// })
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(resp.msg)
|
this.$message.warning(resp.msg)
|
||||||
this.showButton = true
|
this.showButton = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
async initData(data){
|
async initData(data){
|
||||||
this.id = data.id
|
this.id = data.id
|
||||||
this.index = data.index
|
|
||||||
this.enrollId = data.enrollId
|
this.enrollId = data.enrollId
|
||||||
this.fromUrlByMy = data.fromUrlByMy
|
|
||||||
this.editOther = data.editOther
|
this.editOther = data.editOther
|
||||||
|
|
||||||
await this.getData()
|
|
||||||
|
|
||||||
if (this.enrollId || this.editOther) {
|
if (this.enrollId || this.editOther) {
|
||||||
await this.findSignUpInfoById()
|
await this.findSignUpInfoById()
|
||||||
}
|
}
|
||||||
|
await this.getData()
|
||||||
await this.join()
|
await this.join()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -351,16 +351,21 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
<line-sign-up ref="lineSignUpRef"></line-sign-up>
|
<line-sign-up ref="lineSignUpRef"></line-sign-up>
|
||||||
|
|
||||||
|
<el-dialog :title="baseName + '报名'" width="60%" :visible.sync="baseVisible" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
|
<base-sign-up ref="baseRef" :config_data="config" @success="baseSuccess"></base-sign-up>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
<!--#include('lineSignUp.js'){}#-->
|
<!--#include('lineSignUp.js'){}#-->
|
||||||
|
<!--#include('base.js'){}#-->
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
el: '#app',
|
el: '#app',
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
components: {
|
components: {
|
||||||
'line-sign-up': LineSignUp
|
'line-sign-up': LineSignUp,
|
||||||
|
'base-sign-up': BASE
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -376,6 +381,10 @@ layout("/layouts/platform.html"){
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 定点报名相关
|
||||||
|
baseName: '',
|
||||||
|
baseVisible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -436,6 +445,7 @@ layout("/layouts/platform.html"){
|
|||||||
},
|
},
|
||||||
// 处理报名
|
// 处理报名
|
||||||
async handleSignUp(row) {
|
async handleSignUp(row) {
|
||||||
|
if (["0", "1"].includes(this.pageForm.theRapyRecuperationType)) {
|
||||||
const {code,data,msg} = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo',{
|
const {code,data,msg} = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo',{
|
||||||
enroll: JSON.stringify({
|
enroll: JSON.stringify({
|
||||||
isNormal: true,
|
isNormal: true,
|
||||||
@@ -443,17 +453,40 @@ layout("/layouts/platform.html"){
|
|||||||
takePartInUnionId: row.takePartInUnionId,
|
takePartInUnionId: row.takePartInUnionId,
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
// if (code !== 0) {
|
if (code !== 0) {
|
||||||
// this.$message.error(msg);
|
this.$message.error(msg);
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (["0", "1"].includes(this.pageForm.theRapyRecuperationType)) {
|
|
||||||
// 线路
|
// 线路
|
||||||
this.$refs.lineSignUpRef.onOpen(row, this.pageForm, this.config);
|
this.$refs.lineSignUpRef.onOpen(row, this.pageForm, this.config);
|
||||||
} else if (this.pageForm.theRapyRecuperationType === 3) {
|
} else if (this.pageForm.theRapyRecuperationType === "3") {
|
||||||
// 定点疗休养
|
// 定点疗休养
|
||||||
|
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', {
|
||||||
|
enroll: JSON.stringify({
|
||||||
|
takePartInBaseManagementId: row.id,
|
||||||
|
isNormal: true,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
if (resp.code !== 0) {
|
||||||
|
this.$message.error(resp.msg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
const data = {
|
||||||
|
id: row.id,
|
||||||
|
enrollId: '',
|
||||||
|
}
|
||||||
|
this.baseName = row.baseName
|
||||||
|
this.baseVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.baseRef.initData(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 定点相关
|
||||||
|
baseSuccess() {
|
||||||
|
this.baseVisible = false
|
||||||
|
this.pageData();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
Reference in New Issue
Block a user