保誠-保戶業務員媒合平台
Tomas
2022-01-13 66a8dd0cfd0122aee97a6f6859407630d6b4d384
update: appointmentService - add closeAppointment()
修改2個檔案
新增1個檔案
38 ■■■■■ 已變更過的檔案
PAMapp/shared/models/appointment.model.ts 19 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/models/enum/contact-status.ts 8 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/appointment.service.ts 11 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/models/appointment.model.ts
@@ -1,3 +1,5 @@
import { ContactStatus } from "./enum/contact-status";
export interface AppointmentLog {
    id              : number;
    createdDate     : string;
@@ -130,3 +132,20 @@
  content: string;
  id     : number;
}
export interface ToDoneAppointment {
    appointmentId         : number;
    contactStatus         : ContactStatus;
    planCode              : string;
    policyEntryDate       : string;
    policyholderIdentityId: string;
}
export interface ToCloseAppointment {
  appointmentId    : number;
  closedOtherReason: string;
  closedReason     : string;
  contactStatus    : ContactStatus;
  remark           : string;
}
PAMapp/shared/models/enum/contact-status.ts
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,8 @@
export enum ContactStatus {
  PICKED    = 'picked',
  RESERVED  = 'reserved',
  CONTACTED = 'contacted',
  DONE      = 'done',
  CLOSE     = 'close',
  CANCEL    = 'cancel',
}
PAMapp/shared/services/appointment.service.ts
@@ -1,6 +1,6 @@
import { http } from "./httpClient";
import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model";
import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, ToCloseAppointment, ToDoneAppointment, updatedMemoInfo } from "~/shared/models/appointment.model";
class AppointmentService {
@@ -41,12 +41,12 @@
  }
  // æ–°å¢žè¨»è¨˜
  createMemo(memoInfo: createdMemoInfo): Promise<AppointmentMemoInfo> {
  async createMemo(memoInfo: createdMemoInfo): Promise<AppointmentMemoInfo> {
    return http.post('/appointment/memo/create', memoInfo).then(res => res.data);
  }
  // ç·¨è¼¯è¨»è¨˜
  updateMemo(memoInfo: updatedMemoInfo): Promise<AppointmentMemoInfo> {
  async updateMemo(memoInfo: updatedMemoInfo): Promise<AppointmentMemoInfo> {
    return http.post('/appointment/memo/update', memoInfo).then(res => res.data);
  }
@@ -54,6 +54,11 @@
  deleteMemo(appointmentMemoId: number) {
    return http.delete(`/appointment/memo/${appointmentMemoId}`)
  }
  // é ç´„單結案
  async closeAppointment(appointmentInfo: ToDoneAppointment | ToCloseAppointment) {
    return http.post(`/appointment/close`, appointmentInfo).then((res) => res.data);
  }
}
export default new AppointmentService();