k94314517
2025-06-06 7af24e2656ddae37f03f1ae62b439f1bbf6a9dc4
company/src/components/business/OpearaCaseEntryWindow.vue
@@ -51,6 +51,7 @@
                                <el-date-picker
                                    v-model="ruleForm.extData.memberBirthday"
                                    type="date"
                                    @change="changeMemberBirthday"
                                    placeholder="选择日期"
                                    format="yyyy 年 MM 月 dd 日"
                                    value-format="yyyy-MM-dd">
@@ -982,6 +983,26 @@
      }
      this.getCompensations()
    },
      changeMemberBirthday(e) {
          if (!e) {
              this.ruleForm.extData.memberAge = ''
          } else {
              this.ruleForm.extData.memberAge = this.calculateAge(e)
          }
      },
      calculateAge(birthDate) {
          const today = new Date();
          const birthDateObject = new Date(birthDate);
          let age = today.getFullYear() - birthDateObject.getFullYear();
          const monthDiff = today.getMonth() - birthDateObject.getMonth();
          if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDateObject.getDate())) {
              age--;
          }
          return age;
      },
    confirm () {
      this.$refs.ruleForm.validate((valid) => {
        if (!valid) return