|
@@ -101,7 +101,7 @@
|
|
|
</div>
|
|
|
<div class="bodyOuter">
|
|
|
<div class="inlineBlock">{{ item.roomNo }}</div>
|
|
|
- <div class="inlineBlock" v-if="item.name">{{ item.sexName }} 22岁</div>
|
|
|
+ <div class="inlineBlock" v-if="item.name">{{ item.sexName + ' ' + handleAge(item.birthDate, item.currentDate) }}</div>
|
|
|
</div>
|
|
|
<div v-if="item.name" style="width:100%">
|
|
|
<div class="bodyOuter">
|
|
@@ -368,6 +368,20 @@ function handleClickReceive(row) {
|
|
|
}).catch(() => {})
|
|
|
}
|
|
|
|
|
|
+const handleAge = (birthDate,currentDate) => {
|
|
|
+ const today = new Date(currentDate);
|
|
|
+ const birth = new Date(birthDate);
|
|
|
+
|
|
|
+ let age = today.getFullYear() - birth.getFullYear();
|
|
|
+ const month = today.getMonth() - birth.getMonth();
|
|
|
+
|
|
|
+ if (month < 0 || (month === 0 && today.getDate() < birth.getDate())) {
|
|
|
+ age--;
|
|
|
+ }
|
|
|
+
|
|
|
+ return age;
|
|
|
+}
|
|
|
+
|
|
|
function handleSelectPh(val) {
|
|
|
receiveRow.value.phry = val.code
|
|
|
showSearchPh.value = false
|