|  |  |  | 
|---|
|  |  |  | placeholder="请选择起保日期" | 
|---|
|  |  |  | :disabled-date="disabledStartDate" | 
|---|
|  |  |  | :disabled="isSupply" | 
|---|
|  |  |  | @change="handleStartDateChange" | 
|---|
|  |  |  | ></ProFormDatePicker> | 
|---|
|  |  |  | </ProFormItemV2> | 
|---|
|  |  |  | <ProFormItemV2 | 
|---|
|  |  |  | label="截止日期:" | 
|---|
|  |  |  | prop="effectEndTime" | 
|---|
|  |  |  | :check-rules="[{ message: '请选择截止日期' }]" | 
|---|
|  |  |  | v-if="currentInsureProductScheme?.period === InsurancePeriodEnum['1-29D']" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <ProFormDatePicker | 
|---|
|  |  |  | v-model="form.effectEndTime" | 
|---|
|  |  |  | type="date" | 
|---|
|  |  |  | value-format="YYYY-MM-DD" | 
|---|
|  |  |  | placeholder="请选择截止日期" | 
|---|
|  |  |  | :disabled-date="disabledEndDate" | 
|---|
|  |  |  | :disabled="isSupply" | 
|---|
|  |  |  | ></ProFormDatePicker> | 
|---|
|  |  |  | </ProFormItemV2> | 
|---|
|  |  |  | <ProFormItemV2 | 
|---|
|  |  |  | 
|---|
|  |  |  | import dayjs from 'dayjs'; | 
|---|
|  |  |  | import { FormInstance } from 'element-plus'; | 
|---|
|  |  |  | import _ from 'lodash'; | 
|---|
|  |  |  | import { InsurancePeriodEnum } from '@/constants'; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | defineOptions({ | 
|---|
|  |  |  | name: 'UploadInsurePersonDialog', | 
|---|
|  |  |  | 
|---|
|  |  |  | productIdNumber: string; | 
|---|
|  |  |  | productSchemeIdNumber: string; | 
|---|
|  |  |  | effectStartTime: string; | 
|---|
|  |  |  | effectEndTime: string; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | //是否是补提 | 
|---|
|  |  |  | isSupply?: boolean; | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const { allUserInsureProductSettingList, getInsureProductIdByIdNumber } = | 
|---|
|  |  |  | useUserInsureProductSetting(); | 
|---|
|  |  |  | const { allInsureProductSchemeList } = useInsureProductSchemeAllList({ | 
|---|
|  |  |  | insureProductId: computed(() => getInsureProductIdByIdNumber(props.form.productIdNumber)), | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | const { allInsureProductSchemeList, getInsureProductSchemeByIdNumber } = | 
|---|
|  |  |  | useInsureProductSchemeAllList({ | 
|---|
|  |  |  | insureProductId: computed(() => getInsureProductIdByIdNumber(props.form.productIdNumber)), | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const currentInsureProductScheme = computed(() => | 
|---|
|  |  |  | getInsureProductSchemeByIdNumber(props.form.productSchemeIdNumber) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleProductChange() { | 
|---|
|  |  |  | innerForm.value.productSchemeIdNumber = ''; | 
|---|
|  |  |  | 
|---|
|  |  |  | return dayjs(time).isBefore(dayjs()) || dayjs(time).isAfter(dayjs().add(60, 'day')); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const disabledEndDate = (time: Date) => { | 
|---|
|  |  |  | const startDate = dayjs(props.form.effectStartTime); | 
|---|
|  |  |  | return ( | 
|---|
|  |  |  | dayjs(time).isBefore(startDate) || | 
|---|
|  |  |  | dayjs(time).isAfter(dayjs(props.form.effectStartTime).add(28, 'day')) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function handleStartDateChange() { | 
|---|
|  |  |  | if (disabledEndDate(props.form.effectEndTime as any)) { | 
|---|
|  |  |  | innerForm.value.effectEndTime = ''; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const innerVisible = computed({ | 
|---|
|  |  |  | get() { | 
|---|
|  |  |  | return props.modelValue; | 
|---|