更新航次登记页面 voyageReg

This commit is contained in:
80937518651731347 2026-06-29 13:21:18 +08:00
parent b4c8296d75
commit 8da4829da3
1 changed files with 31 additions and 13 deletions

View File

@ -320,7 +320,7 @@
<el-table-column prop="member_sex" label="性别" width="50" /> <el-table-column prop="member_sex" label="性别" width="50" />
<el-table-column prop="member_birthday" label="出生年月" width="100"> <el-table-column prop="member_birthday" label="出生年月" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.member_birthday.slice(0,10) }}</span> <span>{{ formatBirthday(scope.row.member_birthday) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="年龄" width="50"> <el-table-column label="年龄" width="50">
@ -719,10 +719,31 @@ export default {
this.paramsPeople.limit = val this.paramsPeople.limit = val
this.getPeopleList() this.getPeopleList()
}, },
/**
* 格式化出生日期显示
* @param {string|null|undefined} birthDateString - 出生日期
* @returns {string}
*/
formatBirthday(birthDateString) {
if (!birthDateString || !String(birthDateString).trim()) {
return ''
}
return String(birthDateString).slice(0, 10)
},
/**
* 根据出生日期计算年龄出生信息为空时不计算
* @param {string|null|undefined} birthDateString - 出生日期
* @returns {string|number}
*/
formatAge(birthDateString) { formatAge(birthDateString) {
if (birthDateString) { if (!birthDateString || !String(birthDateString).trim()) {
const today = new Date() return ''
}
const birthDate = new Date(birthDateString) const birthDate = new Date(birthDateString)
if (isNaN(birthDate.getTime())) {
return ''
}
const today = new Date()
let age = today.getFullYear() - birthDate.getFullYear() let age = today.getFullYear() - birthDate.getFullYear()
// //
const m = today.getMonth() - birthDate.getMonth() const m = today.getMonth() - birthDate.getMonth()
@ -730,9 +751,6 @@ export default {
age-- age--
} }
return age return age
} else {
return ''
}
}, },
cancelPeople() { cancelPeople() {
this.openPeople = false this.openPeople = false