解决合并冲突
This commit is contained in:
@@ -350,6 +350,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="PatientAddDialog">
|
||||
import { watch } from 'vue';
|
||||
import { watch, defineProps } from "vue";
|
||||
import pcas from 'china-division/dist/pcas-code.json';
|
||||
import { addPatient, patientlLists, getOutpatientRegistrationList } from './outpatientregistration';
|
||||
@@ -711,22 +712,22 @@ watch(
|
||||
const birthYear = parseInt(newIdCard.substring(6, 10));
|
||||
const birthMonth = parseInt(newIdCard.substring(10, 12));
|
||||
const birthDay = parseInt(newIdCard.substring(12, 14));
|
||||
|
||||
// 设置出生日期
|
||||
form.value.birthDate = `${birthYear}-${birthMonth.toString().padStart(2, '0')}-${birthDay.toString().padStart(2, '0')}`;
|
||||
const today = new Date();
|
||||
const currentYear = today.getFullYear();
|
||||
const currentMonth = today.getMonth() + 1;
|
||||
const currentDay = today.getDate();
|
||||
|
||||
|
||||
let age = currentYear - birthYear;
|
||||
|
||||
|
||||
// 如果当前月份小于出生月份,或者月份相同但当前日期小于出生日期,则年龄减1
|
||||
if (
|
||||
currentMonth < birthMonth ||
|
||||
(currentMonth === birthMonth && currentDay < birthDay)
|
||||
) {
|
||||
if (currentMonth < birthMonth || (currentMonth === birthMonth && currentDay < birthDay)) {
|
||||
age--;
|
||||
}
|
||||
|
||||
form.value.age = age;
|
||||
|
||||
form.value.age = age ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user