保誠-保戶業務員媒合平台
劉鈞霖
2021-11-15 f4ff5a6a7156417f23302ca86896a85d2937ce6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<template>
    <div>
        <el-input
            type="text"
            placeholder="請輸入關鍵字"
            class="mb-30 pam-clientReserved-input"
            v-model="keyWord"
        >
            <i
                slot="suffix"
                class="icon-search search cursor--pointer"
                @click="search"
            ></i>
        </el-input>
 
        <ClientList
            :clients="pageList"
            :title="'contactedList'"
        ></ClientList>
 
        <UiPagination
            :totalList="filterList"
            @changePage="changePage"
        ></UiPagination>
    </div>
</template>
 
<script lang="ts">
import { Vue, Component, Prop } from 'nuxt-property-decorator';
import { ClientInfo } from '~/assets/ts/api/appointment';
 
@Component
export default class ClientContactedList extends Vue {
    @Prop({default: []}) contactedList!: ClientInfo[];
    pageList: ClientInfo[] = [];
    keyWord: string = '';
    filterList: ClientInfo[] = [];
 
    mounted() {
        this.filterList = JSON.parse(JSON.stringify(this.contactedList));
    }
 
    changePage(pageList: ClientInfo[]) {
        this.pageList = pageList;
    }
 
    search() {
        this.filterList = this.contactedList.filter(item => {
            return item.name.match(this.keyWord) || item.requirement.match(this.keyWord)
        })
    }
}
</script>