保誠-保戶業務員媒合平台
Mila
2021-12-09 57dc3fc3fcd7c33e2cdd9bb7ba40028dd60faa17
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
import { service } from '~/assets/ts/api/share';
import { AxiosResponse } from 'axios';
import { AppointmentLog } from '../models/appointment.model';
 
// 取得所有預約清單
export function getMyAppointmentList():Promise<ClientInfo[]> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get('/consultant/getMyAppointment', {headers}).then(res => res.data);
}
 
// 標記為已聯絡
export function markAsContact(appointmentId: number) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    // TODO: 跟後端確認,這裡的 API 不應該傳回 void, 而是應該是更新後的資料 - Ben 2021/11/16
    return service.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers})
            .then(res => res.data)
}
 
export function getMyReviewLog(): Promise<AppointmentLog[]> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get('/satisfaction/getMySatisfaction', { headers }).then(res => res.data);
}
 
 
// 顧問登入顯示新預約單筆數後觸發
export function allAppointmentsView() {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.post('/consultant/record/allAppointmentsView', undefined, {headers})
}
 
// 讀取預約單時觸發
export function recordRead(appointmentId: number) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.post('/appointment/recordRead/' + appointmentId, undefined, {headers})
}
 
 
export interface ClientInfo {
    id               : number,
    phone            : string,
    email            : string,
    contactType      : string,
    gender           : string,
    age              : string,
    job              : string,
    requirement      : string,
    communicateStatus: string,
    hopeContactTime  : string,
    otherRequirement : string,
    appointmentDate  : Date,
    agentNo          : string,
    customerId       : number,
    name             : string,
    consultantViewTime: Date,
    consultantReadTime: Date,
    contactTime      : Date,
    satisfactionScore: number
}