保誠-保戶業務員媒合平台
HelenHuang
2021-12-06 9cb6d5f92ad7aeda45ad1fe6482dcfc63d17be2b
PAMapp/pages/myAppointmentList/appointmentList.vue
@@ -5,6 +5,7 @@
            placeholder="請輸入關鍵字"
            class="mb-30 pam-clientReserved-input"
            v-model="keyWord"
            @keyup.enter.native="search"
        >
            <i slot="suffix" class="icon-search search cursor--pointer" @click="search"></i>
        </el-input>
@@ -15,14 +16,14 @@
        ></ClientList>
        <UiPagination
            :totalList="appointmentList"
            :totalList="filterList"
            @changePage="changePage"
        ></UiPagination>
    </div>
</template>
<script lang="ts">
import { Vue, Component, Prop, State, Watch } from 'nuxt-property-decorator';
import { Vue, Component, State, Watch } from 'nuxt-property-decorator';
import { ClientInfo } from '~/assets/ts/api/appointment';
@Component
@@ -36,9 +37,16 @@
    @Watch('myAppointmentList')
    onMyAppointmentListChange() {
        this.appointmentList = this.myAppointmentList
            .filter(item => item.communicateStatus !== 'contacted')
            .sort((a, b) => a.appointmentDate > b.appointmentDate ? -1 : 1);;
        const unreadList = this.myAppointmentList
            .filter(item => item.communicateStatus !== 'contacted' && !item.consultantReadTime)
            .sort((a, b) => a.consultantViewTime > b.consultantViewTime ? 1 : -1);
        const readList = this.myAppointmentList
            .filter(item => item.communicateStatus !== 'contacted' && item.consultantReadTime)
            .sort((a, b) => a.consultantReadTime > b.consultantReadTime ? -1 : 1)
        this.appointmentList = unreadList.concat(readList);
        this.filterList = this.appointmentList;
    }
    mounted() {