保誠-保戶業務員媒合平台
HelenHuang
2021-12-06 9cb6d5f92ad7aeda45ad1fe6482dcfc63d17be2b
PAMapp/pages/myAppointmentList/contactedList.vue
@@ -5,6 +5,7 @@
            placeholder="請輸入關鍵字"
            class="mb-30 pam-clientReserved-input"
            v-model="keyWord"
            @keyup.enter.native="search"
        >
            <i
                slot="suffix"
@@ -26,18 +27,28 @@
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'nuxt-property-decorator';
import { ClientInfo } from '~/assets/ts/api/consultant';
import { Vue, Component, Watch, State } from 'nuxt-property-decorator';
import { ClientInfo } from '~/assets/ts/api/appointment';
@Component
export default class ClientContactedList extends Vue {
    @Prop({default: []}) contactedList!: ClientInfo[];
    @State('myAppointmentList') myAppointmentList!: ClientInfo[];
    contactedList: ClientInfo[] = [];
    pageList: ClientInfo[] = [];
    keyWord: string = '';
    filterList: ClientInfo[] = [];
    @Watch('myAppointmentList')
    onMyAppointmentListChange() {
        this.contactedList = (this.myAppointmentList || [])
            .filter(item => item.communicateStatus === 'contacted')
            .sort((a, b) => a.contactTime > b.contactTime ? -1 : 1);
        this.filterList = this.contactedList;
    }
    mounted() {
        this.filterList = JSON.parse(JSON.stringify(this.contactedList));
        this.onMyAppointmentListChange();
    }
    changePage(pageList: ClientInfo[]) {