保誠-保戶業務員媒合平台
Tomas
2022-01-13 46da7429ca192bf6a947d79437e8076b94676a05
update: 刪除重複的 interface: clientInfo => appointment
刪除1個檔案
修改10個檔案
253 ■■■■ 已變更過的檔案
PAMapp/components/Client/ClientCard.vue 6 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Client/ClientList.vue 4 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList.vue 10 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList/appointmentList.vue 13 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList/contactedList.vue 13 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList/onProgressList.vue 13 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/models/appointment.model.ts 138 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/models/client.model.ts 29 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/appointment.service.ts 11 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/shared/services/my-consultant.service.ts 7 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/store/index.ts 9 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Client/ClientCard.vue
@@ -137,9 +137,9 @@
import appointmentService from '~/shared/services/appointment.service';
import UtilsService from '~/shared/services/utils.service';
import { hideReviews } from '~/shared/const/hide-reviews';
import { AppointmentMemoInfo, ClientInfo } from '~/shared/models/client.model';
import myConsultantService from '~/shared/services/my-consultant.service';
import { ElRow } from 'element-ui/types/row';
import { Appointment, AppointmentMemoInfo } from '~/shared/models/appointment.model';
const localStorage = namespace('localStorage');
@Component({
@@ -163,10 +163,10 @@
})
export default class ClientList extends Vue {
    @Action
    updateMyAppointment!: (data: ClientInfo) => void;
    updateMyAppointment!: (data: Appointment) => void;
    @Prop()
    client!: ClientInfo;
    client!: Appointment;
    @localStorage.Mutation
    storageClearAppointmentIdFromMsg!: () => void;
PAMapp/components/Client/ClientList.vue
@@ -18,11 +18,11 @@
<script lang='ts'>
import { Vue, Component, Prop } from 'nuxt-property-decorator';
import { ClientInfo } from '~/shared/models/client.model';
import { Appointment } from '~/shared/models/appointment.model';
@Component
export default class ClientList extends Vue {
    @Prop() clients!: ClientInfo[];
    @Prop() clients!: Appointment[];
    @Prop() title!: string;
    //////////////////////////////////////////////////////////////////////
PAMapp/pages/myAppointmentList.vue
@@ -52,7 +52,7 @@
import * as _ from 'lodash';
import { ClientInfo } from '~/shared/models/client.model';
import { Appointment } from '~/shared/models/appointment.model';
const localStorage = namespace('localStorage');
@@ -63,7 +63,7 @@
export default class ClientReservedList extends Vue {
    @State('myAppointmentList')
    myAppointmentList!: ClientInfo[];
    myAppointmentList!: Appointment[];
    @State('myNewAppointmentSum')
    newAppointmentSum!: number;
@@ -78,9 +78,9 @@
    currentAppointmentIdFromMsg!: string;
    activeTabName         : string       = 'appointmentList';
    appointmentList       : ClientInfo[] = [];
    clients               : ClientInfo[] = [];
    contactedList         : ClientInfo[] = [];
    appointmentList       : Appointment[] = [];
    clients               : Appointment[] = [];
    contactedList         : Appointment[] = [];
    showNewAppointmentHint: boolean      = false;
    //////////////////////////////////////////////////////////////////////
PAMapp/pages/myAppointmentList/appointmentList.vue
@@ -26,22 +26,23 @@
<script lang="ts">
import { Vue, Component, State, Watch, namespace } from 'nuxt-property-decorator';
import { ClientInfo } from '~/shared/models/client.model';
import { Appointment } from '~/shared/models/appointment.model';
const localStorage = namespace('localStorage');
@Component
export default class ClientReservedList extends Vue {
    @State('myAppointmentList')
    myAppointmentList!: ClientInfo[];
    myAppointmentList!: Appointment[];
    @localStorage.Getter
    currentAppointmentIdFromMsg!: string;
    appointmentList: ClientInfo[] = [];
    filterList     : ClientInfo[] = [];
    appointmentList: Appointment[] = [];
    filterList     : Appointment[] = [];
    keyWord        : string       = '';
    pageList       : ClientInfo[] = [];
    pageList       : Appointment[] = [];
    currentPage    : number = 1;
    //////////////////////////////////////////////////////////////////////
@@ -92,7 +93,7 @@
        })
    }
    changePage(pageList: ClientInfo[]): void {
    changePage(pageList: Appointment[]): void {
        this.pageList = pageList;
    }
PAMapp/pages/myAppointmentList/contactedList.vue
@@ -30,22 +30,23 @@
<script lang="ts">
import { Vue, Component, Watch, State, namespace } from 'nuxt-property-decorator';
import { ClientInfo } from '~/shared/models/client.model';
import { Appointment } from '~/shared/models/appointment.model';
const localStorage = namespace('localStorage');
@Component
export default class ClientContactedList extends Vue {
    @State('myAppointmentList')
    myAppointmentList!: ClientInfo[];
    myAppointmentList!: Appointment[];
    @localStorage.Getter
    currentAppointmentIdFromMsg!: string;
    contactedList: ClientInfo[] = [];
    filterList   : ClientInfo[] = [];
    contactedList: Appointment[] = [];
    filterList   : Appointment[] = [];
    keyWord      : string       = '';
    pageList     : ClientInfo[] = [];
    pageList     : Appointment[] = [];
    currentPage  : number = 1;
    //////////////////////////////////////////////////////////////////////
@@ -83,7 +84,7 @@
        })
    }
    changePage(pageList: ClientInfo[]): void {
    changePage(pageList: Appointment[]): void {
        this.pageList = pageList;
    }
PAMapp/pages/myAppointmentList/onProgressList.vue
@@ -30,22 +30,23 @@
<script lang="ts">
import { Vue, Component, Watch, State, namespace } from 'nuxt-property-decorator';
import { ClientInfo } from '~/shared/models/client.model';
import { Appointment } from '~/shared/models/appointment.model';
const localStorage = namespace('localStorage');
@Component
export default class ClientContactedList extends Vue {
    @State('myAppointmentList')
    myAppointmentList!: ClientInfo[];
    myAppointmentList!: Appointment[];
    @localStorage.Getter
    currentAppointmentIdFromMsg!: string;
    contactedList: ClientInfo[] = [];
    filterList   : ClientInfo[] = [];
    contactedList: Appointment[] = [];
    filterList   : Appointment[] = [];
    keyWord      : string       = '';
    pageList     : ClientInfo[] = [];
    pageList     : Appointment[] = [];
    currentPage  : number = 1;
    //////////////////////////////////////////////////////////////////////
@@ -83,7 +84,7 @@
        })
    }
    changePage(pageList: ClientInfo[]): void {
    changePage(pageList: Appointment[]): void {
        this.pageList = pageList;
    }
PAMapp/shared/models/appointment.model.ts
@@ -1,41 +1,60 @@
export interface AppointmentLog {
    id              : number,
    createdDate     : Date,
    lastModifiedDate: Date,
    customerId      : number,
    agentNo         : string,
    status          : 'UNFILLED' | 'FILLED',
    score           : number,
    agentName       : string,
    customerName    : string,
    id              : number;
    createdDate     : string;
    lastModifiedDate: string;
    customerId      : number;
    agentNo         : string;
    status          : 'UNFILLED' | 'FILLED';
    score           : number;
    agentName       : string;
    customerName    : string;
}
export interface Appointment {
  id                 : number;
  phone?             : string;
  email?             : string;
  contactType        : string;
  gender             : string;
  age                : string;
  job                : string;
  requirement        : string;
  communicateStatus  : string;
  hopeContactTime    : string;
  otherRequirement?  : string;
  appointmentDate    : string;
  lastModifiedDate   : string;
  agentNo            : string;
  appointmentDate    : string;
  appointmentMemoList: AppointmentMemoInfo[]
  communicateStatus  : string;
  consultantReadTime : string;
  consultantViewTime : string;
  contactTime        : string;
  contactType        : string;
  customerId         : number;
  email              : string;
  gender             : string;
  hopeContactTime    : string;
  id                 : number;
  interviewRecordDTOs: InterviewRecord[];
  job                : string;
  lastModifiedDate   : string;
  name               : string;
  consultantViewTime?: string;
  consultantReadTime?: string;
  satisfactionScore? : number;
  otherRequirement   : string;
  phone              : string;
  requirement        : string;
  satisfactionScore  : number;
};
export interface AppointmentMemoInfo {
  appointmentId: number;
  content      : string;
  id           : number;
}
export interface InterviewRecord {
  appointmentId   : number;
  content         : string;
  createdBy       : string;
  createdDate     : string;
  id              : number;
  interviewDate   : string;
  lastModifiedBy  : string;
  lastModifiedDate: string;
}
export interface AppointmentWithConsultantInfo extends Appointment {
  consultantName      : string;
  consultantAvatar    : string;
  consultantExpertList: string[]
  updateTime          : Date | string;
  consultantExpertList: string[];
  consultantName      : string;
  contactStatus       : string;
  updateTime          : string;
}
export interface AppointmentDetail {
@@ -63,52 +82,51 @@
  satisfactionScore?  : number;
}
export interface AppointmentParams {
  phone          : string;
  email          : string;
  contactType    : string;
  gender         : string;
  age            : string;
  job            : string;
  requirement    : string;
  hopeContactTime: string;
  agentNo        : string;
  contactType    : string;
  email          : string;
  gender         : string;
  hopeContactTime: string;
  job            : string;
  phone          : string;
  requirement    : string;
}
export interface EditAppointmentParams {
  id              : number,
  phone           : string,
  email           : string,
  contactType     : string,
  gender          : string,
  age             : string,
  job             : string,
  requirement     : string,
  hopeContactTime : string,
  otherRequirement: null
  age             : string;
  contactType     : string;
  email           : string;
  gender          : string;
  hopeContactTime : string;
  id              : number;
  job             : string;
  otherRequirement: null;
  phone           : string;
  requirement     : string;
}
export interface AppointmentRequests {
  phone          : string,
  email          : string,
  contactType    : string,
  gender         : string,
  age            : string,
  job            : string,
  requirement    : string[],
  hopeContactTime: ContactTime[],
  agentNo        : string,
  age            : string;
  agentNo        : string;
  contactType    : string;
  email          : string;
  gender         : string;
  hopeContactTime: ContactTime[];
  job            : string;
  phone          : string;
  requirement    : string[];
}
export interface ContactTime {
selectWeekOptions : string[],
selectTimesOptions: string[]
  selectTimesOptions: string[];
  selectWeekOptions : string[];
}
export interface createdMemoInfo {
  content: string,
  appointmentId: number
  appointmentId: number;
  content      : string;
}
export interface updatedMemoInfo {
  content: string,
  /** memo id */
  id: number
  content: string;
  id     : number;
}
PAMapp/shared/models/client.model.ts
Àɮפw§R°£
PAMapp/shared/services/appointment.service.ts
@@ -1,14 +1,13 @@
import { http } from "./httpClient";
import { AppointmentMemoInfo, ClientInfo } from "~/shared/models/client.model";
import { AppointmentDetail, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model";
import { Appointment, AppointmentDetail, AppointmentMemoInfo, createdMemoInfo, EditAppointmentParams, updatedMemoInfo } from "~/shared/models/appointment.model";
class AppointmentService {
  // å–得所有預約清單
  async getMyAppointmentList(): Promise<ClientInfo[]> {
  // é¡§å•å–得所有自己的預約單API
  async getMyAppointmentList(): Promise<Appointment[]> {
    return http.get('/consultant/getMyAppointment').then((res) => {
      const hasNewAppointment = res.data.find((appointment: ClientInfo) => !appointment.consultantViewTime);
      const hasNewAppointment = res.data.find((appointment: Appointment) => !appointment.consultantViewTime);
      if (hasNewAppointment) {
        this.viewAllAppointment();
      }
@@ -16,7 +15,7 @@
    });
  }
  // é¡§å•ç™»å…¥é¡¯ç¤ºæ–°é ç´„單筆數後觸發
  // é¡§å•ç€è¦½è‡ªå·±æ‰€æœ‰çš„預約單紀錄觸發API
  private viewAllAppointment(): void {
    http.post('/consultant/record/allAppointmentsView').then();
  }
PAMapp/shared/services/my-consultant.service.ts
@@ -1,8 +1,9 @@
import _ from "lodash";
import { http } from "./httpClient";
import { AgentInfo } from '~/shared/models/agent-info.model';
import { Consultant } from "../models/consultant.model";
import _ from "lodash";
import { ClientInfo } from "../models/client.model";
import { Appointment } from "../models/appointment.model";
class MyConsultantService {
  async getFavoriteConsultantList(): Promise<Consultant[]> {
@@ -30,7 +31,7 @@
  }
  // æ¨™è¨˜ç‚ºå·²è¯çµ¡
  markAsContact(appointmentId: number): Promise<ClientInfo> {
  markAsContact(appointmentId: number): Promise<Appointment> {
    return http.post(`/appointment/markAsContacted/${appointmentId}`).then(res => res.data);
  }
PAMapp/store/index.ts
@@ -9,8 +9,7 @@
import reviewsService from '~/shared/services/reviews.service';
import { Consultant } from '~/shared/models/consultant.model';
import { AppointmentLog } from '~/shared/models/appointment.model';
import { ClientInfo } from '~/shared/models/client.model';
import { Appointment, AppointmentLog } from '~/shared/models/appointment.model';
import { AgentOfStrictQuery } from '~/shared/models/strict-query.model';
@Module
export default class Store extends VuexModule {
@@ -18,7 +17,7 @@
    strictQueryList: AgentOfStrictQuery[] = [];
    myConsultantList: Consultant[] = [];
    myAppointmentList: ClientInfo[] = [];
    myAppointmentList: Appointment[] = [];
    myNewAppointmentSum: number = 0;
    myAppointmentReviewLogList: AppointmentLog[] = [];
@@ -43,7 +42,7 @@
    }
    @Mutation
    updateMyAppointmentList(data: ClientInfo[]) {
    updateMyAppointmentList(data: Appointment[]) {
        this.myAppointmentList = data;
    }
@@ -149,7 +148,7 @@
    }
    @Action
    updateMyAppointment(myAppointment: ClientInfo) {
    updateMyAppointment(myAppointment: Appointment) {
        const data = this.myAppointmentList.filter(item => item.id !== myAppointment.id);
        data.unshift(myAppointment);
        this.context.commit('updateMyAppointmentList', data)