保誠-保戶業務員媒合平台
Mila
2021-11-15 8956474e0072133a8650e4a23bcd6b2a3235688a
update: TOOD#130022 我的顧問清單: 串接移除顧問 API
修改5個檔案
38 ■■■■■ 已變更過的檔案
PAMapp/assets/ts/api/consultant.ts 11 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Client/ClientCard.vue 2 ●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/components/Consultant/ConsultantCard.vue 4 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/index.vue 13 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/myConsultantList.vue 8 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/assets/ts/api/consultant.ts
@@ -42,11 +42,7 @@
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
<<<<<<< HEAD
    return service.post('/appointment/customer/create', data, {headers})
=======
    return service.post('/appointment/customer/create', data ,{headers})
>>>>>>> b7de9faedf2a3e21c77c4ab3fc645ef01ac549cf
}
//顧問詳細資訊
@@ -54,6 +50,13 @@
    return service.get('/consultant/detail', {params:{agentNo:agentNo}})
}
// 移除顧問
export function deleteConsultant(agentId: string) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.delete('/consultant/favorite/'+agentId, {headers})
}
export interface Consultants {
    agentNo: string,
    name: string,
PAMapp/components/Client/ClientCard.vue
@@ -114,7 +114,7 @@
    }
    markAppointment() {
        markAsContact(this.client.id).then(res => console.log(res))
        markAsContact(this.client.id).then(res => this.$router.go(0))
    }
}
PAMapp/components/Consultant/ConsultantCard.vue
@@ -26,8 +26,8 @@
                        </div>
                        <div
                            class="delete"
                            v-if="agentInfo.contactStatus !== 'reserved'
                                || agentInfo.contactStatus !== 'contacted'"
                            v-if="agentInfo.contactStatus === 'picked'
                                || !agentInfo.contactStatus"
                            @click="removeAgent"
                        >移除</div>
                    </el-col>
PAMapp/pages/index.vue
@@ -45,7 +45,7 @@
<script lang="ts">
import { Vue, Component, State, Action } from 'nuxt-property-decorator';
import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant';
import { addFavoriteConsultant, Consultants } from '~/assets/ts/api/consultant';
import { addFavoriteConsultant, Consultants, deleteConsultant } from '~/assets/ts/api/consultant';
import { login, getFavoriteConsultant } from '~/assets/ts/api/consultant';
import { isLogin } from '~/assets/ts/auth';
@@ -84,12 +84,15 @@
    }
    removeAgent(agentNo: string) {
        const findIndex = this.consultantList.findIndex((item, i) => {
            return item.agentNo === agentNo;
        })
        this.consultantList.splice(findIndex, 1);
        if (!isLogin()) {
            const findIndex = this.consultantList.findIndex((item, i) => {
                return item.agentNo === agentNo;
            })
            this.consultantList.splice(findIndex, 1);
            setFavoriteToStorage(this.consultantList)
        } else {
            deleteConsultant(agentNo).then(res => this.$router.go(0))
        }
    }
PAMapp/pages/myConsultantList.vue
@@ -30,7 +30,7 @@
import { Vue, Component, Watch } from 'vue-property-decorator';
import { Route } from 'vue-router/types/router.d'
import { getFavoriteFromStorage, setFavoriteToStorage } from '~/assets/ts/storageConsultant';
import { Consultants, getFavoriteConsultant } from '~/assets/ts/api/consultant';
import { Consultants, deleteConsultant, getFavoriteConsultant } from '~/assets/ts/api/consultant';
import { isLogin } from '~/assets/ts/auth';
@Component
@@ -67,10 +67,12 @@
    }
    removeAgent(agentNo: string) {
        const fintIndex = this.consultantList.findIndex(item => item.agentNo === agentNo);
        this.consultantList.splice(fintIndex, 1);
        if (!isLogin()) {
            const fintIndex = this.consultantList.findIndex(item => item.agentNo === agentNo);
            this.consultantList.splice(fintIndex, 1);
            setFavoriteToStorage(this.consultantList);
        } else {
            deleteConsultant(agentNo).then(res => this.$router.go(0))
        }
    }