保誠-保戶業務員媒合平台
Mila
2022-01-19 c8c18ece009bafdcac9ed73446d8c2d4fbbf3256
fixed TODO#134382 新增約訪紀錄:  "defaultValue" is not defined error
修改2個檔案
14 ■■■■■ 已變更過的檔案
PAMapp/components/Interview/InterviewAdd.vue 10 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Ui/UiDatePicker.vue 4 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Interview/InterviewAdd.vue
@@ -119,7 +119,7 @@
    showInterviewMsgPopup = false;
    showFutureDateConfirmPopup = false;
    defaultValue!: Date;
    defaultValue = '';
    ////////////////////////////////////////////////////////////////////
@@ -152,7 +152,7 @@
    watchInterviewRecord() {
        if (this.interviewRecord && this.interviewRecord.content) {
            this.content = this.interviewRecord.content;
            this.defaultValue = new Date(this.interviewRecord.interviewDate);
            this.defaultValue = this.interviewRecord.interviewDate;
        }
    }
@@ -211,7 +211,7 @@
    cancel() {
        if (this.interviewId) {
           this.content = this.interviewRecord.content;
           this.defaultValue = new Date(this.interviewRecord.interviewDate);
           this.defaultValue = this.interviewRecord.interviewDate;
           this.isEdit = false;
        } else {
           this.$router.push(`/appointment/${this.appointmentId}`);
@@ -222,7 +222,9 @@
    get formatInterviewDate() {
        const interviewDate = new Date(this.interviewRecord.interviewDate);
        return `${interviewDate.getFullYear()}/${interviewDate.getMonth() + 1}/${interviewDate.getDate()} ${interviewDate.getHours()}:${interviewDate.getMinutes()}`;
        const hours = interviewDate.getHours();
        const minutes = interviewDate.getMinutes();
        return `${interviewDate.getFullYear()}/${interviewDate.getMonth() + 1}/${interviewDate.getDate()} ${hours < 10 ? '0' + hours : hours}:${minutes < 10 ? '0' + minutes : minutes}`;
    }
}
PAMapp/components/Ui/UiDatePicker.vue
@@ -18,7 +18,7 @@
@Component
export default class UiDatePicker extends Vue {
    dateValue = '';
    dateValue: Date | string = '';
    @Prop()
    defaultValue!: string;
@@ -31,7 +31,7 @@
    @Watch('defaultValue', {immediate: true})
    updateDefault() {
        if (this.defaultValue) {
            this.dateValue = this.defaultValue;
            this.dateValue = new Date(this.defaultValue);
            this.changeDate();
        }
    }