保誠-保戶業務員媒合平台
Mila
2021-11-16 bb682522ce2e18f7c67f087620134d3aadba559d
PAMapp/pages/myAppointmentList/appointmentList.vue
@@ -15,25 +15,34 @@
        ></ClientList>
        <UiPagination
            :totalList="filterList"
            :totalList="appointmentList"
            @changePage="changePage"
        ></UiPagination>
    </div>
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'nuxt-property-decorator';
import { Vue, Component, Prop, State, Watch } from 'nuxt-property-decorator';
import { ClientInfo } from '~/assets/ts/api/appointment';
@Component
export default class ClientReservedList extends Vue {
    @Prop({default: []}) appointmentList!: ClientInfo[];
    @State('myAppointmentList') myAppointmentList!: ClientInfo[];
    appointmentList: ClientInfo[] = [];
    pageList: ClientInfo[] = [];
    keyWord: string = '';
    filterList: ClientInfo[] = [];
    @Watch('myAppointmentList')
    onMyAppointmentListChange() {
        this.appointmentList = this.myAppointmentList
            .filter(item => item.communicateStatus !== 'contacted')
            .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);;
    }
    mounted() {
        this.filterList = JSON.parse(JSON.stringify(this.appointmentList))
        this.onMyAppointmentListChange();
    }
    changePage(pageList: ClientInfo[]) {