保誠-保戶業務員媒合平台
Mila
2022-01-17 f41af9be6cf3a4edb8b222f6e351bfaa03362085
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
  <div class="edit-appointment-record">
      <div class="edit-appointment-record-date">
          <span>今天 11:00 建立</span>
          <span>今天 11:00 更新</span>
      </div>
 
      <div class="mdTxt mb-10">約訪時間</div>
      <DateTimePicker
        @changeDateTime="interviewTime = $event"
      ></DateTimePicker>
 
      <div class="mdTxt mb-10 mt-10">約訪紀錄</div>
      <el-input
        type="textarea"
        :rows="5"
        placeholder="請輸入約訪紀錄"
        resize="none"
        v-model="content"
      >
      </el-input>
 
      <div class="edit-appointment-record-btn">
          <el-button>取消</el-button>
          <el-button :disabled="!interviewTime || !content" @click="createInterviewRecord">確定</el-button>
      </div>
 
      <PopUpFrame :isOpen.sync="isConfirmPopup"
        @closePopUp="closeConfirmPopup">
        <div class="text--center mdTxt">新增成功</div>
        <div class="text--center mt-30">
            <el-button @click="closeConfirmPopup" type="primary">確定</el-button>
        </div>
    </PopUpFrame>
  </div>
</template>
<script lang="ts">
import { AppointmentLog, InterviewRecordInfo } from '~/shared/models/appointment.model';
import { Vue, Component, Prop } from 'nuxt-property-decorator';
import authService from '~/shared/services/auth.service';
import appointmentService from '~/shared/services/appointment.service';
 
@Component
export default class InterviewAdd extends Vue {
    interviewTime = '';
    content = '';
    isConfirmPopup = false;
 
    // @Prop()
    // myAppointmentReviewLogList!: AppointmentLog[];
 
    // isUserLogin = false;
 
    //////////////////////////////////////////////////////////////////////
    // mounted() {
    //   this.isUserLogin = authService.isUserLogin();
    // }
 
    createInterviewRecord() {
        const interviewRecordInfo: InterviewRecordInfo = {
            content: this.content,
            interviewDate: this.interviewTime,
            appointmentId: +this.$route.params.appointmentId
        }
        appointmentService.createInterviewRecord(interviewRecordInfo).then(res => {
            this.isConfirmPopup = true;
        });
 
    }
 
    closeConfirmPopup() {
        this.isConfirmPopup = false;
        this.$router.go(-1);
    }
 
}
</script>
 
<style lang="scss" scoped>
.edit-appointment-record {
    padding-left : 10px;
    padding-right: 10px;
    .edit-appointment-record-date{
        color          : #68737A;
        display        : flex;
        justify-content: space-between;
        margin-bottom  : 26px;
    }
}
.icon {
    color          : $PRIMARY_RED;
    display        : flex;
    flex           : 1;
    justify-content: flex-end;
}
.edit-appointment-record-btn{
    margin-top: 30px;
    display: flex;
    justify-content: center;
}
</style>