fix#137058: 顧問管理流程 - 約訪記錄填寫日期需要卡控
| | |
| | | <div class="dateTime"> |
| | | <UiDatePicker |
| | | @changeDate="changeDateTime($event, 'date')" |
| | | :disabledBeforeSpecificDate="disabledBeforeSpecificDate" |
| | | :isPastDateDisabled="isPastDateDisabled" |
| | | :isFutureDateDisabled="isFutureDateDisabled" |
| | | :defaultValue="defaultValue" |
| | |
| | | @Prop() |
| | | isFutureDateDisabled!: boolean; |
| | | |
| | | @Prop() |
| | | disabledBeforeSpecificDate?: string; |
| | | |
| | | @Emit('changeDateTime') |
| | | changeDateTime(event, type) { |
| | | if (type === 'date') { |
| | |
| | | justify-content: space-between; |
| | | font-size: 20px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | ><i class="icon-edit"></i></span> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <template v-if="!interviewId || isEdit"> |
| | | <DateTimePicker |
| | | :disabledBeforeSpecificDate="appointmentDetail.appointmentDate" |
| | | @changeDateTime="interviewTime = $event" |
| | | :defaultValue="defaultValue" |
| | | ></DateTimePicker> |
| | |
| | | @Prop({default: false}) |
| | | isFutureDateDisabled!: boolean; |
| | | |
| | | @Prop() |
| | | disabledBeforeSpecificDate?: string; |
| | | |
| | | @Emit('changeDate') |
| | | changeDate() { |
| | | return this.dateValue; |
| | |
| | | get pickerOptions() { |
| | | const date = new Date(); |
| | | const currentDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`; |
| | | |
| | | if (!!this.disabledBeforeSpecificDate) { |
| | | const compareDate = new Date(this.disabledBeforeSpecificDate); |
| | | return { |
| | | disabledDate(time: Date) { |
| | | const pickedDate = `${time.getFullYear()}/${time.getMonth() + 1}/${time.getDate()}`; |
| | | return new Date(pickedDate).getTime() < compareDate.getTime(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.isPastDateDisabled) { |
| | | return { |
| | |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | </script> |