保誠-保戶業務員媒合平台
add#133806: 調整預約單列表的頁籤為 '未聯絡'、'約訪中'、'結案',並新增約訪中頁面
修改1個檔案
新增2個檔案
111 ■■■■■ 已變更過的檔案
PAMapp/pages/appointment/_appointmentId.vue 5 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList.vue 15 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myAppointmentList/onProgressList.vue 91 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/appointment/_appointmentId.vue
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,5 @@
<template>
  <div>
    APPOINTMENT_3
  </div>
</template>
PAMapp/pages/myAppointmentList.vue
@@ -7,15 +7,22 @@
                    class="cus-tab-item"
                    :class="{'is-active': activeTabName === 'appointmentList'}"
                    @click="clickTab('appointmentList')"
                >客戶預約
                    <span class="p">({{appointmentList.length}})</span>
                >
                  <span class="smTxt">未聯絡({{ appointmentList.length }})</span>
                </div>
                <div
                    class="cus-tab-item"
                    :class="{'is-active': activeTabName === 'onProgressList'}"
                    @click="clickTab('onProgressList')"
                >
                  <span class="smTxt">約訪中({{ appointmentList.length }})</span>
                </div>
                <div
                    class="cus-tab-item"
                    :class="{'is-active': activeTabName === 'contactedList'}"
                    @click="clickTab('contactedList')"
                >已聯絡
                    <span class="p">({{contactedList.length}})</span>
                >
                  <span class="smTxt">結案({{ contactedList.length }})</span>
                </div>
            </div>
PAMapp/pages/myAppointmentList/onProgressList.vue
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,91 @@
<template>
    <div>
        <el-input
            type="text"
            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>
        <ClientList
            :clients="pageList"
            :title="'contactedList'"
        ></ClientList>
        <UiPagination
            :totalList="filterList"
            :currentPage="currentPage"
            @changePage="changePage"
        ></UiPagination>
    </div>
</template>
<script lang="ts">
import { Vue, Component, Watch, State, namespace } from 'nuxt-property-decorator';
import { ClientInfo } from '~/shared/models/client.model';
const localStorage = namespace('localStorage');
@Component
export default class ClientContactedList extends Vue {
    @State('myAppointmentList')
    myAppointmentList!: ClientInfo[];
    @localStorage.Getter
    currentAppointmentIdFromMsg!: string;
    contactedList: ClientInfo[] = [];
    filterList   : ClientInfo[] = [];
    keyWord      : string       = '';
    pageList     : ClientInfo[] = [];
    currentPage  : number = 1;
    //////////////////////////////////////////////////////////////////////
    mounted() {
        this.onMyAppointmentListChange();
    }
    //////////////////////////////////////////////////////////////////////
    @Watch('myAppointmentList')
    onMyAppointmentListChange() {
        this.contactedList = (this.myAppointmentList || [])
            .filter(item => item.communicateStatus === 'contacted')
            .map((item) => ({...item, sortTime: new Date(item.contactTime)}))
            .sort((prevItem, nextItem) => +nextItem.sortTime - +prevItem.sortTime);
        this.filterList = this.contactedList;
        this.getCurrentPage();
    }
    private getCurrentPage() {
        const currentIndex = this.filterList.findIndex(item => item.id === +this.currentAppointmentIdFromMsg);
        const pageSize = 5;
        if (currentIndex > -1) {
            this.currentPage = Math.ceil((currentIndex + 1) / pageSize);
        }
    }
    //////////////////////////////////////////////////////////////////////
    search(): void {
        this.filterList = this.contactedList.filter(item => {
            return item?.name?.match(this.keyWord) || item?.requirement?.match(this.keyWord)
        })
    }
    changePage(pageList: ClientInfo[]): void {
        this.pageList = pageList;
    }
}
</script>