保誠-保戶業務員媒合平台
Tomas
2021-12-14 497f54b264eba626b77e79fec2ca6947ccae19e4
PAMapp/assets/ts/api/appointment.ts
@@ -1,14 +1,6 @@
import { service } from '~/assets/ts/api/share';
import { AxiosResponse } from 'axios';
import { AppointmentLog } from '../models/appointment.model';
import { http } from '~/assets/ts/services/httpClient';
// 取得所有預約清單
export function getMyAppointmentList():Promise<ClientInfo[]> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get('/consultant/getMyAppointment', {headers}).then(res => res.data);
}
import { AppointmentLog } from '../models/appointment.model';
// 標記為已聯絡
export function markAsContact(appointmentId: number) {
@@ -16,7 +8,7 @@
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    // TODO: 跟後端確認,這裡的 API 不應該傳回 void, 而是應該是更新後的資料 - Ben 2021/11/16
    return service.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers})
    return http.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers})
            .then(res => res.data)
}
@@ -24,26 +16,22 @@
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get('/satisfaction/getMySatisfaction', { headers }).then(res => res.data);
    return http.get('/satisfaction/getMySatisfaction', { headers }).then(res => res.data);
}
// 顧問登入顯示新預約單筆數後觸發
export function allAppointmentsView() {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.post('/consultant/record/allAppointmentsView', 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
}
// 讀取預約單時觸發
export function recordRead(appointmentId: number) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return http.post('/appointment/recordRead/' + appointmentId, undefined, {headers})
}